{"size": 588287, "ext": "js", "max_stars_repo_path": "public/scripts/bundle.min.js", "max_stars_repo_name": "TAMU-GradeDistribution/TAMU-GradeDistribution-Website", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "public/scripts/bundle.min.js", "max_issues_repo_name": "TAMU-GradeDistribution/TAMU-GradeDistribution-Website", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "public/scripts/bundle.min.js", "max_forks_repo_name": "TAMU-GradeDistribution/TAMU-GradeDistribution-Website", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 9488.5, "max_line_length": 295481, "alphanum_fraction": 0.7819924629}
/*!
 * jQuery JavaScript Library v3.6.0
 * https://jquery.com/
 *
 * Includes Sizzle.js
 * https://sizzlejs.com/
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license
 * https://jquery.org/license
 *
 * Date: 2021-03-02T17:08Z
 */
!function(global,factory){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=global.document?factory(global,!0):function(w){if(!w.document)throw new Error("jQuery requires a window with a document");return factory(w)}:factory(global)}("undefined"!=typeof window?window:this,(function(window,noGlobal){"use strict";var arr=[],getProto=Object.getPrototypeOf,slice=arr.slice,flat=arr.flat?function(array){return arr.flat.call(array)}:function(array){return arr.concat.apply([],array)},push=arr.push,indexOf=arr.indexOf,class2type={},toString=class2type.toString,hasOwn=class2type.hasOwnProperty,fnToString=hasOwn.toString,ObjectFunctionString=fnToString.call(Object),support={},isFunction=function isFunction(obj){return"function"==typeof obj&&"number"!=typeof obj.nodeType&&"function"!=typeof obj.item},isWindow=function isWindow(obj){return null!=obj&&obj===obj.window},document=window.document,preservedScriptAttributes={type:!0,src:!0,nonce:!0,noModule:!0};function DOMEval(code,node,doc){var i,val,script=(doc=doc||document).createElement("script");if(script.text=code,node)for(i in preservedScriptAttributes)(val=node[i]||node.getAttribute&&node.getAttribute(i))&&script.setAttribute(i,val);doc.head.appendChild(script).parentNode.removeChild(script)}function toType(obj){return null==obj?obj+"":"object"==typeof obj||"function"==typeof obj?class2type[toString.call(obj)]||"object":typeof obj}var version="3.6.0",jQuery=function(selector,context){return new jQuery.fn.init(selector,context)};function isArrayLike(obj){var length=!!obj&&"length"in obj&&obj.length,type=toType(obj);return!isFunction(obj)&&!isWindow(obj)&&("array"===type||0===length||"number"==typeof length&&length>0&&length-1 in obj)}jQuery.fn=jQuery.prototype={jquery:"3.6.0",constructor:jQuery,length:0,toArray:function(){return slice.call(this)},get:function(num){return null==num?slice.call(this):num<0?this[num+this.length]:this[num]},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);return ret.prevObject=this,ret},each:function(callback){return jQuery.each(this,callback)},map:function(callback){return this.pushStack(jQuery.map(this,(function(elem,i){return callback.call(elem,i,elem)})))},slice:function(){return this.pushStack(slice.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(jQuery.grep(this,(function(_elem,i){return(i+1)%2})))},odd:function(){return this.pushStack(jQuery.grep(this,(function(_elem,i){return i%2})))},eq:function(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(j>=0&&j<len?[this[j]]:[])},end:function(){return this.prevObject||this.constructor()},push:push,sort:arr.sort,splice:arr.splice},jQuery.extend=jQuery.fn.extend=function(){var options,name,src,copy,copyIsArray,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=!1;for("boolean"==typeof target&&(deep=target,target=arguments[i]||{},i++),"object"==typeof target||isFunction(target)||(target={}),i===length&&(target=this,i--);i<length;i++)if(null!=(options=arguments[i]))for(name in options)copy=options[name],"__proto__"!==name&&target!==copy&&(deep&&copy&&(jQuery.isPlainObject(copy)||(copyIsArray=Array.isArray(copy)))?(src=target[name],clone=copyIsArray&&!Array.isArray(src)?[]:copyIsArray||jQuery.isPlainObject(src)?src:{},copyIsArray=!1,target[name]=jQuery.extend(deep,clone,copy)):void 0!==copy&&(target[name]=copy));return target},jQuery.extend({expando:"jQuery"+("3.6.0"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(msg){throw new Error(msg)},noop:function(){},isPlainObject:function(obj){var proto,Ctor;return!(!obj||"[object Object]"!==toString.call(obj))&&(!(proto=getProto(obj))||"function"==typeof(Ctor=hasOwn.call(proto,"constructor")&&proto.constructor)&&fnToString.call(Ctor)===ObjectFunctionString)},isEmptyObject:function(obj){var name;for(name in obj)return!1;return!0},globalEval:function(code,options,doc){DOMEval(code,{nonce:options&&options.nonce},doc)},each:function(obj,callback){var length,i=0;if(isArrayLike(obj))for(length=obj.length;i<length&&!1!==callback.call(obj[i],i,obj[i]);i++);else for(i in obj)if(!1===callback.call(obj[i],i,obj[i]))break;return obj},makeArray:function(arr,results){var ret=results||[];return null!=arr&&(isArrayLike(Object(arr))?jQuery.merge(ret,"string"==typeof arr?[arr]:arr):push.call(ret,arr)),ret},inArray:function(elem,arr,i){return null==arr?-1:indexOf.call(arr,elem,i)},merge:function(first,second){for(var len=+second.length,j=0,i=first.length;j<len;j++)first[i++]=second[j];return first.length=i,first},grep:function(elems,callback,invert){for(var callbackInverse,matches=[],i=0,length=elems.length,callbackExpect=!invert;i<length;i++)(callbackInverse=!callback(elems[i],i))!==callbackExpect&&matches.push(elems[i]);return matches},map:function(elems,callback,arg){var length,value,i=0,ret=[];if(isArrayLike(elems))for(length=elems.length;i<length;i++)null!=(value=callback(elems[i],i,arg))&&ret.push(value);else for(i in elems)null!=(value=callback(elems[i],i,arg))&&ret.push(value);return flat(ret)},guid:1,support:support}),"function"==typeof Symbol&&(jQuery.fn[Symbol.iterator]=arr[Symbol.iterator]),jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(_i,name){class2type["[object "+name+"]"]=name.toLowerCase()}));var Sizzle=
/*!
 * Sizzle CSS Selector Engine v2.3.6
 * https://sizzlejs.com/
 *
 * Copyright JS Foundation and other contributors
 * Released under the MIT license
 * https://js.foundation/
 *
 * Date: 2021-02-16
 */
function(window){var i,support,Expr,getText,isXML,tokenize,compile,select,outermostContext,sortInput,hasDuplicate,setDocument,document,docElem,documentIsHTML,rbuggyQSA,rbuggyMatches,matches,contains,expando="sizzle"+1*new Date,preferredDoc=window.document,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),nonnativeSelectorCache=createCache(),sortOrder=function(a,b){return a===b&&(hasDuplicate=!0),0},hasOwn={}.hasOwnProperty,arr=[],pop=arr.pop,pushNative=arr.push,push=arr.push,slice=arr.slice,indexOf=function(list,elem){for(var i=0,len=list.length;i<len;i++)if(list[i]===elem)return i;return-1},booleans="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",whitespace="[\\x20\\t\\r\\n\\f]",identifier="(?:\\\\[\\da-fA-F]{1,6}"+whitespace+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",attributes="\\["+whitespace+"*("+identifier+")(?:"+whitespace+"*([*^$|!~]?=)"+whitespace+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+identifier+"))|)"+whitespace+"*\\]",pseudos=":("+identifier+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+attributes+")*)|.*)\\)|)",rwhitespace=new RegExp(whitespace+"+","g"),rtrim=new RegExp("^"+whitespace+"+|((?:^|[^\\\\])(?:\\\\.)*)"+whitespace+"+$","g"),rcomma=new RegExp("^"+whitespace+"*,"+whitespace+"*"),rcombinators=new RegExp("^"+whitespace+"*([>+~]|"+whitespace+")"+whitespace+"*"),rdescend=new RegExp(whitespace+"|>"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={ID:new RegExp("^#("+identifier+")"),CLASS:new RegExp("^\\.("+identifier+")"),TAG:new RegExp("^("+identifier+"|[*])"),ATTR:new RegExp("^"+attributes),PSEUDO:new RegExp("^"+pseudos),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),bool:new RegExp("^(?:"+booleans+")$","i"),needsContext:new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rhtml=/HTML$/i,rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rnative=/^[^{]+\{\s*\[native \w/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rsibling=/[+~]/,runescape=new RegExp("\\\\[\\da-fA-F]{1,6}"+whitespace+"?|\\\\([^\\r\\n\\f])","g"),funescape=function(escape,nonHex){var high="0x"+escape.slice(1)-65536;return nonHex||(high<0?String.fromCharCode(high+65536):String.fromCharCode(high>>10|55296,1023&high|56320))},rcssescape=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,fcssescape=function(ch,asCodePoint){return asCodePoint?"\0"===ch?"�":ch.slice(0,-1)+"\\"+ch.charCodeAt(ch.length-1).toString(16)+" ":"\\"+ch},unloadHandler=function(){setDocument()},inDisabledFieldset=addCombinator((function(elem){return!0===elem.disabled&&"fieldset"===elem.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{push.apply(arr=slice.call(preferredDoc.childNodes),preferredDoc.childNodes),arr[preferredDoc.childNodes.length].nodeType}catch(e){push={apply:arr.length?function(target,els){pushNative.apply(target,slice.call(els))}:function(target,els){for(var j=target.length,i=0;target[j++]=els[i++];);target.length=j-1}}}function Sizzle(selector,context,results,seed){var m,i,elem,nid,match,groups,newSelector,newContext=context&&context.ownerDocument,nodeType=context?context.nodeType:9;if(results=results||[],"string"!=typeof selector||!selector||1!==nodeType&&9!==nodeType&&11!==nodeType)return results;if(!seed&&(setDocument(context),context=context||document,documentIsHTML)){if(11!==nodeType&&(match=rquickExpr.exec(selector)))if(m=match[1]){if(9===nodeType){if(!(elem=context.getElementById(m)))return results;if(elem.id===m)return results.push(elem),results}else if(newContext&&(elem=newContext.getElementById(m))&&contains(context,elem)&&elem.id===m)return results.push(elem),results}else{if(match[2])return push.apply(results,context.getElementsByTagName(selector)),results;if((m=match[3])&&support.getElementsByClassName&&context.getElementsByClassName)return push.apply(results,context.getElementsByClassName(m)),results}if(support.qsa&&!nonnativeSelectorCache[selector+" "]&&(!rbuggyQSA||!rbuggyQSA.test(selector))&&(1!==nodeType||"object"!==context.nodeName.toLowerCase())){if(newSelector=selector,newContext=context,1===nodeType&&(rdescend.test(selector)||rcombinators.test(selector))){for((newContext=rsibling.test(selector)&&testContext(context.parentNode)||context)===context&&support.scope||((nid=context.getAttribute("id"))?nid=nid.replace(rcssescape,fcssescape):context.setAttribute("id",nid=expando)),i=(groups=tokenize(selector)).length;i--;)groups[i]=(nid?"#"+nid:":scope")+" "+toSelector(groups[i]);newSelector=groups.join(",")}try{return push.apply(results,newContext.querySelectorAll(newSelector)),results}catch(qsaError){nonnativeSelectorCache(selector,!0)}finally{nid===expando&&context.removeAttribute("id")}}}return select(selector.replace(rtrim,"$1"),context,results,seed)}function createCache(){var keys=[];function cache(key,value){return keys.push(key+" ")>Expr.cacheLength&&delete cache[keys.shift()],cache[key+" "]=value}return cache}function markFunction(fn){return fn[expando]=!0,fn}function assert(fn){var el=document.createElement("fieldset");try{return!!fn(el)}catch(e){return!1}finally{el.parentNode&&el.parentNode.removeChild(el),el=null}}function addHandle(attrs,handler){for(var arr=attrs.split("|"),i=arr.length;i--;)Expr.attrHandle[arr[i]]=handler}function siblingCheck(a,b){var cur=b&&a,diff=cur&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(diff)return diff;if(cur)for(;cur=cur.nextSibling;)if(cur===b)return-1;return a?1:-1}function createInputPseudo(type){return function(elem){var name;return"input"===elem.nodeName.toLowerCase()&&elem.type===type}}function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return("input"===name||"button"===name)&&elem.type===type}}function createDisabledPseudo(disabled){return function(elem){return"form"in elem?elem.parentNode&&!1===elem.disabled?"label"in elem?"label"in elem.parentNode?elem.parentNode.disabled===disabled:elem.disabled===disabled:elem.isDisabled===disabled||elem.isDisabled!==!disabled&&inDisabledFieldset(elem)===disabled:elem.disabled===disabled:"label"in elem&&elem.disabled===disabled}}function createPositionalPseudo(fn){return markFunction((function(argument){return argument=+argument,markFunction((function(seed,matches){for(var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;i--;)seed[j=matchIndexes[i]]&&(seed[j]=!(matches[j]=seed[j]))}))}))}function testContext(context){return context&&void 0!==context.getElementsByTagName&&context}for(i in support=Sizzle.support={},isXML=Sizzle.isXML=function(elem){var namespace=elem&&elem.namespaceURI,docElem=elem&&(elem.ownerDocument||elem).documentElement;return!rhtml.test(namespace||docElem&&docElem.nodeName||"HTML")},setDocument=Sizzle.setDocument=function(node){var hasCompare,subWindow,doc=node?node.ownerDocument||node:preferredDoc;return doc!=document&&9===doc.nodeType&&doc.documentElement?(docElem=(document=doc).documentElement,documentIsHTML=!isXML(document),preferredDoc!=document&&(subWindow=document.defaultView)&&subWindow.top!==subWindow&&(subWindow.addEventListener?subWindow.addEventListener("unload",unloadHandler,!1):subWindow.attachEvent&&subWindow.attachEvent("onunload",unloadHandler)),support.scope=assert((function(el){return docElem.appendChild(el).appendChild(document.createElement("div")),void 0!==el.querySelectorAll&&!el.querySelectorAll(":scope fieldset div").length})),support.attributes=assert((function(el){return el.className="i",!el.getAttribute("className")})),support.getElementsByTagName=assert((function(el){return el.appendChild(document.createComment("")),!el.getElementsByTagName("*").length})),support.getElementsByClassName=rnative.test(document.getElementsByClassName),support.getById=assert((function(el){return docElem.appendChild(el).id=expando,!document.getElementsByName||!document.getElementsByName(expando).length})),support.getById?(Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId}},Expr.find.ID=function(id,context){if(void 0!==context.getElementById&&documentIsHTML){var elem=context.getElementById(id);return elem?[elem]:[]}}):(Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=void 0!==elem.getAttributeNode&&elem.getAttributeNode("id");return node&&node.value===attrId}},Expr.find.ID=function(id,context){if(void 0!==context.getElementById&&documentIsHTML){var node,i,elems,elem=context.getElementById(id);if(elem){if((node=elem.getAttributeNode("id"))&&node.value===id)return[elem];for(elems=context.getElementsByName(id),i=0;elem=elems[i++];)if((node=elem.getAttributeNode("id"))&&node.value===id)return[elem]}return[]}}),Expr.find.TAG=support.getElementsByTagName?function(tag,context){return void 0!==context.getElementsByTagName?context.getElementsByTagName(tag):support.qsa?context.querySelectorAll(tag):void 0}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if("*"===tag){for(;elem=results[i++];)1===elem.nodeType&&tmp.push(elem);return tmp}return results},Expr.find.CLASS=support.getElementsByClassName&&function(className,context){if(void 0!==context.getElementsByClassName&&documentIsHTML)return context.getElementsByClassName(className)},rbuggyMatches=[],rbuggyQSA=[],(support.qsa=rnative.test(document.querySelectorAll))&&(assert((function(el){var input;docElem.appendChild(el).innerHTML="<a id='"+expando+"'></a><select id='"+expando+"-\r\\' msallowcapture=''><option selected=''></option></select>",el.querySelectorAll("[msallowcapture^='']").length&&rbuggyQSA.push("[*^$]="+whitespace+"*(?:''|\"\")"),el.querySelectorAll("[selected]").length||rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")"),el.querySelectorAll("[id~="+expando+"-]").length||rbuggyQSA.push("~="),(input=document.createElement("input")).setAttribute("name",""),el.appendChild(input),el.querySelectorAll("[name='']").length||rbuggyQSA.push("\\["+whitespace+"*name"+whitespace+"*="+whitespace+"*(?:''|\"\")"),el.querySelectorAll(":checked").length||rbuggyQSA.push(":checked"),el.querySelectorAll("a#"+expando+"+*").length||rbuggyQSA.push(".#.+[+~]"),el.querySelectorAll("\\\f"),rbuggyQSA.push("[\\r\\n\\f]")})),assert((function(el){el.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var input=document.createElement("input");input.setAttribute("type","hidden"),el.appendChild(input).setAttribute("name","D"),el.querySelectorAll("[name=d]").length&&rbuggyQSA.push("name"+whitespace+"*[*^$|!~]?="),2!==el.querySelectorAll(":enabled").length&&rbuggyQSA.push(":enabled",":disabled"),docElem.appendChild(el).disabled=!0,2!==el.querySelectorAll(":disabled").length&&rbuggyQSA.push(":enabled",":disabled"),el.querySelectorAll("*,:x"),rbuggyQSA.push(",.*:")}))),(support.matchesSelector=rnative.test(matches=docElem.matches||docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector))&&assert((function(el){support.disconnectedMatch=matches.call(el,"*"),matches.call(el,"[s!='']:x"),rbuggyMatches.push("!=",pseudos)})),rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|")),rbuggyMatches=rbuggyMatches.length&&new RegExp(rbuggyMatches.join("|")),hasCompare=rnative.test(docElem.compareDocumentPosition),contains=hasCompare||rnative.test(docElem.contains)?function(a,b){var adown=9===a.nodeType?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!(!bup||1!==bup.nodeType||!(adown.contains?adown.contains(bup):a.compareDocumentPosition&&16&a.compareDocumentPosition(bup)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},sortOrder=hasCompare?function(a,b){if(a===b)return hasDuplicate=!0,0;var compare=!a.compareDocumentPosition-!b.compareDocumentPosition;return compare||(1&(compare=(a.ownerDocument||a)==(b.ownerDocument||b)?a.compareDocumentPosition(b):1)||!support.sortDetached&&b.compareDocumentPosition(a)===compare?a==document||a.ownerDocument==preferredDoc&&contains(preferredDoc,a)?-1:b==document||b.ownerDocument==preferredDoc&&contains(preferredDoc,b)?1:sortInput?indexOf(sortInput,a)-indexOf(sortInput,b):0:4&compare?-1:1)}:function(a,b){if(a===b)return hasDuplicate=!0,0;var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(!aup||!bup)return a==document?-1:b==document?1:aup?-1:bup?1:sortInput?indexOf(sortInput,a)-indexOf(sortInput,b):0;if(aup===bup)return siblingCheck(a,b);for(cur=a;cur=cur.parentNode;)ap.unshift(cur);for(cur=b;cur=cur.parentNode;)bp.unshift(cur);for(;ap[i]===bp[i];)i++;return i?siblingCheck(ap[i],bp[i]):ap[i]==preferredDoc?-1:bp[i]==preferredDoc?1:0},document):document},Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements)},Sizzle.matchesSelector=function(elem,expr){if(setDocument(elem),support.matchesSelector&&documentIsHTML&&!nonnativeSelectorCache[expr+" "]&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&(!rbuggyQSA||!rbuggyQSA.test(expr)))try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&11!==elem.document.nodeType)return ret}catch(e){nonnativeSelectorCache(expr,!0)}return Sizzle(expr,document,null,[elem]).length>0},Sizzle.contains=function(context,elem){return(context.ownerDocument||context)!=document&&setDocument(context),contains(context,elem)},Sizzle.attr=function(elem,name){(elem.ownerDocument||elem)!=document&&setDocument(elem);var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):void 0;return void 0!==val?val:support.attributes||!documentIsHTML?elem.getAttribute(name):(val=elem.getAttributeNode(name))&&val.specified?val.value:null},Sizzle.escape=function(sel){return(sel+"").replace(rcssescape,fcssescape)},Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg)},Sizzle.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;if(hasDuplicate=!support.detectDuplicates,sortInput=!support.sortStable&&results.slice(0),results.sort(sortOrder),hasDuplicate){for(;elem=results[i++];)elem===results[i]&&(j=duplicates.push(i));for(;j--;)results.splice(duplicates[j],1)}return sortInput=null,results},getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(nodeType){if(1===nodeType||9===nodeType||11===nodeType){if("string"==typeof elem.textContent)return elem.textContent;for(elem=elem.firstChild;elem;elem=elem.nextSibling)ret+=getText(elem)}else if(3===nodeType||4===nodeType)return elem.nodeValue}else for(;node=elem[i++];)ret+=getText(node);return ret},(Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(match){return match[1]=match[1].replace(runescape,funescape),match[3]=(match[3]||match[4]||match[5]||"").replace(runescape,funescape),"~="===match[2]&&(match[3]=" "+match[3]+" "),match.slice(0,4)},CHILD:function(match){return match[1]=match[1].toLowerCase(),"nth"===match[1].slice(0,3)?(match[3]||Sizzle.error(match[0]),match[4]=+(match[4]?match[5]+(match[6]||1):2*("even"===match[3]||"odd"===match[3])),match[5]=+(match[7]+match[8]||"odd"===match[3])):match[3]&&Sizzle.error(match[0]),match},PSEUDO:function(match){var excess,unquoted=!match[6]&&match[2];return matchExpr.CHILD.test(match[0])?null:(match[3]?match[2]=match[4]||match[5]||"":unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,!0))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)&&(match[0]=match[0].slice(0,excess),match[2]=unquoted.slice(0,excess)),match.slice(0,3))}},filter:{TAG:function(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return"*"===nodeNameSelector?function(){return!0}:function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName}},CLASS:function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,(function(elem){return pattern.test("string"==typeof elem.className&&elem.className||void 0!==elem.getAttribute&&elem.getAttribute("class")||"")}))},ATTR:function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);return null==result?"!="===operator:!operator||(result+="","="===operator?result===check:"!="===operator?result!==check:"^="===operator?check&&0===result.indexOf(check):"*="===operator?check&&result.indexOf(check)>-1:"$="===operator?check&&result.slice(-check.length)===check:"~="===operator?(" "+result.replace(rwhitespace," ")+" ").indexOf(check)>-1:"|="===operator&&(result===check||result.slice(0,check.length+1)===check+"-"))}},CHILD:function(type,what,_argument,first,last){var simple="nth"!==type.slice(0,3),forward="last"!==type.slice(-4),ofType="of-type"===what;return 1===first&&0===last?function(elem){return!!elem.parentNode}:function(elem,_context,xml){var cache,uniqueCache,outerCache,node,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType,diff=!1;if(parent){if(simple){for(;dir;){for(node=elem;node=node[dir];)if(ofType?node.nodeName.toLowerCase()===name:1===node.nodeType)return!1;start=dir="only"===type&&!start&&"nextSibling"}return!0}if(start=[forward?parent.firstChild:parent.lastChild],forward&&useCache){for(diff=(nodeIndex=(cache=(uniqueCache=(outerCache=(node=parent)[expando]||(node[expando]={}))[node.uniqueID]||(outerCache[node.uniqueID]={}))[type]||[])[0]===dirruns&&cache[1])&&cache[2],node=nodeIndex&&parent.childNodes[nodeIndex];node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop();)if(1===node.nodeType&&++diff&&node===elem){uniqueCache[type]=[dirruns,nodeIndex,diff];break}}else if(useCache&&(diff=nodeIndex=(cache=(uniqueCache=(outerCache=(node=elem)[expando]||(node[expando]={}))[node.uniqueID]||(outerCache[node.uniqueID]={}))[type]||[])[0]===dirruns&&cache[1]),!1===diff)for(;(node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())&&((ofType?node.nodeName.toLowerCase()!==name:1!==node.nodeType)||!++diff||(useCache&&((uniqueCache=(outerCache=node[expando]||(node[expando]={}))[node.uniqueID]||(outerCache[node.uniqueID]={}))[type]=[dirruns,diff]),node!==elem)););return(diff-=last)===first||diff%first==0&&diff/first>=0}}},PSEUDO:function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);return fn[expando]?fn(argument):fn.length>1?(args=[pseudo,pseudo,"",argument],Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction((function(seed,matches){for(var idx,matched=fn(seed,argument),i=matched.length;i--;)seed[idx=indexOf(seed,matched[i])]=!(matches[idx]=matched[i])})):function(elem){return fn(elem,0,args)}):fn}},pseudos:{not:markFunction((function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction((function(seed,matches,_context,xml){for(var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;i--;)(elem=unmatched[i])&&(seed[i]=!(matches[i]=elem))})):function(elem,_context,xml){return input[0]=elem,matcher(input,null,xml,results),input[0]=null,!results.pop()}})),has:markFunction((function(selector){return function(elem){return Sizzle(selector,elem).length>0}})),contains:markFunction((function(text){return text=text.replace(runescape,funescape),function(elem){return(elem.textContent||getText(elem)).indexOf(text)>-1}})),lang:markFunction((function(lang){return ridentifier.test(lang||"")||Sizzle.error("unsupported lang: "+lang),lang=lang.replace(runescape,funescape).toLowerCase(),function(elem){var elemLang;do{if(elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang"))return(elemLang=elemLang.toLowerCase())===lang||0===elemLang.indexOf(lang+"-")}while((elem=elem.parentNode)&&1===elem.nodeType);return!1}})),target:function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id},root:function(elem){return elem===docElem},focus:function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex)},enabled:createDisabledPseudo(!1),disabled:createDisabledPseudo(!0),checked:function(elem){var nodeName=elem.nodeName.toLowerCase();return"input"===nodeName&&!!elem.checked||"option"===nodeName&&!!elem.selected},selected:function(elem){return elem.parentNode&&elem.parentNode.selectedIndex,!0===elem.selected},empty:function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling)if(elem.nodeType<6)return!1;return!0},parent:function(elem){return!Expr.pseudos.empty(elem)},header:function(elem){return rheader.test(elem.nodeName)},input:function(elem){return rinputs.test(elem.nodeName)},button:function(elem){var name=elem.nodeName.toLowerCase();return"input"===name&&"button"===elem.type||"button"===name},text:function(elem){var attr;return"input"===elem.nodeName.toLowerCase()&&"text"===elem.type&&(null==(attr=elem.getAttribute("type"))||"text"===attr.toLowerCase())},first:createPositionalPseudo((function(){return[0]})),last:createPositionalPseudo((function(_matchIndexes,length){return[length-1]})),eq:createPositionalPseudo((function(_matchIndexes,length,argument){return[argument<0?argument+length:argument]})),even:createPositionalPseudo((function(matchIndexes,length){for(var i=0;i<length;i+=2)matchIndexes.push(i);return matchIndexes})),odd:createPositionalPseudo((function(matchIndexes,length){for(var i=1;i<length;i+=2)matchIndexes.push(i);return matchIndexes})),lt:createPositionalPseudo((function(matchIndexes,length,argument){for(var i=argument<0?argument+length:argument>length?length:argument;--i>=0;)matchIndexes.push(i);return matchIndexes})),gt:createPositionalPseudo((function(matchIndexes,length,argument){for(var i=argument<0?argument+length:argument;++i<length;)matchIndexes.push(i);return matchIndexes}))}}).pseudos.nth=Expr.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})Expr.pseudos[i]=createInputPseudo(i);for(i in{submit:!0,reset:!0})Expr.pseudos[i]=createButtonPseudo(i);function setFilters(){}function toSelector(tokens){for(var i=0,len=tokens.length,selector="";i<len;i++)selector+=tokens[i].value;return selector}function addCombinator(matcher,combinator,base){var dir=combinator.dir,skip=combinator.next,key=skip||dir,checkNonElements=base&&"parentNode"===key,doneName=done++;return combinator.first?function(elem,context,xml){for(;elem=elem[dir];)if(1===elem.nodeType||checkNonElements)return matcher(elem,context,xml);return!1}:function(elem,context,xml){var oldCache,uniqueCache,outerCache,newCache=[dirruns,doneName];if(xml){for(;elem=elem[dir];)if((1===elem.nodeType||checkNonElements)&&matcher(elem,context,xml))return!0}else for(;elem=elem[dir];)if(1===elem.nodeType||checkNonElements)if(uniqueCache=(outerCache=elem[expando]||(elem[expando]={}))[elem.uniqueID]||(outerCache[elem.uniqueID]={}),skip&&skip===elem.nodeName.toLowerCase())elem=elem[dir]||elem;else{if((oldCache=uniqueCache[key])&&oldCache[0]===dirruns&&oldCache[1]===doneName)return newCache[2]=oldCache[2];if(uniqueCache[key]=newCache,newCache[2]=matcher(elem,context,xml))return!0}return!1}}function elementMatcher(matchers){return matchers.length>1?function(elem,context,xml){for(var i=matchers.length;i--;)if(!matchers[i](elem,context,xml))return!1;return!0}:matchers[0]}function multipleContexts(selector,contexts,results){for(var i=0,len=contexts.length;i<len;i++)Sizzle(selector,contexts[i],results);return results}function condense(unmatched,map,filter,context,xml){for(var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=null!=map;i<len;i++)(elem=unmatched[i])&&(filter&&!filter(elem,context,xml)||(newUnmatched.push(elem),mapped&&map.push(i)));return newUnmatched}function setMatcher(preFilter,selector,matcher,postFilter,postFinder,postSelector){return postFilter&&!postFilter[expando]&&(postFilter=setMatcher(postFilter)),postFinder&&!postFinder[expando]&&(postFinder=setMatcher(postFinder,postSelector)),markFunction((function(seed,results,context,xml){var temp,i,elem,preMap=[],postMap=[],preexisting=results.length,elems=seed||multipleContexts(selector||"*",context.nodeType?[context]:context,[]),matcherIn=!preFilter||!seed&&selector?elems:condense(elems,preMap,preFilter,context,xml),matcherOut=matcher?postFinder||(seed?preFilter:preexisting||postFilter)?[]:results:matcherIn;if(matcher&&matcher(matcherIn,matcherOut,context,xml),postFilter)for(temp=condense(matcherOut,postMap),postFilter(temp,[],context,xml),i=temp.length;i--;)(elem=temp[i])&&(matcherOut[postMap[i]]=!(matcherIn[postMap[i]]=elem));if(seed){if(postFinder||preFilter){if(postFinder){for(temp=[],i=matcherOut.length;i--;)(elem=matcherOut[i])&&temp.push(matcherIn[i]=elem);postFinder(null,matcherOut=[],temp,xml)}for(i=matcherOut.length;i--;)(elem=matcherOut[i])&&(temp=postFinder?indexOf(seed,elem):preMap[i])>-1&&(seed[temp]=!(results[temp]=elem))}}else matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut),postFinder?postFinder(null,results,matcherOut,xml):push.apply(results,matcherOut)}))}function matcherFromTokens(tokens){for(var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator((function(elem){return elem===checkContext}),implicitRelative,!0),matchAnyContext=addCombinator((function(elem){return indexOf(checkContext,elem)>-1}),implicitRelative,!0),matchers=[function(elem,context,xml){var ret=!leadingRelative&&(xml||context!==outermostContext)||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml));return checkContext=null,ret}];i<len;i++)if(matcher=Expr.relative[tokens[i].type])matchers=[addCombinator(elementMatcher(matchers),matcher)];else{if((matcher=Expr.filter[tokens[i].type].apply(null,tokens[i].matches))[expando]){for(j=++i;j<len&&!Expr.relative[tokens[j].type];j++);return setMatcher(i>1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:" "===tokens[i-2].type?"*":""})).replace(rtrim,"$1"),matcher,i<j&&matcherFromTokens(tokens.slice(i,j)),j<len&&matcherFromTokens(tokens=tokens.slice(j)),j<len&&toSelector(tokens))}matchers.push(matcher)}return elementMatcher(matchers)}function matcherFromGroupMatchers(elementMatchers,setMatchers){var bySet=setMatchers.length>0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,outermost){var elem,j,matcher,matchedCount=0,i="0",unmatched=seed&&[],setMatched=[],contextBackup=outermostContext,elems=seed||byElement&&Expr.find.TAG("*",outermost),dirrunsUnique=dirruns+=null==contextBackup?1:Math.random()||.1,len=elems.length;for(outermost&&(outermostContext=context==document||context||outermost);i!==len&&null!=(elem=elems[i]);i++){if(byElement&&elem){for(j=0,context||elem.ownerDocument==document||(setDocument(elem),xml=!documentIsHTML);matcher=elementMatchers[j++];)if(matcher(elem,context||document,xml)){results.push(elem);break}outermost&&(dirruns=dirrunsUnique)}bySet&&((elem=!matcher&&elem)&&matchedCount--,seed&&unmatched.push(elem))}if(matchedCount+=i,bySet&&i!==matchedCount){for(j=0;matcher=setMatchers[j++];)matcher(unmatched,setMatched,context,xml);if(seed){if(matchedCount>0)for(;i--;)unmatched[i]||setMatched[i]||(setMatched[i]=pop.call(results));setMatched=condense(setMatched)}push.apply(results,setMatched),outermost&&!seed&&setMatched.length>0&&matchedCount+setMatchers.length>1&&Sizzle.uniqueSort(results)}return outermost&&(dirruns=dirrunsUnique,outermostContext=contextBackup),unmatched};return bySet?markFunction(superMatcher):superMatcher}return setFilters.prototype=Expr.filters=Expr.pseudos,Expr.setFilters=new setFilters,tokenize=Sizzle.tokenize=function(selector,parseOnly){var matched,match,tokens,type,soFar,groups,preFilters,cached=tokenCache[selector+" "];if(cached)return parseOnly?0:cached.slice(0);for(soFar=selector,groups=[],preFilters=Expr.preFilter;soFar;){for(type in matched&&!(match=rcomma.exec(soFar))||(match&&(soFar=soFar.slice(match[0].length)||soFar),groups.push(tokens=[])),matched=!1,(match=rcombinators.exec(soFar))&&(matched=match.shift(),tokens.push({value:matched,type:match[0].replace(rtrim," ")}),soFar=soFar.slice(matched.length)),Expr.filter)!(match=matchExpr[type].exec(soFar))||preFilters[type]&&!(match=preFilters[type](match))||(matched=match.shift(),tokens.push({value:matched,type:type,matches:match}),soFar=soFar.slice(matched.length));if(!matched)break}return parseOnly?soFar.length:soFar?Sizzle.error(selector):tokenCache(selector,groups).slice(0)},compile=Sizzle.compile=function(selector,match){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){for(match||(match=tokenize(selector)),i=match.length;i--;)(cached=matcherFromTokens(match[i]))[expando]?setMatchers.push(cached):elementMatchers.push(cached);(cached=compilerCache(selector,matcherFromGroupMatchers(elementMatchers,setMatchers))).selector=selector}return cached},select=Sizzle.select=function(selector,context,results,seed){var i,tokens,token,type,find,compiled="function"==typeof selector&&selector,match=!seed&&tokenize(selector=compiled.selector||selector);if(results=results||[],1===match.length){if((tokens=match[0]=match[0].slice(0)).length>2&&"ID"===(token=tokens[0]).type&&9===context.nodeType&&documentIsHTML&&Expr.relative[tokens[1].type]){if(!(context=(Expr.find.ID(token.matches[0].replace(runescape,funescape),context)||[])[0]))return results;compiled&&(context=context.parentNode),selector=selector.slice(tokens.shift().value.length)}for(i=matchExpr.needsContext.test(selector)?0:tokens.length;i--&&(token=tokens[i],!Expr.relative[type=token.type]);)if((find=Expr.find[type])&&(seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&testContext(context.parentNode)||context))){if(tokens.splice(i,1),!(selector=seed.length&&toSelector(tokens)))return push.apply(results,seed),results;break}}return(compiled||compile(selector,match))(seed,context,!documentIsHTML,results,!context||rsibling.test(selector)&&testContext(context.parentNode)||context),results},support.sortStable=expando.split("").sort(sortOrder).join("")===expando,support.detectDuplicates=!!hasDuplicate,setDocument(),support.sortDetached=assert((function(el){return 1&el.compareDocumentPosition(document.createElement("fieldset"))})),assert((function(el){return el.innerHTML="<a href='#'></a>","#"===el.firstChild.getAttribute("href")}))||addHandle("type|href|height|width",(function(elem,name,isXML){if(!isXML)return elem.getAttribute(name,"type"===name.toLowerCase()?1:2)})),support.attributes&&assert((function(el){return el.innerHTML="<input/>",el.firstChild.setAttribute("value",""),""===el.firstChild.getAttribute("value")}))||addHandle("value",(function(elem,_name,isXML){if(!isXML&&"input"===elem.nodeName.toLowerCase())return elem.defaultValue})),assert((function(el){return null==el.getAttribute("disabled")}))||addHandle(booleans,(function(elem,name,isXML){var val;if(!isXML)return!0===elem[name]?name.toLowerCase():(val=elem.getAttributeNode(name))&&val.specified?val.value:null})),Sizzle}(window);jQuery.find=Sizzle,jQuery.expr=Sizzle.selectors,jQuery.expr[":"]=jQuery.expr.pseudos,jQuery.uniqueSort=jQuery.unique=Sizzle.uniqueSort,jQuery.text=Sizzle.getText,jQuery.isXMLDoc=Sizzle.isXML,jQuery.contains=Sizzle.contains,jQuery.escapeSelector=Sizzle.escape;var dir=function(elem,dir,until){for(var matched=[],truncate=void 0!==until;(elem=elem[dir])&&9!==elem.nodeType;)if(1===elem.nodeType){if(truncate&&jQuery(elem).is(until))break;matched.push(elem)}return matched},siblings=function(n,elem){for(var matched=[];n;n=n.nextSibling)1===n.nodeType&&n!==elem&&matched.push(n);return matched},rneedsContext=jQuery.expr.match.needsContext;function nodeName(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase()}var rsingleTag=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function winnow(elements,qualifier,not){return isFunction(qualifier)?jQuery.grep(elements,(function(elem,i){return!!qualifier.call(elem,i,elem)!==not})):qualifier.nodeType?jQuery.grep(elements,(function(elem){return elem===qualifier!==not})):"string"!=typeof qualifier?jQuery.grep(elements,(function(elem){return indexOf.call(qualifier,elem)>-1!==not})):jQuery.filter(qualifier,elements,not)}jQuery.filter=function(expr,elems,not){var elem=elems[0];return not&&(expr=":not("+expr+")"),1===elems.length&&1===elem.nodeType?jQuery.find.matchesSelector(elem,expr)?[elem]:[]:jQuery.find.matches(expr,jQuery.grep(elems,(function(elem){return 1===elem.nodeType})))},jQuery.fn.extend({find:function(selector){var i,ret,len=this.length,self=this;if("string"!=typeof selector)return this.pushStack(jQuery(selector).filter((function(){for(i=0;i<len;i++)if(jQuery.contains(self[i],this))return!0})));for(ret=this.pushStack([]),i=0;i<len;i++)jQuery.find(selector,self[i],ret);return len>1?jQuery.uniqueSort(ret):ret},filter:function(selector){return this.pushStack(winnow(this,selector||[],!1))},not:function(selector){return this.pushStack(winnow(this,selector||[],!0))},is:function(selector){return!!winnow(this,"string"==typeof selector&&rneedsContext.test(selector)?jQuery(selector):selector||[],!1).length}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,init;(jQuery.fn.init=function(selector,context,root){var match,elem;if(!selector)return this;if(root=root||rootjQuery,"string"==typeof selector){if(!(match="<"===selector[0]&&">"===selector[selector.length-1]&&selector.length>=3?[null,selector,null]:rquickExpr.exec(selector))||!match[1]&&context)return!context||context.jquery?(context||root).find(selector):this.constructor(context).find(selector);if(match[1]){if(context=context instanceof jQuery?context[0]:context,jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,!0)),rsingleTag.test(match[1])&&jQuery.isPlainObject(context))for(match in context)isFunction(this[match])?this[match](context[match]):this.attr(match,context[match]);return this}return(elem=document.getElementById(match[2]))&&(this[0]=elem,this.length=1),this}return selector.nodeType?(this[0]=selector,this.length=1,this):isFunction(selector)?void 0!==root.ready?root.ready(selector):selector(jQuery):jQuery.makeArray(selector,this)}).prototype=jQuery.fn,rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:!0,contents:!0,next:!0,prev:!0};function sibling(cur,dir){for(;(cur=cur[dir])&&1!==cur.nodeType;);return cur}jQuery.fn.extend({has:function(target){var targets=jQuery(target,this),l=targets.length;return this.filter((function(){for(var i=0;i<l;i++)if(jQuery.contains(this,targets[i]))return!0}))},closest:function(selectors,context){var cur,i=0,l=this.length,matched=[],targets="string"!=typeof selectors&&jQuery(selectors);if(!rneedsContext.test(selectors))for(;i<l;i++)for(cur=this[i];cur&&cur!==context;cur=cur.parentNode)if(cur.nodeType<11&&(targets?targets.index(cur)>-1:1===cur.nodeType&&jQuery.find.matchesSelector(cur,selectors))){matched.push(cur);break}return this.pushStack(matched.length>1?jQuery.uniqueSort(matched):matched)},index:function(elem){return elem?"string"==typeof elem?indexOf.call(jQuery(elem),this[0]):indexOf.call(this,elem.jquery?elem[0]:elem):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(selector,context){return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(),jQuery(selector,context))))},addBack:function(selector){return this.add(null==selector?this.prevObject:this.prevObject.filter(selector))}}),jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&11!==parent.nodeType?parent:null},parents:function(elem){return dir(elem,"parentNode")},parentsUntil:function(elem,_i,until){return dir(elem,"parentNode",until)},next:function(elem){return sibling(elem,"nextSibling")},prev:function(elem){return sibling(elem,"previousSibling")},nextAll:function(elem){return dir(elem,"nextSibling")},prevAll:function(elem){return dir(elem,"previousSibling")},nextUntil:function(elem,_i,until){return dir(elem,"nextSibling",until)},prevUntil:function(elem,_i,until){return dir(elem,"previousSibling",until)},siblings:function(elem){return siblings((elem.parentNode||{}).firstChild,elem)},children:function(elem){return siblings(elem.firstChild)},contents:function(elem){return null!=elem.contentDocument&&getProto(elem.contentDocument)?elem.contentDocument:(nodeName(elem,"template")&&(elem=elem.content||elem),jQuery.merge([],elem.childNodes))}},(function(name,fn){jQuery.fn[name]=function(until,selector){var matched=jQuery.map(this,fn,until);return"Until"!==name.slice(-5)&&(selector=until),selector&&"string"==typeof selector&&(matched=jQuery.filter(selector,matched)),this.length>1&&(guaranteedUnique[name]||jQuery.uniqueSort(matched),rparentsprev.test(name)&&matched.reverse()),this.pushStack(matched)}}));var rnothtmlwhite=/[^\x20\t\r\n\f]+/g;function createOptions(options){var object={};return jQuery.each(options.match(rnothtmlwhite)||[],(function(_,flag){object[flag]=!0})),object}function Identity(v){return v}function Thrower(ex){throw ex}function adoptValue(value,resolve,reject,noValue){var method;try{value&&isFunction(method=value.promise)?method.call(value).done(resolve).fail(reject):value&&isFunction(method=value.then)?method.call(value,resolve,reject):resolve.apply(void 0,[value].slice(noValue))}catch(value){reject.apply(void 0,[value])}}jQuery.Callbacks=function(options){options="string"==typeof options?createOptions(options):jQuery.extend({},options);var firing,memory,fired,locked,list=[],queue=[],firingIndex=-1,fire=function(){for(locked=locked||options.once,fired=firing=!0;queue.length;firingIndex=-1)for(memory=queue.shift();++firingIndex<list.length;)!1===list[firingIndex].apply(memory[0],memory[1])&&options.stopOnFalse&&(firingIndex=list.length,memory=!1);options.memory||(memory=!1),firing=!1,locked&&(list=memory?[]:"")},self={add:function(){return list&&(memory&&!firing&&(firingIndex=list.length-1,queue.push(memory)),function add(args){jQuery.each(args,(function(_,arg){isFunction(arg)?options.unique&&self.has(arg)||list.push(arg):arg&&arg.length&&"string"!==toType(arg)&&add(arg)}))}(arguments),memory&&!firing&&fire()),this},remove:function(){return jQuery.each(arguments,(function(_,arg){for(var index;(index=jQuery.inArray(arg,list,index))>-1;)list.splice(index,1),index<=firingIndex&&firingIndex--})),this},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:list.length>0},empty:function(){return list&&(list=[]),this},disable:function(){return locked=queue=[],list=memory="",this},disabled:function(){return!list},lock:function(){return locked=queue=[],memory||firing||(list=memory=""),this},locked:function(){return!!locked},fireWith:function(context,args){return locked||(args=[context,(args=args||[]).slice?args.slice():args],queue.push(args),firing||fire()),this},fire:function(){return self.fireWith(this,arguments),this},fired:function(){return!!fired}};return self},jQuery.extend({Deferred:function(func){var tuples=[["notify","progress",jQuery.Callbacks("memory"),jQuery.Callbacks("memory"),2],["resolve","done",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),0,"resolved"],["reject","fail",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),1,"rejected"]],state="pending",promise={state:function(){return state},always:function(){return deferred.done(arguments).fail(arguments),this},catch:function(fn){return promise.then(null,fn)},pipe:function(){var fns=arguments;return jQuery.Deferred((function(newDefer){jQuery.each(tuples,(function(_i,tuple){var fn=isFunction(fns[tuple[4]])&&fns[tuple[4]];deferred[tuple[1]]((function(){var returned=fn&&fn.apply(this,arguments);returned&&isFunction(returned.promise)?returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject):newDefer[tuple[0]+"With"](this,fn?[returned]:arguments)}))})),fns=null})).promise()},then:function(onFulfilled,onRejected,onProgress){var maxDepth=0;function resolve(depth,deferred,handler,special){return function(){var that=this,args=arguments,mightThrow=function(){var returned,then;if(!(depth<maxDepth)){if((returned=handler.apply(that,args))===deferred.promise())throw new TypeError("Thenable self-resolution");then=returned&&("object"==typeof returned||"function"==typeof returned)&&returned.then,isFunction(then)?special?then.call(returned,resolve(maxDepth,deferred,Identity,special),resolve(maxDepth,deferred,Thrower,special)):(maxDepth++,then.call(returned,resolve(maxDepth,deferred,Identity,special),resolve(maxDepth,deferred,Thrower,special),resolve(maxDepth,deferred,Identity,deferred.notifyWith))):(handler!==Identity&&(that=void 0,args=[returned]),(special||deferred.resolveWith)(that,args))}},process=special?mightThrow:function(){try{mightThrow()}catch(e){jQuery.Deferred.exceptionHook&&jQuery.Deferred.exceptionHook(e,process.stackTrace),depth+1>=maxDepth&&(handler!==Thrower&&(that=void 0,args=[e]),deferred.rejectWith(that,args))}};depth?process():(jQuery.Deferred.getStackHook&&(process.stackTrace=jQuery.Deferred.getStackHook()),window.setTimeout(process))}}return jQuery.Deferred((function(newDefer){tuples[0][3].add(resolve(0,newDefer,isFunction(onProgress)?onProgress:Identity,newDefer.notifyWith)),tuples[1][3].add(resolve(0,newDefer,isFunction(onFulfilled)?onFulfilled:Identity)),tuples[2][3].add(resolve(0,newDefer,isFunction(onRejected)?onRejected:Thrower))})).promise()},promise:function(obj){return null!=obj?jQuery.extend(obj,promise):promise}},deferred={};return jQuery.each(tuples,(function(i,tuple){var list=tuple[2],stateString=tuple[5];promise[tuple[1]]=list.add,stateString&&list.add((function(){state=stateString}),tuples[3-i][2].disable,tuples[3-i][3].disable,tuples[0][2].lock,tuples[0][3].lock),list.add(tuple[3].fire),deferred[tuple[0]]=function(){return deferred[tuple[0]+"With"](this===deferred?void 0:this,arguments),this},deferred[tuple[0]+"With"]=list.fireWith})),promise.promise(deferred),func&&func.call(deferred,deferred),deferred},when:function(singleValue){var remaining=arguments.length,i=remaining,resolveContexts=Array(i),resolveValues=slice.call(arguments),primary=jQuery.Deferred(),updateFunc=function(i){return function(value){resolveContexts[i]=this,resolveValues[i]=arguments.length>1?slice.call(arguments):value,--remaining||primary.resolveWith(resolveContexts,resolveValues)}};if(remaining<=1&&(adoptValue(singleValue,primary.done(updateFunc(i)).resolve,primary.reject,!remaining),"pending"===primary.state()||isFunction(resolveValues[i]&&resolveValues[i].then)))return primary.then();for(;i--;)adoptValue(resolveValues[i],updateFunc(i),primary.reject);return primary.promise()}});var rerrorNames=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;jQuery.Deferred.exceptionHook=function(error,stack){window.console&&window.console.warn&&error&&rerrorNames.test(error.name)&&window.console.warn("jQuery.Deferred exception: "+error.message,error.stack,stack)},jQuery.readyException=function(error){window.setTimeout((function(){throw error}))};var readyList=jQuery.Deferred();function completed(){document.removeEventListener("DOMContentLoaded",completed),window.removeEventListener("load",completed),jQuery.ready()}jQuery.fn.ready=function(fn){return readyList.then(fn).catch((function(error){jQuery.readyException(error)})),this},jQuery.extend({isReady:!1,readyWait:1,ready:function(wait){(!0===wait?--jQuery.readyWait:jQuery.isReady)||(jQuery.isReady=!0,!0!==wait&&--jQuery.readyWait>0||readyList.resolveWith(document,[jQuery]))}}),jQuery.ready.then=readyList.then,"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?window.setTimeout(jQuery.ready):(document.addEventListener("DOMContentLoaded",completed),window.addEventListener("load",completed));var access=function(elems,fn,key,value,chainable,emptyGet,raw){var i=0,len=elems.length,bulk=null==key;if("object"===toType(key))for(i in chainable=!0,key)access(elems,fn,i,key[i],!0,emptyGet,raw);else if(void 0!==value&&(chainable=!0,isFunction(value)||(raw=!0),bulk&&(raw?(fn.call(elems,value),fn=null):(bulk=fn,fn=function(elem,_key,value){return bulk.call(jQuery(elem),value)})),fn))for(;i<len;i++)fn(elems[i],key,raw?value:value.call(elems[i],i,fn(elems[i],key)));return chainable?elems:bulk?fn.call(elems):len?fn(elems[0],key):emptyGet},rmsPrefix=/^-ms-/,rdashAlpha=/-([a-z])/g;function fcamelCase(_all,letter){return letter.toUpperCase()}function camelCase(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase)}var acceptData=function(owner){return 1===owner.nodeType||9===owner.nodeType||!+owner.nodeType};function Data(){this.expando=jQuery.expando+Data.uid++}Data.uid=1,Data.prototype={cache:function(owner){var value=owner[this.expando];return value||(value={},acceptData(owner)&&(owner.nodeType?owner[this.expando]=value:Object.defineProperty(owner,this.expando,{value:value,configurable:!0}))),value},set:function(owner,data,value){var prop,cache=this.cache(owner);if("string"==typeof data)cache[camelCase(data)]=value;else for(prop in data)cache[camelCase(prop)]=data[prop];return cache},get:function(owner,key){return void 0===key?this.cache(owner):owner[this.expando]&&owner[this.expando][camelCase(key)]},access:function(owner,key,value){return void 0===key||key&&"string"==typeof key&&void 0===value?this.get(owner,key):(this.set(owner,key,value),void 0!==value?value:key)},remove:function(owner,key){var i,cache=owner[this.expando];if(void 0!==cache){if(void 0!==key){i=(key=Array.isArray(key)?key.map(camelCase):(key=camelCase(key))in cache?[key]:key.match(rnothtmlwhite)||[]).length;for(;i--;)delete cache[key[i]]}(void 0===key||jQuery.isEmptyObject(cache))&&(owner.nodeType?owner[this.expando]=void 0:delete owner[this.expando])}},hasData:function(owner){var cache=owner[this.expando];return void 0!==cache&&!jQuery.isEmptyObject(cache)}};var dataPriv=new Data,dataUser=new Data,rbrace=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,rmultiDash=/[A-Z]/g;function getData(data){return"true"===data||"false"!==data&&("null"===data?null:data===+data+""?+data:rbrace.test(data)?JSON.parse(data):data)}function dataAttr(elem,key,data){var name;if(void 0===data&&1===elem.nodeType)if(name="data-"+key.replace(rmultiDash,"-$&").toLowerCase(),"string"==typeof(data=elem.getAttribute(name))){try{data=getData(data)}catch(e){}dataUser.set(elem,key,data)}else data=void 0;return data}jQuery.extend({hasData:function(elem){return dataUser.hasData(elem)||dataPriv.hasData(elem)},data:function(elem,name,data){return dataUser.access(elem,name,data)},removeData:function(elem,name){dataUser.remove(elem,name)},_data:function(elem,name,data){return dataPriv.access(elem,name,data)},_removeData:function(elem,name){dataPriv.remove(elem,name)}}),jQuery.fn.extend({data:function(key,value){var i,name,data,elem=this[0],attrs=elem&&elem.attributes;if(void 0===key){if(this.length&&(data=dataUser.get(elem),1===elem.nodeType&&!dataPriv.get(elem,"hasDataAttrs"))){for(i=attrs.length;i--;)attrs[i]&&0===(name=attrs[i].name).indexOf("data-")&&(name=camelCase(name.slice(5)),dataAttr(elem,name,data[name]));dataPriv.set(elem,"hasDataAttrs",!0)}return data}return"object"==typeof key?this.each((function(){dataUser.set(this,key)})):access(this,(function(value){var data;if(elem&&void 0===value)return void 0!==(data=dataUser.get(elem,key))?data:void 0!==(data=dataAttr(elem,key))?data:void 0;this.each((function(){dataUser.set(this,key,value)}))}),null,value,arguments.length>1,null,!0)},removeData:function(key){return this.each((function(){dataUser.remove(this,key)}))}}),jQuery.extend({queue:function(elem,type,data){var queue;if(elem)return type=(type||"fx")+"queue",queue=dataPriv.get(elem,type),data&&(!queue||Array.isArray(data)?queue=dataPriv.access(elem,type,jQuery.makeArray(data)):queue.push(data)),queue||[]},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type)};"inprogress"===fn&&(fn=queue.shift(),startLength--),fn&&("fx"===type&&queue.unshift("inprogress"),delete hooks.stop,fn.call(elem,next,hooks)),!startLength&&hooks&&hooks.empty.fire()},_queueHooks:function(elem,type){var key=type+"queueHooks";return dataPriv.get(elem,key)||dataPriv.access(elem,key,{empty:jQuery.Callbacks("once memory").add((function(){dataPriv.remove(elem,[type+"queue",key])}))})}}),jQuery.fn.extend({queue:function(type,data){var setter=2;return"string"!=typeof type&&(data=type,type="fx",setter--),arguments.length<setter?jQuery.queue(this[0],type):void 0===data?this:this.each((function(){var queue=jQuery.queue(this,type,data);jQuery._queueHooks(this,type),"fx"===type&&"inprogress"!==queue[0]&&jQuery.dequeue(this,type)}))},dequeue:function(type){return this.each((function(){jQuery.dequeue(this,type)}))},clearQueue:function(type){return this.queue(type||"fx",[])},promise:function(type,obj){var tmp,count=1,defer=jQuery.Deferred(),elements=this,i=this.length,resolve=function(){--count||defer.resolveWith(elements,[elements])};for("string"!=typeof type&&(obj=type,type=void 0),type=type||"fx";i--;)(tmp=dataPriv.get(elements[i],type+"queueHooks"))&&tmp.empty&&(count++,tmp.empty.add(resolve));return resolve(),defer.promise(obj)}});var pnum=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,rcssNum=new RegExp("^(?:([+-])=|)("+pnum+")([a-z%]*)$","i"),cssExpand=["Top","Right","Bottom","Left"],documentElement=document.documentElement,isAttached=function(elem){return jQuery.contains(elem.ownerDocument,elem)},composed={composed:!0};documentElement.getRootNode&&(isAttached=function(elem){return jQuery.contains(elem.ownerDocument,elem)||elem.getRootNode(composed)===elem.ownerDocument});var isHiddenWithinTree=function(elem,el){return"none"===(elem=el||elem).style.display||""===elem.style.display&&isAttached(elem)&&"none"===jQuery.css(elem,"display")};function adjustCSS(elem,prop,valueParts,tween){var adjusted,scale,maxIterations=20,currentValue=tween?function(){return tween.cur()}:function(){return jQuery.css(elem,prop,"")},initial=currentValue(),unit=valueParts&&valueParts[3]||(jQuery.cssNumber[prop]?"":"px"),initialInUnit=elem.nodeType&&(jQuery.cssNumber[prop]||"px"!==unit&&+initial)&&rcssNum.exec(jQuery.css(elem,prop));if(initialInUnit&&initialInUnit[3]!==unit){for(initial/=2,unit=unit||initialInUnit[3],initialInUnit=+initial||1;maxIterations--;)jQuery.style(elem,prop,initialInUnit+unit),(1-scale)*(1-(scale=currentValue()/initial||.5))<=0&&(maxIterations=0),initialInUnit/=scale;initialInUnit*=2,jQuery.style(elem,prop,initialInUnit+unit),valueParts=valueParts||[]}return valueParts&&(initialInUnit=+initialInUnit||+initial||0,adjusted=valueParts[1]?initialInUnit+(valueParts[1]+1)*valueParts[2]:+valueParts[2],tween&&(tween.unit=unit,tween.start=initialInUnit,tween.end=adjusted)),adjusted}var defaultDisplayMap={};function getDefaultDisplay(elem){var temp,doc=elem.ownerDocument,nodeName=elem.nodeName,display=defaultDisplayMap[nodeName];return display||(temp=doc.body.appendChild(doc.createElement(nodeName)),display=jQuery.css(temp,"display"),temp.parentNode.removeChild(temp),"none"===display&&(display="block"),defaultDisplayMap[nodeName]=display,display)}function showHide(elements,show){for(var display,elem,values=[],index=0,length=elements.length;index<length;index++)(elem=elements[index]).style&&(display=elem.style.display,show?("none"===display&&(values[index]=dataPriv.get(elem,"display")||null,values[index]||(elem.style.display="")),""===elem.style.display&&isHiddenWithinTree(elem)&&(values[index]=getDefaultDisplay(elem))):"none"!==display&&(values[index]="none",dataPriv.set(elem,"display",display)));for(index=0;index<length;index++)null!=values[index]&&(elements[index].style.display=values[index]);return elements}jQuery.fn.extend({show:function(){return showHide(this,!0)},hide:function(){return showHide(this)},toggle:function(state){return"boolean"==typeof state?state?this.show():this.hide():this.each((function(){isHiddenWithinTree(this)?jQuery(this).show():jQuery(this).hide()}))}});var rcheckableType=/^(?:checkbox|radio)$/i,rtagName=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,rscriptType=/^$|^module$|\/(?:java|ecma)script/i,fragment,div,input;div=document.createDocumentFragment().appendChild(document.createElement("div")),(input=document.createElement("input")).setAttribute("type","radio"),input.setAttribute("checked","checked"),input.setAttribute("name","t"),div.appendChild(input),support.checkClone=div.cloneNode(!0).cloneNode(!0).lastChild.checked,div.innerHTML="<textarea>x</textarea>",support.noCloneChecked=!!div.cloneNode(!0).lastChild.defaultValue,div.innerHTML="<option></option>",support.option=!!div.lastChild;var wrapMap={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 getAll(context,tag){var ret;return ret=void 0!==context.getElementsByTagName?context.getElementsByTagName(tag||"*"):void 0!==context.querySelectorAll?context.querySelectorAll(tag||"*"):[],void 0===tag||tag&&nodeName(context,tag)?jQuery.merge([context],ret):ret}function setGlobalEval(elems,refElements){for(var i=0,l=elems.length;i<l;i++)dataPriv.set(elems[i],"globalEval",!refElements||dataPriv.get(refElements[i],"globalEval"))}wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead,wrapMap.th=wrapMap.td,support.option||(wrapMap.optgroup=wrapMap.option=[1,"<select multiple='multiple'>","</select>"]);var rhtml=/<|&#?\w+;/;function buildFragment(elems,context,scripts,selection,ignored){for(var elem,tmp,tag,wrap,attached,j,fragment=context.createDocumentFragment(),nodes=[],i=0,l=elems.length;i<l;i++)if((elem=elems[i])||0===elem)if("object"===toType(elem))jQuery.merge(nodes,elem.nodeType?[elem]:elem);else if(rhtml.test(elem)){for(tmp=tmp||fragment.appendChild(context.createElement("div")),tag=(rtagName.exec(elem)||["",""])[1].toLowerCase(),wrap=wrapMap[tag]||wrapMap._default,tmp.innerHTML=wrap[1]+jQuery.htmlPrefilter(elem)+wrap[2],j=wrap[0];j--;)tmp=tmp.lastChild;jQuery.merge(nodes,tmp.childNodes),(tmp=fragment.firstChild).textContent=""}else nodes.push(context.createTextNode(elem));for(fragment.textContent="",i=0;elem=nodes[i++];)if(selection&&jQuery.inArray(elem,selection)>-1)ignored&&ignored.push(elem);else if(attached=isAttached(elem),tmp=getAll(fragment.appendChild(elem),"script"),attached&&setGlobalEval(tmp),scripts)for(j=0;elem=tmp[j++];)rscriptType.test(elem.type||"")&&scripts.push(elem);return fragment}var rtypenamespace=/^([^.]*)(?:\.(.+)|)/;function returnTrue(){return!0}function returnFalse(){return!1}function expectSync(elem,type){return elem===safeActiveElement()==("focus"===type)}function safeActiveElement(){try{return document.activeElement}catch(err){}}function on(elem,types,selector,data,fn,one){var origFn,type;if("object"==typeof types){for(type in"string"!=typeof selector&&(data=data||selector,selector=void 0),types)on(elem,type,selector,data,types[type],one);return elem}if(null==data&&null==fn?(fn=selector,data=selector=void 0):null==fn&&("string"==typeof selector?(fn=data,data=void 0):(fn=data,data=selector,selector=void 0)),!1===fn)fn=returnFalse;else if(!fn)return elem;return 1===one&&(origFn=fn,(fn=function(event){return jQuery().off(event),origFn.apply(this,arguments)}).guid=origFn.guid||(origFn.guid=jQuery.guid++)),elem.each((function(){jQuery.event.add(this,types,fn,data,selector)}))}function leverageNative(el,type,expectSync){expectSync?(dataPriv.set(el,type,!1),jQuery.event.add(el,type,{namespace:!1,handler:function(event){var notAsync,result,saved=dataPriv.get(this,type);if(1&event.isTrigger&&this[type]){if(saved.length)(jQuery.event.special[type]||{}).delegateType&&event.stopPropagation();else if(saved=slice.call(arguments),dataPriv.set(this,type,saved),notAsync=expectSync(this,type),this[type](),saved!==(result=dataPriv.get(this,type))||notAsync?dataPriv.set(this,type,!1):result={},saved!==result)return event.stopImmediatePropagation(),event.preventDefault(),result&&result.value}else saved.length&&(dataPriv.set(this,type,{value:jQuery.event.trigger(jQuery.extend(saved[0],jQuery.Event.prototype),saved.slice(1),this)}),event.stopImmediatePropagation())}})):void 0===dataPriv.get(el,type)&&jQuery.event.add(el,type,returnTrue)}jQuery.event={global:{},add:function(elem,types,handler,data,selector){var handleObjIn,eventHandle,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.get(elem);if(acceptData(elem))for(handler.handler&&(handler=(handleObjIn=handler).handler,selector=handleObjIn.selector),selector&&jQuery.find.matchesSelector(documentElement,selector),handler.guid||(handler.guid=jQuery.guid++),(events=elemData.events)||(events=elemData.events=Object.create(null)),(eventHandle=elemData.handle)||(eventHandle=elemData.handle=function(e){return void 0!==jQuery&&jQuery.event.triggered!==e.type?jQuery.event.dispatch.apply(elem,arguments):void 0}),t=(types=(types||"").match(rnothtmlwhite)||[""]).length;t--;)type=origType=(tmp=rtypenamespace.exec(types[t])||[])[1],namespaces=(tmp[2]||"").split(".").sort(),type&&(special=jQuery.event.special[type]||{},type=(selector?special.delegateType:special.bindType)||type,special=jQuery.event.special[type]||{},handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn),(handlers=events[type])||((handlers=events[type]=[]).delegateCount=0,special.setup&&!1!==special.setup.call(elem,data,namespaces,eventHandle)||elem.addEventListener&&elem.addEventListener(type,eventHandle)),special.add&&(special.add.call(elem,handleObj),handleObj.handler.guid||(handleObj.handler.guid=handler.guid)),selector?handlers.splice(handlers.delegateCount++,0,handleObj):handlers.push(handleObj),jQuery.event.global[type]=!0)},remove:function(elem,types,handler,selector,mappedTypes){var j,origCount,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.hasData(elem)&&dataPriv.get(elem);if(elemData&&(events=elemData.events)){for(t=(types=(types||"").match(rnothtmlwhite)||[""]).length;t--;)if(type=origType=(tmp=rtypenamespace.exec(types[t])||[])[1],namespaces=(tmp[2]||"").split(".").sort(),type){for(special=jQuery.event.special[type]||{},handlers=events[type=(selector?special.delegateType:special.bindType)||type]||[],tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"),origCount=j=handlers.length;j--;)handleObj=handlers[j],!mappedTypes&&origType!==handleObj.origType||handler&&handler.guid!==handleObj.guid||tmp&&!tmp.test(handleObj.namespace)||selector&&selector!==handleObj.selector&&("**"!==selector||!handleObj.selector)||(handlers.splice(j,1),handleObj.selector&&handlers.delegateCount--,special.remove&&special.remove.call(elem,handleObj));origCount&&!handlers.length&&(special.teardown&&!1!==special.teardown.call(elem,namespaces,elemData.handle)||jQuery.removeEvent(elem,type,elemData.handle),delete events[type])}else for(type in events)jQuery.event.remove(elem,type+types[t],handler,selector,!0);jQuery.isEmptyObject(events)&&dataPriv.remove(elem,"handle events")}},dispatch:function(nativeEvent){var i,j,ret,matched,handleObj,handlerQueue,args=new Array(arguments.length),event=jQuery.event.fix(nativeEvent),handlers=(dataPriv.get(this,"events")||Object.create(null))[event.type]||[],special=jQuery.event.special[event.type]||{};for(args[0]=event,i=1;i<arguments.length;i++)args[i]=arguments[i];if(event.delegateTarget=this,!special.preDispatch||!1!==special.preDispatch.call(this,event)){for(handlerQueue=jQuery.event.handlers.call(this,event,handlers),i=0;(matched=handlerQueue[i++])&&!event.isPropagationStopped();)for(event.currentTarget=matched.elem,j=0;(handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped();)event.rnamespace&&!1!==handleObj.namespace&&!event.rnamespace.test(handleObj.namespace)||(event.handleObj=handleObj,event.data=handleObj.data,void 0!==(ret=((jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler).apply(matched.elem,args))&&!1===(event.result=ret)&&(event.preventDefault(),event.stopPropagation()));return special.postDispatch&&special.postDispatch.call(this,event),event.result}},handlers:function(event,handlers){var i,handleObj,sel,matchedHandlers,matchedSelectors,handlerQueue=[],delegateCount=handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&!("click"===event.type&&event.button>=1))for(;cur!==this;cur=cur.parentNode||this)if(1===cur.nodeType&&("click"!==event.type||!0!==cur.disabled)){for(matchedHandlers=[],matchedSelectors={},i=0;i<delegateCount;i++)void 0===matchedSelectors[sel=(handleObj=handlers[i]).selector+" "]&&(matchedSelectors[sel]=handleObj.needsContext?jQuery(sel,this).index(cur)>-1:jQuery.find(sel,this,null,[cur]).length),matchedSelectors[sel]&&matchedHandlers.push(handleObj);matchedHandlers.length&&handlerQueue.push({elem:cur,handlers:matchedHandlers})}return cur=this,delegateCount<handlers.length&&handlerQueue.push({elem:cur,handlers:handlers.slice(delegateCount)}),handlerQueue},addProp:function(name,hook){Object.defineProperty(jQuery.Event.prototype,name,{enumerable:!0,configurable:!0,get:isFunction(hook)?function(){if(this.originalEvent)return hook(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[name]},set:function(value){Object.defineProperty(this,name,{enumerable:!0,configurable:!0,writable:!0,value:value})}})},fix:function(originalEvent){return originalEvent[jQuery.expando]?originalEvent:new jQuery.Event(originalEvent)},special:{load:{noBubble:!0},click:{setup:function(data){var el=this||data;return rcheckableType.test(el.type)&&el.click&&nodeName(el,"input")&&leverageNative(el,"click",returnTrue),!1},trigger:function(data){var el=this||data;return rcheckableType.test(el.type)&&el.click&&nodeName(el,"input")&&leverageNative(el,"click"),!0},_default:function(event){var target=event.target;return rcheckableType.test(target.type)&&target.click&&nodeName(target,"input")&&dataPriv.get(target,"click")||nodeName(target,"a")}},beforeunload:{postDispatch:function(event){void 0!==event.result&&event.originalEvent&&(event.originalEvent.returnValue=event.result)}}}},jQuery.removeEvent=function(elem,type,handle){elem.removeEventListener&&elem.removeEventListener(type,handle)},jQuery.Event=function(src,props){if(!(this instanceof jQuery.Event))return new jQuery.Event(src,props);src&&src.type?(this.originalEvent=src,this.type=src.type,this.isDefaultPrevented=src.defaultPrevented||void 0===src.defaultPrevented&&!1===src.returnValue?returnTrue:returnFalse,this.target=src.target&&3===src.target.nodeType?src.target.parentNode:src.target,this.currentTarget=src.currentTarget,this.relatedTarget=src.relatedTarget):this.type=src,props&&jQuery.extend(this,props),this.timeStamp=src&&src.timeStamp||Date.now(),this[jQuery.expando]=!0},jQuery.Event.prototype={constructor:jQuery.Event,isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=returnTrue,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=returnTrue,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=returnTrue,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},jQuery.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},jQuery.event.addProp),jQuery.each({focus:"focusin",blur:"focusout"},(function(type,delegateType){jQuery.event.special[type]={setup:function(){return leverageNative(this,type,expectSync),!1},trigger:function(){return leverageNative(this,type),!0},_default:function(){return!0},delegateType:delegateType}})),jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(orig,fix){jQuery.event.special[orig]={delegateType:fix,bindType:fix,handle:function(event){var ret,target=this,related=event.relatedTarget,handleObj=event.handleObj;return related&&(related===target||jQuery.contains(target,related))||(event.type=handleObj.origType,ret=handleObj.handler.apply(this,arguments),event.type=fix),ret}}})),jQuery.fn.extend({on:function(types,selector,data,fn){return on(this,types,selector,data,fn)},one:function(types,selector,data,fn){return on(this,types,selector,data,fn,1)},off:function(types,selector,fn){var handleObj,type;if(types&&types.preventDefault&&types.handleObj)return handleObj=types.handleObj,jQuery(types.delegateTarget).off(handleObj.namespace?handleObj.origType+"."+handleObj.namespace:handleObj.origType,handleObj.selector,handleObj.handler),this;if("object"==typeof types){for(type in types)this.off(type,selector,types[type]);return this}return!1!==selector&&"function"!=typeof selector||(fn=selector,selector=void 0),!1===fn&&(fn=returnFalse),this.each((function(){jQuery.event.remove(this,types,fn,selector)}))}});var rnoInnerhtml=/<script|<style|<link/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,rcleanScript=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function manipulationTarget(elem,content){return nodeName(elem,"table")&&nodeName(11!==content.nodeType?content:content.firstChild,"tr")&&jQuery(elem).children("tbody")[0]||elem}function disableScript(elem){return elem.type=(null!==elem.getAttribute("type"))+"/"+elem.type,elem}function restoreScript(elem){return"true/"===(elem.type||"").slice(0,5)?elem.type=elem.type.slice(5):elem.removeAttribute("type"),elem}function cloneCopyEvent(src,dest){var i,l,type,pdataOld,udataOld,udataCur,events;if(1===dest.nodeType){if(dataPriv.hasData(src)&&(events=(pdataOld=dataPriv.get(src)).events))for(type in dataPriv.remove(dest,"handle events"),events)for(i=0,l=events[type].length;i<l;i++)jQuery.event.add(dest,type,events[type][i]);dataUser.hasData(src)&&(udataOld=dataUser.access(src),udataCur=jQuery.extend({},udataOld),dataUser.set(dest,udataCur))}}function fixInput(src,dest){var nodeName=dest.nodeName.toLowerCase();"input"===nodeName&&rcheckableType.test(src.type)?dest.checked=src.checked:"input"!==nodeName&&"textarea"!==nodeName||(dest.defaultValue=src.defaultValue)}function domManip(collection,args,callback,ignored){args=flat(args);var fragment,first,scripts,hasScripts,node,doc,i=0,l=collection.length,iNoClone=l-1,value=args[0],valueIsFunction=isFunction(value);if(valueIsFunction||l>1&&"string"==typeof value&&!support.checkClone&&rchecked.test(value))return collection.each((function(index){var self=collection.eq(index);valueIsFunction&&(args[0]=value.call(this,index,self.html())),domManip(self,args,callback,ignored)}));if(l&&(first=(fragment=buildFragment(args,collection[0].ownerDocument,!1,collection,ignored)).firstChild,1===fragment.childNodes.length&&(fragment=first),first||ignored)){for(hasScripts=(scripts=jQuery.map(getAll(fragment,"script"),disableScript)).length;i<l;i++)node=fragment,i!==iNoClone&&(node=jQuery.clone(node,!0,!0),hasScripts&&jQuery.merge(scripts,getAll(node,"script"))),callback.call(collection[i],node,i);if(hasScripts)for(doc=scripts[scripts.length-1].ownerDocument,jQuery.map(scripts,restoreScript),i=0;i<hasScripts;i++)node=scripts[i],rscriptType.test(node.type||"")&&!dataPriv.access(node,"globalEval")&&jQuery.contains(doc,node)&&(node.src&&"module"!==(node.type||"").toLowerCase()?jQuery._evalUrl&&!node.noModule&&jQuery._evalUrl(node.src,{nonce:node.nonce||node.getAttribute("nonce")},doc):DOMEval(node.textContent.replace(rcleanScript,""),node,doc))}return collection}function remove(elem,selector,keepData){for(var node,nodes=selector?jQuery.filter(selector,elem):elem,i=0;null!=(node=nodes[i]);i++)keepData||1!==node.nodeType||jQuery.cleanData(getAll(node)),node.parentNode&&(keepData&&isAttached(node)&&setGlobalEval(getAll(node,"script")),node.parentNode.removeChild(node));return elem}jQuery.extend({htmlPrefilter:function(html){return html},clone:function(elem,dataAndEvents,deepDataAndEvents){var i,l,srcElements,destElements,clone=elem.cloneNode(!0),inPage=isAttached(elem);if(!(support.noCloneChecked||1!==elem.nodeType&&11!==elem.nodeType||jQuery.isXMLDoc(elem)))for(destElements=getAll(clone),i=0,l=(srcElements=getAll(elem)).length;i<l;i++)fixInput(srcElements[i],destElements[i]);if(dataAndEvents)if(deepDataAndEvents)for(srcElements=srcElements||getAll(elem),destElements=destElements||getAll(clone),i=0,l=srcElements.length;i<l;i++)cloneCopyEvent(srcElements[i],destElements[i]);else cloneCopyEvent(elem,clone);return(destElements=getAll(clone,"script")).length>0&&setGlobalEval(destElements,!inPage&&getAll(elem,"script")),clone},cleanData:function(elems){for(var data,elem,type,special=jQuery.event.special,i=0;void 0!==(elem=elems[i]);i++)if(acceptData(elem)){if(data=elem[dataPriv.expando]){if(data.events)for(type in data.events)special[type]?jQuery.event.remove(elem,type):jQuery.removeEvent(elem,type,data.handle);elem[dataPriv.expando]=void 0}elem[dataUser.expando]&&(elem[dataUser.expando]=void 0)}}}),jQuery.fn.extend({detach:function(selector){return remove(this,selector,!0)},remove:function(selector){return remove(this,selector)},text:function(value){return access(this,(function(value){return void 0===value?jQuery.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=value)}))}),null,value,arguments.length)},append:function(){return domManip(this,arguments,(function(elem){var target;1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||manipulationTarget(this,elem).appendChild(elem)}))},prepend:function(){return domManip(this,arguments,(function(elem){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var target=manipulationTarget(this,elem);target.insertBefore(elem,target.firstChild)}}))},before:function(){return domManip(this,arguments,(function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this)}))},after:function(){return domManip(this,arguments,(function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this.nextSibling)}))},empty:function(){for(var elem,i=0;null!=(elem=this[i]);i++)1===elem.nodeType&&(jQuery.cleanData(getAll(elem,!1)),elem.textContent="");return this},clone:function(dataAndEvents,deepDataAndEvents){return dataAndEvents=null!=dataAndEvents&&dataAndEvents,deepDataAndEvents=null==deepDataAndEvents?dataAndEvents:deepDataAndEvents,this.map((function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents)}))},html:function(value){return access(this,(function(value){var elem=this[0]||{},i=0,l=this.length;if(void 0===value&&1===elem.nodeType)return elem.innerHTML;if("string"==typeof value&&!rnoInnerhtml.test(value)&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=jQuery.htmlPrefilter(value);try{for(;i<l;i++)1===(elem=this[i]||{}).nodeType&&(jQuery.cleanData(getAll(elem,!1)),elem.innerHTML=value);elem=0}catch(e){}}elem&&this.empty().append(value)}),null,value,arguments.length)},replaceWith:function(){var ignored=[];return domManip(this,arguments,(function(elem){var parent=this.parentNode;jQuery.inArray(this,ignored)<0&&(jQuery.cleanData(getAll(this)),parent&&parent.replaceChild(elem,this))}),ignored)}}),jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(name,original){jQuery.fn[name]=function(selector){for(var elems,ret=[],insert=jQuery(selector),last=insert.length-1,i=0;i<=last;i++)elems=i===last?this:this.clone(!0),jQuery(insert[i])[original](elems),push.apply(ret,elems.get());return this.pushStack(ret)}}));var rnumnonpx=new RegExp("^("+pnum+")(?!px)[a-z%]+$","i"),getStyles=function(elem){var view=elem.ownerDocument.defaultView;return view&&view.opener||(view=window),view.getComputedStyle(elem)},swap=function(elem,options,callback){var ret,name,old={};for(name in options)old[name]=elem.style[name],elem.style[name]=options[name];for(name in ret=callback.call(elem),options)elem.style[name]=old[name];return ret},rboxStyle=new RegExp(cssExpand.join("|"),"i");function curCSS(elem,name,computed){var width,minWidth,maxWidth,ret,style=elem.style;return(computed=computed||getStyles(elem))&&(""!==(ret=computed.getPropertyValue(name)||computed[name])||isAttached(elem)||(ret=jQuery.style(elem,name)),!support.pixelBoxStyles()&&rnumnonpx.test(ret)&&rboxStyle.test(name)&&(width=style.width,minWidth=style.minWidth,maxWidth=style.maxWidth,style.minWidth=style.maxWidth=style.width=ret,ret=computed.width,style.width=width,style.minWidth=minWidth,style.maxWidth=maxWidth)),void 0!==ret?ret+"":ret}function addGetHookIf(conditionFn,hookFn){return{get:function(){if(!conditionFn())return(this.get=hookFn).apply(this,arguments);delete this.get}}}!function(){function computeStyleTests(){if(div){container.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",div.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",documentElement.appendChild(container).appendChild(div);var divStyle=window.getComputedStyle(div);pixelPositionVal="1%"!==divStyle.top,reliableMarginLeftVal=12===roundPixelMeasures(divStyle.marginLeft),div.style.right="60%",pixelBoxStylesVal=36===roundPixelMeasures(divStyle.right),boxSizingReliableVal=36===roundPixelMeasures(divStyle.width),div.style.position="absolute",scrollboxSizeVal=12===roundPixelMeasures(div.offsetWidth/3),documentElement.removeChild(container),div=null}}function roundPixelMeasures(measure){return Math.round(parseFloat(measure))}var pixelPositionVal,boxSizingReliableVal,scrollboxSizeVal,pixelBoxStylesVal,reliableTrDimensionsVal,reliableMarginLeftVal,container=document.createElement("div"),div=document.createElement("div");div.style&&(div.style.backgroundClip="content-box",div.cloneNode(!0).style.backgroundClip="",support.clearCloneStyle="content-box"===div.style.backgroundClip,jQuery.extend(support,{boxSizingReliable:function(){return computeStyleTests(),boxSizingReliableVal},pixelBoxStyles:function(){return computeStyleTests(),pixelBoxStylesVal},pixelPosition:function(){return computeStyleTests(),pixelPositionVal},reliableMarginLeft:function(){return computeStyleTests(),reliableMarginLeftVal},scrollboxSize:function(){return computeStyleTests(),scrollboxSizeVal},reliableTrDimensions:function(){var table,tr,trChild,trStyle;return null==reliableTrDimensionsVal&&(table=document.createElement("table"),tr=document.createElement("tr"),trChild=document.createElement("div"),table.style.cssText="position:absolute;left:-11111px;border-collapse:separate",tr.style.cssText="border:1px solid",tr.style.height="1px",trChild.style.height="9px",trChild.style.display="block",documentElement.appendChild(table).appendChild(tr).appendChild(trChild),trStyle=window.getComputedStyle(tr),reliableTrDimensionsVal=parseInt(trStyle.height,10)+parseInt(trStyle.borderTopWidth,10)+parseInt(trStyle.borderBottomWidth,10)===tr.offsetHeight,documentElement.removeChild(table)),reliableTrDimensionsVal}}))}();var cssPrefixes=["Webkit","Moz","ms"],emptyStyle=document.createElement("div").style,vendorProps={};function vendorPropName(name){for(var capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;i--;)if((name=cssPrefixes[i]+capName)in emptyStyle)return name}function finalPropName(name){var final=jQuery.cssProps[name]||vendorProps[name];return final||(name in emptyStyle?name:vendorProps[name]=vendorPropName(name)||name)}var rdisplayswap=/^(none|table(?!-c[ea]).+)/,rcustomProp=/^--/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:"0",fontWeight:"400"};function setPositiveNumber(_elem,value,subtract){var matches=rcssNum.exec(value);return matches?Math.max(0,matches[2]-(subtract||0))+(matches[3]||"px"):value}function boxModelAdjustment(elem,dimension,box,isBorderBox,styles,computedVal){var i="width"===dimension?1:0,extra=0,delta=0;if(box===(isBorderBox?"border":"content"))return 0;for(;i<4;i+=2)"margin"===box&&(delta+=jQuery.css(elem,box+cssExpand[i],!0,styles)),isBorderBox?("content"===box&&(delta-=jQuery.css(elem,"padding"+cssExpand[i],!0,styles)),"margin"!==box&&(delta-=jQuery.css(elem,"border"+cssExpand[i]+"Width",!0,styles))):(delta+=jQuery.css(elem,"padding"+cssExpand[i],!0,styles),"padding"!==box?delta+=jQuery.css(elem,"border"+cssExpand[i]+"Width",!0,styles):extra+=jQuery.css(elem,"border"+cssExpand[i]+"Width",!0,styles));return!isBorderBox&&computedVal>=0&&(delta+=Math.max(0,Math.ceil(elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)]-computedVal-delta-extra-.5))||0),delta}function getWidthOrHeight(elem,dimension,extra){var styles=getStyles(elem),boxSizingNeeded,isBorderBox=(!support.boxSizingReliable()||extra)&&"border-box"===jQuery.css(elem,"boxSizing",!1,styles),valueIsBorderBox=isBorderBox,val=curCSS(elem,dimension,styles),offsetProp="offset"+dimension[0].toUpperCase()+dimension.slice(1);if(rnumnonpx.test(val)){if(!extra)return val;val="auto"}return(!support.boxSizingReliable()&&isBorderBox||!support.reliableTrDimensions()&&nodeName(elem,"tr")||"auto"===val||!parseFloat(val)&&"inline"===jQuery.css(elem,"display",!1,styles))&&elem.getClientRects().length&&(isBorderBox="border-box"===jQuery.css(elem,"boxSizing",!1,styles),(valueIsBorderBox=offsetProp in elem)&&(val=elem[offsetProp])),(val=parseFloat(val)||0)+boxModelAdjustment(elem,dimension,extra||(isBorderBox?"border":"content"),valueIsBorderBox,styles,val)+"px"}function Tween(elem,options,prop,end,easing){return new Tween.prototype.init(elem,options,prop,end,easing)}jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return""===ret?"1":ret}}}},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(elem,name,value,extra){if(elem&&3!==elem.nodeType&&8!==elem.nodeType&&elem.style){var ret,type,hooks,origName=camelCase(name),isCustomProp=rcustomProp.test(name),style=elem.style;if(isCustomProp||(name=finalPropName(origName)),hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName],void 0===value)return hooks&&"get"in hooks&&void 0!==(ret=hooks.get(elem,!1,extra))?ret:style[name];"string"===(type=typeof value)&&(ret=rcssNum.exec(value))&&ret[1]&&(value=adjustCSS(elem,name,ret),type="number"),null!=value&&value==value&&("number"!==type||isCustomProp||(value+=ret&&ret[3]||(jQuery.cssNumber[origName]?"":"px")),support.clearCloneStyle||""!==value||0!==name.indexOf("background")||(style[name]="inherit"),hooks&&"set"in hooks&&void 0===(value=hooks.set(elem,value,extra))||(isCustomProp?style.setProperty(name,value):style[name]=value))}},css:function(elem,name,extra,styles){var val,num,hooks,origName=camelCase(name),isCustomProp;return rcustomProp.test(name)||(name=finalPropName(origName)),(hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName])&&"get"in hooks&&(val=hooks.get(elem,!0,extra)),void 0===val&&(val=curCSS(elem,name,styles)),"normal"===val&&name in cssNormalTransform&&(val=cssNormalTransform[name]),""===extra||extra?(num=parseFloat(val),!0===extra||isFinite(num)?num||0:val):val}}),jQuery.each(["height","width"],(function(_i,dimension){jQuery.cssHooks[dimension]={get:function(elem,computed,extra){if(computed)return!rdisplayswap.test(jQuery.css(elem,"display"))||elem.getClientRects().length&&elem.getBoundingClientRect().width?getWidthOrHeight(elem,dimension,extra):swap(elem,cssShow,(function(){return getWidthOrHeight(elem,dimension,extra)}))},set:function(elem,value,extra){var matches,styles=getStyles(elem),scrollboxSizeBuggy=!support.scrollboxSize()&&"absolute"===styles.position,boxSizingNeeded,isBorderBox=(scrollboxSizeBuggy||extra)&&"border-box"===jQuery.css(elem,"boxSizing",!1,styles),subtract=extra?boxModelAdjustment(elem,dimension,extra,isBorderBox,styles):0;return isBorderBox&&scrollboxSizeBuggy&&(subtract-=Math.ceil(elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)]-parseFloat(styles[dimension])-boxModelAdjustment(elem,dimension,"border",!1,styles)-.5)),subtract&&(matches=rcssNum.exec(value))&&"px"!==(matches[3]||"px")&&(elem.style[dimension]=value,value=jQuery.css(elem,dimension)),setPositiveNumber(elem,value,subtract)}}})),jQuery.cssHooks.marginLeft=addGetHookIf(support.reliableMarginLeft,(function(elem,computed){if(computed)return(parseFloat(curCSS(elem,"marginLeft"))||elem.getBoundingClientRect().left-swap(elem,{marginLeft:0},(function(){return elem.getBoundingClientRect().left})))+"px"})),jQuery.each({margin:"",padding:"",border:"Width"},(function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){for(var i=0,expanded={},parts="string"==typeof value?value.split(" "):[value];i<4;i++)expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0];return expanded}},"margin"!==prefix&&(jQuery.cssHooks[prefix+suffix].set=setPositiveNumber)})),jQuery.fn.extend({css:function(name,value){return access(this,(function(elem,name,value){var styles,len,map={},i=0;if(Array.isArray(name)){for(styles=getStyles(elem),len=name.length;i<len;i++)map[name[i]]=jQuery.css(elem,name[i],!1,styles);return map}return void 0!==value?jQuery.style(elem,name,value):jQuery.css(elem,name)}),name,value,arguments.length>1)}}),jQuery.Tween=Tween,Tween.prototype={constructor:Tween,init:function(elem,options,prop,end,easing,unit){this.elem=elem,this.prop=prop,this.easing=easing||jQuery.easing._default,this.options=options,this.start=this.now=this.cur(),this.end=end,this.unit=unit||(jQuery.cssNumber[prop]?"":"px")},cur:function(){var hooks=Tween.propHooks[this.prop];return hooks&&hooks.get?hooks.get(this):Tween.propHooks._default.get(this)},run:function(percent){var eased,hooks=Tween.propHooks[this.prop];return this.options.duration?this.pos=eased=jQuery.easing[this.easing](percent,this.options.duration*percent,0,1,this.options.duration):this.pos=eased=percent,this.now=(this.end-this.start)*eased+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),hooks&&hooks.set?hooks.set(this):Tween.propHooks._default.set(this),this}},Tween.prototype.init.prototype=Tween.prototype,Tween.propHooks={_default:{get:function(tween){var result;return 1!==tween.elem.nodeType||null!=tween.elem[tween.prop]&&null==tween.elem.style[tween.prop]?tween.elem[tween.prop]:(result=jQuery.css(tween.elem,tween.prop,""))&&"auto"!==result?result:0},set:function(tween){jQuery.fx.step[tween.prop]?jQuery.fx.step[tween.prop](tween):1!==tween.elem.nodeType||!jQuery.cssHooks[tween.prop]&&null==tween.elem.style[finalPropName(tween.prop)]?tween.elem[tween.prop]=tween.now:jQuery.style(tween.elem,tween.prop,tween.now+tween.unit)}}},Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(tween){tween.elem.nodeType&&tween.elem.parentNode&&(tween.elem[tween.prop]=tween.now)}},jQuery.easing={linear:function(p){return p},swing:function(p){return.5-Math.cos(p*Math.PI)/2},_default:"swing"},jQuery.fx=Tween.prototype.init,jQuery.fx.step={};var fxNow,inProgress,rfxtypes=/^(?:toggle|show|hide)$/,rrun=/queueHooks$/;function schedule(){inProgress&&(!1===document.hidden&&window.requestAnimationFrame?window.requestAnimationFrame(schedule):window.setTimeout(schedule,jQuery.fx.interval),jQuery.fx.tick())}function createFxNow(){return window.setTimeout((function(){fxNow=void 0})),fxNow=Date.now()}function genFx(type,includeWidth){var which,i=0,attrs={height:type};for(includeWidth=includeWidth?1:0;i<4;i+=2-includeWidth)attrs["margin"+(which=cssExpand[i])]=attrs["padding"+which]=type;return includeWidth&&(attrs.opacity=attrs.width=type),attrs}function createTween(value,prop,animation){for(var tween,collection=(Animation.tweeners[prop]||[]).concat(Animation.tweeners["*"]),index=0,length=collection.length;index<length;index++)if(tween=collection[index].call(animation,prop,value))return tween}function defaultPrefilter(elem,props,opts){var prop,value,toggle,hooks,oldfire,propTween,restoreDisplay,display,isBox="width"in props||"height"in props,anim=this,orig={},style=elem.style,hidden=elem.nodeType&&isHiddenWithinTree(elem),dataShow=dataPriv.get(elem,"fxshow");for(prop in opts.queue||(null==(hooks=jQuery._queueHooks(elem,"fx")).unqueued&&(hooks.unqueued=0,oldfire=hooks.empty.fire,hooks.empty.fire=function(){hooks.unqueued||oldfire()}),hooks.unqueued++,anim.always((function(){anim.always((function(){hooks.unqueued--,jQuery.queue(elem,"fx").length||hooks.empty.fire()}))}))),props)if(value=props[prop],rfxtypes.test(value)){if(delete props[prop],toggle=toggle||"toggle"===value,value===(hidden?"hide":"show")){if("show"!==value||!dataShow||void 0===dataShow[prop])continue;hidden=!0}orig[prop]=dataShow&&dataShow[prop]||jQuery.style(elem,prop)}if((propTween=!jQuery.isEmptyObject(props))||!jQuery.isEmptyObject(orig))for(prop in isBox&&1===elem.nodeType&&(opts.overflow=[style.overflow,style.overflowX,style.overflowY],null==(restoreDisplay=dataShow&&dataShow.display)&&(restoreDisplay=dataPriv.get(elem,"display")),"none"===(display=jQuery.css(elem,"display"))&&(restoreDisplay?display=restoreDisplay:(showHide([elem],!0),restoreDisplay=elem.style.display||restoreDisplay,display=jQuery.css(elem,"display"),showHide([elem]))),("inline"===display||"inline-block"===display&&null!=restoreDisplay)&&"none"===jQuery.css(elem,"float")&&(propTween||(anim.done((function(){style.display=restoreDisplay})),null==restoreDisplay&&(display=style.display,restoreDisplay="none"===display?"":display)),style.display="inline-block")),opts.overflow&&(style.overflow="hidden",anim.always((function(){style.overflow=opts.overflow[0],style.overflowX=opts.overflow[1],style.overflowY=opts.overflow[2]}))),propTween=!1,orig)propTween||(dataShow?"hidden"in dataShow&&(hidden=dataShow.hidden):dataShow=dataPriv.access(elem,"fxshow",{display:restoreDisplay}),toggle&&(dataShow.hidden=!hidden),hidden&&showHide([elem],!0),anim.done((function(){for(prop in hidden||showHide([elem]),dataPriv.remove(elem,"fxshow"),orig)jQuery.style(elem,prop,orig[prop])}))),propTween=createTween(hidden?dataShow[prop]:0,prop,anim),prop in dataShow||(dataShow[prop]=propTween.start,hidden&&(propTween.end=propTween.start,propTween.start=0))}function propFilter(props,specialEasing){var index,name,easing,value,hooks;for(index in props)if(easing=specialEasing[name=camelCase(index)],value=props[index],Array.isArray(value)&&(easing=value[1],value=props[index]=value[0]),index!==name&&(props[name]=value,delete props[index]),(hooks=jQuery.cssHooks[name])&&"expand"in hooks)for(index in value=hooks.expand(value),delete props[name],value)index in props||(props[index]=value[index],specialEasing[index]=easing);else specialEasing[name]=easing}function Animation(elem,properties,options){var result,stopped,index=0,length=Animation.prefilters.length,deferred=jQuery.Deferred().always((function(){delete tick.elem})),tick=function(){if(stopped)return!1;for(var currentTime=fxNow||createFxNow(),remaining=Math.max(0,animation.startTime+animation.duration-currentTime),temp,percent=1-(remaining/animation.duration||0),index=0,length=animation.tweens.length;index<length;index++)animation.tweens[index].run(percent);return deferred.notifyWith(elem,[animation,percent,remaining]),percent<1&&length?remaining:(length||deferred.notifyWith(elem,[animation,1,0]),deferred.resolveWith(elem,[animation]),!1)},animation=deferred.promise({elem:elem,props:jQuery.extend({},properties),opts:jQuery.extend(!0,{specialEasing:{},easing:jQuery.easing._default},options),originalProperties:properties,originalOptions:options,startTime:fxNow||createFxNow(),duration:options.duration,tweens:[],createTween:function(prop,end){var tween=jQuery.Tween(elem,animation.opts,prop,end,animation.opts.specialEasing[prop]||animation.opts.easing);return animation.tweens.push(tween),tween},stop:function(gotoEnd){var index=0,length=gotoEnd?animation.tweens.length:0;if(stopped)return this;for(stopped=!0;index<length;index++)animation.tweens[index].run(1);return gotoEnd?(deferred.notifyWith(elem,[animation,1,0]),deferred.resolveWith(elem,[animation,gotoEnd])):deferred.rejectWith(elem,[animation,gotoEnd]),this}}),props=animation.props;for(propFilter(props,animation.opts.specialEasing);index<length;index++)if(result=Animation.prefilters[index].call(animation,elem,props,animation.opts))return isFunction(result.stop)&&(jQuery._queueHooks(animation.elem,animation.opts.queue).stop=result.stop.bind(result)),result;return jQuery.map(props,createTween,animation),isFunction(animation.opts.start)&&animation.opts.start.call(elem,animation),animation.progress(animation.opts.progress).done(animation.opts.done,animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always),jQuery.fx.timer(jQuery.extend(tick,{elem:elem,anim:animation,queue:animation.opts.queue})),animation}jQuery.Animation=jQuery.extend(Animation,{tweeners:{"*":[function(prop,value){var tween=this.createTween(prop,value);return adjustCSS(tween.elem,prop,rcssNum.exec(value),tween),tween}]},tweener:function(props,callback){isFunction(props)?(callback=props,props=["*"]):props=props.match(rnothtmlwhite);for(var prop,index=0,length=props.length;index<length;index++)prop=props[index],Animation.tweeners[prop]=Animation.tweeners[prop]||[],Animation.tweeners[prop].unshift(callback)},prefilters:[defaultPrefilter],prefilter:function(callback,prepend){prepend?Animation.prefilters.unshift(callback):Animation.prefilters.push(callback)}}),jQuery.speed=function(speed,easing,fn){var opt=speed&&"object"==typeof speed?jQuery.extend({},speed):{complete:fn||!fn&&easing||isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!isFunction(easing)&&easing};return jQuery.fx.off?opt.duration=0:"number"!=typeof opt.duration&&(opt.duration in jQuery.fx.speeds?opt.duration=jQuery.fx.speeds[opt.duration]:opt.duration=jQuery.fx.speeds._default),null!=opt.queue&&!0!==opt.queue||(opt.queue="fx"),opt.old=opt.complete,opt.complete=function(){isFunction(opt.old)&&opt.old.call(this),opt.queue&&jQuery.dequeue(this,opt.queue)},opt},jQuery.fn.extend({fadeTo:function(speed,to,easing,callback){return this.filter(isHiddenWithinTree).css("opacity",0).show().end().animate({opacity:to},speed,easing,callback)},animate:function(prop,speed,easing,callback){var empty=jQuery.isEmptyObject(prop),optall=jQuery.speed(speed,easing,callback),doAnimation=function(){var anim=Animation(this,jQuery.extend({},prop),optall);(empty||dataPriv.get(this,"finish"))&&anim.stop(!0)};return doAnimation.finish=doAnimation,empty||!1===optall.queue?this.each(doAnimation):this.queue(optall.queue,doAnimation)},stop:function(type,clearQueue,gotoEnd){var stopQueue=function(hooks){var stop=hooks.stop;delete hooks.stop,stop(gotoEnd)};return"string"!=typeof type&&(gotoEnd=clearQueue,clearQueue=type,type=void 0),clearQueue&&this.queue(type||"fx",[]),this.each((function(){var dequeue=!0,index=null!=type&&type+"queueHooks",timers=jQuery.timers,data=dataPriv.get(this);if(index)data[index]&&data[index].stop&&stopQueue(data[index]);else for(index in data)data[index]&&data[index].stop&&rrun.test(index)&&stopQueue(data[index]);for(index=timers.length;index--;)timers[index].elem!==this||null!=type&&timers[index].queue!==type||(timers[index].anim.stop(gotoEnd),dequeue=!1,timers.splice(index,1));!dequeue&&gotoEnd||jQuery.dequeue(this,type)}))},finish:function(type){return!1!==type&&(type=type||"fx"),this.each((function(){var index,data=dataPriv.get(this),queue=data[type+"queue"],hooks=data[type+"queueHooks"],timers=jQuery.timers,length=queue?queue.length:0;for(data.finish=!0,jQuery.queue(this,type,[]),hooks&&hooks.stop&&hooks.stop.call(this,!0),index=timers.length;index--;)timers[index].elem===this&&timers[index].queue===type&&(timers[index].anim.stop(!0),timers.splice(index,1));for(index=0;index<length;index++)queue[index]&&queue[index].finish&&queue[index].finish.call(this);delete data.finish}))}}),jQuery.each(["toggle","show","hide"],(function(_i,name){var cssFn=jQuery.fn[name];jQuery.fn[name]=function(speed,easing,callback){return null==speed||"boolean"==typeof speed?cssFn.apply(this,arguments):this.animate(genFx(name,!0),speed,easing,callback)}})),jQuery.each({slideDown:genFx("show"),slideUp:genFx("hide"),slideToggle:genFx("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(name,props){jQuery.fn[name]=function(speed,easing,callback){return this.animate(props,speed,easing,callback)}})),jQuery.timers=[],jQuery.fx.tick=function(){var timer,i=0,timers=jQuery.timers;for(fxNow=Date.now();i<timers.length;i++)(timer=timers[i])()||timers[i]!==timer||timers.splice(i--,1);timers.length||jQuery.fx.stop(),fxNow=void 0},jQuery.fx.timer=function(timer){jQuery.timers.push(timer),jQuery.fx.start()},jQuery.fx.interval=13,jQuery.fx.start=function(){inProgress||(inProgress=!0,schedule())},jQuery.fx.stop=function(){inProgress=null},jQuery.fx.speeds={slow:600,fast:200,_default:400},jQuery.fn.delay=function(time,type){return time=jQuery.fx&&jQuery.fx.speeds[time]||time,type=type||"fx",this.queue(type,(function(next,hooks){var timeout=window.setTimeout(next,time);hooks.stop=function(){window.clearTimeout(timeout)}}))},function(){var input=document.createElement("input"),select,opt=document.createElement("select").appendChild(document.createElement("option"));input.type="checkbox",support.checkOn=""!==input.value,support.optSelected=opt.selected,(input=document.createElement("input")).value="t",input.type="radio",support.radioValue="t"===input.value}();var boolHook,attrHandle=jQuery.expr.attrHandle;jQuery.fn.extend({attr:function(name,value){return access(this,jQuery.attr,name,value,arguments.length>1)},removeAttr:function(name){return this.each((function(){jQuery.removeAttr(this,name)}))}}),jQuery.extend({attr:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(3!==nType&&8!==nType&&2!==nType)return void 0===elem.getAttribute?jQuery.prop(elem,name,value):(1===nType&&jQuery.isXMLDoc(elem)||(hooks=jQuery.attrHooks[name.toLowerCase()]||(jQuery.expr.match.bool.test(name)?boolHook:void 0)),void 0!==value?null===value?void jQuery.removeAttr(elem,name):hooks&&"set"in hooks&&void 0!==(ret=hooks.set(elem,value,name))?ret:(elem.setAttribute(name,value+""),value):hooks&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:null==(ret=jQuery.find.attr(elem,name))?void 0:ret)},attrHooks:{type:{set:function(elem,value){if(!support.radioValue&&"radio"===value&&nodeName(elem,"input")){var val=elem.value;return elem.setAttribute("type",value),val&&(elem.value=val),value}}}},removeAttr:function(elem,value){var name,i=0,attrNames=value&&value.match(rnothtmlwhite);if(attrNames&&1===elem.nodeType)for(;name=attrNames[i++];)elem.removeAttribute(name)}}),boolHook={set:function(elem,value,name){return!1===value?jQuery.removeAttr(elem,name):elem.setAttribute(name,name),name}},jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),(function(_i,name){var getter=attrHandle[name]||jQuery.find.attr;attrHandle[name]=function(elem,name,isXML){var ret,handle,lowercaseName=name.toLowerCase();return isXML||(handle=attrHandle[lowercaseName],attrHandle[lowercaseName]=ret,ret=null!=getter(elem,name,isXML)?lowercaseName:null,attrHandle[lowercaseName]=handle),ret}}));var rfocusable=/^(?:input|select|textarea|button)$/i,rclickable=/^(?:a|area)$/i;function stripAndCollapse(value){var tokens;return(value.match(rnothtmlwhite)||[]).join(" ")}function getClass(elem){return elem.getAttribute&&elem.getAttribute("class")||""}function classesToArray(value){return Array.isArray(value)?value:"string"==typeof value&&value.match(rnothtmlwhite)||[]}jQuery.fn.extend({prop:function(name,value){return access(this,jQuery.prop,name,value,arguments.length>1)},removeProp:function(name){return this.each((function(){delete this[jQuery.propFix[name]||name]}))}}),jQuery.extend({prop:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(3!==nType&&8!==nType&&2!==nType)return 1===nType&&jQuery.isXMLDoc(elem)||(name=jQuery.propFix[name]||name,hooks=jQuery.propHooks[name]),void 0!==value?hooks&&"set"in hooks&&void 0!==(ret=hooks.set(elem,value,name))?ret:elem[name]=value:hooks&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:elem[name]},propHooks:{tabIndex:{get:function(elem){var tabindex=jQuery.find.attr(elem,"tabindex");return tabindex?parseInt(tabindex,10):rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),support.optSelected||(jQuery.propHooks.selected={get:function(elem){var parent=elem.parentNode;return parent&&parent.parentNode&&parent.parentNode.selectedIndex,null},set:function(elem){var parent=elem.parentNode;parent&&(parent.selectedIndex,parent.parentNode&&parent.parentNode.selectedIndex)}}),jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){jQuery.propFix[this.toLowerCase()]=this})),jQuery.fn.extend({addClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(isFunction(value))return this.each((function(j){jQuery(this).addClass(value.call(this,j,getClass(this)))}));if((classes=classesToArray(value)).length)for(;elem=this[i++];)if(curValue=getClass(elem),cur=1===elem.nodeType&&" "+stripAndCollapse(curValue)+" "){for(j=0;clazz=classes[j++];)cur.indexOf(" "+clazz+" ")<0&&(cur+=clazz+" ");curValue!==(finalValue=stripAndCollapse(cur))&&elem.setAttribute("class",finalValue)}return this},removeClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(isFunction(value))return this.each((function(j){jQuery(this).removeClass(value.call(this,j,getClass(this)))}));if(!arguments.length)return this.attr("class","");if((classes=classesToArray(value)).length)for(;elem=this[i++];)if(curValue=getClass(elem),cur=1===elem.nodeType&&" "+stripAndCollapse(curValue)+" "){for(j=0;clazz=classes[j++];)for(;cur.indexOf(" "+clazz+" ")>-1;)cur=cur.replace(" "+clazz+" "," ");curValue!==(finalValue=stripAndCollapse(cur))&&elem.setAttribute("class",finalValue)}return this},toggleClass:function(value,stateVal){var type=typeof value,isValidValue="string"===type||Array.isArray(value);return"boolean"==typeof stateVal&&isValidValue?stateVal?this.addClass(value):this.removeClass(value):isFunction(value)?this.each((function(i){jQuery(this).toggleClass(value.call(this,i,getClass(this),stateVal),stateVal)})):this.each((function(){var className,i,self,classNames;if(isValidValue)for(i=0,self=jQuery(this),classNames=classesToArray(value);className=classNames[i++];)self.hasClass(className)?self.removeClass(className):self.addClass(className);else void 0!==value&&"boolean"!==type||((className=getClass(this))&&dataPriv.set(this,"__className__",className),this.setAttribute&&this.setAttribute("class",className||!1===value?"":dataPriv.get(this,"__className__")||""))}))},hasClass:function(selector){var className,elem,i=0;for(className=" "+selector+" ";elem=this[i++];)if(1===elem.nodeType&&(" "+stripAndCollapse(getClass(elem))+" ").indexOf(className)>-1)return!0;return!1}});var rreturn=/\r/g;jQuery.fn.extend({val:function(value){var hooks,ret,valueIsFunction,elem=this[0];return arguments.length?(valueIsFunction=isFunction(value),this.each((function(i){var val;1===this.nodeType&&(null==(val=valueIsFunction?value.call(this,i,jQuery(this).val()):value)?val="":"number"==typeof val?val+="":Array.isArray(val)&&(val=jQuery.map(val,(function(value){return null==value?"":value+""}))),(hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()])&&"set"in hooks&&void 0!==hooks.set(this,val,"value")||(this.value=val))}))):elem?(hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()])&&"get"in hooks&&void 0!==(ret=hooks.get(elem,"value"))?ret:"string"==typeof(ret=elem.value)?ret.replace(rreturn,""):null==ret?"":ret:void 0}}),jQuery.extend({valHooks:{option:{get:function(elem){var val=jQuery.find.attr(elem,"value");return null!=val?val:stripAndCollapse(jQuery.text(elem))}},select:{get:function(elem){var value,option,i,options=elem.options,index=elem.selectedIndex,one="select-one"===elem.type,values=one?null:[],max=one?index+1:options.length;for(i=index<0?max:one?index:0;i<max;i++)if(((option=options[i]).selected||i===index)&&!option.disabled&&(!option.parentNode.disabled||!nodeName(option.parentNode,"optgroup"))){if(value=jQuery(option).val(),one)return value;values.push(value)}return values},set:function(elem,value){for(var optionSet,option,options=elem.options,values=jQuery.makeArray(value),i=options.length;i--;)((option=options[i]).selected=jQuery.inArray(jQuery.valHooks.option.get(option),values)>-1)&&(optionSet=!0);return optionSet||(elem.selectedIndex=-1),values}}}}),jQuery.each(["radio","checkbox"],(function(){jQuery.valHooks[this]={set:function(elem,value){if(Array.isArray(value))return elem.checked=jQuery.inArray(jQuery(elem).val(),value)>-1}},support.checkOn||(jQuery.valHooks[this].get=function(elem){return null===elem.getAttribute("value")?"on":elem.value})})),support.focusin="onfocusin"in window;var rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,stopPropagationCallback=function(e){e.stopPropagation()};jQuery.extend(jQuery.event,{trigger:function(event,data,elem,onlyHandlers){var i,cur,tmp,bubbleType,ontype,handle,special,lastElement,eventPath=[elem||document],type=hasOwn.call(event,"type")?event.type:event,namespaces=hasOwn.call(event,"namespace")?event.namespace.split("."):[];if(cur=lastElement=tmp=elem=elem||document,3!==elem.nodeType&&8!==elem.nodeType&&!rfocusMorph.test(type+jQuery.event.triggered)&&(type.indexOf(".")>-1&&(namespaces=type.split("."),type=namespaces.shift(),namespaces.sort()),ontype=type.indexOf(":")<0&&"on"+type,(event=event[jQuery.expando]?event:new jQuery.Event(type,"object"==typeof event&&event)).isTrigger=onlyHandlers?2:3,event.namespace=namespaces.join("."),event.rnamespace=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,event.result=void 0,event.target||(event.target=elem),data=null==data?[event]:jQuery.makeArray(data,[event]),special=jQuery.event.special[type]||{},onlyHandlers||!special.trigger||!1!==special.trigger.apply(elem,data))){if(!onlyHandlers&&!special.noBubble&&!isWindow(elem)){for(bubbleType=special.delegateType||type,rfocusMorph.test(bubbleType+type)||(cur=cur.parentNode);cur;cur=cur.parentNode)eventPath.push(cur),tmp=cur;tmp===(elem.ownerDocument||document)&&eventPath.push(tmp.defaultView||tmp.parentWindow||window)}for(i=0;(cur=eventPath[i++])&&!event.isPropagationStopped();)lastElement=cur,event.type=i>1?bubbleType:special.bindType||type,(handle=(dataPriv.get(cur,"events")||Object.create(null))[event.type]&&dataPriv.get(cur,"handle"))&&handle.apply(cur,data),(handle=ontype&&cur[ontype])&&handle.apply&&acceptData(cur)&&(event.result=handle.apply(cur,data),!1===event.result&&event.preventDefault());return event.type=type,onlyHandlers||event.isDefaultPrevented()||special._default&&!1!==special._default.apply(eventPath.pop(),data)||!acceptData(elem)||ontype&&isFunction(elem[type])&&!isWindow(elem)&&((tmp=elem[ontype])&&(elem[ontype]=null),jQuery.event.triggered=type,event.isPropagationStopped()&&lastElement.addEventListener(type,stopPropagationCallback),elem[type](),event.isPropagationStopped()&&lastElement.removeEventListener(type,stopPropagationCallback),jQuery.event.triggered=void 0,tmp&&(elem[ontype]=tmp)),event.result}},simulate:function(type,elem,event){var e=jQuery.extend(new jQuery.Event,event,{type:type,isSimulated:!0});jQuery.event.trigger(e,null,elem)}}),jQuery.fn.extend({trigger:function(type,data){return this.each((function(){jQuery.event.trigger(type,data,this)}))},triggerHandler:function(type,data){var elem=this[0];if(elem)return jQuery.event.trigger(type,data,elem,!0)}}),support.focusin||jQuery.each({focus:"focusin",blur:"focusout"},(function(orig,fix){var handler=function(event){jQuery.event.simulate(fix,event.target,jQuery.event.fix(event))};jQuery.event.special[fix]={setup:function(){var doc=this.ownerDocument||this.document||this,attaches=dataPriv.access(doc,fix);attaches||doc.addEventListener(orig,handler,!0),dataPriv.access(doc,fix,(attaches||0)+1)},teardown:function(){var doc=this.ownerDocument||this.document||this,attaches=dataPriv.access(doc,fix)-1;attaches?dataPriv.access(doc,fix,attaches):(doc.removeEventListener(orig,handler,!0),dataPriv.remove(doc,fix))}}}));var location=window.location,nonce={guid:Date.now()},rquery=/\?/;jQuery.parseXML=function(data){var xml,parserErrorElem;if(!data||"string"!=typeof data)return null;try{xml=(new window.DOMParser).parseFromString(data,"text/xml")}catch(e){}return parserErrorElem=xml&&xml.getElementsByTagName("parsererror")[0],xml&&!parserErrorElem||jQuery.error("Invalid XML: "+(parserErrorElem?jQuery.map(parserErrorElem.childNodes,(function(el){return el.textContent})).join("\n"):data)),xml};var rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;function buildParams(prefix,obj,traditional,add){var name;if(Array.isArray(obj))jQuery.each(obj,(function(i,v){traditional||rbracket.test(prefix)?add(prefix,v):buildParams(prefix+"["+("object"==typeof v&&null!=v?i:"")+"]",v,traditional,add)}));else if(traditional||"object"!==toType(obj))add(prefix,obj);else for(name in obj)buildParams(prefix+"["+name+"]",obj[name],traditional,add)}jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,valueOrFunction){var value=isFunction(valueOrFunction)?valueOrFunction():valueOrFunction;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(null==value?"":value)};if(null==a)return"";if(Array.isArray(a)||a.jquery&&!jQuery.isPlainObject(a))jQuery.each(a,(function(){add(this.name,this.value)}));else for(prefix in a)buildParams(prefix,a[prefix],traditional,add);return s.join("&")},jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this})).filter((function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!rcheckableType.test(type))})).map((function(_i,elem){var val=jQuery(this).val();return null==val?null:Array.isArray(val)?jQuery.map(val,(function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")}})):{name:elem.name,value:val.replace(rCRLF,"\r\n")}})).get()}});var r20=/%20/g,rhash=/#.*$/,rantiCache=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)$/gm,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,prefilters={},transports={},allTypes="*/".concat("*"),originAnchor=document.createElement("a");function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){"string"!=typeof dataTypeExpression&&(func=dataTypeExpression,dataTypeExpression="*");var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnothtmlwhite)||[];if(isFunction(func))for(;dataType=dataTypes[i++];)"+"===dataType[0]?(dataType=dataType.slice(1)||"*",(structure[dataType]=structure[dataType]||[]).unshift(func)):(structure[dataType]=structure[dataType]||[]).push(func)}}function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){var inspected={},seekingTransport=structure===transports;function inspect(dataType){var selected;return inspected[dataType]=!0,jQuery.each(structure[dataType]||[],(function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);return"string"!=typeof dataTypeOrTransport||seekingTransport||inspected[dataTypeOrTransport]?seekingTransport?!(selected=dataTypeOrTransport):void 0:(options.dataTypes.unshift(dataTypeOrTransport),inspect(dataTypeOrTransport),!1)})),selected}return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*")}function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src)void 0!==src[key]&&((flatOptions[key]?target:deep||(deep={}))[key]=src[key]);return deep&&jQuery.extend(!0,target,deep),target}function ajaxHandleResponses(s,jqXHR,responses){for(var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;"*"===dataTypes[0];)dataTypes.shift(),void 0===ct&&(ct=s.mimeType||jqXHR.getResponseHeader("Content-Type"));if(ct)for(type in contents)if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break}if(dataTypes[0]in responses)finalDataType=dataTypes[0];else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break}firstDataType||(firstDataType=type)}finalDataType=finalDataType||firstDataType}if(finalDataType)return finalDataType!==dataTypes[0]&&dataTypes.unshift(finalDataType),responses[finalDataType]}function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},dataTypes=s.dataTypes.slice();if(dataTypes[1])for(conv in s.converters)converters[conv.toLowerCase()]=s.converters[conv];for(current=dataTypes.shift();current;)if(s.responseFields[current]&&(jqXHR[s.responseFields[current]]=response),!prev&&isSuccess&&s.dataFilter&&(response=s.dataFilter(response,s.dataType)),prev=current,current=dataTypes.shift())if("*"===current)current=prev;else if("*"!==prev&&prev!==current){if(!(conv=converters[prev+" "+current]||converters["* "+current]))for(conv2 in converters)if((tmp=conv2.split(" "))[1]===current&&(conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]])){!0===conv?conv=converters[conv2]:!0!==converters[conv2]&&(current=tmp[0],dataTypes.unshift(tmp[1]));break}if(!0!==conv)if(conv&&s.throws)response=conv(response);else try{response=conv(response)}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current}}}return{state:"success",data:response}}originAnchor.href=location.href,jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:location.href,type:"GET",isLocal:rlocalProtocol.test(location.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,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":jQuery.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target)},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){"object"==typeof url&&(options=url,url=void 0),options=options||{};var transport,cacheURL,responseHeadersString,responseHeaders,timeoutTimer,urlAnchor,completed,fireGlobals,i,uncached,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(completed){if(!responseHeaders)for(responseHeaders={};match=rheaders.exec(responseHeadersString);)responseHeaders[match[1].toLowerCase()+" "]=(responseHeaders[match[1].toLowerCase()+" "]||[]).concat(match[2]);match=responseHeaders[key.toLowerCase()+" "]}return null==match?null:match.join(", ")},getAllResponseHeaders:function(){return completed?responseHeadersString:null},setRequestHeader:function(name,value){return null==completed&&(name=requestHeadersNames[name.toLowerCase()]=requestHeadersNames[name.toLowerCase()]||name,requestHeaders[name]=value),this},overrideMimeType:function(type){return null==completed&&(s.mimeType=type),this},statusCode:function(map){var code;if(map)if(completed)jqXHR.always(map[jqXHR.status]);else for(code in map)statusCode[code]=[statusCode[code],map[code]];return this},abort:function(statusText){var finalText=statusText||strAbort;return transport&&transport.abort(finalText),done(0,finalText),this}};if(deferred.promise(jqXHR),s.url=((url||s.url||location.href)+"").replace(rprotocol,location.protocol+"//"),s.type=options.method||options.type||s.method||s.type,s.dataTypes=(s.dataType||"*").toLowerCase().match(rnothtmlwhite)||[""],null==s.crossDomain){urlAnchor=document.createElement("a");try{urlAnchor.href=s.url,urlAnchor.href=urlAnchor.href,s.crossDomain=originAnchor.protocol+"//"+originAnchor.host!=urlAnchor.protocol+"//"+urlAnchor.host}catch(e){s.crossDomain=!0}}if(s.data&&s.processData&&"string"!=typeof s.data&&(s.data=jQuery.param(s.data,s.traditional)),inspectPrefiltersOrTransports(prefilters,s,options,jqXHR),completed)return jqXHR;for(i in(fireGlobals=jQuery.event&&s.global)&&0==jQuery.active++&&jQuery.event.trigger("ajaxStart"),s.type=s.type.toUpperCase(),s.hasContent=!rnoContent.test(s.type),cacheURL=s.url.replace(rhash,""),s.hasContent?s.data&&s.processData&&0===(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&(s.data=s.data.replace(r20,"+")):(uncached=s.url.slice(cacheURL.length),s.data&&(s.processData||"string"==typeof s.data)&&(cacheURL+=(rquery.test(cacheURL)?"&":"?")+s.data,delete s.data),!1===s.cache&&(cacheURL=cacheURL.replace(rantiCache,"$1"),uncached=(rquery.test(cacheURL)?"&":"?")+"_="+nonce.guid+++uncached),s.url=cacheURL+uncached),s.ifModified&&(jQuery.lastModified[cacheURL]&&jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL]),jQuery.etag[cacheURL]&&jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL])),(s.data&&s.hasContent&&!1!==s.contentType||options.contentType)&&jqXHR.setRequestHeader("Content-Type",s.contentType),jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+("*"!==s.dataTypes[0]?", "+allTypes+"; q=0.01":""):s.accepts["*"]),s.headers)jqXHR.setRequestHeader(i,s.headers[i]);if(s.beforeSend&&(!1===s.beforeSend.call(callbackContext,jqXHR,s)||completed))return jqXHR.abort();if(strAbort="abort",completeDeferred.add(s.complete),jqXHR.done(s.success),jqXHR.fail(s.error),transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR)){if(jqXHR.readyState=1,fireGlobals&&globalEventContext.trigger("ajaxSend",[jqXHR,s]),completed)return jqXHR;s.async&&s.timeout>0&&(timeoutTimer=window.setTimeout((function(){jqXHR.abort("timeout")}),s.timeout));try{completed=!1,transport.send(requestHeaders,done)}catch(e){if(completed)throw e;done(-1,e)}}else done(-1,"No Transport");function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;completed||(completed=!0,timeoutTimer&&window.clearTimeout(timeoutTimer),transport=void 0,responseHeadersString=headers||"",jqXHR.readyState=status>0?4:0,isSuccess=status>=200&&status<300||304===status,responses&&(response=ajaxHandleResponses(s,jqXHR,responses)),!isSuccess&&jQuery.inArray("script",s.dataTypes)>-1&&jQuery.inArray("json",s.dataTypes)<0&&(s.converters["text script"]=function(){}),response=ajaxConvert(s,response,jqXHR,isSuccess),isSuccess?(s.ifModified&&((modified=jqXHR.getResponseHeader("Last-Modified"))&&(jQuery.lastModified[cacheURL]=modified),(modified=jqXHR.getResponseHeader("etag"))&&(jQuery.etag[cacheURL]=modified)),204===status||"HEAD"===s.type?statusText="nocontent":304===status?statusText="notmodified":(statusText=response.state,success=response.data,isSuccess=!(error=response.error))):(error=statusText,!status&&statusText||(statusText="error",status<0&&(status=0))),jqXHR.status=status,jqXHR.statusText=(nativeStatusText||statusText)+"",isSuccess?deferred.resolveWith(callbackContext,[success,statusText,jqXHR]):deferred.rejectWith(callbackContext,[jqXHR,statusText,error]),jqXHR.statusCode(statusCode),statusCode=void 0,fireGlobals&&globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error]),completeDeferred.fireWith(callbackContext,[jqXHR,statusText]),fireGlobals&&(globalEventContext.trigger("ajaxComplete",[jqXHR,s]),--jQuery.active||jQuery.event.trigger("ajaxStop")))}return jqXHR},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},getScript:function(url,callback){return jQuery.get(url,void 0,callback,"script")}}),jQuery.each(["get","post"],(function(_i,method){jQuery[method]=function(url,data,callback,type){return isFunction(data)&&(type=type||callback,callback=data,data=void 0),jQuery.ajax(jQuery.extend({url:url,type:method,dataType:type,data:data,success:callback},jQuery.isPlainObject(url)&&url))}})),jQuery.ajaxPrefilter((function(s){var i;for(i in s.headers)"content-type"===i.toLowerCase()&&(s.contentType=s.headers[i]||"")})),jQuery._evalUrl=function(url,options,doc){return jQuery.ajax({url:url,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(response){jQuery.globalEval(response,options,doc)}})},jQuery.fn.extend({wrapAll:function(html){var wrap;return this[0]&&(isFunction(html)&&(html=html.call(this[0])),wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&wrap.insertBefore(this[0]),wrap.map((function(){for(var elem=this;elem.firstElementChild;)elem=elem.firstElementChild;return elem})).append(this)),this},wrapInner:function(html){return isFunction(html)?this.each((function(i){jQuery(this).wrapInner(html.call(this,i))})):this.each((function(){var self=jQuery(this),contents=self.contents();contents.length?contents.wrapAll(html):self.append(html)}))},wrap:function(html){var htmlIsFunction=isFunction(html);return this.each((function(i){jQuery(this).wrapAll(htmlIsFunction?html.call(this,i):html)}))},unwrap:function(selector){return this.parent(selector).not("body").each((function(){jQuery(this).replaceWith(this.childNodes)})),this}}),jQuery.expr.pseudos.hidden=function(elem){return!jQuery.expr.pseudos.visible(elem)},jQuery.expr.pseudos.visible=function(elem){return!!(elem.offsetWidth||elem.offsetHeight||elem.getClientRects().length)},jQuery.ajaxSettings.xhr=function(){try{return new window.XMLHttpRequest}catch(e){}};var xhrSuccessStatus={0:200,1223:204},xhrSupported=jQuery.ajaxSettings.xhr();support.cors=!!xhrSupported&&"withCredentials"in xhrSupported,support.ajax=xhrSupported=!!xhrSupported,jQuery.ajaxTransport((function(options){var callback,errorCallback;if(support.cors||xhrSupported&&!options.crossDomain)return{send:function(headers,complete){var i,xhr=options.xhr();if(xhr.open(options.type,options.url,options.async,options.username,options.password),options.xhrFields)for(i in options.xhrFields)xhr[i]=options.xhrFields[i];for(i in options.mimeType&&xhr.overrideMimeType&&xhr.overrideMimeType(options.mimeType),options.crossDomain||headers["X-Requested-With"]||(headers["X-Requested-With"]="XMLHttpRequest"),headers)xhr.setRequestHeader(i,headers[i]);callback=function(type){return function(){callback&&(callback=errorCallback=xhr.onload=xhr.onerror=xhr.onabort=xhr.ontimeout=xhr.onreadystatechange=null,"abort"===type?xhr.abort():"error"===type?"number"!=typeof xhr.status?complete(0,"error"):complete(xhr.status,xhr.statusText):complete(xhrSuccessStatus[xhr.status]||xhr.status,xhr.statusText,"text"!==(xhr.responseType||"text")||"string"!=typeof xhr.responseText?{binary:xhr.response}:{text:xhr.responseText},xhr.getAllResponseHeaders()))}},xhr.onload=callback(),errorCallback=xhr.onerror=xhr.ontimeout=callback("error"),void 0!==xhr.onabort?xhr.onabort=errorCallback:xhr.onreadystatechange=function(){4===xhr.readyState&&window.setTimeout((function(){callback&&errorCallback()}))},callback=callback("abort");try{xhr.send(options.hasContent&&options.data||null)}catch(e){if(callback)throw e}},abort:function(){callback&&callback()}}})),jQuery.ajaxPrefilter((function(s){s.crossDomain&&(s.contents.script=!1)})),jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(text){return jQuery.globalEval(text),text}}}),jQuery.ajaxPrefilter("script",(function(s){void 0===s.cache&&(s.cache=!1),s.crossDomain&&(s.type="GET")})),jQuery.ajaxTransport("script",(function(s){var script,callback;if(s.crossDomain||s.scriptAttrs)return{send:function(_,complete){script=jQuery("<script>").attr(s.scriptAttrs||{}).prop({charset:s.scriptCharset,src:s.url}).on("load error",callback=function(evt){script.remove(),callback=null,evt&&complete("error"===evt.type?404:200,evt.type)}),document.head.appendChild(script[0])},abort:function(){callback&&callback()}}}));var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/,body;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop()||jQuery.expando+"_"+nonce.guid++;return this[callback]=!0,callback}}),jQuery.ajaxPrefilter("json jsonp",(function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=!1!==s.jsonp&&(rjsonp.test(s.url)?"url":"string"==typeof s.data&&0===(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&rjsonp.test(s.data)&&"data");if(jsonProp||"jsonp"===s.dataTypes[0])return callbackName=s.jsonpCallback=isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback,jsonProp?s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName):!1!==s.jsonp&&(s.url+=(rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName),s.converters["script json"]=function(){return responseContainer||jQuery.error(callbackName+" was not called"),responseContainer[0]},s.dataTypes[0]="json",overwritten=window[callbackName],window[callbackName]=function(){responseContainer=arguments},jqXHR.always((function(){void 0===overwritten?jQuery(window).removeProp(callbackName):window[callbackName]=overwritten,s[callbackName]&&(s.jsonpCallback=originalSettings.jsonpCallback,oldCallbacks.push(callbackName)),responseContainer&&isFunction(overwritten)&&overwritten(responseContainer[0]),responseContainer=overwritten=void 0})),"script"})),support.createHTMLDocument=((body=document.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===body.childNodes.length),jQuery.parseHTML=function(data,context,keepScripts){return"string"!=typeof data?[]:("boolean"==typeof context&&(keepScripts=context,context=!1),context||(support.createHTMLDocument?((base=(context=document.implementation.createHTMLDocument("")).createElement("base")).href=document.location.href,context.head.appendChild(base)):context=document),scripts=!keepScripts&&[],(parsed=rsingleTag.exec(data))?[context.createElement(parsed[1])]:(parsed=buildFragment([data],context,scripts),scripts&&scripts.length&&jQuery(scripts).remove(),jQuery.merge([],parsed.childNodes)));var base,parsed,scripts},jQuery.fn.load=function(url,params,callback){var selector,type,response,self=this,off=url.indexOf(" ");return off>-1&&(selector=stripAndCollapse(url.slice(off)),url=url.slice(0,off)),isFunction(params)?(callback=params,params=void 0):params&&"object"==typeof params&&(type="POST"),self.length>0&&jQuery.ajax({url:url,type:type||"GET",dataType:"html",data:params}).done((function(responseText){response=arguments,self.html(selector?jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector):responseText)})).always(callback&&function(jqXHR,status){self.each((function(){callback.apply(this,response||[jqXHR.responseText,status,jqXHR])}))}),this},jQuery.expr.pseudos.animated=function(elem){return jQuery.grep(jQuery.timers,(function(fn){return elem===fn.elem})).length},jQuery.offset={setOffset:function(elem,options,i){var curPosition,curLeft,curCSSTop,curTop,curOffset,curCSSLeft,calculatePosition,position=jQuery.css(elem,"position"),curElem=jQuery(elem),props={};"static"===position&&(elem.style.position="relative"),curOffset=curElem.offset(),curCSSTop=jQuery.css(elem,"top"),curCSSLeft=jQuery.css(elem,"left"),(calculatePosition=("absolute"===position||"fixed"===position)&&(curCSSTop+curCSSLeft).indexOf("auto")>-1)?(curTop=(curPosition=curElem.position()).top,curLeft=curPosition.left):(curTop=parseFloat(curCSSTop)||0,curLeft=parseFloat(curCSSLeft)||0),isFunction(options)&&(options=options.call(elem,i,jQuery.extend({},curOffset))),null!=options.top&&(props.top=options.top-curOffset.top+curTop),null!=options.left&&(props.left=options.left-curOffset.left+curLeft),"using"in options?options.using.call(elem,props):curElem.css(props)}},jQuery.fn.extend({offset:function(options){if(arguments.length)return void 0===options?this:this.each((function(i){jQuery.offset.setOffset(this,options,i)}));var rect,win,elem=this[0];return elem?elem.getClientRects().length?(rect=elem.getBoundingClientRect(),win=elem.ownerDocument.defaultView,{top:rect.top+win.pageYOffset,left:rect.left+win.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var offsetParent,offset,doc,elem=this[0],parentOffset={top:0,left:0};if("fixed"===jQuery.css(elem,"position"))offset=elem.getBoundingClientRect();else{for(offset=this.offset(),doc=elem.ownerDocument,offsetParent=elem.offsetParent||doc.documentElement;offsetParent&&(offsetParent===doc.body||offsetParent===doc.documentElement)&&"static"===jQuery.css(offsetParent,"position");)offsetParent=offsetParent.parentNode;offsetParent&&offsetParent!==elem&&1===offsetParent.nodeType&&((parentOffset=jQuery(offsetParent).offset()).top+=jQuery.css(offsetParent,"borderTopWidth",!0),parentOffset.left+=jQuery.css(offsetParent,"borderLeftWidth",!0))}return{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",!0),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var offsetParent=this.offsetParent;offsetParent&&"static"===jQuery.css(offsetParent,"position");)offsetParent=offsetParent.offsetParent;return offsetParent||documentElement}))}}),jQuery.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(method,prop){var top="pageYOffset"===prop;jQuery.fn[method]=function(val){return access(this,(function(elem,method,val){var win;if(isWindow(elem)?win=elem:9===elem.nodeType&&(win=elem.defaultView),void 0===val)return win?win[prop]:elem[method];win?win.scrollTo(top?win.pageXOffset:val,top?val:win.pageYOffset):elem[method]=val}),method,val,arguments.length)}})),jQuery.each(["top","left"],(function(_i,prop){jQuery.cssHooks[prop]=addGetHookIf(support.pixelPosition,(function(elem,computed){if(computed)return computed=curCSS(elem,prop),rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed}))})),jQuery.each({Height:"height",Width:"width"},(function(name,type){jQuery.each({padding:"inner"+name,content:type,"":"outer"+name},(function(defaultExtra,funcName){jQuery.fn[funcName]=function(margin,value){var chainable=arguments.length&&(defaultExtra||"boolean"!=typeof margin),extra=defaultExtra||(!0===margin||!0===value?"margin":"border");return access(this,(function(elem,type,value){var doc;return isWindow(elem)?0===funcName.indexOf("outer")?elem["inner"+name]:elem.document.documentElement["client"+name]:9===elem.nodeType?(doc=elem.documentElement,Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc["offset"+name],doc["client"+name])):void 0===value?jQuery.css(elem,type,extra):jQuery.style(elem,type,value,extra)}),type,chainable?margin:void 0,chainable)}}))})),jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(_i,type){jQuery.fn[type]=function(fn){return this.on(type,fn)}})),jQuery.fn.extend({bind:function(types,data,fn){return this.on(types,null,data,fn)},unbind:function(types,fn){return this.off(types,null,fn)},delegate:function(selector,types,data,fn){return this.on(types,selector,data,fn)},undelegate:function(selector,types,fn){return 1===arguments.length?this.off(selector,"**"):this.off(types,selector||"**",fn)},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver)}}),jQuery.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(_i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name)}}));var rtrim=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;jQuery.proxy=function(fn,context){var tmp,args,proxy;if("string"==typeof context&&(tmp=fn[context],context=fn,fn=tmp),isFunction(fn))return args=slice.call(arguments,2),(proxy=function(){return fn.apply(context||this,args.concat(slice.call(arguments)))}).guid=fn.guid=fn.guid||jQuery.guid++,proxy},jQuery.holdReady=function(hold){hold?jQuery.readyWait++:jQuery.ready(!0)},jQuery.isArray=Array.isArray,jQuery.parseJSON=JSON.parse,jQuery.nodeName=nodeName,jQuery.isFunction=isFunction,jQuery.isWindow=isWindow,jQuery.camelCase=camelCase,jQuery.type=toType,jQuery.now=Date.now,jQuery.isNumeric=function(obj){var type=jQuery.type(obj);return("number"===type||"string"===type)&&!isNaN(obj-parseFloat(obj))},jQuery.trim=function(text){return null==text?"":(text+"").replace(rtrim,"")},"function"==typeof define&&define.amd&&define("jquery",[],(function(){return jQuery}));var _jQuery=window.jQuery,_$=window.$;return jQuery.noConflict=function(deep){return window.$===jQuery&&(window.$=_$),deep&&window.jQuery===jQuery&&(window.jQuery=_jQuery),jQuery},void 0===noGlobal&&(window.jQuery=window.$=jQuery),jQuery})),
/*!
Chosen, a Select Box Enhancer for jQuery and Prototype
Version 2.2.1
Full source at https://github.com/jjj/chosen
Copyright (c) 2011-2021 JJJ
MIT License, https://github.com/jjj/chosen/blob/master/LICENSE.md
This file is generated by `grunt build`, do not edit it by hand.
*/
function(){var $,AbstractChosen,Chosen,SelectParser;(SelectParser=class SelectParser{constructor(options){this.options_index=0,this.parsed=[],this.copy_data_attributes=options.copy_data_attributes||!1}add_node(child){return"OPTGROUP"===child.nodeName.toUpperCase()?this.add_group(child):this.add_option(child)}add_group(group){var group_position,j,len,option,ref,results1;for(group_position=this.parsed.length,this.parsed.push({array_index:group_position,group:!0,label:group.label,title:group.title?group.title:void 0,children:0,disabled:group.disabled,hidden:group.hidden,classes:group.className}),results1=[],j=0,len=(ref=group.childNodes).length;j<len;j++)option=ref[j],results1.push(this.add_option(option,group_position,group.disabled));return results1}add_option(option,group_position,group_disabled){if("OPTION"===option.nodeName.toUpperCase())return""!==option.text?(null!=group_position&&(this.parsed[group_position].children+=1),this.parsed.push({options_index:this.options_index,value:option.value,text:option.text,html:option.innerHTML.replace(/^\s+|\s+$/g,""),title:option.title?option.title:void 0,selected:option.selected,disabled:!0===group_disabled?group_disabled:option.disabled,hidden:option.hidden,group_array_index:group_position,group_label:null!=group_position?this.parsed[group_position].label:null,classes:option.className,style:option.style.cssText,data:this.parse_data_attributes(option)})):this.parsed.push({options_index:this.options_index,empty:!0,data:this.parse_data_attributes(option)}),this.options_index+=1}parse_data_attributes(option){var attr,attrName,dataAttr,j,len,ref;if(dataAttr={"data-option-array-index":this.parsed.length,"data-value":option.value},this.copy_data_attributes&&option)for(j=0,len=(ref=option.attributes).length;j<len;j++)attrName=(attr=ref[j]).nodeName,/data-.*/.test(attrName)&&(dataAttr[attrName]=attr.nodeValue);return dataAttr}}).select_to_array=function(select,options){var child,j,len,parser,ref;for(parser=new SelectParser(options),j=0,len=(ref=select.childNodes).length;j<len;j++)child=ref[j],parser.add_node(child);return parser.parsed},AbstractChosen=function(){class AbstractChosen{constructor(form_field,options1={}){this.label_click_handler=this.label_click_handler.bind(this),this.form_field=form_field,this.options=options1,AbstractChosen.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.can_select_by_group=null!==this.form_field.getAttribute("select-by-group"),this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}set_default_values(){return this.click_test_action=evt=>this.test_active_click(evt),this.activate_action=evt=>this.activate_field(evt),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.is_rtl=this.options.rtl||/\bchosen-rtl\b/.test(this.form_field.className),this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text&&this.options.allow_single_deselect,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null==this.options.enable_split_word_search||this.options.enable_split_word_search,this.group_search=null==this.options.group_search||this.options.group_search,this.search_in_values=this.options.search_in_values||!1,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null==this.options.single_backstroke_delete||this.options.single_backstroke_delete,this.max_selected_options=this.options.max_selected_options||Infinity,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.inherit_option_classes=this.options.inherit_option_classes||!1,this.display_selected_options=null==this.options.display_selected_options||this.options.display_selected_options,this.display_disabled_options=null==this.options.display_disabled_options||this.options.display_disabled_options,this.parser_config=this.options.parser_config||{},this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1,this.hide_results_on_select=null==this.options.hide_results_on_select||this.options.hide_results_on_select,this.create_option=this.options.create_option||!1,this.persistent_create_option=this.options.persistent_create_option||!1,this.skip_no_results=this.options.skip_no_results||!1}set_default_text(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text,this.default_text=this.escape_html(this.default_text),this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text,this.create_option_text=this.form_field.getAttribute("data-create_option_text")||this.options.create_option_text||AbstractChosen.default_create_option_text}choice_label(item){return this.include_group_label_in_selected&&null!=item.group_label?`<b class='group-name'>${this.escape_html(item.group_label)}</b>${item.html}`:item.html}mouse_enter(){return this.mouse_on_container=!0}mouse_leave(){return this.mouse_on_container=!1}input_focus(evt){if(this.is_multiple){if(!this.active_field)return setTimeout(()=>this.container_mousedown(),50)}else if(!this.active_field)return this.activate_field()}input_blur(evt){if(!this.mouse_on_container)return this.active_field=!1,setTimeout(()=>this.blur_test(),100)}label_click_handler(evt){return this.is_multiple?this.container_mousedown(evt):this.activate_field()}results_option_build(options){var content,data,data_content,j,len,ref,shown_results;for(content="",shown_results=0,j=0,len=(ref=this.results_data).length;j<len&&(data_content="",""!==(data_content=(data=ref[j]).group?this.result_add_group(data):this.result_add_option(data))&&(shown_results++,content+=data_content),(null!=options?options.first:void 0)&&(data.selected&&this.is_multiple?this.choice_build(data):data.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(data))),!(shown_results>=this.max_shown_results));j++);return content}result_add_option(option){var attrName,classes,option_el;if(!option.search_match)return"";if(!this.include_option_in_results(option))return"";for(attrName in classes=[],option.disabled||option.selected&&this.is_multiple||classes.push("active-result"),!option.disabled||option.selected&&this.is_multiple||classes.push("disabled-result"),option.selected&&classes.push("result-selected"),null!=option.group_array_index&&classes.push("group-option"),""!==option.classes&&classes.push(option.classes),(option_el=document.createElement("li")).className=classes.join(" "),option.style&&(option_el.style.cssText=option.style),option.data)option.data.hasOwnProperty(attrName)&&option_el.setAttribute(attrName,option.data[attrName]);return option_el.setAttribute("role","option"),option_el.innerHTML=option.highlighted_html||option.html,option_el.id=`${this.form_field.id}-chosen-search-result-${option.data["data-option-array-index"]}`,option.title&&(option_el.title=option.title),this.outerHTML(option_el)}result_add_group(group){var classes,group_el;return(group.search_match||group.group_match)&&group.active_options>0?((classes=[]).push("group-result"),group.classes&&classes.push(group.classes),(group_el=document.createElement("li")).className=classes.join(" "),group_el.innerHTML=group.highlighted_html||this.escape_html(group.label),group.title&&(group_el.title=group.title),this.outerHTML(group_el)):""}append_option(option){return this.select_append_option(option)}results_update_field(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()}reset_single_select_options(){var j,len,ref,result,results1;for(results1=[],j=0,len=(ref=this.results_data).length;j<len;j++)(result=ref[j]).selected?results1.push(result.selected=!1):results1.push(void 0);return results1}results_toggle(){return this.results_showing?this.results_hide():this.results_show()}results_search(evt){return this.results_showing?this.winnow_results():this.results_show(),this.form_field_jq.trigger("chosen:search",{chosen:this})}winnow_results(options){var escaped_query,exact_regex,exact_result,fix,highlight_regex,j,len,match_value,option,prefix,query,ref,regex,results,results_group,search_match,startpos,suffix,text;for(this.no_results_clear(),results=0,exact_result=!1,match_value=!1,escaped_query=(query=this.get_search_text()).replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),regex=this.get_search_regex(escaped_query),exact_regex=new RegExp(`^${escaped_query}$`),highlight_regex=this.get_highlight_regex(escaped_query),j=0,len=(ref=this.results_data).length;j<len;j++)(option=ref[j]).search_match=!1,results_group=null,search_match=null,option.highlighted_html="",this.include_option_in_results(option)&&(option.group&&(option.group_match=!1,option.active_options=0),null!=option.group_array_index&&this.results_data[option.group_array_index]&&(0===(results_group=this.results_data[option.group_array_index]).active_options&&results_group.search_match&&(results+=1),results_group.active_options+=1),text=option.group?option.label:option.text,option.group&&!this.group_search||(search_match=this.search_string_match(text,regex),option.search_match=null!=search_match,!option.search_match&&this.search_in_values&&(option.search_match=this.search_string_match(option.value,regex),match_value=!0),option.search_match&&!option.group&&(results+=1),exact_result=exact_result||exact_regex.test(option.html),option.search_match?(query.length&&!match_value&&(startpos=search_match.index,prefix=text.slice(0,startpos),fix=text.slice(startpos,startpos+query.length),suffix=text.slice(startpos+query.length),option.highlighted_html=`${this.escape_html(prefix)}<em>${this.escape_html(fix)}</em>${this.escape_html(suffix)}`),null!=results_group&&(results_group.group_match=!0)):null!=option.group_array_index&&this.results_data[option.group_array_index].search_match&&(option.search_match=!0)));if(this.result_clear_highlight(),results<1&&query.length?(this.update_results_content(""),this.fire_search_updated(query),this.create_option&&this.skip_no_results||this.no_results(query)):(this.update_results_content(this.results_option_build()),this.fire_search_updated(query),(null!=options?options.skip_highlight:void 0)||this.winnow_results_set_highlight()),this.create_option&&(results<1||!exact_result&&this.persistent_create_option)&&query.length)return this.show_create_option(query)}get_search_regex(escaped_search_string){var regex_flag,regex_string;return regex_string=this.search_contains?escaped_search_string:`(^|\\s|\\b)${escaped_search_string}[^\\s]*`,this.enable_split_word_search||this.search_contains||(regex_string=`^${regex_string}`),regex_flag=this.case_sensitive_search?"":"i",new RegExp(regex_string,regex_flag)}get_highlight_regex(escaped_search_string){var regex_anchor,regex_flag;return regex_anchor=this.search_contains?"":"\\b",regex_flag=this.case_sensitive_search?"":"i",new RegExp(regex_anchor+escaped_search_string,regex_flag)}get_list_special_char(){var chars;return(chars=[]).push({val:"ae",let:"(ä|æ|ǽ)"}),chars.push({val:"oe",let:"(ö|œ)"}),chars.push({val:"ue",let:"(ü)"}),chars.push({val:"Ae",let:"(Ä)"}),chars.push({val:"Ue",let:"(Ü)"}),chars.push({val:"Oe",let:"(Ö)"}),chars.push({val:"AE",let:"(Æ|Ǽ)"}),chars.push({val:"ss",let:"(ß)"}),chars.push({val:"IJ",let:"(Ĳ)"}),chars.push({val:"ij",let:"(ĳ)"}),chars.push({val:"OE",let:"(Œ)"}),chars.push({val:"A",let:"(À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ)"}),chars.push({val:"a",let:"(à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª)"}),chars.push({val:"C",let:"(Ç|Ć|Ĉ|Ċ|Č)"}),chars.push({val:"c",let:"(ç|ć|ĉ|ċ|č)"}),chars.push({val:"D",let:"(Ð|Ď|Đ)"}),chars.push({val:"d",let:"(ð|ď|đ)"}),chars.push({val:"E",let:"(È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě)"}),chars.push({val:"e",let:"(è|é|ê|ë|ē|ĕ|ė|ę|ě)"}),chars.push({val:"G",let:"(Ĝ|Ğ|Ġ|Ģ)"}),chars.push({val:"g",let:"(ĝ|ğ|ġ|ģ)"}),chars.push({val:"H",let:"(Ĥ|Ħ)"}),chars.push({val:"h",let:"(ĥ|ħ)"}),chars.push({val:"I",let:"(Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ)"}),chars.push({val:"i",let:"(ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı)"}),chars.push({val:"J",let:"(Ĵ)"}),chars.push({val:"j",let:"(ĵ)"}),chars.push({val:"K",let:"(Ķ)"}),chars.push({val:"k",let:"(ķ)"}),chars.push({val:"L",let:"(Ĺ|Ļ|Ľ|Ŀ|Ł)"}),chars.push({val:"l",let:"(ĺ|ļ|ľ|ŀ|ł)"}),chars.push({val:"N",let:"(Ñ|Ń|Ņ|Ň)"}),chars.push({val:"n",let:"(ñ|ń|ņ|ň|ŉ)"}),chars.push({val:"O",let:"(Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ)"}),chars.push({val:"o",let:"(ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º)"}),chars.push({val:"R",let:"(Ŕ|Ŗ|Ř)"}),chars.push({val:"r",let:"(ŕ|ŗ|ř)"}),chars.push({val:"S",let:"(Ś|Ŝ|Ş|Š)"}),chars.push({val:"s",let:"(ś|ŝ|ş|š|ſ)"}),chars.push({val:"T",let:"(Ţ|Ť|Ŧ)"}),chars.push({val:"t",let:"(ţ|ť|ŧ)"}),chars.push({val:"U",let:"(Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ)"}),chars.push({val:"u",let:"(ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ)"}),chars.push({val:"Y",let:"(Ý|Ÿ|Ŷ)"}),chars.push({val:"y",let:"(ý|ÿ|ŷ)"}),chars.push({val:"W",let:"(Ŵ)"}),chars.push({val:"w",let:"(ŵ)"}),chars.push({val:"Z",let:"(Ź|Ż|Ž)"}),chars.push({val:"z",let:"(ź|ż|ž)"}),chars.push({val:"f",let:"(ƒ)"}),chars}escape_special_char(str){var j,len,special,specialChars;for(j=0,len=(specialChars=this.get_list_special_char()).length;j<len;j++)special=specialChars[j],str.replace(new RegExp(special.let,"g"),special.val);return str}search_string_match(search_string,regex){var match;return match=regex.exec(search_string),this.case_sensitive_search||null==match||(match=regex.exec(this.escape_special_char(search_string))),!this.search_contains&&(null!=match?match[1]:void 0)&&(match.index+=1),match}choices_count(){var j,len,option,ref;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,j=0,len=(ref=this.form_field.options).length;j<len;j++)(option=ref[j]).selected&&(this.selected_option_count+=1);return this.selected_option_count}choices_click(evt){if(evt.preventDefault(),this.activate_field(),!this.results_showing&&!this.is_disabled)return this.results_show()}mousedown_checker(evt){var mousedown_type,ref,ref1,ref2;switch(mousedown_type=null,(evt=evt||window.event).which||void 0===evt.button||(evt.which=null!=(ref=1&evt.button)?ref:{1:null!=(ref1=2&evt.button)?ref1:{3:null!=(ref2=4&evt.button)?ref2:{2:0}}}),evt.which){case 1:mousedown_type="left";break;case 2:mousedown_type="right";break;case 3:mousedown_type="middle";break;default:mousedown_type="other"}return mousedown_type}keydown_checker(evt){var ref,stroke;switch(stroke=null!=(ref=evt.which)?ref:evt.keyCode,this.search_field_scale(),8!==stroke&&this.pending_backstroke&&this.clear_backstroke(),stroke){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(evt),this.mouse_on_container=!1;break;case 13:case 27:this.results_showing&&evt.preventDefault();break;case 32:this.disable_search&&evt.preventDefault();break;case 38:evt.preventDefault(),this.keyup_arrow();break;case 40:evt.preventDefault(),this.keydown_arrow()}}keyup_checker(evt){var ref,stroke;switch(stroke=null!=(ref=evt.which)?ref:evt.keyCode,this.search_field_scale(),stroke){case 8:this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:evt.preventDefault(),this.results_showing&&this.result_select(evt);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}}clipboard_event_checker(evt){if(!this.is_disabled)return setTimeout(()=>this.results_search(),50)}container_width(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth>0?`${this.form_field.offsetWidth}px`:"auto"}include_option_in_results(option){return!(this.is_multiple&&!this.display_selected_options&&option.selected)&&(!(!this.display_disabled_options&&option.disabled)&&(!option.empty&&(!option.hidden&&(null==option.group_array_index||!this.results_data[option.group_array_index].hidden))))}search_results_touchstart(evt){return this.touch_started=!0,this.search_results_mouseover(evt)}search_results_touchmove(evt){return this.touch_started=!1,this.search_results_mouseout(evt)}search_results_touchend(evt){if(this.touch_started)return this.search_results_mouseup(evt)}outerHTML(element){var tmp;return element.outerHTML?element.outerHTML:((tmp=document.createElement("div")).appendChild(element),tmp.innerHTML)}get_single_html(){return`<span class="chosen-single chosen-default">\n    <span>${this.default_text}</span>\n    <div><b></b></div>\n  </span>\n  <div class="chosen-drop">\n    <div class="chosen-search">\n      <input class="chosen-search-input" type="text" autocomplete="off" role="combobox" aria-label="searchbox" aria-expanded="false" aria-haspopup="true" aria-autocomplete="list" autocomplete="off" />\n    </div>\n    <ul class="chosen-results" role="listbox" aria-label="search results"></ul>\n  </div>`}get_multi_html(){return`<ul class="chosen-choices" role="list">\n    <li class="search-field">\n      <input class="chosen-search-input" type="text" autocomplete="off" role="combobox" aria-label="searchbox" placeholder="${this.default_text}" aria-expanded="false" aria-haspopup="true" aria-autocomplete="list" />\n    </li>\n  </ul>\n  <div class="chosen-drop">\n    <ul class="chosen-results" role="listbox" aria-label="search results"></ul>\n  </div>`}get_no_results_html(terms){return`<li class="no-results">\n    ${this.results_none_found} <span>${this.escape_html(terms)}</span>\n  </li>`}get_option_html({value:value,text:text}){return`<option value="${value}" selected>${text}</option>`}get_create_option_html(terms){return`<li class="create-option active-result" role="option"><a>${this.create_option_text}</a> <span>${this.escape_html(terms)}</span></li>`}static browser_is_supported(){return!0}}return AbstractChosen.default_multiple_text="Select Some Options",AbstractChosen.default_single_text="Select an Option",AbstractChosen.default_no_result_text="No results for:",AbstractChosen.default_create_option_text="Add Option:",AbstractChosen}.call(this),($=jQuery).fn.extend({chosen:function(options){return AbstractChosen.browser_is_supported()?this.each((function(input_field){var $this,chosen;chosen=($this=$(this)).data("chosen"),"destroy"!==options?chosen instanceof Chosen||$this.data("chosen",new Chosen(this,options)):chosen instanceof Chosen&&chosen.destroy()})):this}}),Chosen=class Chosen extends AbstractChosen{setup(){return this.form_field_jq=$(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex}set_up_html(){var container_classes,container_props;return(container_classes=["chosen-container"]).push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&container_classes.push(this.form_field.className),this.is_rtl&&container_classes.push("chosen-rtl"),container_props={class:container_classes.join(" "),title:this.form_field.title},this.form_field.id.length&&(container_props.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=$("<div />",container_props),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.css("position","absolute").css("opacity",0).css("display","none").after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_results.attr("id",`${this.form_field.id}-chosen-search-results`),this.search_groups=this.container.find("li.group-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.set_aria_labels(),this.results_build(),this.set_tab_index(),this.set_label_behavior()}on_ready(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})}register_observers(){return this.container.on("touchstart.chosen",evt=>{this.container_mousedown(evt)}),this.container.on("touchend.chosen",evt=>{this.container_mouseup(evt)}),this.container.on("mousedown.chosen",evt=>{this.container_mousedown(evt)}),this.container.on("mouseup.chosen",evt=>{this.container_mouseup(evt)}),this.container.on("mouseenter.chosen",evt=>{this.mouse_enter(evt)}),this.container.on("mouseleave.chosen",evt=>{this.mouse_leave(evt)}),this.search_groups.bind("mouseup.chosen",evt=>{this.search_results_mouseup(evt)}),this.search_groups.bind("mouseover.chosen",evt=>{this.search_results_mouseover(evt)}),this.search_groups.bind("mouseout.chosen",evt=>{this.search_results_mouseout(evt)}),this.search_groups.bind("mousewheel.chosen DOMMouseScroll.chosen",evt=>{this.search_results_mousewheel(evt)}),this.search_results.on("mouseup.chosen",evt=>{this.search_results_mouseup(evt)}),this.search_results.on("mouseover.chosen",evt=>{this.search_results_mouseover(evt)}),this.search_results.on("mouseout.chosen",evt=>{this.search_results_mouseout(evt)}),this.search_results.on("mousewheel.chosen DOMMouseScroll.chosen",evt=>{this.search_results_mousewheel(evt)}),this.search_results.on("touchstart.chosen",evt=>{this.search_results_touchstart(evt)}),this.search_results.on("touchmove.chosen",evt=>{this.search_results_touchmove(evt)}),this.search_results.on("touchend.chosen",evt=>{this.search_results_touchend(evt)}),this.form_field_jq.on("chosen:updated.chosen",evt=>{this.results_update_field(evt)}),this.form_field_jq.on("chosen:activate.chosen",evt=>{this.activate_field(evt)}),this.form_field_jq.on("chosen:open.chosen",evt=>{this.container_mousedown(evt)}),this.form_field_jq.on("chosen:close.chosen",evt=>{this.close_field(evt)}),this.search_field.on("blur.chosen",evt=>{this.input_blur(evt)}),this.search_field.on("keyup.chosen",evt=>{this.keyup_checker(evt)}),this.search_field.on("keydown.chosen",evt=>{this.keydown_checker(evt)}),this.search_field.on("focus.chosen",evt=>{this.input_focus(evt)}),this.search_field.on("cut.chosen",evt=>{this.clipboard_event_checker(evt)}),this.search_field.on("paste.chosen",evt=>{this.clipboard_event_checker(evt)}),this.is_multiple?this.search_choices.on("click.chosen",evt=>{this.choices_click(evt)}):this.container.on("click.chosen",(function(evt){evt.preventDefault()}))}destroy(){return $(null!=this.container[0].getRootNode?this.container[0].getRootNode():this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.form_field_label.length>0&&this.form_field_label.off("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()}set_aria_labels(){var i,j,label,labelledbyList,len,ref;if(this.search_field.attr("aria-owns",this.search_results.attr("id")),this.form_field.attributes["aria-label"]){if(this.search_field.attr("aria-label",this.form_field.attributes["aria-label"]),this.form_field.attributes["aria-labelledby"])return this.search_field.attr("aria-labelledby",this.form_field.attributes["aria-labelledby"])}else if(Object.prototype.hasOwnProperty.call(this.form_field,"labels")&&this.form_field.labels.length){for(labelledbyList="",i=j=0,len=(ref=this.form_field.labels).length;j<len;i=++j)""===(label=ref[i]).id&&(label.id=`${this.form_field.id}-chosen-label-${i}`),labelledbyList+=this.form_field.labels[i].id+" ";return this.search_field.attr("aria-labelledby",labelledbyList)}}search_field_disabled(){return this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chosen-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.off("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.on("focus.chosen",this.activate_field)}container_mousedown(evt){var ref;if(!this.is_disabled&&evt&&"left"===this.mousedown_checker(evt)&&evt&&"mousedown"===evt.type&&!this.results_showing&&evt.preventDefault(),!evt||"mousedown"!==(ref=evt.type)&&"touchstart"!==ref||this.results_showing||evt.preventDefault(),null==evt||!$(evt.target).hasClass("search-choice-close"))return this.active_field?this.is_multiple||!evt||$(evt.target)[0]!==this.selected_item[0]&&!$(evt.target).parents("span.chosen-single").length||(evt.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),$(null!=this.container[0].getRootNode?this.container[0].getRootNode():this.container[0].ownerDocument).on("click.chosen",this.click_test_action),this.results_show()),this.activate_field()}container_mouseup(evt){if(!this.is_disabled&&this.allow_single_deselect&&$(evt.target).hasClass("search-choice-close"))return this.results_reset(evt)}search_results_mousewheel(evt){var delta;if(evt.originalEvent&&(delta=evt.originalEvent.deltaY||-evt.originalEvent.wheelDelta||evt.originalEvent.detail),null!=delta)return evt.preventDefault(),"DOMMouseScroll"===evt.type&&(delta*=40),this.search_results.scrollTop(delta+this.search_results.scrollTop())}blur_test(evt){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()}close_field(){return $(null!=this.container[0].getRootNode?this.container[0].getRootNode():this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.search_field.attr("aria-expanded",!1),this.container.removeClass("chosen-container-active"),this.container.removeClass("chosen-dropup"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.trigger("blur")}should_dropup(){var dropdownTop,totalHeight,windowHeight;return windowHeight=$(window).height(),dropdownTop=this.container.offset().top+this.container.height()-$(window).scrollTop(),(totalHeight=this.dropdown.height()+dropdownTop)>windowHeight}activate_field(){if(!this.is_disabled)return this.container.addClass("chosen-container-active"),this.should_dropup()&&this.container.addClass("chosen-dropup"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.attr("aria-expanded",!0),this.search_results.attr("aria-busy",!1),this.search_field.trigger("focus")}test_active_click(evt){var active_container;return active_container=$(evt.target).closest(".chosen-container"),"left"===this.mousedown_checker(evt)&&active_container.length&&this.container[0]===active_container[0]?this.active_field=!0:this.close_field()}results_build(){return this.parsing=!0,this.selected_option_count=null,this.results_data=SelectParser.select_to_array(this.form_field,this.parser_config),this.is_multiple?this.search_choices.find("li.search-choice").remove():(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold&&!this.create_option?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1}result_do_highlight(el){var high_bottom,high_top,maxHeight,visible_bottom,visible_top;if(el.length){if(this.result_clear_highlight(),this.result_highlight=el,this.result_highlight.addClass("highlighted"),this.search_field.attr("aria-activedescendant",this.result_highlight.attr("id")),visible_bottom=(maxHeight=parseInt(this.search_results.css("maxHeight"),10))+(visible_top=this.search_results.scrollTop()),(high_bottom=(high_top=this.result_highlight.position().top+this.search_results.scrollTop())+this.result_highlight.outerHeight())>=visible_bottom)return this.search_results.scrollTop(high_bottom-maxHeight>0?high_bottom-maxHeight:0);if(high_top<visible_top)return this.search_results.scrollTop(high_top)}}result_clear_highlight(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null}results_show(){return!(this.is_multiple&&this.max_selected_options<=this.choices_count()+1&&(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),this.is_multiple&&this.max_selected_options<=this.choices_count()))&&(this.should_dropup()&&this.container.addClass("chosen-dropup"),this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.trigger("focus"),this.search_field.val(this.get_search_field_value()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))}update_results_content(content){return this.search_results.html(content)}fire_search_updated(search_term){return this.form_field_jq.trigger("chosen:search_updated",{chosen:this,search_term:search_term})}results_hide(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.container.removeClass("chosen-dropup"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1}set_tab_index(el){var ti;if(this.form_field.tabIndex)return ti=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=ti}set_label_behavior(){if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=$(`label[for='${this.form_field.id}']`)),this.form_field_label.length>0)return this.form_field_label.on("click.chosen",this.label_click_handler)}set_search_field_placeholder(){return this.is_multiple&&this.choices_count()<1?this.search_field.attr("placeholder",this.default_text):this.search_field.attr("placeholder","")}show_search_field_default(){return this.search_field.val(""),this.set_search_field_placeholder(),this.is_multiple&&this.choices_count()<1&&!this.active_field?this.search_field.addClass("default"):this.search_field.removeClass("default")}search_results_mouseup(evt){var target;if("left"===this.mousedown_checker(evt)&&(target=$(evt.target).is(".active-result,.group-result")?$(evt.target):$(evt.target).parents(".active-result").first()).length)return this.result_highlight=target,this.result_select(evt),this.search_field.focus()}search_results_mouseover(evt){var target;if(target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first())return this.result_do_highlight(target)}search_results_mouseout(evt){if($(evt.target).hasClass("active-result")||$(evt.target).parents(".active-result").first())return this.result_clear_highlight()}choice_build(item){var choice,close_link;return choice=$("<li />",{class:"search-choice","data-value":item.value,role:"option"}).html(`<span>${this.choice_label(item)}</span>`),item.disabled?choice.addClass("search-choice-disabled"):((close_link=$("<button />",{type:"button",tabindex:-1,"aria-label":"remove",class:"search-choice-close","data-option-array-index":item.data["data-option-array-index"]})).on("click.chosen",evt=>this.choice_destroy_link_click(evt)),choice.append(close_link)),this.inherit_option_classes&&item.classes&&choice[0].classList.add(item.classes),this.search_container.before(choice)}choice_destroy_link_click(evt){if(evt.preventDefault(),evt.stopPropagation(),!this.is_disabled)return this.choice_destroy($(evt.target))}choice_destroy(link){if(this.result_deselect(link[0].getAttribute("data-option-array-index")))return this.active_field?this.search_field.trigger("focus"):this.show_search_field_default(),this.is_multiple&&this.hide_results_on_select&&this.choices_count()>0&&this.get_search_field_value().length<1&&this.results_hide(),link.parents("li").first().remove(),this.set_search_field_placeholder(),this.search_field_scale()}results_reset(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field)return this.results_hide()}results_reset_cleanup(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find(".search-choice-close").remove()}result_select(evt){var high,item;if($(evt.target).hasClass("group-result")){if(!this.can_select_by_group)return;$(evt.target).nextAll().each((_,option)=>{var array_index,is_chosen;return!$(option).hasClass("group-result")&&(array_index=$(option).attr("data-option-array-index"),is_chosen=!1,$("#pops_chosen > .chosen-choices").find(".search-choice-close").each((_,choice)=>{if($(choice).attr("data-option-array-index")===array_index)return is_chosen=!0,!1}),is_chosen?void 0:(this.result_highlight=$(option),evt.target=option,evt.selected=!0,this.result_select(evt)))})}else if(this.result_highlight)return(high=this.result_highlight).hasClass("create-option")?(this.select_create_option(this.search_field.val()),this.results_hide()):(this.result_clear_highlight(),!(this.is_multiple&&this.max_selected_options<=this.choices_count()+1&&(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),this.is_multiple&&this.max_selected_options<=this.choices_count()))&&(this.is_multiple?high.removeClass("active-result"):this.reset_single_select_options(),high.addClass("result-selected"),(item=this.results_data[high[0].getAttribute("data-option-array-index")]).selected=!0,this.form_field.options[item.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(item):this.single_set_selected_text(this.choice_label(item)),this.is_multiple&&(!this.hide_results_on_select||evt.metaKey||evt.ctrlKey)?evt.metaKey||evt.ctrlKey?this.winnow_results({skip_highlight:!0}):(this.search_field.val(""),this.winnow_results()):(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change({selected:this.form_field.options[item.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,evt.preventDefault(),this.search_field_scale()))}single_set_selected_text(text=this.default_text){return text===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(text)}result_deselect(pos){var result_data;return result_data=this.results_data[pos],!this.form_field.options[result_data.options_index].disabled&&(result_data.selected=!1,this.form_field.options[result_data.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[result_data.options_index].value}),this.search_field_scale(),!0)}single_deselect_control_build(){if(this.allow_single_deselect)return this.selected_item.find(".search-choice-close").length||this.selected_item.find("span").first().after('<button type="button" tabindex="-1" aria-label="remove" class="search-choice-close"></button>'),this.selected_item.addClass("chosen-single-with-deselect")}get_search_field_value(){return this.search_field.val()}get_search_text(){return $.trim(this.get_search_field_value())}escape_html(text){return $("<div/>").text(text).html()}winnow_results_set_highlight(){var do_high,selected_results;if(null!=(do_high=(selected_results=this.is_multiple?[]:this.search_results.find(".result-selected.active-result")).length?selected_results.first():this.search_results.find(".active-result").first()))return this.result_do_highlight(do_high)}no_results(terms){var no_results_html;return no_results_html=this.get_no_results_html(terms),this.search_results.append(no_results_html),this.form_field_jq.trigger("chosen:no_results",{chosen:this})}show_create_option(terms){var create_option_html;return create_option_html=this.get_create_option_html(terms),this.search_results.append(create_option_html)}create_option_clear(){return this.search_results.find(".create-option").remove()}select_create_option(terms){return $.isFunction(this.create_option)?this.create_option.call(this,terms):this.select_append_option({value:terms,text:terms})}select_append_option(options){var option;return option=this.get_,option_html(options),this.form_field_jq.append(option),this.form_field_jq.trigger("chosen:updated"),this.form_field_jq.trigger("change"),this.search_field.trigger("focus")}no_results_clear(){return this.search_results.find(".no-results").remove()}keydown_arrow(){var next_sib;return this.results_showing&&this.result_highlight?(next_sib=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(next_sib):void 0:this.results_showing&&this.create_option?this.result_do_highlight(this.search_results.find(".create-option")):this.results_show()}keyup_arrow(){var prev_sibs;return this.results_showing||this.is_multiple?this.result_highlight?(prev_sibs=this.result_highlight.prevAll("li.active-result")).length?this.result_do_highlight(prev_sibs.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight()):void 0:this.results_show()}keydown_backstroke(){var next_available_destroy;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find(".search-choice-close").first()),this.clear_backstroke()):(next_available_destroy=this.search_container.siblings("li.search-choice").last()).length&&!next_available_destroy.hasClass("search-choice-disabled")?(this.pending_backstroke=next_available_destroy,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0}clear_backstroke(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null}search_field_scale(){var div,j,len,style,style_block,styles,width;if(this.is_multiple){for(style_block={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},j=0,len=(styles=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"]).length;j<len;j++)style_block[style=styles[j]]=this.search_field.css(style);return(div=$("<div />").css(style_block)).text(this.get_search_field_value()||this.search_field.attr("placeholder")),$("body").append(div),width=div.width()+25,div.remove(),this.container.is(":visible")&&(width=Math.min(this.container.outerWidth()-10,width)),this.search_field.width(width)}}trigger_form_field_change(extra){return this.form_field_jq.trigger("input",extra),this.form_field_jq.trigger("change",extra)}}}.call(this),function($,window,document,undefined){"use strict";var jRange=function(){return this.init.apply(this,arguments)};jRange.prototype={defaults:{onstatechange:function(){},ondragend:function(){},onbarclicked:function(){},isRange:!1,showLabels:!0,showScale:!0,step:1,format:"%s",theme:"theme-default",width:300,disable:!1,snap:!1},template:'<div class="slider-container">             <div class="back-bar">                 <div class="selected-bar"></div>                 <div class="pointer low"></div><div class="pointer-label low">123456</div>                 <div class="pointer high"></div><div class="pointer-label high">456789</div>                 <div class="clickable-dummy"></div>             </div>             <div class="scale"></div>         </div>',init:function(node,options){this.options=$.extend({},this.defaults,options),this.inputNode=$(node),this.options.value=this.inputNode.val()||(this.options.isRange?this.options.from+","+this.options.from:""+this.options.from),this.domNode=$(this.template),this.domNode.addClass(this.options.theme),this.inputNode.after(this.domNode),this.domNode.on("change",this.onChange),this.pointers=$(".pointer",this.domNode),this.lowPointer=this.pointers.first(),this.highPointer=this.pointers.last(),this.labels=$(".pointer-label",this.domNode),this.lowLabel=this.labels.first(),this.highLabel=this.labels.last(),this.scale=$(".scale",this.domNode),this.bar=$(".selected-bar",this.domNode),this.clickableBar=this.domNode.find(".clickable-dummy"),this.interval=this.options.to-this.options.from,this.render()},render:function(){0!==this.inputNode.width()||this.options.width?(this.options.width=this.options.width||this.inputNode.width(),this.domNode.width(this.options.width),this.inputNode.hide(),this.isSingle()&&(this.lowPointer.hide(),this.lowLabel.hide()),this.options.showLabels||this.labels.hide(),this.attachEvents(),this.options.showScale&&this.renderScale(),this.setValue(this.options.value)):console.log("jRange : no width found, returning")},isSingle:function(){return"number"==typeof this.options.value||-1===this.options.value.indexOf(",")&&!this.options.isRange},attachEvents:function(){this.clickableBar.click($.proxy(this.barClicked,this)),this.pointers.on("mousedown touchstart",$.proxy(this.onDragStart,this)),this.pointers.bind("dragstart",(function(event){event.preventDefault()}))},onDragStart:function(e){if(!(this.options.disable||"mousedown"===e.type&&1!==e.which)){e.stopPropagation(),e.preventDefault();var pointer=$(e.target);this.pointers.removeClass("last-active"),pointer.addClass("focused last-active"),this[(pointer.hasClass("low")?"low":"high")+"Label"].addClass("focused"),$(document).on("mousemove.slider touchmove.slider",$.proxy(this.onDrag,this,pointer)),$(document).on("mouseup.slider touchend.slider touchcancel.slider",$.proxy(this.onDragEnd,this))}},onDrag:function(pointer,e){e.stopPropagation(),e.preventDefault(),e.originalEvent.touches&&e.originalEvent.touches.length?e=e.originalEvent.touches[0]:e.originalEvent.changedTouches&&e.originalEvent.changedTouches.length&&(e=e.originalEvent.changedTouches[0]);var position=e.clientX-this.domNode.offset().left;this.domNode.trigger("change",[this,pointer,position])},onDragEnd:function(e){this.pointers.removeClass("focused").trigger("rangeslideend"),this.labels.removeClass("focused"),$(document).off(".slider"),this.options.ondragend.call(this,this.options.value)},barClicked:function(e){if(!this.options.disable){var x=e.pageX-this.clickableBar.offset().left;if(this.isSingle())this.setPosition(this.pointers.last(),x,!0,!0);else{var firstLeft=Math.abs(parseFloat(this.pointers.first().css("left"),10)),firstHalfWidth=this.pointers.first().width()/2,lastLeft=Math.abs(parseFloat(this.pointers.last().css("left"),10)),lastHalfWidth=this.pointers.first().width()/2,leftSide=Math.abs(firstLeft-x+firstHalfWidth),rightSide=Math.abs(lastLeft-x+lastHalfWidth),pointer;pointer=leftSide==rightSide?x<firstLeft?this.pointers.first():this.pointers.last():leftSide<rightSide?this.pointers.first():this.pointers.last(),this.setPosition(pointer,x,!0,!0)}this.options.onbarclicked.call(this,this.options.value)}},onChange:function(e,self,pointer,position){var min,max;min=0,max=self.domNode.width(),self.isSingle()||(min=pointer.hasClass("high")?parseFloat(self.lowPointer.css("left"))+self.lowPointer.width()/2:0,max=pointer.hasClass("low")?parseFloat(self.highPointer.css("left"))+self.highPointer.width()/2:self.domNode.width());var value=Math.min(Math.max(position,min),max);self.setPosition(pointer,value,!0)},setPosition:function(pointer,position,isPx,animate){var leftPos,rightPos,lowPos=parseFloat(this.lowPointer.css("left")),highPos=parseFloat(this.highPointer.css("left"))||0,circleWidth=this.highPointer.width()/2;if(isPx||(position=this.prcToPx(position)),this.options.snap){var expPos=this.correctPositionForSnap(position);if(-1===expPos)return;position=expPos}pointer[0]===this.highPointer[0]?highPos=Math.round(position-circleWidth):lowPos=Math.round(position-circleWidth),pointer[animate?"animate":"css"]({left:Math.round(position-circleWidth)}),this.isSingle()?leftPos=0:(leftPos=lowPos+circleWidth,rightPos=highPos+circleWidth);var w=Math.round(highPos+circleWidth-leftPos);this.bar[animate?"animate":"css"]({width:Math.abs(w),left:w>0?leftPos:leftPos+w}),this.showPointerValue(pointer,position,animate),this.isReadonly()},correctPositionForSnap:function(position){var currentValue=this.positionToValue(position)-this.options.from,diff=this.options.width/(this.interval/this.options.step),expectedPosition=currentValue/this.options.step*diff;return position<=expectedPosition+diff/2&&position>=expectedPosition-diff/2?expectedPosition:-1},setValue:function(value){var values=value.toString().split(",");values[0]=Math.min(Math.max(values[0],this.options.from),this.options.to)+"",values.length>1&&(values[1]=Math.min(Math.max(values[1],this.options.from),this.options.to)+""),this.options.value=value;var prc=this.valuesToPrc(2===values.length?values:[0,values[0]]);this.isSingle()?this.setPosition(this.highPointer,prc[1]):(this.setPosition(this.lowPointer,prc[0]),this.setPosition(this.highPointer,prc[1]))},renderScale:function(){for(var s=this.options.scale||[this.options.from,this.options.to],prc=Math.round(100/(s.length-1)*10)/10,str="",i=0;i<s.length;i++)str+='<span style="left: '+i*prc+'%">'+("|"!=s[i]?"<ins>"+s[i]+"</ins>":"")+"</span>";this.scale.html(str),$("ins",this.scale).each((function(){$(this).css({marginLeft:-$(this).outerWidth()/2})}))},getBarWidth:function(){var values=this.options.value.split(",");return values.length>1?parseFloat(values[1])-parseFloat(values[0]):parseFloat(values[0])},showPointerValue:function(pointer,position,animate){var label=$(".pointer-label",this.domNode)[pointer.hasClass("low")?"first":"last"](),text,value=this.positionToValue(position);if($.isFunction(this.options.format)){var type=this.isSingle()?void 0:pointer.hasClass("low")?"low":"high";text=this.options.format(value,type)}else text=this.options.format.replace("%s",value);var width=label.html(text).width(),left=position-width/2;left=Math.min(Math.max(left,0),this.options.width-width),label[animate?"animate":"css"]({left:left}),this.setInputValue(pointer,value)},valuesToPrc:function(values){var lowPrc,highPrc;return[100*(parseFloat(values[0])-parseFloat(this.options.from))/this.interval,100*(parseFloat(values[1])-parseFloat(this.options.from))/this.interval]},prcToPx:function(prc){return this.domNode.width()*prc/100},isDecimal:function(){return-1!==(this.options.value+this.options.from+this.options.to).indexOf(".")},positionToValue:function(pos){var value=pos/this.domNode.width()*this.interval;if(value=parseFloat(value,10)+parseFloat(this.options.from,10),this.isDecimal()){var final=Math.round(Math.round(value/this.options.step)*this.options.step*100)/100;if(0!==final)for(-1===(final=""+final).indexOf(".")&&(final+=".");final.length-final.indexOf(".")<3;)final+="0";else final="0.00";return final}return Math.round(value/this.options.step)*this.options.step},setInputValue:function(pointer,v){if(this.isSingle())this.options.value=v.toString();else{var values=this.options.value.split(",");pointer.hasClass("low")?this.options.value=v+","+values[1]:this.options.value=values[0]+","+v}this.inputNode.val()!==this.options.value&&(this.inputNode.val(this.options.value).trigger("change"),this.options.onstatechange.call(this,this.options.value))},getValue:function(){return this.options.value},getOptions:function(){return this.options},getRange:function(){return this.options.from+","+this.options.to},isReadonly:function(){this.domNode.toggleClass("slider-readonly",this.options.disable)},disable:function(){this.options.disable=!0,this.isReadonly()},enable:function(){this.options.disable=!1,this.isReadonly()},toggleDisable:function(){this.options.disable=!this.options.disable,this.isReadonly()},updateRange:function(range,value){var values=range.toString().split(",");if(this.options.from=values[0],this.options.to=values[1],this.interval=parseInt(values[1])-parseInt(values[0]),value?this.setValue(value):this.setValue(this.getValue()),this.options.showScale){for(var len=this.options.scale?this.options.scale.length:2,step=this.interval/(len-1),scale=[],i=0;i<len;i+=1){var value=i*step+parseInt(this.options.from);scale.push(value)}this.options.scale=scale,this.renderScale()}},updateRender:function(data){return 0!==this.inputNode.width()||this.options.width?(this.options.width=this.options.width||this.inputNode.width(),this.domNode.width(this.options.width),this.inputNode.hide(),this.isSingle()&&(this.lowPointer.hide(),this.lowLabel.hide()),this.options.showLabels||this.labels.hide(),this.attachEvents(),this.options.showScale&&this.updateScale(data),void this.setValue(this.options.value)):void console.log("jRange : no width found, returning")},updateScale:function(scale,from,to){for(var t=scale||[from,to],i=Math.round(100/(t.length-1)*10)/10,s="",o=0;o<t.length;o++)s+='<span style="left: '+o*i+'%">'+("|"!=t[o]?"<ins>"+t[o]+"</ins>":"")+"</span>";this.scale.html(s),$("ins",this.scale).each((function(){$(this).css({marginLeft:-$(this).outerWidth()/2})}))}};var pluginName="jRange";$.fn.jRange=function(option){var args=arguments,result;return this.each((function(){var $this=$(this),data=$.data(this,"plugin_jRange"),options="object"==typeof option&&option;data||($this.data("plugin_jRange",data=new jRange(this,options)),$(window).resize((function(){var width=data.domNode.parent().width();data.options.width=width,data.render(),data.setValue(data.getValue())}))),"string"==typeof option&&(result=data[option].apply(data,Array.prototype.slice.call(args,1)))})),result||this}}(jQuery,window,document),
/*!
 * Chart.js v3.5.1
 * https://www.chartjs.org
 * (c) 2021 Chart.js Contributors
 * Released under the MIT License
 */
function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory():"function"==typeof define&&define.amd?define(factory):(global="undefined"!=typeof globalThis?globalThis:global||self).Chart=factory()}(this,(function(){"use strict";function fontString(pixelSize,fontStyle,fontFamily){return fontStyle+" "+pixelSize+"px "+fontFamily}const requestAnimFrame="undefined"==typeof window?function(callback){return callback()}:window.requestAnimationFrame;function throttled(fn,thisArg,updateFn){const updateArgs=updateFn||(args=>Array.prototype.slice.call(args));let ticking=!1,args=[];return function(...rest){args=updateArgs(rest),ticking||(ticking=!0,requestAnimFrame.call(window,()=>{ticking=!1,fn.apply(thisArg,args)}))}}function debounce(fn,delay){let timeout;return function(){return delay?(clearTimeout(timeout),timeout=setTimeout(fn,delay)):fn(),delay}}const _toLeftRightCenter=align=>"start"===align?"left":"end"===align?"right":"center",_alignStartEnd=(align,start,end)=>"start"===align?start:"end"===align?end:(start+end)/2,_textX=(align,left,right,rtl)=>{const check=rtl?"left":"right";return align===check?right:"center"===align?(left+right)/2:left};class Animator{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(chart,anims,date,type){const callbacks=anims.listeners[type],numSteps=anims.duration;callbacks.forEach(fn=>fn({chart:chart,initial:anims.initial,numSteps:numSteps,currentStep:Math.min(date-anims.start,numSteps)}))}_refresh(){const me=this;me._request||(me._running=!0,me._request=requestAnimFrame.call(window,()=>{me._update(),me._request=null,me._running&&me._refresh()}))}_update(date=Date.now()){const me=this;let remaining=0;me._charts.forEach((anims,chart)=>{if(!anims.running||!anims.items.length)return;const items=anims.items;let i=items.length-1,draw=!1,item;for(;i>=0;--i)item=items[i],item._active?(item._total>anims.duration&&(anims.duration=item._total),item.tick(date),draw=!0):(items[i]=items[items.length-1],items.pop());draw&&(chart.draw(),me._notify(chart,anims,date,"progress")),items.length||(anims.running=!1,me._notify(chart,anims,date,"complete"),anims.initial=!1),remaining+=items.length}),me._lastDate=date,0===remaining&&(me._running=!1)}_getAnims(chart){const charts=this._charts;let anims=charts.get(chart);return anims||(anims={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},charts.set(chart,anims)),anims}listen(chart,event,cb){this._getAnims(chart).listeners[event].push(cb)}add(chart,items){items&&items.length&&this._getAnims(chart).items.push(...items)}has(chart){return this._getAnims(chart).items.length>0}start(chart){const anims=this._charts.get(chart);anims&&(anims.running=!0,anims.start=Date.now(),anims.duration=anims.items.reduce((acc,cur)=>Math.max(acc,cur._duration),0),this._refresh())}running(chart){if(!this._running)return!1;const anims=this._charts.get(chart);return!!(anims&&anims.running&&anims.items.length)}stop(chart){const anims=this._charts.get(chart);if(!anims||!anims.items.length)return;const items=anims.items;let i=items.length-1;for(;i>=0;--i)items[i].cancel();anims.items=[],this._notify(chart,anims,Date.now(),"complete")}remove(chart){return this._charts.delete(chart)}}var animator=new Animator;
/*!
     * @kurkle/color v0.1.9
     * https://github.com/kurkle/color#readme
     * (c) 2020 Jukka Kurkela
     * Released under the MIT License
     */const map$1={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},hex="0123456789ABCDEF",h1=b=>hex[15&b],h2=b=>hex[(240&b)>>4]+hex[15&b],eq=b=>(240&b)>>4==(15&b);function isShort(v){return eq(v.r)&&eq(v.g)&&eq(v.b)&&eq(v.a)}function hexParse(str){var len=str.length,ret;return"#"===str[0]&&(4===len||5===len?ret={r:255&17*map$1[str[1]],g:255&17*map$1[str[2]],b:255&17*map$1[str[3]],a:5===len?17*map$1[str[4]]:255}:7!==len&&9!==len||(ret={r:map$1[str[1]]<<4|map$1[str[2]],g:map$1[str[3]]<<4|map$1[str[4]],b:map$1[str[5]]<<4|map$1[str[6]],a:9===len?map$1[str[7]]<<4|map$1[str[8]]:255})),ret}function hexString(v){var f=isShort(v)?h1:h2;return v?"#"+f(v.r)+f(v.g)+f(v.b)+(v.a<255?f(v.a):""):v}function round(v){return v+.5|0}const lim=(v,l,h)=>Math.max(Math.min(v,h),l);function p2b(v){return lim(round(2.55*v),0,255)}function n2b(v){return lim(round(255*v),0,255)}function b2n(v){return lim(round(v/2.55)/100,0,1)}function n2p(v){return lim(round(100*v),0,100)}const RGB_RE=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rgbParse(str){const m=RGB_RE.exec(str);let a=255,r,g,b;if(m){if(m[7]!==r){const v=+m[7];a=255&(m[8]?p2b(v):255*v)}return r=+m[1],g=+m[3],b=+m[5],r=255&(m[2]?p2b(r):r),g=255&(m[4]?p2b(g):g),b=255&(m[6]?p2b(b):b),{r:r,g:g,b:b,a:a}}}function rgbString(v){return v&&(v.a<255?`rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`:`rgb(${v.r}, ${v.g}, ${v.b})`)}const HUE_RE=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hsl2rgbn(h,s,l){const a=s*Math.min(l,1-l),f=(n,k=(n+h/30)%12)=>l-a*Math.max(Math.min(k-3,9-k,1),-1);return[f(0),f(8),f(4)]}function hsv2rgbn(h,s,v){const f=(n,k=(n+h/60)%6)=>v-v*s*Math.max(Math.min(k,4-k,1),0);return[f(5),f(3),f(1)]}function hwb2rgbn(h,w,b){const rgb=hsl2rgbn(h,1,.5);let i;for(w+b>1&&(i=1/(w+b),w*=i,b*=i),i=0;i<3;i++)rgb[i]*=1-w-b,rgb[i]+=w;return rgb}function rgb2hsl(v){const range=255,r=v.r/255,g=v.g/255,b=v.b/255,max=Math.max(r,g,b),min=Math.min(r,g,b),l=(max+min)/2;let h,s,d;return max!==min&&(d=max-min,s=l>.5?d/(2-max-min):d/(max+min),h=max===r?(g-b)/d+(g<b?6:0):max===g?(b-r)/d+2:(r-g)/d+4,h=60*h+.5),[0|h,s||0,l]}function calln(f,a,b,c){return(Array.isArray(a)?f(a[0],a[1],a[2]):f(a,b,c)).map(n2b)}function hsl2rgb(h,s,l){return calln(hsl2rgbn,h,s,l)}function hwb2rgb(h,w,b){return calln(hwb2rgbn,h,w,b)}function hsv2rgb(h,s,v){return calln(hsv2rgbn,h,s,v)}function hue(h){return(h%360+360)%360}function hueParse(str){const m=HUE_RE.exec(str);let a=255,v;if(!m)return;m[5]!==v&&(a=m[6]?p2b(+m[5]):n2b(+m[5]));const h=hue(+m[2]),p1=+m[3]/100,p2=+m[4]/100;return v="hwb"===m[1]?hwb2rgb(h,p1,p2):"hsv"===m[1]?hsv2rgb(h,p1,p2):hsl2rgb(h,p1,p2),{r:v[0],g:v[1],b:v[2],a:a}}function rotate(v,deg){var h=rgb2hsl(v);h[0]=hue(h[0]+deg),h=hsl2rgb(h),v.r=h[0],v.g=h[1],v.b=h[2]}function hslString(v){if(!v)return;const a=rgb2hsl(v),h=a[0],s=n2p(a[1]),l=n2p(a[2]);return v.a<255?`hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`:`hsl(${h}, ${s}%, ${l}%)`}const map$1$1={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"},names={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 unpack(){const unpacked={},keys=Object.keys(names),tkeys=Object.keys(map$1$1);let i,j,k,ok,nk;for(i=0;i<keys.length;i++){for(ok=nk=keys[i],j=0;j<tkeys.length;j++)k=tkeys[j],nk=nk.replace(k,map$1$1[k]);k=parseInt(names[ok],16),unpacked[nk]=[k>>16&255,k>>8&255,255&k]}return unpacked}let names$1;function nameParse(str){names$1||(names$1=unpack(),names$1.transparent=[0,0,0,0]);const a=names$1[str.toLowerCase()];return a&&{r:a[0],g:a[1],b:a[2],a:4===a.length?a[3]:255}}function modHSL(v,i,ratio){if(v){let tmp=rgb2hsl(v);tmp[i]=Math.max(0,Math.min(tmp[i]+tmp[i]*ratio,0===i?360:1)),tmp=hsl2rgb(tmp),v.r=tmp[0],v.g=tmp[1],v.b=tmp[2]}}function clone$1(v,proto){return v?Object.assign(proto||{},v):v}function fromObject(input){var v={r:0,g:0,b:0,a:255};return Array.isArray(input)?input.length>=3&&(v={r:input[0],g:input[1],b:input[2],a:255},input.length>3&&(v.a=n2b(input[3]))):(v=clone$1(input,{r:0,g:0,b:0,a:1})).a=n2b(v.a),v}function functionParse(str){return"r"===str.charAt(0)?rgbParse(str):hueParse(str)}class Color{constructor(input){if(input instanceof Color)return input;const type=typeof input;let v;"object"===type?v=fromObject(input):"string"===type&&(v=hexParse(input)||nameParse(input)||functionParse(input)),this._rgb=v,this._valid=!!v}get valid(){return this._valid}get rgb(){var v=clone$1(this._rgb);return v&&(v.a=b2n(v.a)),v}set rgb(obj){this._rgb=fromObject(obj)}rgbString(){return this._valid?rgbString(this._rgb):this._rgb}hexString(){return this._valid?hexString(this._rgb):this._rgb}hslString(){return this._valid?hslString(this._rgb):this._rgb}mix(color,weight){const me=this;if(color){const c1=me.rgb,c2=color.rgb;let w2;const p=weight===w2?.5:weight,w=2*p-1,a=c1.a-c2.a,w1=((w*a==-1?w:(w+a)/(1+w*a))+1)/2;w2=1-w1,c1.r=255&w1*c1.r+w2*c2.r+.5,c1.g=255&w1*c1.g+w2*c2.g+.5,c1.b=255&w1*c1.b+w2*c2.b+.5,c1.a=p*c1.a+(1-p)*c2.a,me.rgb=c1}return me}clone(){return new Color(this.rgb)}alpha(a){return this._rgb.a=n2b(a),this}clearer(ratio){const rgb=this._rgb;return rgb.a*=1-ratio,this}greyscale(){const rgb=this._rgb,val=round(.3*rgb.r+.59*rgb.g+.11*rgb.b);return rgb.r=rgb.g=rgb.b=val,this}opaquer(ratio){const rgb=this._rgb;return rgb.a*=1+ratio,this}negate(){const v=this._rgb;return v.r=255-v.r,v.g=255-v.g,v.b=255-v.b,this}lighten(ratio){return modHSL(this._rgb,2,ratio),this}darken(ratio){return modHSL(this._rgb,2,-ratio),this}saturate(ratio){return modHSL(this._rgb,1,ratio),this}desaturate(ratio){return modHSL(this._rgb,1,-ratio),this}rotate(deg){return rotate(this._rgb,deg),this}}function index_esm(input){return new Color(input)}const isPatternOrGradient=value=>value instanceof CanvasGradient||value instanceof CanvasPattern;function color(value){return isPatternOrGradient(value)?value:index_esm(value)}function getHoverColor(value){return isPatternOrGradient(value)?value:index_esm(value).saturate(.5).darken(.1).hexString()}function noop(){}const uid=function(){let id=0;return function(){return id++}}();function isNullOrUndef(value){return null==value}function isArray(value){if(Array.isArray&&Array.isArray(value))return!0;const type=Object.prototype.toString.call(value);return"[object"===type.substr(0,7)&&"Array]"===type.substr(-6)}function isObject(value){return null!==value&&"[object Object]"===Object.prototype.toString.call(value)}const isNumberFinite=value=>("number"==typeof value||value instanceof Number)&&isFinite(+value);function finiteOrDefault(value,defaultValue){return isNumberFinite(value)?value:defaultValue}function valueOrDefault(value,defaultValue){return void 0===value?defaultValue:value}const toPercentage=(value,dimension)=>"string"==typeof value&&value.endsWith("%")?parseFloat(value)/100:value/dimension,toDimension=(value,dimension)=>"string"==typeof value&&value.endsWith("%")?parseFloat(value)/100*dimension:+value;function callback(fn,args,thisArg){if(fn&&"function"==typeof fn.call)return fn.apply(thisArg,args)}function each(loopable,fn,thisArg,reverse){let i,len,keys;if(isArray(loopable))if(len=loopable.length,reverse)for(i=len-1;i>=0;i--)fn.call(thisArg,loopable[i],i);else for(i=0;i<len;i++)fn.call(thisArg,loopable[i],i);else if(isObject(loopable))for(keys=Object.keys(loopable),len=keys.length,i=0;i<len;i++)fn.call(thisArg,loopable[keys[i]],keys[i])}function _elementsEqual(a0,a1){let i,ilen,v0,v1;if(!a0||!a1||a0.length!==a1.length)return!1;for(i=0,ilen=a0.length;i<ilen;++i)if(v0=a0[i],v1=a1[i],v0.datasetIndex!==v1.datasetIndex||v0.index!==v1.index)return!1;return!0}function clone(source){if(isArray(source))return source.map(clone);if(isObject(source)){const target=Object.create(null),keys=Object.keys(source),klen=keys.length;let k=0;for(;k<klen;++k)target[keys[k]]=clone(source[keys[k]]);return target}return source}function isValidKey(key){return-1===["__proto__","prototype","constructor"].indexOf(key)}function _merger(key,target,source,options){if(!isValidKey(key))return;const tval=target[key],sval=source[key];isObject(tval)&&isObject(sval)?merge(tval,sval,options):target[key]=clone(sval)}function merge(target,source,options){const sources=isArray(source)?source:[source],ilen=sources.length;if(!isObject(target))return target;const merger=(options=options||{}).merger||_merger;for(let i=0;i<ilen;++i){if(!isObject(source=sources[i]))continue;const keys=Object.keys(source);for(let k=0,klen=keys.length;k<klen;++k)merger(keys[k],target,source,options)}return target}function mergeIf(target,source){return merge(target,source,{merger:_mergerIf})}function _mergerIf(key,target,source){if(!isValidKey(key))return;const tval=target[key],sval=source[key];isObject(tval)&&isObject(sval)?mergeIf(tval,sval):Object.prototype.hasOwnProperty.call(target,key)||(target[key]=clone(sval))}function _deprecated(scope,value,previous,current){void 0!==value&&console.warn(scope+': "'+previous+'" is deprecated. Please use "'+current+'" instead')}const emptyString="",dot=".";function indexOfDotOrLength(key,start){const idx=key.indexOf(".",start);return-1===idx?key.length:idx}function resolveObjectKey(obj,key){if(""===key)return obj;let pos=0,idx=indexOfDotOrLength(key,pos);for(;obj&&idx>pos;)obj=obj[key.substr(pos,idx-pos)],pos=idx+1,idx=indexOfDotOrLength(key,pos);return obj}function _capitalize(str){return str.charAt(0).toUpperCase()+str.slice(1)}const defined=value=>void 0!==value,isFunction=value=>"function"==typeof value,setsEqual=(a,b)=>{if(a.size!==b.size)return!1;for(const item of a)if(!b.has(item))return!1;return!0},overrides=Object.create(null),descriptors=Object.create(null);function getScope$1(node,key){if(!key)return node;const keys=key.split(".");for(let i=0,n=keys.length;i<n;++i){const k=keys[i];node=node[k]||(node[k]=Object.create(null))}return node}function set(root,scope,values){return"string"==typeof scope?merge(getScope$1(root,scope),values):merge(getScope$1(root,""),scope)}class Defaults{constructor(_descriptors){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=context=>context.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=(ctx,options)=>getHoverColor(options.backgroundColor),this.hoverBorderColor=(ctx,options)=>getHoverColor(options.borderColor),this.hoverColor=(ctx,options)=>getHoverColor(options.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(_descriptors)}set(scope,values){return set(this,scope,values)}get(scope){return getScope$1(this,scope)}describe(scope,values){return set(descriptors,scope,values)}override(scope,values){return set(overrides,scope,values)}route(scope,name,targetScope,targetName){const scopeObject=getScope$1(this,scope),targetScopeObject=getScope$1(this,targetScope),privateName="_"+name;Object.defineProperties(scopeObject,{[privateName]:{value:scopeObject[name],writable:!0},[name]:{enumerable:!0,get(){const local=this[privateName],target=targetScopeObject[targetName];return isObject(local)?Object.assign({},target,local):valueOrDefault(local,target)},set(value){this[privateName]=value}}})}}var defaults=new Defaults({_scriptable:name=>!name.startsWith("on"),_indexable:name=>"events"!==name,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});const PI=Math.PI,TAU=2*PI,PITAU=TAU+PI,INFINITY=Number.POSITIVE_INFINITY,RAD_PER_DEG=PI/180,HALF_PI=PI/2,QUARTER_PI=PI/4,TWO_THIRDS_PI=2*PI/3,log10=Math.log10,sign=Math.sign;function niceNum(range){const roundedRange=Math.round(range);range=almostEquals(range,roundedRange,range/1e3)?roundedRange:range;const niceRange=Math.pow(10,Math.floor(log10(range))),fraction=range/niceRange,niceFraction=fraction<=1?1:fraction<=2?2:fraction<=5?5:10;return niceFraction*niceRange}function _factorize(value){const result=[],sqrt=Math.sqrt(value);let i;for(i=1;i<sqrt;i++)value%i==0&&(result.push(i),result.push(value/i));return sqrt===(0|sqrt)&&result.push(sqrt),result.sort((a,b)=>a-b).pop(),result}function isNumber(n){return!isNaN(parseFloat(n))&&isFinite(n)}function almostEquals(x,y,epsilon){return Math.abs(x-y)<epsilon}function almostWhole(x,epsilon){const rounded=Math.round(x);return rounded-epsilon<=x&&rounded+epsilon>=x}function _setMinAndMaxByKey(array,target,property){let i,ilen,value;for(i=0,ilen=array.length;i<ilen;i++)value=array[i][property],isNaN(value)||(target.min=Math.min(target.min,value),target.max=Math.max(target.max,value))}function toRadians(degrees){return degrees*(PI/180)}function toDegrees(radians){return radians*(180/PI)}function _decimalPlaces(x){if(!isNumberFinite(x))return;let e=1,p=0;for(;Math.round(x*e)/e!==x;)e*=10,p++;return p}function getAngleFromPoint(centrePoint,anglePoint){const distanceFromXCenter=anglePoint.x-centrePoint.x,distanceFromYCenter=anglePoint.y-centrePoint.y,radialDistanceFromCenter=Math.sqrt(distanceFromXCenter*distanceFromXCenter+distanceFromYCenter*distanceFromYCenter);let angle=Math.atan2(distanceFromYCenter,distanceFromXCenter);return angle<-.5*PI&&(angle+=TAU),{angle:angle,distance:radialDistanceFromCenter}}function distanceBetweenPoints(pt1,pt2){return Math.sqrt(Math.pow(pt2.x-pt1.x,2)+Math.pow(pt2.y-pt1.y,2))}function _angleDiff(a,b){return(a-b+PITAU)%TAU-PI}function _normalizeAngle(a){return(a%TAU+TAU)%TAU}function _angleBetween(angle,start,end,sameAngleIsFullCircle){const a=_normalizeAngle(angle),s=_normalizeAngle(start),e=_normalizeAngle(end),angleToStart=_normalizeAngle(s-a),angleToEnd=_normalizeAngle(e-a),startToAngle=_normalizeAngle(a-s),endToAngle=_normalizeAngle(a-e);return a===s||a===e||sameAngleIsFullCircle&&s===e||angleToStart>angleToEnd&&startToAngle<endToAngle}function _limitValue(value,min,max){return Math.max(min,Math.min(max,value))}function _int16Range(value){return _limitValue(value,-32768,32767)}function toFontString(font){return!font||isNullOrUndef(font.size)||isNullOrUndef(font.family)?null:(font.style?font.style+" ":"")+(font.weight?font.weight+" ":"")+font.size+"px "+font.family}function _measureText(ctx,data,gc,longest,string){let textWidth=data[string];return textWidth||(textWidth=data[string]=ctx.measureText(string).width,gc.push(string)),textWidth>longest&&(longest=textWidth),longest}function _longestText(ctx,font,arrayOfThings,cache){let data=(cache=cache||{}).data=cache.data||{},gc=cache.garbageCollect=cache.garbageCollect||[];cache.font!==font&&(data=cache.data={},gc=cache.garbageCollect=[],cache.font=font),ctx.save(),ctx.font=font;let longest=0;const ilen=arrayOfThings.length;let i,j,jlen,thing,nestedThing;for(i=0;i<ilen;i++)if(thing=arrayOfThings[i],null!=thing&&!0!==isArray(thing))longest=_measureText(ctx,data,gc,longest,thing);else if(isArray(thing))for(j=0,jlen=thing.length;j<jlen;j++)nestedThing=thing[j],null==nestedThing||isArray(nestedThing)||(longest=_measureText(ctx,data,gc,longest,nestedThing));ctx.restore();const gcLen=gc.length/2;if(gcLen>arrayOfThings.length){for(i=0;i<gcLen;i++)delete data[gc[i]];gc.splice(0,gcLen)}return longest}function _alignPixel(chart,pixel,width){const devicePixelRatio=chart.currentDevicePixelRatio,halfWidth=0!==width?Math.max(width/2,.5):0;return Math.round((pixel-halfWidth)*devicePixelRatio)/devicePixelRatio+halfWidth}function clearCanvas(canvas,ctx){(ctx=ctx||canvas.getContext("2d")).save(),ctx.resetTransform(),ctx.clearRect(0,0,canvas.width,canvas.height),ctx.restore()}function drawPoint(ctx,options,x,y){let type,xOffset,yOffset,size,cornerRadius;const style=options.pointStyle,rotation=options.rotation,radius=options.radius;let rad=(rotation||0)*RAD_PER_DEG;if(style&&"object"==typeof style&&(type=style.toString(),"[object HTMLImageElement]"===type||"[object HTMLCanvasElement]"===type))return ctx.save(),ctx.translate(x,y),ctx.rotate(rad),ctx.drawImage(style,-style.width/2,-style.height/2,style.width,style.height),void ctx.restore();if(!(isNaN(radius)||radius<=0)){switch(ctx.beginPath(),style){default:ctx.arc(x,y,radius,0,TAU),ctx.closePath();break;case"triangle":ctx.moveTo(x+Math.sin(rad)*radius,y-Math.cos(rad)*radius),rad+=TWO_THIRDS_PI,ctx.lineTo(x+Math.sin(rad)*radius,y-Math.cos(rad)*radius),rad+=TWO_THIRDS_PI,ctx.lineTo(x+Math.sin(rad)*radius,y-Math.cos(rad)*radius),ctx.closePath();break;case"rectRounded":cornerRadius=.516*radius,size=radius-cornerRadius,xOffset=Math.cos(rad+QUARTER_PI)*size,yOffset=Math.sin(rad+QUARTER_PI)*size,ctx.arc(x-xOffset,y-yOffset,cornerRadius,rad-PI,rad-HALF_PI),ctx.arc(x+yOffset,y-xOffset,cornerRadius,rad-HALF_PI,rad),ctx.arc(x+xOffset,y+yOffset,cornerRadius,rad,rad+HALF_PI),ctx.arc(x-yOffset,y+xOffset,cornerRadius,rad+HALF_PI,rad+PI),ctx.closePath();break;case"rect":if(!rotation){size=Math.SQRT1_2*radius,ctx.rect(x-size,y-size,2*size,2*size);break}rad+=QUARTER_PI;case"rectRot":xOffset=Math.cos(rad)*radius,yOffset=Math.sin(rad)*radius,ctx.moveTo(x-xOffset,y-yOffset),ctx.lineTo(x+yOffset,y-xOffset),ctx.lineTo(x+xOffset,y+yOffset),ctx.lineTo(x-yOffset,y+xOffset),ctx.closePath();break;case"crossRot":rad+=QUARTER_PI;case"cross":xOffset=Math.cos(rad)*radius,yOffset=Math.sin(rad)*radius,ctx.moveTo(x-xOffset,y-yOffset),ctx.lineTo(x+xOffset,y+yOffset),ctx.moveTo(x+yOffset,y-xOffset),ctx.lineTo(x-yOffset,y+xOffset);break;case"star":xOffset=Math.cos(rad)*radius,yOffset=Math.sin(rad)*radius,ctx.moveTo(x-xOffset,y-yOffset),ctx.lineTo(x+xOffset,y+yOffset),ctx.moveTo(x+yOffset,y-xOffset),ctx.lineTo(x-yOffset,y+xOffset),rad+=QUARTER_PI,xOffset=Math.cos(rad)*radius,yOffset=Math.sin(rad)*radius,ctx.moveTo(x-xOffset,y-yOffset),ctx.lineTo(x+xOffset,y+yOffset),ctx.moveTo(x+yOffset,y-xOffset),ctx.lineTo(x-yOffset,y+xOffset);break;case"line":xOffset=Math.cos(rad)*radius,yOffset=Math.sin(rad)*radius,ctx.moveTo(x-xOffset,y-yOffset),ctx.lineTo(x+xOffset,y+yOffset);break;case"dash":ctx.moveTo(x,y),ctx.lineTo(x+Math.cos(rad)*radius,y+Math.sin(rad)*radius)}ctx.fill(),options.borderWidth>0&&ctx.stroke()}}function _isPointInArea(point,area,margin){return margin=margin||.5,!area||point&&point.x>area.left-margin&&point.x<area.right+margin&&point.y>area.top-margin&&point.y<area.bottom+margin}function clipArea(ctx,area){ctx.save(),ctx.beginPath(),ctx.rect(area.left,area.top,area.right-area.left,area.bottom-area.top),ctx.clip()}function unclipArea(ctx){ctx.restore()}function _steppedLineTo(ctx,previous,target,flip,mode){if(!previous)return ctx.lineTo(target.x,target.y);if("middle"===mode){const midpoint=(previous.x+target.x)/2;ctx.lineTo(midpoint,previous.y),ctx.lineTo(midpoint,target.y)}else"after"===mode!=!!flip?ctx.lineTo(previous.x,target.y):ctx.lineTo(target.x,previous.y);ctx.lineTo(target.x,target.y)}function _bezierCurveTo(ctx,previous,target,flip){if(!previous)return ctx.lineTo(target.x,target.y);ctx.bezierCurveTo(flip?previous.cp1x:previous.cp2x,flip?previous.cp1y:previous.cp2y,flip?target.cp2x:target.cp1x,flip?target.cp2y:target.cp1y,target.x,target.y)}function renderText(ctx,text,x,y,font,opts={}){const lines=isArray(text)?text:[text],stroke=opts.strokeWidth>0&&""!==opts.strokeColor;let i,line;for(ctx.save(),ctx.font=font.string,setRenderOpts(ctx,opts),i=0;i<lines.length;++i)line=lines[i],stroke&&(opts.strokeColor&&(ctx.strokeStyle=opts.strokeColor),isNullOrUndef(opts.strokeWidth)||(ctx.lineWidth=opts.strokeWidth),ctx.strokeText(line,x,y,opts.maxWidth)),ctx.fillText(line,x,y,opts.maxWidth),decorateText(ctx,x,y,line,opts),y+=font.lineHeight;ctx.restore()}function setRenderOpts(ctx,opts){opts.translation&&ctx.translate(opts.translation[0],opts.translation[1]),isNullOrUndef(opts.rotation)||ctx.rotate(opts.rotation),opts.color&&(ctx.fillStyle=opts.color),opts.textAlign&&(ctx.textAlign=opts.textAlign),opts.textBaseline&&(ctx.textBaseline=opts.textBaseline)}function decorateText(ctx,x,y,line,opts){if(opts.strikethrough||opts.underline){const metrics=ctx.measureText(line),left=x-metrics.actualBoundingBoxLeft,right=x+metrics.actualBoundingBoxRight,top=y-metrics.actualBoundingBoxAscent,bottom=y+metrics.actualBoundingBoxDescent,yDecoration=opts.strikethrough?(top+bottom)/2:bottom;ctx.strokeStyle=ctx.fillStyle,ctx.beginPath(),ctx.lineWidth=opts.decorationWidth||2,ctx.moveTo(left,yDecoration),ctx.lineTo(right,yDecoration),ctx.stroke()}}function addRoundedRectPath(ctx,rect){const{x:x,y:y,w:w,h:h,radius:radius}=rect;ctx.arc(x+radius.topLeft,y+radius.topLeft,radius.topLeft,-HALF_PI,PI,!0),ctx.lineTo(x,y+h-radius.bottomLeft),ctx.arc(x+radius.bottomLeft,y+h-radius.bottomLeft,radius.bottomLeft,PI,HALF_PI,!0),ctx.lineTo(x+w-radius.bottomRight,y+h),ctx.arc(x+w-radius.bottomRight,y+h-radius.bottomRight,radius.bottomRight,HALF_PI,0,!0),ctx.lineTo(x+w,y+radius.topRight),ctx.arc(x+w-radius.topRight,y+radius.topRight,radius.topRight,0,-HALF_PI,!0),ctx.lineTo(x+radius.topLeft,y)}function _lookup(table,value,cmp){cmp=cmp||(index=>table[index]<value);let hi=table.length-1,lo=0,mid;for(;hi-lo>1;)mid=lo+hi>>1,cmp(mid)?lo=mid:hi=mid;return{lo:lo,hi:hi}}const _lookupByKey=(table,key,value)=>_lookup(table,value,index=>table[index][key]<value),_rlookupByKey=(table,key,value)=>_lookup(table,value,index=>table[index][key]>=value);function _filterBetween(values,min,max){let start=0,end=values.length;for(;start<end&&values[start]<min;)start++;for(;end>start&&values[end-1]>max;)end--;return start>0||end<values.length?values.slice(start,end):values}const arrayEvents=["push","pop","shift","splice","unshift"];function listenArrayEvents(array,listener){array._chartjs?array._chartjs.listeners.push(listener):(Object.defineProperty(array,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[listener]}}),arrayEvents.forEach(key=>{const method="_onData"+_capitalize(key),base=array[key];Object.defineProperty(array,key,{configurable:!0,enumerable:!1,value(...args){const res=base.apply(this,args);return array._chartjs.listeners.forEach(object=>{"function"==typeof object[method]&&object[method](...args)}),res}})}))}function unlistenArrayEvents(array,listener){const stub=array._chartjs;if(!stub)return;const listeners=stub.listeners,index=listeners.indexOf(listener);-1!==index&&listeners.splice(index,1),listeners.length>0||(arrayEvents.forEach(key=>{delete array[key]}),delete array._chartjs)}function _arrayUnique(items){const set=new Set;let i,ilen;for(i=0,ilen=items.length;i<ilen;++i)set.add(items[i]);return set.size===ilen?items:Array.from(set)}function _isDomSupported(){return"undefined"!=typeof window&&"undefined"!=typeof document}function _getParentNode(domNode){let parent=domNode.parentNode;return parent&&"[object ShadowRoot]"===parent.toString()&&(parent=parent.host),parent}function parseMaxStyle(styleValue,node,parentProperty){let valueInPixels;return"string"==typeof styleValue?(valueInPixels=parseInt(styleValue,10),-1!==styleValue.indexOf("%")&&(valueInPixels=valueInPixels/100*node.parentNode[parentProperty])):valueInPixels=styleValue,valueInPixels}const getComputedStyle=element=>window.getComputedStyle(element,null);function getStyle(el,property){return getComputedStyle(el).getPropertyValue(property)}const positions=["top","right","bottom","left"];function getPositionedStyle(styles,style,suffix){const result={};suffix=suffix?"-"+suffix:"";for(let i=0;i<4;i++){const pos=positions[i];result[pos]=parseFloat(styles[style+"-"+pos+suffix])||0}return result.width=result.left+result.right,result.height=result.top+result.bottom,result}const useOffsetPos=(x,y,target)=>(x>0||y>0)&&(!target||!target.shadowRoot);function getCanvasPosition(evt,canvas){const e=evt.native||evt,touches=e.touches,source=touches&&touches.length?touches[0]:e,{offsetX:offsetX,offsetY:offsetY}=source;let box=!1,x,y;if(useOffsetPos(offsetX,offsetY,e.target))x=offsetX,y=offsetY;else{const rect=canvas.getBoundingClientRect();x=source.clientX-rect.left,y=source.clientY-rect.top,box=!0}return{x:x,y:y,box:box}}function getRelativePosition$1(evt,chart){const{canvas:canvas,currentDevicePixelRatio:currentDevicePixelRatio}=chart,style=getComputedStyle(canvas),borderBox="border-box"===style.boxSizing,paddings=getPositionedStyle(style,"padding"),borders=getPositionedStyle(style,"border","width"),{x:x,y:y,box:box}=getCanvasPosition(evt,canvas),xOffset=paddings.left+(box&&borders.left),yOffset=paddings.top+(box&&borders.top);let{width:width,height:height}=chart;return borderBox&&(width-=paddings.width+borders.width,height-=paddings.height+borders.height),{x:Math.round((x-xOffset)/width*canvas.width/currentDevicePixelRatio),y:Math.round((y-yOffset)/height*canvas.height/currentDevicePixelRatio)}}function getContainerSize(canvas,width,height){let maxWidth,maxHeight;if(void 0===width||void 0===height){const container=_getParentNode(canvas);if(container){const rect=container.getBoundingClientRect(),containerStyle=getComputedStyle(container),containerBorder=getPositionedStyle(containerStyle,"border","width"),containerPadding=getPositionedStyle(containerStyle,"padding");width=rect.width-containerPadding.width-containerBorder.width,height=rect.height-containerPadding.height-containerBorder.height,maxWidth=parseMaxStyle(containerStyle.maxWidth,container,"clientWidth"),maxHeight=parseMaxStyle(containerStyle.maxHeight,container,"clientHeight")}else width=canvas.clientWidth,height=canvas.clientHeight}return{width:width,height:height,maxWidth:maxWidth||INFINITY,maxHeight:maxHeight||INFINITY}}const round1=v=>Math.round(10*v)/10;function getMaximumSize(canvas,bbWidth,bbHeight,aspectRatio){const style=getComputedStyle(canvas),margins=getPositionedStyle(style,"margin"),maxWidth=parseMaxStyle(style.maxWidth,canvas,"clientWidth")||INFINITY,maxHeight=parseMaxStyle(style.maxHeight,canvas,"clientHeight")||INFINITY,containerSize=getContainerSize(canvas,bbWidth,bbHeight);let{width:width,height:height}=containerSize;if("content-box"===style.boxSizing){const borders=getPositionedStyle(style,"border","width"),paddings=getPositionedStyle(style,"padding");width-=paddings.width+borders.width,height-=paddings.height+borders.height}return width=Math.max(0,width-margins.width),height=Math.max(0,aspectRatio?Math.floor(width/aspectRatio):height-margins.height),width=round1(Math.min(width,maxWidth,containerSize.maxWidth)),height=round1(Math.min(height,maxHeight,containerSize.maxHeight)),width&&!height&&(height=round1(width/2)),{width:width,height:height}}function retinaScale(chart,forceRatio,forceStyle){const pixelRatio=forceRatio||1,deviceHeight=Math.floor(chart.height*pixelRatio),deviceWidth=Math.floor(chart.width*pixelRatio);chart.height=deviceHeight/pixelRatio,chart.width=deviceWidth/pixelRatio;const canvas=chart.canvas;return canvas.style&&(forceStyle||!canvas.style.height&&!canvas.style.width)&&(canvas.style.height=`${chart.height}px`,canvas.style.width=`${chart.width}px`),(chart.currentDevicePixelRatio!==pixelRatio||canvas.height!==deviceHeight||canvas.width!==deviceWidth)&&(chart.currentDevicePixelRatio=pixelRatio,canvas.height=deviceHeight,canvas.width=deviceWidth,chart.ctx.setTransform(pixelRatio,0,0,pixelRatio,0,0),!0)}const supportsEventListenerOptions=function(){let passiveSupported=!1;try{const options={get passive(){return passiveSupported=!0,!1}};window.addEventListener("test",null,options),window.removeEventListener("test",null,options)}catch(e){}return passiveSupported}();function readUsedSize(element,property){const value=getStyle(element,property),matches=value&&value.match(/^(\d+)(\.\d+)?px$/);return matches?+matches[1]:void 0}function getRelativePosition(e,chart){return"native"in e?{x:e.x,y:e.y}:getRelativePosition$1(e,chart)}function evaluateAllVisibleItems(chart,handler){const metasets=chart.getSortedVisibleDatasetMetas();let index,data,element;for(let i=0,ilen=metasets.length;i<ilen;++i){({index:index,data:data}=metasets[i]);for(let j=0,jlen=data.length;j<jlen;++j)element=data[j],element.skip||handler(element,index,j)}}function binarySearch(metaset,axis,value,intersect){const{controller:controller,data:data,_sorted:_sorted}=metaset,iScale=controller._cachedMeta.iScale;if(iScale&&axis===iScale.axis&&_sorted&&data.length){const lookupMethod=iScale._reversePixels?_rlookupByKey:_lookupByKey;if(!intersect)return lookupMethod(data,axis,value);if(controller._sharedOptions){const el=data[0],range="function"==typeof el.getRange&&el.getRange(axis);if(range){const start=lookupMethod(data,axis,value-range),end=lookupMethod(data,axis,value+range);return{lo:start.lo,hi:end.hi}}}}return{lo:0,hi:data.length-1}}function optimizedEvaluateItems(chart,axis,position,handler,intersect){const metasets=chart.getSortedVisibleDatasetMetas(),value=position[axis];for(let i=0,ilen=metasets.length;i<ilen;++i){const{index:index,data:data}=metasets[i],{lo:lo,hi:hi}=binarySearch(metasets[i],axis,value,intersect);for(let j=lo;j<=hi;++j){const element=data[j];element.skip||handler(element,index,j)}}}function getDistanceMetricForAxis(axis){const useX=-1!==axis.indexOf("x"),useY=-1!==axis.indexOf("y");return function(pt1,pt2){const deltaX=useX?Math.abs(pt1.x-pt2.x):0,deltaY=useY?Math.abs(pt1.y-pt2.y):0;return Math.sqrt(Math.pow(deltaX,2)+Math.pow(deltaY,2))}}function getIntersectItems(chart,position,axis,useFinalPosition){const items=[];if(!_isPointInArea(position,chart.chartArea,chart._minPadding))return items;const evaluationFunc=function(element,datasetIndex,index){element.inRange(position.x,position.y,useFinalPosition)&&items.push({element:element,datasetIndex:datasetIndex,index:index})};return optimizedEvaluateItems(chart,axis,position,evaluationFunc,!0),items}function getNearestItems(chart,position,axis,intersect,useFinalPosition){const distanceMetric=getDistanceMetricForAxis(axis);let minDistance=Number.POSITIVE_INFINITY,items=[];if(!_isPointInArea(position,chart.chartArea,chart._minPadding))return items;const evaluationFunc=function(element,datasetIndex,index){if(intersect&&!element.inRange(position.x,position.y,useFinalPosition))return;const center=element.getCenterPoint(useFinalPosition);if(!_isPointInArea(center,chart.chartArea,chart._minPadding)&&!element.inRange(position.x,position.y,useFinalPosition))return;const distance=distanceMetric(position,center);distance<minDistance?(items=[{element:element,datasetIndex:datasetIndex,index:index}],minDistance=distance):distance===minDistance&&items.push({element:element,datasetIndex:datasetIndex,index:index})};return optimizedEvaluateItems(chart,axis,position,evaluationFunc),items}function getAxisItems(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),items=[],axis=options.axis,rangeMethod="x"===axis?"inXRange":"inYRange";let intersectsItem=!1;return evaluateAllVisibleItems(chart,(element,datasetIndex,index)=>{element[rangeMethod](position[axis],useFinalPosition)&&items.push({element:element,datasetIndex:datasetIndex,index:index}),element.inRange(position.x,position.y,useFinalPosition)&&(intersectsItem=!0)}),options.intersect&&!intersectsItem?[]:items}var Interaction={modes:{index(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"x",items=options.intersect?getIntersectItems(chart,position,axis,useFinalPosition):getNearestItems(chart,position,axis,!1,useFinalPosition),elements=[];return items.length?(chart.getSortedVisibleDatasetMetas().forEach(meta=>{const index=items[0].index,element=meta.data[index];element&&!element.skip&&elements.push({element:element,datasetIndex:meta.index,index:index})}),elements):[]},dataset(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"xy";let items=options.intersect?getIntersectItems(chart,position,axis,useFinalPosition):getNearestItems(chart,position,axis,!1,useFinalPosition);if(items.length>0){const datasetIndex=items[0].datasetIndex,data=chart.getDatasetMeta(datasetIndex).data;items=[];for(let i=0;i<data.length;++i)items.push({element:data[i],datasetIndex:datasetIndex,index:i})}return items},point(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"xy";return getIntersectItems(chart,position,axis,useFinalPosition)},nearest(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"xy";return getNearestItems(chart,position,axis,options.intersect,useFinalPosition)},x:(chart,e,options,useFinalPosition)=>(options.axis="x",getAxisItems(chart,e,options,useFinalPosition)),y:(chart,e,options,useFinalPosition)=>(options.axis="y",getAxisItems(chart,e,options,useFinalPosition))}};const LINE_HEIGHT=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),FONT_STYLE=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function toLineHeight(value,size){const matches=(""+value).match(LINE_HEIGHT);if(!matches||"normal"===matches[1])return 1.2*size;switch(value=+matches[2],matches[3]){case"px":return value;case"%":value/=100}return size*value}const numberOrZero$1=v=>+v||0;function _readValueToProps(value,props){const ret={},objProps=isObject(props),keys=objProps?Object.keys(props):props,read=isObject(value)?objProps?prop=>valueOrDefault(value[prop],value[props[prop]]):prop=>value[prop]:()=>value;for(const prop of keys)ret[prop]=numberOrZero$1(read(prop));return ret}function toTRBL(value){return _readValueToProps(value,{top:"y",right:"x",bottom:"y",left:"x"})}function toTRBLCorners(value){return _readValueToProps(value,["topLeft","topRight","bottomLeft","bottomRight"])}function toPadding(value){const obj=toTRBL(value);return obj.width=obj.left+obj.right,obj.height=obj.top+obj.bottom,obj}function toFont(options,fallback){options=options||{},fallback=fallback||defaults.font;let size=valueOrDefault(options.size,fallback.size);"string"==typeof size&&(size=parseInt(size,10));let style=valueOrDefault(options.style,fallback.style);style&&!(""+style).match(FONT_STYLE)&&(console.warn('Invalid font style specified: "'+style+'"'),style="");const font={family:valueOrDefault(options.family,fallback.family),lineHeight:toLineHeight(valueOrDefault(options.lineHeight,fallback.lineHeight),size),size:size,style:style,weight:valueOrDefault(options.weight,fallback.weight),string:""};return font.string=toFontString(font),font}function resolve(inputs,context,index,info){let cacheable=!0,i,ilen,value;for(i=0,ilen=inputs.length;i<ilen;++i)if(value=inputs[i],void 0!==value&&(void 0!==context&&"function"==typeof value&&(value=value(context),cacheable=!1),void 0!==index&&isArray(value)&&(value=value[index%value.length],cacheable=!1),void 0!==value))return info&&!cacheable&&(info.cacheable=!1),value}function _addGrace(minmax,grace){const{min:min,max:max}=minmax;return{min:min-Math.abs(toDimension(grace,min)),max:max+toDimension(grace,max)}}const STATIC_POSITIONS=["left","top","right","bottom"];function filterByPosition(array,position){return array.filter(v=>v.pos===position)}function filterDynamicPositionByAxis(array,axis){return array.filter(v=>-1===STATIC_POSITIONS.indexOf(v.pos)&&v.box.axis===axis)}function sortByWeight(array,reverse){return array.sort((a,b)=>{const v0=reverse?b:a,v1=reverse?a:b;return v0.weight===v1.weight?v0.index-v1.index:v0.weight-v1.weight})}function wrapBoxes(boxes){const layoutBoxes=[];let i,ilen,box,pos,stack,stackWeight;for(i=0,ilen=(boxes||[]).length;i<ilen;++i)box=boxes[i],({position:pos,options:{stack:stack,stackWeight:stackWeight=1}}=box),layoutBoxes.push({index:i,box:box,pos:pos,horizontal:box.isHorizontal(),weight:box.weight,stack:stack&&pos+stack,stackWeight:stackWeight});return layoutBoxes}function buildStacks(layouts){const stacks={};for(const wrap of layouts){const{stack:stack,pos:pos,stackWeight:stackWeight}=wrap;if(!stack||!STATIC_POSITIONS.includes(pos))continue;const _stack=stacks[stack]||(stacks[stack]={count:0,placed:0,weight:0,size:0});_stack.count++,_stack.weight+=stackWeight}return stacks}function setLayoutDims(layouts,params){const stacks=buildStacks(layouts),{vBoxMaxWidth:vBoxMaxWidth,hBoxMaxHeight:hBoxMaxHeight}=params;let i,ilen,layout;for(i=0,ilen=layouts.length;i<ilen;++i){layout=layouts[i];const{fullSize:fullSize}=layout.box,stack=stacks[layout.stack],factor=stack&&layout.stackWeight/stack.weight;layout.horizontal?(layout.width=factor?factor*vBoxMaxWidth:fullSize&&params.availableWidth,layout.height=hBoxMaxHeight):(layout.width=vBoxMaxWidth,layout.height=factor?factor*hBoxMaxHeight:fullSize&&params.availableHeight)}return stacks}function buildLayoutBoxes(boxes){const layoutBoxes=wrapBoxes(boxes),fullSize=sortByWeight(layoutBoxes.filter(wrap=>wrap.box.fullSize),!0),left=sortByWeight(filterByPosition(layoutBoxes,"left"),!0),right=sortByWeight(filterByPosition(layoutBoxes,"right")),top=sortByWeight(filterByPosition(layoutBoxes,"top"),!0),bottom=sortByWeight(filterByPosition(layoutBoxes,"bottom")),centerHorizontal=filterDynamicPositionByAxis(layoutBoxes,"x"),centerVertical=filterDynamicPositionByAxis(layoutBoxes,"y");return{fullSize:fullSize,leftAndTop:left.concat(top),rightAndBottom:right.concat(centerVertical).concat(bottom).concat(centerHorizontal),chartArea:filterByPosition(layoutBoxes,"chartArea"),vertical:left.concat(right).concat(centerVertical),horizontal:top.concat(bottom).concat(centerHorizontal)}}function getCombinedMax(maxPadding,chartArea,a,b){return Math.max(maxPadding[a],chartArea[a])+Math.max(maxPadding[b],chartArea[b])}function updateMaxPadding(maxPadding,boxPadding){maxPadding.top=Math.max(maxPadding.top,boxPadding.top),maxPadding.left=Math.max(maxPadding.left,boxPadding.left),maxPadding.bottom=Math.max(maxPadding.bottom,boxPadding.bottom),maxPadding.right=Math.max(maxPadding.right,boxPadding.right)}function updateDims(chartArea,params,layout,stacks){const{pos:pos,box:box}=layout,maxPadding=chartArea.maxPadding;if(!isObject(pos)){layout.size&&(chartArea[pos]-=layout.size);const stack=stacks[layout.stack]||{size:0,count:1};stack.size=Math.max(stack.size,layout.horizontal?box.height:box.width),layout.size=stack.size/stack.count,chartArea[pos]+=layout.size}box.getPadding&&updateMaxPadding(maxPadding,box.getPadding());const newWidth=Math.max(0,params.outerWidth-getCombinedMax(maxPadding,chartArea,"left","right")),newHeight=Math.max(0,params.outerHeight-getCombinedMax(maxPadding,chartArea,"top","bottom")),widthChanged=newWidth!==chartArea.w,heightChanged=newHeight!==chartArea.h;return chartArea.w=newWidth,chartArea.h=newHeight,layout.horizontal?{same:widthChanged,other:heightChanged}:{same:heightChanged,other:widthChanged}}function handleMaxPadding(chartArea){const maxPadding=chartArea.maxPadding;function updatePos(pos){const change=Math.max(maxPadding[pos]-chartArea[pos],0);return chartArea[pos]+=change,change}chartArea.y+=updatePos("top"),chartArea.x+=updatePos("left"),updatePos("right"),updatePos("bottom")}function getMargins(horizontal,chartArea){const maxPadding=chartArea.maxPadding;function marginForPositions(positions){const margin={left:0,top:0,right:0,bottom:0};return positions.forEach(pos=>{margin[pos]=Math.max(chartArea[pos],maxPadding[pos])}),margin}return marginForPositions(horizontal?["left","right"]:["top","bottom"])}function fitBoxes(boxes,chartArea,params,stacks){const refitBoxes=[];let i,ilen,layout,box,refit,changed;for(i=0,ilen=boxes.length,refit=0;i<ilen;++i){layout=boxes[i],box=layout.box,box.update(layout.width||chartArea.w,layout.height||chartArea.h,getMargins(layout.horizontal,chartArea));const{same:same,other:other}=updateDims(chartArea,params,layout,stacks);refit|=same&&refitBoxes.length,changed=changed||other,box.fullSize||refitBoxes.push(layout)}return refit&&fitBoxes(refitBoxes,chartArea,params,stacks)||changed}function setBoxDims(box,left,top,width,height){box.top=top,box.left=left,box.right=left+width,box.bottom=top+height,box.width=width,box.height=height}function placeBoxes(boxes,chartArea,params,stacks){const userPadding=params.padding;let{x:x,y:y}=chartArea;for(const layout of boxes){const box=layout.box,stack=stacks[layout.stack]||{count:1,placed:0,weight:1},weight=layout.stackWeight/stack.weight||1;if(layout.horizontal){const width=chartArea.w*weight,height=stack.size||box.height;defined(stack.start)&&(y=stack.start),box.fullSize?setBoxDims(box,userPadding.left,y,params.outerWidth-userPadding.right-userPadding.left,height):setBoxDims(box,chartArea.left+stack.placed,y,width,height),stack.start=y,stack.placed+=width,y=box.bottom}else{const height=chartArea.h*weight,width=stack.size||box.width;defined(stack.start)&&(x=stack.start),box.fullSize?setBoxDims(box,x,userPadding.top,width,params.outerHeight-userPadding.bottom-userPadding.top):setBoxDims(box,x,chartArea.top+stack.placed,width,height),stack.start=x,stack.placed+=height,x=box.right}}chartArea.x=x,chartArea.y=y}defaults.set("layout",{padding:{top:0,right:0,bottom:0,left:0}});var layouts={addBox(chart,item){chart.boxes||(chart.boxes=[]),item.fullSize=item.fullSize||!1,item.position=item.position||"top",item.weight=item.weight||0,item._layers=item._layers||function(){return[{z:0,draw(chartArea){item.draw(chartArea)}}]},chart.boxes.push(item)},removeBox(chart,layoutItem){const index=chart.boxes?chart.boxes.indexOf(layoutItem):-1;-1!==index&&chart.boxes.splice(index,1)},configure(chart,item,options){item.fullSize=options.fullSize,item.position=options.position,item.weight=options.weight},update(chart,width,height,minPadding){if(!chart)return;const padding=toPadding(chart.options.layout.padding),availableWidth=Math.max(width-padding.width,0),availableHeight=Math.max(height-padding.height,0),boxes=buildLayoutBoxes(chart.boxes),verticalBoxes=boxes.vertical,horizontalBoxes=boxes.horizontal;each(chart.boxes,box=>{"function"==typeof box.beforeLayout&&box.beforeLayout()});const visibleVerticalBoxCount=verticalBoxes.reduce((total,wrap)=>wrap.box.options&&!1===wrap.box.options.display?total:total+1,0)||1,params=Object.freeze({outerWidth:width,outerHeight:height,padding:padding,availableWidth:availableWidth,availableHeight:availableHeight,vBoxMaxWidth:availableWidth/2/visibleVerticalBoxCount,hBoxMaxHeight:availableHeight/2}),maxPadding=Object.assign({},padding);updateMaxPadding(maxPadding,toPadding(minPadding));const chartArea=Object.assign({maxPadding:maxPadding,w:availableWidth,h:availableHeight,x:padding.left,y:padding.top},padding),stacks=setLayoutDims(verticalBoxes.concat(horizontalBoxes),params);fitBoxes(boxes.fullSize,chartArea,params,stacks),fitBoxes(verticalBoxes,chartArea,params,stacks),fitBoxes(horizontalBoxes,chartArea,params,stacks)&&fitBoxes(verticalBoxes,chartArea,params,stacks),handleMaxPadding(chartArea),placeBoxes(boxes.leftAndTop,chartArea,params,stacks),chartArea.x+=chartArea.w,chartArea.y+=chartArea.h,placeBoxes(boxes.rightAndBottom,chartArea,params,stacks),chart.chartArea={left:chartArea.left,top:chartArea.top,right:chartArea.left+chartArea.w,bottom:chartArea.top+chartArea.h,height:chartArea.h,width:chartArea.w},each(boxes.chartArea,layout=>{const box=layout.box;Object.assign(box,chart.chartArea),box.update(chartArea.w,chartArea.h)})}};function _createResolver(scopes,prefixes=[""],rootScopes=scopes,fallback,getTarget=(()=>scopes[0])){defined(fallback)||(fallback=_resolve("_fallback",scopes));const cache={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:scopes,_rootScopes:rootScopes,_fallback:fallback,_getTarget:getTarget,override:scope=>_createResolver([scope,...scopes],prefixes,rootScopes,fallback)};return new Proxy(cache,{deleteProperty:(target,prop)=>(delete target[prop],delete target._keys,delete scopes[0][prop],!0),get:(target,prop)=>_cached(target,prop,()=>_resolveWithPrefixes(prop,prefixes,scopes,target)),getOwnPropertyDescriptor:(target,prop)=>Reflect.getOwnPropertyDescriptor(target._scopes[0],prop),getPrototypeOf:()=>Reflect.getPrototypeOf(scopes[0]),has:(target,prop)=>getKeysFromAllScopes(target).includes(prop),ownKeys:target=>getKeysFromAllScopes(target),set(target,prop,value){const storage=target._storage||(target._storage=getTarget());return storage[prop]=value,delete target[prop],delete target._keys,!0}})}function _attachContext(proxy,context,subProxy,descriptorDefaults){const cache={_cacheable:!1,_proxy:proxy,_context:context,_subProxy:subProxy,_stack:new Set,_descriptors:_descriptors(proxy,descriptorDefaults),setContext:ctx=>_attachContext(proxy,ctx,subProxy,descriptorDefaults),override:scope=>_attachContext(proxy.override(scope),context,subProxy,descriptorDefaults)};return new Proxy(cache,{deleteProperty:(target,prop)=>(delete target[prop],delete proxy[prop],!0),get:(target,prop,receiver)=>_cached(target,prop,()=>_resolveWithContext(target,prop,receiver)),getOwnPropertyDescriptor:(target,prop)=>target._descriptors.allKeys?Reflect.has(proxy,prop)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(proxy,prop),getPrototypeOf:()=>Reflect.getPrototypeOf(proxy),has:(target,prop)=>Reflect.has(proxy,prop),ownKeys:()=>Reflect.ownKeys(proxy),set:(target,prop,value)=>(proxy[prop]=value,delete target[prop],!0)})}function _descriptors(proxy,defaults={scriptable:!0,indexable:!0}){const{_scriptable:_scriptable=defaults.scriptable,_indexable:_indexable=defaults.indexable,_allKeys:_allKeys=defaults.allKeys}=proxy;return{allKeys:_allKeys,scriptable:_scriptable,indexable:_indexable,isScriptable:isFunction(_scriptable)?_scriptable:()=>_scriptable,isIndexable:isFunction(_indexable)?_indexable:()=>_indexable}}const readKey=(prefix,name)=>prefix?prefix+_capitalize(name):name,needsSubResolver=(prop,value)=>isObject(value)&&"adapters"!==prop;function _cached(target,prop,resolve){let value=target[prop];return defined(value)?value:(value=resolve(),defined(value)&&(target[prop]=value),value)}function _resolveWithContext(target,prop,receiver){const{_proxy:_proxy,_context:_context,_subProxy:_subProxy,_descriptors:descriptors}=target;let value=_proxy[prop];return isFunction(value)&&descriptors.isScriptable(prop)&&(value=_resolveScriptable(prop,value,target,receiver)),isArray(value)&&value.length&&(value=_resolveArray(prop,value,target,descriptors.isIndexable)),needsSubResolver(prop,value)&&(value=_attachContext(value,_context,_subProxy&&_subProxy[prop],descriptors)),value}function _resolveScriptable(prop,value,target,receiver){const{_proxy:_proxy,_context:_context,_subProxy:_subProxy,_stack:_stack}=target;if(_stack.has(prop))throw new Error("Recursion detected: "+Array.from(_stack).join("->")+"->"+prop);return _stack.add(prop),value=value(_context,_subProxy||receiver),_stack.delete(prop),isObject(value)&&(value=createSubResolver(_proxy._scopes,_proxy,prop,value)),value}function _resolveArray(prop,value,target,isIndexable){const{_proxy:_proxy,_context:_context,_subProxy:_subProxy,_descriptors:descriptors}=target;if(defined(_context.index)&&isIndexable(prop))value=value[_context.index%value.length];else if(isObject(value[0])){const arr=value,scopes=_proxy._scopes.filter(s=>s!==arr);value=[];for(const item of arr){const resolver=createSubResolver(scopes,_proxy,prop,item);value.push(_attachContext(resolver,_context,_subProxy&&_subProxy[prop],descriptors))}}return value}function resolveFallback(fallback,prop,value){return isFunction(fallback)?fallback(prop,value):fallback}const getScope=(key,parent)=>!0===key?parent:"string"==typeof key?resolveObjectKey(parent,key):void 0;function addScopes(set,parentScopes,key,parentFallback){for(const parent of parentScopes){const scope=getScope(key,parent);if(scope){set.add(scope);const fallback=resolveFallback(scope._fallback,key,scope);if(defined(fallback)&&fallback!==key&&fallback!==parentFallback)return fallback}else if(!1===scope&&defined(parentFallback)&&key!==parentFallback)return null}return!1}function createSubResolver(parentScopes,resolver,prop,value){const rootScopes=resolver._rootScopes,fallback=resolveFallback(resolver._fallback,prop,value),allScopes=[...parentScopes,...rootScopes],set=new Set;set.add(value);let key=addScopesFromKey(set,allScopes,prop,fallback||prop);return null!==key&&((!defined(fallback)||fallback===prop||(key=addScopesFromKey(set,allScopes,fallback,key),null!==key))&&_createResolver(Array.from(set),[""],rootScopes,fallback,()=>subGetTarget(resolver,prop,value)))}function addScopesFromKey(set,allScopes,key,fallback){for(;key;)key=addScopes(set,allScopes,key,fallback);return key}function subGetTarget(resolver,prop,value){const parent=resolver._getTarget();prop in parent||(parent[prop]={});const target=parent[prop];return isArray(target)&&isObject(value)?value:target}function _resolveWithPrefixes(prop,prefixes,scopes,proxy){let value;for(const prefix of prefixes)if(value=_resolve(readKey(prefix,prop),scopes),defined(value))return needsSubResolver(prop,value)?createSubResolver(scopes,proxy,prop,value):value}function _resolve(key,scopes){for(const scope of scopes){if(!scope)continue;const value=scope[key];if(defined(value))return value}}function getKeysFromAllScopes(target){let keys=target._keys;return keys||(keys=target._keys=resolveKeysFromAllScopes(target._scopes)),keys}function resolveKeysFromAllScopes(scopes){const set=new Set;for(const scope of scopes)for(const key of Object.keys(scope).filter(k=>!k.startsWith("_")))set.add(key);return Array.from(set)}const EPSILON=Number.EPSILON||1e-14,getPoint=(points,i)=>i<points.length&&!points[i].skip&&points[i],getValueAxis=indexAxis=>"x"===indexAxis?"y":"x";function splineCurve(firstPoint,middlePoint,afterPoint,t){const previous=firstPoint.skip?middlePoint:firstPoint,current=middlePoint,next=afterPoint.skip?middlePoint:afterPoint,d01=distanceBetweenPoints(current,previous),d12=distanceBetweenPoints(next,current);let s01=d01/(d01+d12),s12=d12/(d01+d12);s01=isNaN(s01)?0:s01,s12=isNaN(s12)?0:s12;const fa=t*s01,fb=t*s12;return{previous:{x:current.x-fa*(next.x-previous.x),y:current.y-fa*(next.y-previous.y)},next:{x:current.x+fb*(next.x-previous.x),y:current.y+fb*(next.y-previous.y)}}}function monotoneAdjust(points,deltaK,mK){const pointsLen=points.length;let alphaK,betaK,tauK,squaredMagnitude,pointCurrent,pointAfter=getPoint(points,0);for(let i=0;i<pointsLen-1;++i)pointCurrent=pointAfter,pointAfter=getPoint(points,i+1),pointCurrent&&pointAfter&&(almostEquals(deltaK[i],0,EPSILON)?mK[i]=mK[i+1]=0:(alphaK=mK[i]/deltaK[i],betaK=mK[i+1]/deltaK[i],squaredMagnitude=Math.pow(alphaK,2)+Math.pow(betaK,2),squaredMagnitude<=9||(tauK=3/Math.sqrt(squaredMagnitude),mK[i]=alphaK*tauK*deltaK[i],mK[i+1]=betaK*tauK*deltaK[i])))}function monotoneCompute(points,mK,indexAxis="x"){const valueAxis=getValueAxis(indexAxis),pointsLen=points.length;let delta,pointBefore,pointCurrent,pointAfter=getPoint(points,0);for(let i=0;i<pointsLen;++i){if(pointBefore=pointCurrent,pointCurrent=pointAfter,pointAfter=getPoint(points,i+1),!pointCurrent)continue;const iPixel=pointCurrent[indexAxis],vPixel=pointCurrent[valueAxis];pointBefore&&(delta=(iPixel-pointBefore[indexAxis])/3,pointCurrent[`cp1${indexAxis}`]=iPixel-delta,pointCurrent[`cp1${valueAxis}`]=vPixel-delta*mK[i]),pointAfter&&(delta=(pointAfter[indexAxis]-iPixel)/3,pointCurrent[`cp2${indexAxis}`]=iPixel+delta,pointCurrent[`cp2${valueAxis}`]=vPixel+delta*mK[i])}}function splineCurveMonotone(points,indexAxis="x"){const valueAxis=getValueAxis(indexAxis),pointsLen=points.length,deltaK=Array(pointsLen).fill(0),mK=Array(pointsLen);let i,pointBefore,pointCurrent,pointAfter=getPoint(points,0);for(i=0;i<pointsLen;++i)if(pointBefore=pointCurrent,pointCurrent=pointAfter,pointAfter=getPoint(points,i+1),pointCurrent){if(pointAfter){const slopeDelta=pointAfter[indexAxis]-pointCurrent[indexAxis];deltaK[i]=0!==slopeDelta?(pointAfter[valueAxis]-pointCurrent[valueAxis])/slopeDelta:0}mK[i]=pointBefore?pointAfter?sign(deltaK[i-1])!==sign(deltaK[i])?0:(deltaK[i-1]+deltaK[i])/2:deltaK[i-1]:deltaK[i]}monotoneAdjust(points,deltaK,mK),monotoneCompute(points,mK,indexAxis)}function capControlPoint(pt,min,max){return Math.max(Math.min(pt,max),min)}function capBezierPoints(points,area){let i,ilen,point,inArea,inAreaPrev,inAreaNext=_isPointInArea(points[0],area);for(i=0,ilen=points.length;i<ilen;++i)inAreaPrev=inArea,inArea=inAreaNext,inAreaNext=i<ilen-1&&_isPointInArea(points[i+1],area),inArea&&(point=points[i],inAreaPrev&&(point.cp1x=capControlPoint(point.cp1x,area.left,area.right),point.cp1y=capControlPoint(point.cp1y,area.top,area.bottom)),inAreaNext&&(point.cp2x=capControlPoint(point.cp2x,area.left,area.right),point.cp2y=capControlPoint(point.cp2y,area.top,area.bottom)))}function _updateBezierControlPoints(points,options,area,loop,indexAxis){let i,ilen,point,controlPoints;if(options.spanGaps&&(points=points.filter(pt=>!pt.skip)),"monotone"===options.cubicInterpolationMode)splineCurveMonotone(points,indexAxis);else{let prev=loop?points[points.length-1]:points[0];for(i=0,ilen=points.length;i<ilen;++i)point=points[i],controlPoints=splineCurve(prev,point,points[Math.min(i+1,ilen-(loop?0:1))%ilen],options.tension),point.cp1x=controlPoints.previous.x,point.cp1y=controlPoints.previous.y,point.cp2x=controlPoints.next.x,point.cp2y=controlPoints.next.y,prev=point}options.capBezierPoints&&capBezierPoints(points,area)}const atEdge=t=>0===t||1===t,elasticIn=(t,s,p)=>-Math.pow(2,10*(t-=1))*Math.sin((t-s)*TAU/p),elasticOut=(t,s,p)=>Math.pow(2,-10*t)*Math.sin((t-s)*TAU/p)+1,effects={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*HALF_PI),easeOutSine:t=>Math.sin(t*HALF_PI),easeInOutSine:t=>-.5*(Math.cos(PI*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=>atEdge(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=>atEdge(t)?t:elasticIn(t,.075,.3),easeOutElastic:t=>atEdge(t)?t:elasticOut(t,.075,.3),easeInOutElastic(t){const s=.1125,p=.45;return atEdge(t)?t:t<.5?.5*elasticIn(2*t,s,p):.5+.5*elasticOut(2*t-1,s,p)},easeInBack(t){const s=1.70158;return t*t*((s+1)*t-s)},easeOutBack(t){const s=1.70158;return(t-=1)*t*((s+1)*t+s)+1},easeInOutBack(t){let s=1.70158;return(t/=.5)<1?t*t*((1+(s*=1.525))*t-s)*.5:.5*((t-=2)*t*((1+(s*=1.525))*t+s)+2)},easeInBounce:t=>1-effects.easeOutBounce(1-t),easeOutBounce(t){const m=7.5625,d=2.75;return t<1/d?m*t*t:t<2/d?m*(t-=1.5/d)*t+.75:t<2.5/d?m*(t-=2.25/d)*t+.9375:m*(t-=2.625/d)*t+.984375},easeInOutBounce:t=>t<.5?.5*effects.easeInBounce(2*t):.5*effects.easeOutBounce(2*t-1)+.5};function _pointInLine(p1,p2,t,mode){return{x:p1.x+t*(p2.x-p1.x),y:p1.y+t*(p2.y-p1.y)}}function _steppedInterpolation(p1,p2,t,mode){return{x:p1.x+t*(p2.x-p1.x),y:"middle"===mode?t<.5?p1.y:p2.y:"after"===mode?t<1?p1.y:p2.y:t>0?p2.y:p1.y}}function _bezierInterpolation(p1,p2,t,mode){const cp1={x:p1.cp2x,y:p1.cp2y},cp2={x:p2.cp1x,y:p2.cp1y},a=_pointInLine(p1,cp1,t),b=_pointInLine(cp1,cp2,t),c=_pointInLine(cp2,p2,t),d=_pointInLine(a,b,t),e=_pointInLine(b,c,t);return _pointInLine(d,e,t)}const intlCache=new Map;function getNumberFormat(locale,options){options=options||{};const cacheKey=locale+JSON.stringify(options);let formatter=intlCache.get(cacheKey);return formatter||(formatter=new Intl.NumberFormat(locale,options),intlCache.set(cacheKey,formatter)),formatter}function formatNumber(num,locale,options){return getNumberFormat(locale,options).format(num)}const getRightToLeftAdapter=function(rectX,width){return{x:x=>rectX+rectX+width-x,setWidth(w){width=w},textAlign:align=>"center"===align?align:"right"===align?"left":"right",xPlus:(x,value)=>x-value,leftForLtr:(x,itemWidth)=>x-itemWidth}},getLeftToRightAdapter=function(){return{x:x=>x,setWidth(w){},textAlign:align=>align,xPlus:(x,value)=>x+value,leftForLtr:(x,_itemWidth)=>x}};function getRtlAdapter(rtl,rectX,width){return rtl?getRightToLeftAdapter(rectX,width):getLeftToRightAdapter()}function overrideTextDirection(ctx,direction){let style,original;"ltr"!==direction&&"rtl"!==direction||(style=ctx.canvas.style,original=[style.getPropertyValue("direction"),style.getPropertyPriority("direction")],style.setProperty("direction",direction,"important"),ctx.prevTextDirection=original)}function restoreTextDirection(ctx,original){void 0!==original&&(delete ctx.prevTextDirection,ctx.canvas.style.setProperty("direction",original[0],original[1]))}function propertyFn(property){return"angle"===property?{between:_angleBetween,compare:_angleDiff,normalize:_normalizeAngle}:{between:(n,s,e)=>n>=Math.min(s,e)&&n<=Math.max(e,s),compare:(a,b)=>a-b,normalize:x=>x}}function normalizeSegment({start:start,end:end,count:count,loop:loop,style:style}){return{start:start%count,end:end%count,loop:loop&&(end-start+1)%count==0,style:style}}function getSegment(segment,points,bounds){const{property:property,start:startBound,end:endBound}=bounds,{between:between,normalize:normalize}=propertyFn(property),count=points.length;let{start:start,end:end,loop:loop}=segment,i,ilen;if(loop){for(start+=count,end+=count,i=0,ilen=count;i<ilen&&between(normalize(points[start%count][property]),startBound,endBound);++i)start--,end--;start%=count,end%=count}return end<start&&(end+=count),{start:start,end:end,loop:loop,style:segment.style}}function _boundSegment(segment,points,bounds){if(!bounds)return[segment];const{property:property,start:startBound,end:endBound}=bounds,count=points.length,{compare:compare,between:between,normalize:normalize}=propertyFn(property),{start:start,end:end,loop:loop,style:style}=getSegment(segment,points,bounds),result=[];let inside=!1,subStart=null,value,point,prevValue;const startIsBefore=()=>between(startBound,prevValue,value)&&0!==compare(startBound,prevValue),endIsBefore=()=>0===compare(endBound,value)||between(endBound,prevValue,value),shouldStart=()=>inside||startIsBefore(),shouldStop=()=>!inside||endIsBefore();for(let i=start,prev=start;i<=end;++i)point=points[i%count],point.skip||(value=normalize(point[property]),value!==prevValue&&(inside=between(value,startBound,endBound),null===subStart&&shouldStart()&&(subStart=0===compare(value,startBound)?i:prev),null!==subStart&&shouldStop()&&(result.push(normalizeSegment({start:subStart,end:i,loop:loop,count:count,style:style})),subStart=null),prev=i,prevValue=value));return null!==subStart&&result.push(normalizeSegment({start:subStart,end:end,loop:loop,count:count,style:style})),result}function _boundSegments(line,bounds){const result=[],segments=line.segments;for(let i=0;i<segments.length;i++){const sub=_boundSegment(segments[i],line.points,bounds);sub.length&&result.push(...sub)}return result}function findStartAndEnd(points,count,loop,spanGaps){let start=0,end=count-1;if(loop&&!spanGaps)for(;start<count&&!points[start].skip;)start++;for(;start<count&&points[start].skip;)start++;for(start%=count,loop&&(end+=start);end>start&&points[end%count].skip;)end--;return end%=count,{start:start,end:end}}function solidSegments(points,start,max,loop){const count=points.length,result=[];let last=start,prev=points[start],end;for(end=start+1;end<=max;++end){const cur=points[end%count];cur.skip||cur.stop?prev.skip||(loop=!1,result.push({start:start%count,end:(end-1)%count,loop:loop}),start=last=cur.stop?end:null):(last=end,prev.skip&&(start=end)),prev=cur}return null!==last&&result.push({start:start%count,end:last%count,loop:loop}),result}function _computeSegments(line,segmentOptions){const points=line.points,spanGaps=line.options.spanGaps,count=points.length;if(!count)return[];const loop=!!line._loop,{start:start,end:end}=findStartAndEnd(points,count,loop,spanGaps);if(!0===spanGaps)return splitByStyles(line,[{start:start,end:end,loop:loop}],points,segmentOptions);const max=end<start?end+count:end,completeLoop=!!line._fullLoop&&0===start&&end===count-1;return splitByStyles(line,solidSegments(points,start,max,completeLoop),points,segmentOptions)}function splitByStyles(line,segments,points,segmentOptions){return segmentOptions&&segmentOptions.setContext&&points?doSplitByStyles(line,segments,points,segmentOptions):segments}function doSplitByStyles(line,segments,points,segmentOptions){const baseStyle=readStyle(line.options),count=points.length,result=[];let start=segments[0].start,i=start;for(const segment of segments){let prevStyle=baseStyle,prev=points[start%count],style;for(i=start+1;i<=segment.end;i++){const pt=points[i%count];style=readStyle(segmentOptions.setContext({type:"segment",p0:prev,p1:pt,p0DataIndex:(i-1)%count,p1DataIndex:i%count,datasetIndex:line._datasetIndex})),styleChanged(style,prevStyle)&&(result.push({start:start,end:i-1,loop:segment.loop,style:prevStyle}),prevStyle=style,start=i-1),prev=pt,prevStyle=style}start<i-1&&(result.push({start:start,end:i-1,loop:segment.loop,style:style}),start=i-1)}return result}function readStyle(options){return{backgroundColor:options.backgroundColor,borderCapStyle:options.borderCapStyle,borderDash:options.borderDash,borderDashOffset:options.borderDashOffset,borderJoinStyle:options.borderJoinStyle,borderWidth:options.borderWidth,borderColor:options.borderColor}}function styleChanged(style,prevStyle){return prevStyle&&JSON.stringify(style)!==JSON.stringify(prevStyle)}var helpers=Object.freeze({__proto__:null,easingEffects:effects,color:color,getHoverColor:getHoverColor,noop:noop,uid:uid,isNullOrUndef:isNullOrUndef,isArray:isArray,isObject:isObject,isFinite:isNumberFinite,finiteOrDefault:finiteOrDefault,valueOrDefault:valueOrDefault,toPercentage:toPercentage,toDimension:toDimension,callback:callback,each:each,_elementsEqual:_elementsEqual,clone:clone,_merger:_merger,merge:merge,mergeIf:mergeIf,_mergerIf:_mergerIf,_deprecated:_deprecated,resolveObjectKey:resolveObjectKey,_capitalize:_capitalize,defined:defined,isFunction:isFunction,setsEqual:setsEqual,toFontString:toFontString,_measureText:_measureText,_longestText:_longestText,_alignPixel:_alignPixel,clearCanvas:clearCanvas,drawPoint:drawPoint,_isPointInArea:_isPointInArea,clipArea:clipArea,unclipArea:unclipArea,_steppedLineTo:_steppedLineTo,_bezierCurveTo:_bezierCurveTo,renderText:renderText,addRoundedRectPath:addRoundedRectPath,_lookup:_lookup,_lookupByKey:_lookupByKey,_rlookupByKey:_rlookupByKey,_filterBetween:_filterBetween,listenArrayEvents:listenArrayEvents,unlistenArrayEvents:unlistenArrayEvents,_arrayUnique:_arrayUnique,_createResolver:_createResolver,_attachContext:_attachContext,_descriptors:_descriptors,splineCurve:splineCurve,splineCurveMonotone:splineCurveMonotone,_updateBezierControlPoints:_updateBezierControlPoints,_isDomSupported:_isDomSupported,_getParentNode:_getParentNode,getStyle:getStyle,getRelativePosition:getRelativePosition$1,getMaximumSize:getMaximumSize,retinaScale:retinaScale,supportsEventListenerOptions:supportsEventListenerOptions,readUsedSize:readUsedSize,fontString:fontString,requestAnimFrame:requestAnimFrame,throttled:throttled,debounce:debounce,_toLeftRightCenter:_toLeftRightCenter,_alignStartEnd:_alignStartEnd,_textX:_textX,_pointInLine:_pointInLine,_steppedInterpolation:_steppedInterpolation,_bezierInterpolation:_bezierInterpolation,formatNumber:formatNumber,toLineHeight:toLineHeight,_readValueToProps:_readValueToProps,toTRBL:toTRBL,toTRBLCorners:toTRBLCorners,toPadding:toPadding,toFont:toFont,resolve:resolve,_addGrace:_addGrace,PI:PI,TAU:TAU,PITAU:PITAU,INFINITY:INFINITY,RAD_PER_DEG:RAD_PER_DEG,HALF_PI:HALF_PI,QUARTER_PI:QUARTER_PI,TWO_THIRDS_PI:TWO_THIRDS_PI,log10:log10,sign:sign,niceNum:niceNum,_factorize:_factorize,isNumber:isNumber,almostEquals:almostEquals,almostWhole:almostWhole,_setMinAndMaxByKey:_setMinAndMaxByKey,toRadians:toRadians,toDegrees:toDegrees,_decimalPlaces:_decimalPlaces,getAngleFromPoint:getAngleFromPoint,distanceBetweenPoints:distanceBetweenPoints,_angleDiff:_angleDiff,_normalizeAngle:_normalizeAngle,_angleBetween:_angleBetween,_limitValue:_limitValue,_int16Range:_int16Range,getRtlAdapter:getRtlAdapter,overrideTextDirection:overrideTextDirection,restoreTextDirection:restoreTextDirection,_boundSegment:_boundSegment,_boundSegments:_boundSegments,_computeSegments:_computeSegments});class BasePlatform{acquireContext(canvas,aspectRatio){}releaseContext(context){return!1}addEventListener(chart,type,listener){}removeEventListener(chart,type,listener){}getDevicePixelRatio(){return 1}getMaximumSize(element,width,height,aspectRatio){return width=Math.max(0,width||element.width),height=height||element.height,{width:width,height:Math.max(0,aspectRatio?Math.floor(width/aspectRatio):height)}}isAttached(canvas){return!0}}class BasicPlatform extends BasePlatform{acquireContext(item){return item&&item.getContext&&item.getContext("2d")||null}}const EXPANDO_KEY="$chartjs",EVENT_TYPES={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},isNullOrEmpty=value=>null===value||""===value;function initCanvas(canvas,aspectRatio){const style=canvas.style,renderHeight=canvas.getAttribute("height"),renderWidth=canvas.getAttribute("width");if(canvas.$chartjs={initial:{height:renderHeight,width:renderWidth,style:{display:style.display,height:style.height,width:style.width}}},style.display=style.display||"block",style.boxSizing=style.boxSizing||"border-box",isNullOrEmpty(renderWidth)){const displayWidth=readUsedSize(canvas,"width");void 0!==displayWidth&&(canvas.width=displayWidth)}if(isNullOrEmpty(renderHeight))if(""===canvas.style.height)canvas.height=canvas.width/(aspectRatio||2);else{const displayHeight=readUsedSize(canvas,"height");void 0!==displayHeight&&(canvas.height=displayHeight)}return canvas}const eventListenerOptions=!!supportsEventListenerOptions&&{passive:!0};function addListener(node,type,listener){node.addEventListener(type,listener,eventListenerOptions)}function removeListener(chart,type,listener){chart.canvas.removeEventListener(type,listener,eventListenerOptions)}function fromNativeEvent(event,chart){const type=EVENT_TYPES[event.type]||event.type,{x:x,y:y}=getRelativePosition$1(event,chart);return{type:type,chart:chart,native:event,x:void 0!==x?x:null,y:void 0!==y?y:null}}function createAttachObserver(chart,type,listener){const canvas=chart.canvas,container=canvas&&_getParentNode(canvas),element=container||canvas,observer=new MutationObserver(entries=>{const parent=_getParentNode(element);entries.forEach(entry=>{for(let i=0;i<entry.addedNodes.length;i++){const added=entry.addedNodes[i];added!==element&&added!==parent||listener(entry.target)}})});return observer.observe(document,{childList:!0,subtree:!0}),observer}function createDetachObserver(chart,type,listener){const canvas=chart.canvas,container=canvas&&_getParentNode(canvas);if(!container)return;const observer=new MutationObserver(entries=>{entries.forEach(entry=>{for(let i=0;i<entry.removedNodes.length;i++)if(entry.removedNodes[i]===canvas){listener();break}})});return observer.observe(container,{childList:!0}),observer}const drpListeningCharts=new Map;let oldDevicePixelRatio=0;function onWindowResize(){const dpr=window.devicePixelRatio;dpr!==oldDevicePixelRatio&&(oldDevicePixelRatio=dpr,drpListeningCharts.forEach((resize,chart)=>{chart.currentDevicePixelRatio!==dpr&&resize()}))}function listenDevicePixelRatioChanges(chart,resize){drpListeningCharts.size||window.addEventListener("resize",onWindowResize),drpListeningCharts.set(chart,resize)}function unlistenDevicePixelRatioChanges(chart){drpListeningCharts.delete(chart),drpListeningCharts.size||window.removeEventListener("resize",onWindowResize)}function createResizeObserver(chart,type,listener){const canvas=chart.canvas,container=canvas&&_getParentNode(canvas);if(!container)return;const resize=throttled((width,height)=>{const w=container.clientWidth;listener(width,height),w<container.clientWidth&&listener()},window),observer=new ResizeObserver(entries=>{const entry=entries[0],width=entry.contentRect.width,height=entry.contentRect.height;0===width&&0===height||resize(width,height)});return observer.observe(container),listenDevicePixelRatioChanges(chart,resize),observer}function releaseObserver(chart,type,observer){observer&&observer.disconnect(),"resize"===type&&unlistenDevicePixelRatioChanges(chart)}function createProxyAndListen(chart,type,listener){const canvas=chart.canvas,proxy=throttled(event=>{null!==chart.ctx&&listener(fromNativeEvent(event,chart))},chart,args=>{const event=args[0];return[event,event.offsetX,event.offsetY]});return addListener(canvas,type,proxy),proxy}class DomPlatform extends BasePlatform{acquireContext(canvas,aspectRatio){const context=canvas&&canvas.getContext&&canvas.getContext("2d");return context&&context.canvas===canvas?(initCanvas(canvas,aspectRatio),context):null}releaseContext(context){const canvas=context.canvas;if(!canvas.$chartjs)return!1;const initial=canvas.$chartjs.initial;["height","width"].forEach(prop=>{const value=initial[prop];isNullOrUndef(value)?canvas.removeAttribute(prop):canvas.setAttribute(prop,value)});const style=initial.style||{};return Object.keys(style).forEach(key=>{canvas.style[key]=style[key]}),canvas.width=canvas.width,delete canvas.$chartjs,!0}addEventListener(chart,type,listener){this.removeEventListener(chart,type);const proxies=chart.$proxies||(chart.$proxies={}),handlers={attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver},handler=handlers[type]||createProxyAndListen;proxies[type]=handler(chart,type,listener)}removeEventListener(chart,type){const proxies=chart.$proxies||(chart.$proxies={}),proxy=proxies[type];if(!proxy)return;const handlers={attach:releaseObserver,detach:releaseObserver,resize:releaseObserver},handler=handlers[type]||removeListener;handler(chart,type,proxy),proxies[type]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(canvas,width,height,aspectRatio){return getMaximumSize(canvas,width,height,aspectRatio)}isAttached(canvas){const container=_getParentNode(canvas);return!(!container||!container.isConnected)}}function _detectPlatform(canvas){return!_isDomSupported()||"undefined"!=typeof OffscreenCanvas&&canvas instanceof OffscreenCanvas?BasicPlatform:DomPlatform}var platforms=Object.freeze({__proto__:null,_detectPlatform:_detectPlatform,BasePlatform:BasePlatform,BasicPlatform:BasicPlatform,DomPlatform:DomPlatform});const transparent="transparent",interpolators={boolean:(from,to,factor)=>factor>.5?to:from,color(from,to,factor){const c0=color(from||transparent),c1=c0.valid&&color(to||transparent);return c1&&c1.valid?c1.mix(c0,factor).hexString():to},number:(from,to,factor)=>from+(to-from)*factor};class Animation{constructor(cfg,target,prop,to){const currentValue=target[prop];to=resolve([cfg.to,to,currentValue,cfg.from]);const from=resolve([cfg.from,currentValue,to]);this._active=!0,this._fn=cfg.fn||interpolators[cfg.type||typeof from],this._easing=effects[cfg.easing]||effects.linear,this._start=Math.floor(Date.now()+(cfg.delay||0)),this._duration=this._total=Math.floor(cfg.duration),this._loop=!!cfg.loop,this._target=target,this._prop=prop,this._from=from,this._to=to,this._promises=void 0}active(){return this._active}update(cfg,to,date){const me=this;if(me._active){me._notify(!1);const currentValue=me._target[me._prop],elapsed=date-me._start,remain=me._duration-elapsed;me._start=date,me._duration=Math.floor(Math.max(remain,cfg.duration)),me._total+=elapsed,me._loop=!!cfg.loop,me._to=resolve([cfg.to,to,currentValue,cfg.from]),me._from=resolve([cfg.from,currentValue,to])}}cancel(){const me=this;me._active&&(me.tick(Date.now()),me._active=!1,me._notify(!1))}tick(date){const me=this,elapsed=date-me._start,duration=me._duration,prop=me._prop,from=me._from,loop=me._loop,to=me._to;let factor;if(me._active=from!==to&&(loop||elapsed<duration),!me._active)return me._target[prop]=to,void me._notify(!0);elapsed<0?me._target[prop]=from:(factor=elapsed/duration%2,factor=loop&&factor>1?2-factor:factor,factor=me._easing(Math.min(1,Math.max(0,factor))),me._target[prop]=me._fn(from,to,factor))}wait(){const promises=this._promises||(this._promises=[]);return new Promise((res,rej)=>{promises.push({res:res,rej:rej})})}_notify(resolved){const method=resolved?"res":"rej",promises=this._promises||[];for(let i=0;i<promises.length;i++)promises[i][method]()}}const numbers=["x","y","borderWidth","radius","tension"],colors=["color","borderColor","backgroundColor"];defaults.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 animationOptions=Object.keys(defaults.animation);defaults.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:name=>"onProgress"!==name&&"onComplete"!==name&&"fn"!==name}),defaults.set("animations",{colors:{type:"color",properties:colors},numbers:{type:"number",properties:numbers}}),defaults.describe("animations",{_fallback:"animation"}),defaults.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:v=>0|v}}}});class Animations{constructor(chart,config){this._chart=chart,this._properties=new Map,this.configure(config)}configure(config){if(!isObject(config))return;const animatedProps=this._properties;Object.getOwnPropertyNames(config).forEach(key=>{const cfg=config[key];if(!isObject(cfg))return;const resolved={};for(const option of animationOptions)resolved[option]=cfg[option];(isArray(cfg.properties)&&cfg.properties||[key]).forEach(prop=>{prop!==key&&animatedProps.has(prop)||animatedProps.set(prop,resolved)})})}_animateOptions(target,values){const newOptions=values.options,options=resolveTargetOptions(target,newOptions);if(!options)return[];const animations=this._createAnimations(options,newOptions);return newOptions.$shared&&awaitAll(target.options.$animations,newOptions).then(()=>{target.options=newOptions},()=>{}),animations}_createAnimations(target,values){const animatedProps=this._properties,animations=[],running=target.$animations||(target.$animations={}),props=Object.keys(values),date=Date.now();let i;for(i=props.length-1;i>=0;--i){const prop=props[i];if("$"===prop.charAt(0))continue;if("options"===prop){animations.push(...this._animateOptions(target,values));continue}const value=values[prop];let animation=running[prop];const cfg=animatedProps.get(prop);if(animation){if(cfg&&animation.active()){animation.update(cfg,value,date);continue}animation.cancel()}cfg&&cfg.duration?(running[prop]=animation=new Animation(cfg,target,prop,value),animations.push(animation)):target[prop]=value}return animations}update(target,values){if(0===this._properties.size)return void Object.assign(target,values);const animations=this._createAnimations(target,values);return animations.length?(animator.add(this._chart,animations),!0):void 0}}function awaitAll(animations,properties){const running=[],keys=Object.keys(properties);for(let i=0;i<keys.length;i++){const anim=animations[keys[i]];anim&&anim.active()&&running.push(anim.wait())}return Promise.all(running)}function resolveTargetOptions(target,newOptions){if(!newOptions)return;let options=target.options;if(options)return options.$shared&&(target.options=options=Object.assign({},options,{$shared:!1,$animations:{}})),options;target.options=newOptions}function scaleClip(scale,allowedOverflow){const opts=scale&&scale.options||{},reverse=opts.reverse,min=void 0===opts.min?allowedOverflow:0,max=void 0===opts.max?allowedOverflow:0;return{start:reverse?max:min,end:reverse?min:max}}function defaultClip(xScale,yScale,allowedOverflow){if(!1===allowedOverflow)return!1;const x=scaleClip(xScale,allowedOverflow),y=scaleClip(yScale,allowedOverflow);return{top:y.end,right:x.end,bottom:y.start,left:x.start}}function toClip(value){let t,r,b,l;return isObject(value)?(t=value.top,r=value.right,b=value.bottom,l=value.left):t=r=b=l=value,{top:t,right:r,bottom:b,left:l,disabled:!1===value}}function getSortedDatasetIndices(chart,filterVisible){const keys=[],metasets=chart._getSortedDatasetMetas(filterVisible);let i,ilen;for(i=0,ilen=metasets.length;i<ilen;++i)keys.push(metasets[i].index);return keys}function applyStack(stack,value,dsIndex,options){const keys=stack.keys,singleMode="single"===options.mode;let i,ilen,datasetIndex,otherValue;if(null!==value){for(i=0,ilen=keys.length;i<ilen;++i){if(datasetIndex=+keys[i],datasetIndex===dsIndex){if(options.all)continue;break}otherValue=stack.values[datasetIndex],isNumberFinite(otherValue)&&(singleMode||0===value||sign(value)===sign(otherValue))&&(value+=otherValue)}return value}}function convertObjectDataToArray(data){const keys=Object.keys(data),adata=new Array(keys.length);let i,ilen,key;for(i=0,ilen=keys.length;i<ilen;++i)key=keys[i],adata[i]={x:key,y:data[key]};return adata}function isStacked(scale,meta){const stacked=scale&&scale.options.stacked;return stacked||void 0===stacked&&void 0!==meta.stack}function getStackKey(indexScale,valueScale,meta){return`${indexScale.id}.${valueScale.id}.${meta.stack||meta.type}`}function getUserBounds(scale){const{min:min,max:max,minDefined:minDefined,maxDefined:maxDefined}=scale.getUserBounds();return{min:minDefined?min:Number.NEGATIVE_INFINITY,max:maxDefined?max:Number.POSITIVE_INFINITY}}function getOrCreateStack(stacks,stackKey,indexValue){const subStack=stacks[stackKey]||(stacks[stackKey]={});return subStack[indexValue]||(subStack[indexValue]={})}function getLastIndexInStack(stack,vScale,positive){for(const meta of vScale.getMatchingVisibleMetas("bar").reverse()){const value=stack[meta.index];if(positive&&value>0||!positive&&value<0)return meta.index}return null}function updateStacks(controller,parsed){const{chart:chart,_cachedMeta:meta}=controller,stacks=chart._stacks||(chart._stacks={}),{iScale:iScale,vScale:vScale,index:datasetIndex}=meta,iAxis=iScale.axis,vAxis=vScale.axis,key=getStackKey(iScale,vScale,meta),ilen=parsed.length;let stack;for(let i=0;i<ilen;++i){const item=parsed[i],{[iAxis]:index,[vAxis]:value}=item,itemStacks=item._stacks||(item._stacks={});stack=itemStacks[vAxis]=getOrCreateStack(stacks,key,index),stack[datasetIndex]=value,stack._top=getLastIndexInStack(stack,vScale,!0),stack._bottom=getLastIndexInStack(stack,vScale,!1)}}function getFirstScaleId(chart,axis){const scales=chart.scales;return Object.keys(scales).filter(key=>scales[key].axis===axis).shift()}function createDatasetContext(parent,index){return Object.assign(Object.create(parent),{active:!1,dataset:void 0,datasetIndex:index,index:index,mode:"default",type:"dataset"})}function createDataContext(parent,index,element){return Object.assign(Object.create(parent),{active:!1,dataIndex:index,parsed:void 0,raw:void 0,element:element,index:index,mode:"default",type:"data"})}function clearStacks(meta,items){const datasetIndex=meta.controller.index,axis=meta.vScale&&meta.vScale.axis;if(axis){items=items||meta._parsed;for(const parsed of items){const stacks=parsed._stacks;if(!stacks||void 0===stacks[axis]||void 0===stacks[axis][datasetIndex])return;delete stacks[axis][datasetIndex]}}}const isDirectUpdateMode=mode=>"reset"===mode||"none"===mode,cloneIfNotShared=(cached,shared)=>shared?cached:Object.assign({},cached);class DatasetController{constructor(chart,datasetIndex){this.chart=chart,this._ctx=chart.ctx,this.index=datasetIndex,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 me=this,meta=me._cachedMeta;me.configure(),me.linkScales(),meta._stacked=isStacked(meta.vScale,meta),me.addElements()}updateIndex(datasetIndex){this.index!==datasetIndex&&clearStacks(this._cachedMeta),this.index=datasetIndex}linkScales(){const me=this,chart=me.chart,meta=me._cachedMeta,dataset=me.getDataset(),chooseId=(axis,x,y,r)=>"x"===axis?x:"r"===axis?r:y,xid=meta.xAxisID=valueOrDefault(dataset.xAxisID,getFirstScaleId(chart,"x")),yid=meta.yAxisID=valueOrDefault(dataset.yAxisID,getFirstScaleId(chart,"y")),rid=meta.rAxisID=valueOrDefault(dataset.rAxisID,getFirstScaleId(chart,"r")),indexAxis=meta.indexAxis,iid=meta.iAxisID=chooseId(indexAxis,xid,yid,rid),vid=meta.vAxisID=chooseId(indexAxis,yid,xid,rid);meta.xScale=me.getScaleForId(xid),meta.yScale=me.getScaleForId(yid),meta.rScale=me.getScaleForId(rid),meta.iScale=me.getScaleForId(iid),meta.vScale=me.getScaleForId(vid)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(scaleID){return this.chart.scales[scaleID]}_getOtherScale(scale){const meta=this._cachedMeta;return scale===meta.iScale?meta.vScale:meta.iScale}reset(){this._update("reset")}_destroy(){const meta=this._cachedMeta;this._data&&unlistenArrayEvents(this._data,this),meta._stacked&&clearStacks(meta)}_dataCheck(){const me=this,dataset=me.getDataset(),data=dataset.data||(dataset.data=[]),_data=me._data;if(isObject(data))me._data=convertObjectDataToArray(data);else if(_data!==data){if(_data){unlistenArrayEvents(_data,me);const meta=me._cachedMeta;clearStacks(meta),meta._parsed=[]}data&&Object.isExtensible(data)&&listenArrayEvents(data,me),me._syncList=[],me._data=data}}addElements(){const me=this,meta=me._cachedMeta;me._dataCheck(),me.datasetElementType&&(meta.dataset=new me.datasetElementType)}buildOrUpdateElements(resetNewElements){const me=this,meta=me._cachedMeta,dataset=me.getDataset();let stackChanged=!1;me._dataCheck();const oldStacked=meta._stacked;meta._stacked=isStacked(meta.vScale,meta),meta.stack!==dataset.stack&&(stackChanged=!0,clearStacks(meta),meta.stack=dataset.stack),me._resyncElements(resetNewElements),(stackChanged||oldStacked!==meta._stacked)&&updateStacks(me,meta._parsed)}configure(){const me=this,config=me.chart.config,scopeKeys=config.datasetScopeKeys(me._type),scopes=config.getOptionScopes(me.getDataset(),scopeKeys,!0);me.options=config.createResolver(scopes,me.getContext()),me._parsing=me.options.parsing}parse(start,count){const me=this,{_cachedMeta:meta,_data:data}=me,{iScale:iScale,_stacked:_stacked}=meta,iAxis=iScale.axis;let sorted=0===start&&count===data.length||meta._sorted,prev=start>0&&meta._parsed[start-1],i,cur,parsed;if(!1===me._parsing)meta._parsed=data,meta._sorted=!0,parsed=data;else{parsed=isArray(data[start])?me.parseArrayData(meta,data,start,count):isObject(data[start])?me.parseObjectData(meta,data,start,count):me.parsePrimitiveData(meta,data,start,count);const isNotInOrderComparedToPrev=()=>null===cur[iAxis]||prev&&cur[iAxis]<prev[iAxis];for(i=0;i<count;++i)meta._parsed[i+start]=cur=parsed[i],sorted&&(isNotInOrderComparedToPrev()&&(sorted=!1),prev=cur);meta._sorted=sorted}_stacked&&updateStacks(me,parsed)}parsePrimitiveData(meta,data,start,count){const{iScale:iScale,vScale:vScale}=meta,iAxis=iScale.axis,vAxis=vScale.axis,labels=iScale.getLabels(),singleScale=iScale===vScale,parsed=new Array(count);let i,ilen,index;for(i=0,ilen=count;i<ilen;++i)index=i+start,parsed[i]={[iAxis]:singleScale||iScale.parse(labels[index],index),[vAxis]:vScale.parse(data[index],index)};return parsed}parseArrayData(meta,data,start,count){const{xScale:xScale,yScale:yScale}=meta,parsed=new Array(count);let i,ilen,index,item;for(i=0,ilen=count;i<ilen;++i)index=i+start,item=data[index],parsed[i]={x:xScale.parse(item[0],index),y:yScale.parse(item[1],index)};return parsed}parseObjectData(meta,data,start,count){const{xScale:xScale,yScale:yScale}=meta,{xAxisKey:xAxisKey="x",yAxisKey:yAxisKey="y"}=this._parsing,parsed=new Array(count);let i,ilen,index,item;for(i=0,ilen=count;i<ilen;++i)index=i+start,item=data[index],parsed[i]={x:xScale.parse(resolveObjectKey(item,xAxisKey),index),y:yScale.parse(resolveObjectKey(item,yAxisKey),index)};return parsed}getParsed(index){return this._cachedMeta._parsed[index]}getDataElement(index){return this._cachedMeta.data[index]}applyStack(scale,parsed,mode){const chart=this.chart,meta=this._cachedMeta,value=parsed[scale.axis],stack={keys:getSortedDatasetIndices(chart,!0),values:parsed._stacks[scale.axis]};return applyStack(stack,value,meta.index,{mode:mode})}updateRangeFromParsed(range,scale,parsed,stack){const parsedValue=parsed[scale.axis];let value=null===parsedValue?NaN:parsedValue;const values=stack&&parsed._stacks[scale.axis];stack&&values&&(stack.values=values,range.min=Math.min(range.min,value),range.max=Math.max(range.max,value),value=applyStack(stack,parsedValue,this._cachedMeta.index,{all:!0})),range.min=Math.min(range.min,value),range.max=Math.max(range.max,value)}getMinMax(scale,canStack){const me=this,meta=me._cachedMeta,_parsed=meta._parsed,sorted=meta._sorted&&scale===meta.iScale,ilen=_parsed.length,otherScale=me._getOtherScale(scale),stack=canStack&&meta._stacked&&{keys:getSortedDatasetIndices(me.chart,!0),values:null},range={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:otherMin,max:otherMax}=getUserBounds(otherScale);let i,value,parsed,otherValue;function _skip(){return parsed=_parsed[i],value=parsed[scale.axis],otherValue=parsed[otherScale.axis],!isNumberFinite(value)||otherMin>otherValue||otherMax<otherValue}for(i=0;i<ilen&&(_skip()||(me.updateRangeFromParsed(range,scale,parsed,stack),!sorted));++i);if(sorted)for(i=ilen-1;i>=0;--i)if(!_skip()){me.updateRangeFromParsed(range,scale,parsed,stack);break}return range}getAllParsedValues(scale){const parsed=this._cachedMeta._parsed,values=[];let i,ilen,value;for(i=0,ilen=parsed.length;i<ilen;++i)value=parsed[i][scale.axis],isNumberFinite(value)&&values.push(value);return values}getMaxOverflow(){return!1}getLabelAndValue(index){const me=this,meta=me._cachedMeta,iScale=meta.iScale,vScale=meta.vScale,parsed=me.getParsed(index);return{label:iScale?""+iScale.getLabelForValue(parsed[iScale.axis]):"",value:vScale?""+vScale.getLabelForValue(parsed[vScale.axis]):""}}_update(mode){const me=this,meta=me._cachedMeta;me.configure(),me._cachedDataOpts={},me.update(mode||"default"),meta._clip=toClip(valueOrDefault(me.options.clip,defaultClip(meta.xScale,meta.yScale,me.getMaxOverflow())))}update(mode){}draw(){const me=this,ctx=me._ctx,chart=me.chart,meta=me._cachedMeta,elements=meta.data||[],area=chart.chartArea,active=[],start=me._drawStart||0,count=me._drawCount||elements.length-start;let i;for(meta.dataset&&meta.dataset.draw(ctx,area,start,count),i=start;i<start+count;++i){const element=elements[i];element.hidden||(element.active?active.push(element):element.draw(ctx,area))}for(i=0;i<active.length;++i)active[i].draw(ctx,area)}getStyle(index,active){const mode=active?"active":"default";return void 0===index&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(mode):this.resolveDataElementOptions(index||0,mode)}getContext(index,active,mode){const me=this,dataset=me.getDataset();let context;if(index>=0&&index<me._cachedMeta.data.length){const element=me._cachedMeta.data[index];context=element.$context||(element.$context=createDataContext(me.getContext(),index,element)),context.parsed=me.getParsed(index),context.raw=dataset.data[index],context.index=context.dataIndex=index}else context=me.$context||(me.$context=createDatasetContext(me.chart.getContext(),me.index)),context.dataset=dataset,context.index=context.datasetIndex=me.index;return context.active=!!active,context.mode=mode,context}resolveDatasetElementOptions(mode){return this._resolveElementOptions(this.datasetElementType.id,mode)}resolveDataElementOptions(index,mode){return this._resolveElementOptions(this.dataElementType.id,mode,index)}_resolveElementOptions(elementType,mode="default",index){const me=this,active="active"===mode,cache=me._cachedDataOpts,cacheKey=elementType+"-"+mode,cached=cache[cacheKey],sharing=me.enableOptionSharing&&defined(index);if(cached)return cloneIfNotShared(cached,sharing);const config=me.chart.config,scopeKeys=config.datasetElementScopeKeys(me._type,elementType),prefixes=active?[`${elementType}Hover`,"hover",elementType,""]:[elementType,""],scopes=config.getOptionScopes(me.getDataset(),scopeKeys),names=Object.keys(defaults.elements[elementType]),context=()=>me.getContext(index,active),values=config.resolveNamedOptions(scopes,names,context,prefixes);return values.$shared&&(values.$shared=sharing,cache[cacheKey]=Object.freeze(cloneIfNotShared(values,sharing))),values}_resolveAnimations(index,transition,active){const me=this,chart=me.chart,cache=me._cachedDataOpts,cacheKey=`animation-${transition}`,cached=cache[cacheKey];if(cached)return cached;let options;if(!1!==chart.options.animation){const config=me.chart.config,scopeKeys=config.datasetAnimationScopeKeys(me._type,transition),scopes=config.getOptionScopes(me.getDataset(),scopeKeys);options=config.createResolver(scopes,me.getContext(index,active,transition))}const animations=new Animations(chart,options&&options.animations);return options&&options._cacheable&&(cache[cacheKey]=Object.freeze(animations)),animations}getSharedOptions(options){if(options.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},options))}includeOptions(mode,sharedOptions){return!sharedOptions||isDirectUpdateMode(mode)||this.chart._animationsDisabled}updateElement(element,index,properties,mode){isDirectUpdateMode(mode)?Object.assign(element,properties):this._resolveAnimations(index,mode).update(element,properties)}updateSharedOptions(sharedOptions,mode,newOptions){sharedOptions&&!isDirectUpdateMode(mode)&&this._resolveAnimations(void 0,mode).update(sharedOptions,newOptions)}_setStyle(element,index,mode,active){element.active=active;const options=this.getStyle(index,active);this._resolveAnimations(index,mode,active).update(element,{options:!active&&this.getSharedOptions(options)||options})}removeHoverStyle(element,datasetIndex,index){this._setStyle(element,index,"active",!1)}setHoverStyle(element,datasetIndex,index){this._setStyle(element,index,"active",!0)}_removeDatasetHoverStyle(){const element=this._cachedMeta.dataset;element&&this._setStyle(element,void 0,"active",!1)}_setDatasetHoverStyle(){const element=this._cachedMeta.dataset;element&&this._setStyle(element,void 0,"active",!0)}_resyncElements(resetNewElements){const me=this,data=me._data,elements=me._cachedMeta.data;for(const[method,arg1,arg2]of me._syncList)me[method](arg1,arg2);me._syncList=[];const numMeta=elements.length,numData=data.length,count=Math.min(numData,numMeta);count&&me.parse(0,count),numData>numMeta?me._insertElements(numMeta,numData-numMeta,resetNewElements):numData<numMeta&&me._removeElements(numData,numMeta-numData)}_insertElements(start,count,resetNewElements=!0){const me=this,meta=me._cachedMeta,data=meta.data,end=start+count;let i;const move=arr=>{for(arr.length+=count,i=arr.length-1;i>=end;i--)arr[i]=arr[i-count]};for(move(data),i=start;i<end;++i)data[i]=new me.dataElementType;me._parsing&&move(meta._parsed),me.parse(start,count),resetNewElements&&me.updateElements(data,start,count,"reset")}updateElements(element,start,count,mode){}_removeElements(start,count){const me=this,meta=me._cachedMeta;if(me._parsing){const removed=meta._parsed.splice(start,count);meta._stacked&&clearStacks(meta,removed)}meta.data.splice(start,count)}_sync(args){if(this._parsing)this._syncList.push(args);else{const[method,arg1,arg2]=args;this[method](arg1,arg2)}}_onDataPush(){const count=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-count,count])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(start,count){this._sync(["_removeElements",start,count]),this._sync(["_insertElements",start,arguments.length-2])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}DatasetController.defaults={},DatasetController.prototype.datasetElementType=null,DatasetController.prototype.dataElementType=null;class Element{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(useFinalPosition){const{x:x,y:y}=this.getProps(["x","y"],useFinalPosition);return{x:x,y:y}}hasValue(){return isNumber(this.x)&&isNumber(this.y)}getProps(props,final){const me=this,anims=this.$animations;if(!final||!anims)return me;const ret={};return props.forEach(prop=>{ret[prop]=anims[prop]&&anims[prop].active()?anims[prop]._to:me[prop]}),ret}}Element.defaults={},Element.defaultRoutes=void 0;const formatters={values:value=>isArray(value)?value:""+value,numeric(tickValue,index,ticks){if(0===tickValue)return"0";const locale=this.chart.options.locale;let notation,delta=tickValue;if(ticks.length>1){const maxTick=Math.max(Math.abs(ticks[0].value),Math.abs(ticks[ticks.length-1].value));(maxTick<1e-4||maxTick>1e15)&&(notation="scientific"),delta=calculateDelta(tickValue,ticks)}const logDelta=log10(Math.abs(delta)),numDecimal=Math.max(Math.min(-1*Math.floor(logDelta),20),0),options={notation:notation,minimumFractionDigits:numDecimal,maximumFractionDigits:numDecimal};return Object.assign(options,this.options.ticks.format),formatNumber(tickValue,locale,options)},logarithmic(tickValue,index,ticks){if(0===tickValue)return"0";const remain=tickValue/Math.pow(10,Math.floor(log10(tickValue)));return 1===remain||2===remain||5===remain?formatters.numeric.call(this,tickValue,index,ticks):""}};function calculateDelta(tickValue,ticks){let delta=ticks.length>3?ticks[2].value-ticks[1].value:ticks[1].value-ticks[0].value;return Math.abs(delta)>=1&&tickValue!==Math.floor(tickValue)&&(delta=tickValue-Math.floor(tickValue)),delta}var Ticks={formatters:formatters};function autoSkip(scale,ticks){const tickOpts=scale.options.ticks,ticksLimit=tickOpts.maxTicksLimit||determineMaxTicks(scale),majorIndices=tickOpts.major.enabled?getMajorIndices(ticks):[],numMajorIndices=majorIndices.length,first=majorIndices[0],last=majorIndices[numMajorIndices-1],newTicks=[];if(numMajorIndices>ticksLimit)return skipMajors(ticks,newTicks,majorIndices,numMajorIndices/ticksLimit),newTicks;const spacing=calculateSpacing(majorIndices,ticks,ticksLimit);if(numMajorIndices>0){let i,ilen;const avgMajorSpacing=numMajorIndices>1?Math.round((last-first)/(numMajorIndices-1)):null;for(skip(ticks,newTicks,spacing,isNullOrUndef(avgMajorSpacing)?0:first-avgMajorSpacing,first),i=0,ilen=numMajorIndices-1;i<ilen;i++)skip(ticks,newTicks,spacing,majorIndices[i],majorIndices[i+1]);return skip(ticks,newTicks,spacing,last,isNullOrUndef(avgMajorSpacing)?ticks.length:last+avgMajorSpacing),newTicks}return skip(ticks,newTicks,spacing),newTicks}function determineMaxTicks(scale){const offset=scale.options.offset,tickLength=scale._tickSize(),maxScale=scale._length/tickLength+(offset?0:1),maxChart=scale._maxLength/tickLength;return Math.floor(Math.min(maxScale,maxChart))}function calculateSpacing(majorIndices,ticks,ticksLimit){const evenMajorSpacing=getEvenSpacing(majorIndices),spacing=ticks.length/ticksLimit;if(!evenMajorSpacing)return Math.max(spacing,1);const factors=_factorize(evenMajorSpacing);for(let i=0,ilen=factors.length-1;i<ilen;i++){const factor=factors[i];if(factor>spacing)return factor}return Math.max(spacing,1)}function getMajorIndices(ticks){const result=[];let i,ilen;for(i=0,ilen=ticks.length;i<ilen;i++)ticks[i].major&&result.push(i);return result}function skipMajors(ticks,newTicks,majorIndices,spacing){let count=0,next=majorIndices[0],i;for(spacing=Math.ceil(spacing),i=0;i<ticks.length;i++)i===next&&(newTicks.push(ticks[i]),count++,next=majorIndices[count*spacing])}function skip(ticks,newTicks,spacing,majorStart,majorEnd){const start=valueOrDefault(majorStart,0),end=Math.min(valueOrDefault(majorEnd,ticks.length),ticks.length);let count=0,length,i,next;for(spacing=Math.ceil(spacing),majorEnd&&(length=majorEnd-majorStart,spacing=length/Math.floor(length/spacing)),next=start;next<0;)count++,next=Math.round(start+count*spacing);for(i=Math.max(start,0);i<end;i++)i===next&&(newTicks.push(ticks[i]),count++,next=Math.round(start+count*spacing))}function getEvenSpacing(arr){const len=arr.length;let i,diff;if(len<2)return!1;for(diff=arr[0],i=1;i<len;++i)if(arr[i]-arr[i-1]!==diff)return!1;return diff}defaults.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:(_ctx,options)=>options.lineWidth,tickColor:(_ctx,options)=>options.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:Ticks.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),defaults.route("scale.ticks","color","","color"),defaults.route("scale.grid","color","","borderColor"),defaults.route("scale.grid","borderColor","","borderColor"),defaults.route("scale.title","color","","color"),defaults.describe("scale",{_fallback:!1,_scriptable:name=>!name.startsWith("before")&&!name.startsWith("after")&&"callback"!==name&&"parser"!==name,_indexable:name=>"borderDash"!==name&&"tickBorderDash"!==name}),defaults.describe("scales",{_fallback:"scale"}),defaults.describe("scale.ticks",{_scriptable:name=>"backdropPadding"!==name&&"callback"!==name,_indexable:name=>"backdropPadding"!==name});const reverseAlign=align=>"left"===align?"right":"right"===align?"left":align,offsetFromEdge=(scale,edge,offset)=>"top"===edge||"left"===edge?scale[edge]+offset:scale[edge]-offset;function sample(arr,numItems){const result=[],increment=arr.length/numItems,len=arr.length;let i=0;for(;i<len;i+=increment)result.push(arr[Math.floor(i)]);return result}function getPixelForGridLine(scale,index,offsetGridLines){const length=scale.ticks.length,validIndex=Math.min(index,length-1),start=scale._startPixel,end=scale._endPixel,epsilon=1e-6;let lineValue=scale.getPixelForTick(validIndex),offset;if(!(offsetGridLines&&(offset=1===length?Math.max(lineValue-start,end-lineValue):0===index?(scale.getPixelForTick(1)-lineValue)/2:(lineValue-scale.getPixelForTick(validIndex-1))/2,lineValue+=validIndex<index?offset:-offset,lineValue<start-1e-6||lineValue>end+1e-6)))return lineValue}function garbageCollect(caches,length){each(caches,cache=>{const gc=cache.gc,gcLen=gc.length/2;let i;if(gcLen>length){for(i=0;i<gcLen;++i)delete cache.data[gc[i]];gc.splice(0,gcLen)}})}function getTickMarkLength(options){return options.drawTicks?options.tickLength:0}function getTitleHeight(options,fallback){if(!options.display)return 0;const font=toFont(options.font,fallback),padding=toPadding(options.padding),lines=isArray(options.text)?options.text.length:1;return lines*font.lineHeight+padding.height}function createScaleContext(parent,scale){return Object.assign(Object.create(parent),{scale:scale,type:"scale"})}function createTickContext(parent,index,tick){return Object.assign(Object.create(parent),{tick:tick,index:index,type:"tick"})}function titleAlign(align,position,reverse){let ret=_toLeftRightCenter(align);return(reverse&&"right"!==position||!reverse&&"right"===position)&&(ret=reverseAlign(ret)),ret}function titleArgs(scale,offset,position,align){const{top:top,left:left,bottom:bottom,right:right,chart:chart}=scale,{chartArea:chartArea,scales:scales}=chart;let rotation=0,maxWidth,titleX,titleY;const height=bottom-top,width=right-left;if(scale.isHorizontal()){if(titleX=_alignStartEnd(align,left,right),isObject(position)){const positionAxisID=Object.keys(position)[0],value=position[positionAxisID];titleY=scales[positionAxisID].getPixelForValue(value)+height-offset}else titleY="center"===position?(chartArea.bottom+chartArea.top)/2+height-offset:offsetFromEdge(scale,position,offset);maxWidth=right-left}else{if(isObject(position)){const positionAxisID=Object.keys(position)[0],value=position[positionAxisID];titleX=scales[positionAxisID].getPixelForValue(value)-width+offset}else titleX="center"===position?(chartArea.left+chartArea.right)/2-width+offset:offsetFromEdge(scale,position,offset);titleY=_alignStartEnd(align,bottom,top),rotation="left"===position?-HALF_PI:HALF_PI}return{titleX:titleX,titleY:titleY,maxWidth:maxWidth,rotation:rotation}}class Scale extends Element{constructor(cfg){super(),this.id=cfg.id,this.type=cfg.type,this.options=void 0,this.ctx=cfg.ctx,this.chart=cfg.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(options){const me=this;me.options=options.setContext(me.getContext()),me.axis=options.axis,me._userMin=me.parse(options.min),me._userMax=me.parse(options.max),me._suggestedMin=me.parse(options.suggestedMin),me._suggestedMax=me.parse(options.suggestedMax)}parse(raw,index){return raw}getUserBounds(){let{_userMin:_userMin,_userMax:_userMax,_suggestedMin:_suggestedMin,_suggestedMax:_suggestedMax}=this;return _userMin=finiteOrDefault(_userMin,Number.POSITIVE_INFINITY),_userMax=finiteOrDefault(_userMax,Number.NEGATIVE_INFINITY),_suggestedMin=finiteOrDefault(_suggestedMin,Number.POSITIVE_INFINITY),_suggestedMax=finiteOrDefault(_suggestedMax,Number.NEGATIVE_INFINITY),{min:finiteOrDefault(_userMin,_suggestedMin),max:finiteOrDefault(_userMax,_suggestedMax),minDefined:isNumberFinite(_userMin),maxDefined:isNumberFinite(_userMax)}}getMinMax(canStack){const me=this;let{min:min,max:max,minDefined:minDefined,maxDefined:maxDefined}=me.getUserBounds(),range;if(minDefined&&maxDefined)return{min:min,max:max};const metas=me.getMatchingVisibleMetas();for(let i=0,ilen=metas.length;i<ilen;++i)range=metas[i].controller.getMinMax(me,canStack),minDefined||(min=Math.min(min,range.min)),maxDefined||(max=Math.max(max,range.max));return{min:finiteOrDefault(min,finiteOrDefault(max,min)),max:finiteOrDefault(max,finiteOrDefault(min,max))}}getPadding(){const me=this;return{left:me.paddingLeft||0,top:me.paddingTop||0,right:me.paddingRight||0,bottom:me.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const data=this.chart.data;return this.options.labels||(this.isHorizontal()?data.xLabels:data.yLabels)||data.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){callback(this.options.beforeUpdate,[this])}update(maxWidth,maxHeight,margins){const me=this,tickOpts=me.options.ticks,sampleSize=tickOpts.sampleSize;me.beforeUpdate(),me.maxWidth=maxWidth,me.maxHeight=maxHeight,me._margins=margins=Object.assign({left:0,right:0,top:0,bottom:0},margins),me.ticks=null,me._labelSizes=null,me._gridLineItems=null,me._labelItems=null,me.beforeSetDimensions(),me.setDimensions(),me.afterSetDimensions(),me._maxLength=me.isHorizontal()?me.width+margins.left+margins.right:me.height+margins.top+margins.bottom,me._dataLimitsCached||(me.beforeDataLimits(),me.determineDataLimits(),me.afterDataLimits(),me._range=_addGrace(me,me.options.grace),me._dataLimitsCached=!0),me.beforeBuildTicks(),me.ticks=me.buildTicks()||[],me.afterBuildTicks();const samplingEnabled=sampleSize<me.ticks.length;me._convertTicksToLabels(samplingEnabled?sample(me.ticks,sampleSize):me.ticks),me.configure(),me.beforeCalculateLabelRotation(),me.calculateLabelRotation(),me.afterCalculateLabelRotation(),tickOpts.display&&(tickOpts.autoSkip||"auto"===tickOpts.source)&&(me.ticks=autoSkip(me,me.ticks),me._labelSizes=null),samplingEnabled&&me._convertTicksToLabels(me.ticks),me.beforeFit(),me.fit(),me.afterFit(),me.afterUpdate()}configure(){const me=this;let reversePixels=me.options.reverse,startPixel,endPixel;me.isHorizontal()?(startPixel=me.left,endPixel=me.right):(startPixel=me.top,endPixel=me.bottom,reversePixels=!reversePixels),me._startPixel=startPixel,me._endPixel=endPixel,me._reversePixels=reversePixels,me._length=endPixel-startPixel,me._alignToPixels=me.options.alignToPixels}afterUpdate(){callback(this.options.afterUpdate,[this])}beforeSetDimensions(){callback(this.options.beforeSetDimensions,[this])}setDimensions(){const me=this;me.isHorizontal()?(me.width=me.maxWidth,me.left=0,me.right=me.width):(me.height=me.maxHeight,me.top=0,me.bottom=me.height),me.paddingLeft=0,me.paddingTop=0,me.paddingRight=0,me.paddingBottom=0}afterSetDimensions(){callback(this.options.afterSetDimensions,[this])}_callHooks(name){const me=this;me.chart.notifyPlugins(name,me.getContext()),callback(me.options[name],[me])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){callback(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(ticks){const me=this,tickOpts=me.options.ticks;let i,ilen,tick;for(i=0,ilen=ticks.length;i<ilen;i++)tick=ticks[i],tick.label=callback(tickOpts.callback,[tick.value,i,ticks],me)}afterTickToLabelConversion(){callback(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){callback(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const me=this,options=me.options,tickOpts=options.ticks,numTicks=me.ticks.length,minRotation=tickOpts.minRotation||0,maxRotation=tickOpts.maxRotation;let labelRotation=minRotation,tickWidth,maxHeight,maxLabelDiagonal;if(!me._isVisible()||!tickOpts.display||minRotation>=maxRotation||numTicks<=1||!me.isHorizontal())return void(me.labelRotation=minRotation);const labelSizes=me._getLabelSizes(),maxLabelWidth=labelSizes.widest.width,maxLabelHeight=labelSizes.highest.height,maxWidth=_limitValue(me.chart.width-maxLabelWidth,0,me.maxWidth);tickWidth=options.offset?me.maxWidth/numTicks:maxWidth/(numTicks-1),maxLabelWidth+6>tickWidth&&(tickWidth=maxWidth/(numTicks-(options.offset?.5:1)),maxHeight=me.maxHeight-getTickMarkLength(options.grid)-tickOpts.padding-getTitleHeight(options.title,me.chart.options.font),maxLabelDiagonal=Math.sqrt(maxLabelWidth*maxLabelWidth+maxLabelHeight*maxLabelHeight),labelRotation=toDegrees(Math.min(Math.asin(_limitValue((labelSizes.highest.height+6)/tickWidth,-1,1)),Math.asin(_limitValue(maxHeight/maxLabelDiagonal,-1,1))-Math.asin(_limitValue(maxLabelHeight/maxLabelDiagonal,-1,1)))),labelRotation=Math.max(minRotation,Math.min(maxRotation,labelRotation))),me.labelRotation=labelRotation}afterCalculateLabelRotation(){callback(this.options.afterCalculateLabelRotation,[this])}beforeFit(){callback(this.options.beforeFit,[this])}fit(){const me=this,minSize={width:0,height:0},{chart:chart,options:{ticks:tickOpts,title:titleOpts,grid:gridOpts}}=me,display=me._isVisible(),isHorizontal=me.isHorizontal();if(display){const titleHeight=getTitleHeight(titleOpts,chart.options.font);if(isHorizontal?(minSize.width=me.maxWidth,minSize.height=getTickMarkLength(gridOpts)+titleHeight):(minSize.height=me.maxHeight,minSize.width=getTickMarkLength(gridOpts)+titleHeight),tickOpts.display&&me.ticks.length){const{first:first,last:last,widest:widest,highest:highest}=me._getLabelSizes(),tickPadding=2*tickOpts.padding,angleRadians=toRadians(me.labelRotation),cos=Math.cos(angleRadians),sin=Math.sin(angleRadians);if(isHorizontal){const labelHeight=tickOpts.mirror?0:sin*widest.width+cos*highest.height;minSize.height=Math.min(me.maxHeight,minSize.height+labelHeight+tickPadding)}else{const labelWidth=tickOpts.mirror?0:cos*widest.width+sin*highest.height;minSize.width=Math.min(me.maxWidth,minSize.width+labelWidth+tickPadding)}me._calculatePadding(first,last,sin,cos)}}me._handleMargins(),isHorizontal?(me.width=me._length=chart.width-me._margins.left-me._margins.right,me.height=minSize.height):(me.width=minSize.width,me.height=me._length=chart.height-me._margins.top-me._margins.bottom)}_calculatePadding(first,last,sin,cos){const me=this,{ticks:{align:align,padding:padding},position:position}=me.options,isRotated=0!==me.labelRotation,labelsBelowTicks="top"!==position&&"x"===me.axis;if(me.isHorizontal()){const offsetLeft=me.getPixelForTick(0)-me.left,offsetRight=me.right-me.getPixelForTick(me.ticks.length-1);let paddingLeft=0,paddingRight=0;isRotated?labelsBelowTicks?(paddingLeft=cos*first.width,paddingRight=sin*last.height):(paddingLeft=sin*first.height,paddingRight=cos*last.width):"start"===align?paddingRight=last.width:"end"===align?paddingLeft=first.width:(paddingLeft=first.width/2,paddingRight=last.width/2),me.paddingLeft=Math.max((paddingLeft-offsetLeft+padding)*me.width/(me.width-offsetLeft),0),me.paddingRight=Math.max((paddingRight-offsetRight+padding)*me.width/(me.width-offsetRight),0)}else{let paddingTop=last.height/2,paddingBottom=first.height/2;"start"===align?(paddingTop=0,paddingBottom=first.height):"end"===align&&(paddingTop=last.height,paddingBottom=0),me.paddingTop=paddingTop+padding,me.paddingBottom=paddingBottom+padding}}_handleMargins(){const me=this;me._margins&&(me._margins.left=Math.max(me.paddingLeft,me._margins.left),me._margins.top=Math.max(me.paddingTop,me._margins.top),me._margins.right=Math.max(me.paddingRight,me._margins.right),me._margins.bottom=Math.max(me.paddingBottom,me._margins.bottom))}afterFit(){callback(this.options.afterFit,[this])}isHorizontal(){const{axis:axis,position:position}=this.options;return"top"===position||"bottom"===position||"x"===axis}isFullSize(){return this.options.fullSize}_convertTicksToLabels(ticks){const me=this;let i,ilen;for(me.beforeTickToLabelConversion(),me.generateTickLabels(ticks),i=0,ilen=ticks.length;i<ilen;i++)isNullOrUndef(ticks[i].label)&&(ticks.splice(i,1),ilen--,i--);me.afterTickToLabelConversion()}_getLabelSizes(){const me=this;let labelSizes=me._labelSizes;if(!labelSizes){const sampleSize=me.options.ticks.sampleSize;let ticks=me.ticks;sampleSize<ticks.length&&(ticks=sample(ticks,sampleSize)),me._labelSizes=labelSizes=me._computeLabelSizes(ticks,ticks.length)}return labelSizes}_computeLabelSizes(ticks,length){const{ctx:ctx,_longestTextCache:caches}=this,widths=[],heights=[];let widestLabelSize=0,highestLabelSize=0,i,j,jlen,label,tickFont,fontString,cache,lineHeight,width,height,nestedLabel;for(i=0;i<length;++i){if(label=ticks[i].label,tickFont=this._resolveTickFontOptions(i),ctx.font=fontString=tickFont.string,cache=caches[fontString]=caches[fontString]||{data:{},gc:[]},lineHeight=tickFont.lineHeight,width=height=0,isNullOrUndef(label)||isArray(label)){if(isArray(label))for(j=0,jlen=label.length;j<jlen;++j)nestedLabel=label[j],isNullOrUndef(nestedLabel)||isArray(nestedLabel)||(width=_measureText(ctx,cache.data,cache.gc,width,nestedLabel),height+=lineHeight)}else width=_measureText(ctx,cache.data,cache.gc,width,label),height=lineHeight;widths.push(width),heights.push(height),widestLabelSize=Math.max(width,widestLabelSize),highestLabelSize=Math.max(height,highestLabelSize)}garbageCollect(caches,length);const widest=widths.indexOf(widestLabelSize),highest=heights.indexOf(highestLabelSize),valueAt=idx=>({width:widths[idx]||0,height:heights[idx]||0});return{first:valueAt(0),last:valueAt(length-1),widest:valueAt(widest),highest:valueAt(highest),widths:widths,heights:heights}}getLabelForValue(value){return value}getPixelForValue(value,index){return NaN}getValueForPixel(pixel){}getPixelForTick(index){const ticks=this.ticks;return index<0||index>ticks.length-1?null:this.getPixelForValue(ticks[index].value)}getPixelForDecimal(decimal){const me=this;me._reversePixels&&(decimal=1-decimal);const pixel=me._startPixel+decimal*me._length;return _int16Range(me._alignToPixels?_alignPixel(me.chart,pixel,0):pixel)}getDecimalForPixel(pixel){const decimal=(pixel-this._startPixel)/this._length;return this._reversePixels?1-decimal:decimal}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:min,max:max}=this;return min<0&&max<0?max:min>0&&max>0?min:0}getContext(index){const me=this,ticks=me.ticks||[];if(index>=0&&index<ticks.length){const tick=ticks[index];return tick.$context||(tick.$context=createTickContext(me.getContext(),index,tick))}return me.$context||(me.$context=createScaleContext(me.chart.getContext(),me))}_tickSize(){const me=this,optionTicks=me.options.ticks,rot=toRadians(me.labelRotation),cos=Math.abs(Math.cos(rot)),sin=Math.abs(Math.sin(rot)),labelSizes=me._getLabelSizes(),padding=optionTicks.autoSkipPadding||0,w=labelSizes?labelSizes.widest.width+padding:0,h=labelSizes?labelSizes.highest.height+padding:0;return me.isHorizontal()?h*cos>w*sin?w/cos:h/sin:h*sin<w*cos?h/cos:w/sin}_isVisible(){const display=this.options.display;return"auto"!==display?!!display:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(chartArea){const me=this,axis=me.axis,chart=me.chart,options=me.options,{grid:grid,position:position}=options,offset=grid.offset,isHorizontal=me.isHorizontal(),ticks=me.ticks,ticksLength=ticks.length+(offset?1:0),tl=getTickMarkLength(grid),items=[],borderOpts=grid.setContext(me.getContext()),axisWidth=borderOpts.drawBorder?borderOpts.borderWidth:0,axisHalfWidth=axisWidth/2,alignBorderValue=function(pixel){return _alignPixel(chart,pixel,axisWidth)};let borderValue,i,lineValue,alignedLineValue,tx1,ty1,tx2,ty2,x1,y1,x2,y2;if("top"===position)borderValue=alignBorderValue(me.bottom),ty1=me.bottom-tl,ty2=borderValue-axisHalfWidth,y1=alignBorderValue(chartArea.top)+axisHalfWidth,y2=chartArea.bottom;else if("bottom"===position)borderValue=alignBorderValue(me.top),y1=chartArea.top,y2=alignBorderValue(chartArea.bottom)-axisHalfWidth,ty1=borderValue+axisHalfWidth,ty2=me.top+tl;else if("left"===position)borderValue=alignBorderValue(me.right),tx1=me.right-tl,tx2=borderValue-axisHalfWidth,x1=alignBorderValue(chartArea.left)+axisHalfWidth,x2=chartArea.right;else if("right"===position)borderValue=alignBorderValue(me.left),x1=chartArea.left,x2=alignBorderValue(chartArea.right)-axisHalfWidth,tx1=borderValue+axisHalfWidth,tx2=me.left+tl;else if("x"===axis){if("center"===position)borderValue=alignBorderValue((chartArea.top+chartArea.bottom)/2+.5);else if(isObject(position)){const positionAxisID=Object.keys(position)[0],value=position[positionAxisID];borderValue=alignBorderValue(me.chart.scales[positionAxisID].getPixelForValue(value))}y1=chartArea.top,y2=chartArea.bottom,ty1=borderValue+axisHalfWidth,ty2=ty1+tl}else if("y"===axis){if("center"===position)borderValue=alignBorderValue((chartArea.left+chartArea.right)/2);else if(isObject(position)){const positionAxisID=Object.keys(position)[0],value=position[positionAxisID];borderValue=alignBorderValue(me.chart.scales[positionAxisID].getPixelForValue(value))}tx1=borderValue-axisHalfWidth,tx2=tx1-tl,x1=chartArea.left,x2=chartArea.right}const limit=valueOrDefault(options.ticks.maxTicksLimit,ticksLength),step=Math.max(1,Math.ceil(ticksLength/limit));for(i=0;i<ticksLength;i+=step){const optsAtIndex=grid.setContext(me.getContext(i)),lineWidth=optsAtIndex.lineWidth,lineColor=optsAtIndex.color,borderDash=grid.borderDash||[],borderDashOffset=optsAtIndex.borderDashOffset,tickWidth=optsAtIndex.tickWidth,tickColor=optsAtIndex.tickColor,tickBorderDash=optsAtIndex.tickBorderDash||[],tickBorderDashOffset=optsAtIndex.tickBorderDashOffset;lineValue=getPixelForGridLine(me,i,offset),void 0!==lineValue&&(alignedLineValue=_alignPixel(chart,lineValue,lineWidth),isHorizontal?tx1=tx2=x1=x2=alignedLineValue:ty1=ty2=y1=y2=alignedLineValue,items.push({tx1:tx1,ty1:ty1,tx2:tx2,ty2:ty2,x1:x1,y1:y1,x2:x2,y2:y2,width:lineWidth,color:lineColor,borderDash:borderDash,borderDashOffset:borderDashOffset,tickWidth:tickWidth,tickColor:tickColor,tickBorderDash:tickBorderDash,tickBorderDashOffset:tickBorderDashOffset}))}return me._ticksLength=ticksLength,me._borderValue=borderValue,items}_computeLabelItems(chartArea){const me=this,axis=me.axis,options=me.options,{position:position,ticks:optionTicks}=options,isHorizontal=me.isHorizontal(),ticks=me.ticks,{align:align,crossAlign:crossAlign,padding:padding,mirror:mirror}=optionTicks,tl=getTickMarkLength(options.grid),tickAndPadding=tl+padding,hTickAndPadding=mirror?-padding:tickAndPadding,rotation=-toRadians(me.labelRotation),items=[];let i,ilen,tick,label,x,y,textAlign,pixel,font,lineHeight,lineCount,textOffset,textBaseline="middle";if("top"===position)y=me.bottom-hTickAndPadding,textAlign=me._getXAxisLabelAlignment();else if("bottom"===position)y=me.top+hTickAndPadding,textAlign=me._getXAxisLabelAlignment();else if("left"===position){const ret=me._getYAxisLabelAlignment(tl);textAlign=ret.textAlign,x=ret.x}else if("right"===position){const ret=me._getYAxisLabelAlignment(tl);textAlign=ret.textAlign,x=ret.x}else if("x"===axis){if("center"===position)y=(chartArea.top+chartArea.bottom)/2+tickAndPadding;else if(isObject(position)){const positionAxisID=Object.keys(position)[0],value=position[positionAxisID];y=me.chart.scales[positionAxisID].getPixelForValue(value)+tickAndPadding}textAlign=me._getXAxisLabelAlignment()}else if("y"===axis){if("center"===position)x=(chartArea.left+chartArea.right)/2-tickAndPadding;else if(isObject(position)){const positionAxisID=Object.keys(position)[0],value=position[positionAxisID];x=me.chart.scales[positionAxisID].getPixelForValue(value)}textAlign=me._getYAxisLabelAlignment(tl).textAlign}"y"===axis&&("start"===align?textBaseline="top":"end"===align&&(textBaseline="bottom"));const labelSizes=me._getLabelSizes();for(i=0,ilen=ticks.length;i<ilen;++i){tick=ticks[i],label=tick.label;const optsAtIndex=optionTicks.setContext(me.getContext(i));pixel=me.getPixelForTick(i)+optionTicks.labelOffset,font=me._resolveTickFontOptions(i),lineHeight=font.lineHeight,lineCount=isArray(label)?label.length:1;const halfCount=lineCount/2,color=optsAtIndex.color,strokeColor=optsAtIndex.textStrokeColor,strokeWidth=optsAtIndex.textStrokeWidth;let backdrop;if(isHorizontal?(x=pixel,textOffset="top"===position?"near"===crossAlign||0!==rotation?-lineCount*lineHeight+lineHeight/2:"center"===crossAlign?-labelSizes.highest.height/2-halfCount*lineHeight+lineHeight:-labelSizes.highest.height+lineHeight/2:"near"===crossAlign||0!==rotation?lineHeight/2:"center"===crossAlign?labelSizes.highest.height/2-halfCount*lineHeight:labelSizes.highest.height-lineCount*lineHeight,mirror&&(textOffset*=-1)):(y=pixel,textOffset=(1-lineCount)*lineHeight/2),optsAtIndex.showLabelBackdrop){const labelPadding=toPadding(optsAtIndex.backdropPadding),height=labelSizes.heights[i],width=labelSizes.widths[i];let top=y+textOffset-labelPadding.top,left=x-labelPadding.left;switch(textBaseline){case"middle":top-=height/2;break;case"bottom":top-=height}switch(textAlign){case"center":left-=width/2;break;case"right":left-=width}backdrop={left:left,top:top,width:width+labelPadding.width,height:height+labelPadding.height,color:optsAtIndex.backdropColor}}items.push({rotation:rotation,label:label,font:font,color:color,strokeColor:strokeColor,strokeWidth:strokeWidth,textOffset:textOffset,textAlign:textAlign,textBaseline:textBaseline,translation:[x,y],backdrop:backdrop})}return items}_getXAxisLabelAlignment(){const me=this,{position:position,ticks:ticks}=me.options,rotation=-toRadians(me.labelRotation);if(rotation)return"top"===position?"left":"right";let align="center";return"start"===ticks.align?align="left":"end"===ticks.align&&(align="right"),align}_getYAxisLabelAlignment(tl){const me=this,{position:position,ticks:{crossAlign:crossAlign,mirror:mirror,padding:padding}}=me.options,labelSizes=me._getLabelSizes(),tickAndPadding=tl+padding,widest=labelSizes.widest.width;let textAlign,x;return"left"===position?mirror?(x=me.right+padding,"near"===crossAlign?textAlign="left":"center"===crossAlign?(textAlign="center",x+=widest/2):(textAlign="right",x+=widest)):(x=me.right-tickAndPadding,"near"===crossAlign?textAlign="right":"center"===crossAlign?(textAlign="center",x-=widest/2):(textAlign="left",x=me.left)):"right"===position?mirror?(x=me.left+padding,"near"===crossAlign?textAlign="right":"center"===crossAlign?(textAlign="center",x-=widest/2):(textAlign="left",x-=widest)):(x=me.left+tickAndPadding,"near"===crossAlign?textAlign="left":"center"===crossAlign?(textAlign="center",x+=widest/2):(textAlign="right",x=me.right)):textAlign="right",{textAlign:textAlign,x:x}}_computeLabelArea(){const me=this;if(me.options.ticks.mirror)return;const chart=me.chart,position=me.options.position;return"left"===position||"right"===position?{top:0,left:me.left,bottom:chart.height,right:me.right}:"top"===position||"bottom"===position?{top:me.top,left:0,bottom:me.bottom,right:chart.width}:void 0}drawBackground(){const{ctx:ctx,options:{backgroundColor:backgroundColor},left:left,top:top,width:width,height:height}=this;backgroundColor&&(ctx.save(),ctx.fillStyle=backgroundColor,ctx.fillRect(left,top,width,height),ctx.restore())}getLineWidthForValue(value){const me=this,grid=me.options.grid;if(!me._isVisible()||!grid.display)return 0;const ticks=me.ticks,index=ticks.findIndex(t=>t.value===value);if(index>=0){const opts=grid.setContext(me.getContext(index));return opts.lineWidth}return 0}drawGrid(chartArea){const me=this,grid=me.options.grid,ctx=me.ctx,items=me._gridLineItems||(me._gridLineItems=me._computeGridLineItems(chartArea));let i,ilen;const drawLine=(p1,p2,style)=>{style.width&&style.color&&(ctx.save(),ctx.lineWidth=style.width,ctx.strokeStyle=style.color,ctx.setLineDash(style.borderDash||[]),ctx.lineDashOffset=style.borderDashOffset,ctx.beginPath(),ctx.moveTo(p1.x,p1.y),ctx.lineTo(p2.x,p2.y),ctx.stroke(),ctx.restore())};if(grid.display)for(i=0,ilen=items.length;i<ilen;++i){const item=items[i];grid.drawOnChartArea&&drawLine({x:item.x1,y:item.y1},{x:item.x2,y:item.y2},item),grid.drawTicks&&drawLine({x:item.tx1,y:item.ty1},{x:item.tx2,y:item.ty2},{color:item.tickColor,width:item.tickWidth,borderDash:item.tickBorderDash,borderDashOffset:item.tickBorderDashOffset})}}drawBorder(){const me=this,{chart:chart,ctx:ctx,options:{grid:grid}}=me,borderOpts=grid.setContext(me.getContext()),axisWidth=grid.drawBorder?borderOpts.borderWidth:0;if(!axisWidth)return;const lastLineWidth=grid.setContext(me.getContext(0)).lineWidth,borderValue=me._borderValue;let x1,x2,y1,y2;me.isHorizontal()?(x1=_alignPixel(chart,me.left,axisWidth)-axisWidth/2,x2=_alignPixel(chart,me.right,lastLineWidth)+lastLineWidth/2,y1=y2=borderValue):(y1=_alignPixel(chart,me.top,axisWidth)-axisWidth/2,y2=_alignPixel(chart,me.bottom,lastLineWidth)+lastLineWidth/2,x1=x2=borderValue),ctx.save(),ctx.lineWidth=borderOpts.borderWidth,ctx.strokeStyle=borderOpts.borderColor,ctx.beginPath(),ctx.moveTo(x1,y1),ctx.lineTo(x2,y2),ctx.stroke(),ctx.restore()}drawLabels(chartArea){const me=this,optionTicks=me.options.ticks;if(!optionTicks.display)return;const ctx=me.ctx,area=me._computeLabelArea();area&&clipArea(ctx,area);const items=me._labelItems||(me._labelItems=me._computeLabelItems(chartArea));let i,ilen;for(i=0,ilen=items.length;i<ilen;++i){const item=items[i],tickFont=item.font,label=item.label;let y;item.backdrop&&(ctx.fillStyle=item.backdrop.color,ctx.fillRect(item.backdrop.left,item.backdrop.top,item.backdrop.width,item.backdrop.height)),renderText(ctx,label,0,item.textOffset,tickFont,item)}area&&unclipArea(ctx)}drawTitle(){const{ctx:ctx,options:{position:position,title:title,reverse:reverse}}=this;if(!title.display)return;const font=toFont(title.font),padding=toPadding(title.padding),align=title.align;let offset=font.lineHeight/2;"bottom"===position||"center"===position||isObject(position)?(offset+=padding.bottom,isArray(title.text)&&(offset+=font.lineHeight*(title.text.length-1))):offset+=padding.top;const{titleX:titleX,titleY:titleY,maxWidth:maxWidth,rotation:rotation}=titleArgs(this,offset,position,align);renderText(ctx,title.text,0,0,font,{color:title.color,maxWidth:maxWidth,rotation:rotation,textAlign:titleAlign(align,position,reverse),textBaseline:"middle",translation:[titleX,titleY]})}draw(chartArea){const me=this;me._isVisible()&&(me.drawBackground(),me.drawGrid(chartArea),me.drawBorder(),me.drawTitle(),me.drawLabels(chartArea))}_layers(){const me=this,opts=me.options,tz=opts.ticks&&opts.ticks.z||0,gz=valueOrDefault(opts.grid&&opts.grid.z,-1);return me._isVisible()&&me.draw===Scale.prototype.draw?[{z:gz,draw(chartArea){me.drawBackground(),me.drawGrid(chartArea),me.drawTitle()}},{z:gz+1,draw(){me.drawBorder()}},{z:tz,draw(chartArea){me.drawLabels(chartArea)}}]:[{z:tz,draw(chartArea){me.draw(chartArea)}}]}getMatchingVisibleMetas(type){const me=this,metas=me.chart.getSortedVisibleDatasetMetas(),axisID=me.axis+"AxisID",result=[];let i,ilen;for(i=0,ilen=metas.length;i<ilen;++i){const meta=metas[i];meta[axisID]!==me.id||type&&meta.type!==type||result.push(meta)}return result}_resolveTickFontOptions(index){const opts=this.options.ticks.setContext(this.getContext(index));return toFont(opts.font)}_maxDigits(){const me=this,fontSize=me._resolveTickFontOptions(0).lineHeight;return(me.isHorizontal()?me.width:me.height)/fontSize}}class TypedRegistry{constructor(type,scope,override){this.type=type,this.scope=scope,this.override=override,this.items=Object.create(null)}isForType(type){return Object.prototype.isPrototypeOf.call(this.type.prototype,type.prototype)}register(item){const me=this,proto=Object.getPrototypeOf(item);let parentScope;isIChartComponent(proto)&&(parentScope=me.register(proto));const items=me.items,id=item.id,scope=me.scope+"."+id;if(!id)throw new Error("class does not have id: "+item);return id in items?scope:(items[id]=item,registerDefaults(item,scope,parentScope),me.override&&defaults.override(item.id,item.overrides),scope)}get(id){return this.items[id]}unregister(item){const items=this.items,id=item.id,scope=this.scope;id in items&&delete items[id],scope&&id in defaults[scope]&&(delete defaults[scope][id],this.override&&delete overrides[id])}}function registerDefaults(item,scope,parentScope){const itemDefaults=merge(Object.create(null),[parentScope?defaults.get(parentScope):{},defaults.get(scope),item.defaults]);defaults.set(scope,itemDefaults),item.defaultRoutes&&routeDefaults(scope,item.defaultRoutes),item.descriptors&&defaults.describe(scope,item.descriptors)}function routeDefaults(scope,routes){Object.keys(routes).forEach(property=>{const propertyParts=property.split("."),sourceName=propertyParts.pop(),sourceScope=[scope].concat(propertyParts).join("."),parts=routes[property].split("."),targetName=parts.pop(),targetScope=parts.join(".");defaults.route(sourceScope,sourceName,targetScope,targetName)})}function isIChartComponent(proto){return"id"in proto&&"defaults"in proto}class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...args){this._each("register",args)}remove(...args){this._each("unregister",args)}addControllers(...args){this._each("register",args,this.controllers)}addElements(...args){this._each("register",args,this.elements)}addPlugins(...args){this._each("register",args,this.plugins)}addScales(...args){this._each("register",args,this.scales)}getController(id){return this._get(id,this.controllers,"controller")}getElement(id){return this._get(id,this.elements,"element")}getPlugin(id){return this._get(id,this.plugins,"plugin")}getScale(id){return this._get(id,this.scales,"scale")}removeControllers(...args){this._each("unregister",args,this.controllers)}removeElements(...args){this._each("unregister",args,this.elements)}removePlugins(...args){this._each("unregister",args,this.plugins)}removeScales(...args){this._each("unregister",args,this.scales)}_each(method,args,typedRegistry){const me=this;[...args].forEach(arg=>{const reg=typedRegistry||me._getRegistryForType(arg);typedRegistry||reg.isForType(arg)||reg===me.plugins&&arg.id?me._exec(method,reg,arg):each(arg,item=>{const itemReg=typedRegistry||me._getRegistryForType(item);me._exec(method,itemReg,item)})})}_exec(method,registry,component){const camelMethod=_capitalize(method);callback(component["before"+camelMethod],[],component),registry[method](component),callback(component["after"+camelMethod],[],component)}_getRegistryForType(type){for(let i=0;i<this._typedRegistries.length;i++){const reg=this._typedRegistries[i];if(reg.isForType(type))return reg}return this.plugins}_get(id,typedRegistry,type){const item=typedRegistry.get(id);if(void 0===item)throw new Error('"'+id+'" is not a registered '+type+".");return item}}var registry=new Registry;class PluginService{constructor(){this._init=[]}notify(chart,hook,args,filter){const me=this;"beforeInit"===hook&&(me._init=me._createDescriptors(chart,!0),me._notify(me._init,chart,"install"));const descriptors=filter?me._descriptors(chart).filter(filter):me._descriptors(chart),result=me._notify(descriptors,chart,hook,args);return"destroy"===hook&&(me._notify(descriptors,chart,"stop"),me._notify(me._init,chart,"uninstall")),result}_notify(descriptors,chart,hook,args){args=args||{};for(const descriptor of descriptors){const plugin=descriptor.plugin,method=plugin[hook],params=[chart,args,descriptor.options];if(!1===callback(method,params,plugin)&&args.cancelable)return!1}return!0}invalidate(){isNullOrUndef(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(chart){if(this._cache)return this._cache;const descriptors=this._cache=this._createDescriptors(chart);return this._notifyStateChanges(chart),descriptors}_createDescriptors(chart,all){const config=chart&&chart.config,options=valueOrDefault(config.options&&config.options.plugins,{}),plugins=allPlugins(config);return!1!==options||all?createDescriptors(chart,plugins,options,all):[]}_notifyStateChanges(chart){const previousDescriptors=this._oldCache||[],descriptors=this._cache,diff=(a,b)=>a.filter(x=>!b.some(y=>x.plugin.id===y.plugin.id));this._notify(diff(previousDescriptors,descriptors),chart,"stop"),this._notify(diff(descriptors,previousDescriptors),chart,"start")}}function allPlugins(config){const plugins=[],keys=Object.keys(registry.plugins.items);for(let i=0;i<keys.length;i++)plugins.push(registry.getPlugin(keys[i]));const local=config.plugins||[];for(let i=0;i<local.length;i++){const plugin=local[i];-1===plugins.indexOf(plugin)&&plugins.push(plugin)}return plugins}function getOpts(options,all){return all||!1!==options?!0===options?{}:options:null}function createDescriptors(chart,plugins,options,all){const result=[],context=chart.getContext();for(let i=0;i<plugins.length;i++){const plugin=plugins[i],id=plugin.id,opts=getOpts(options[id],all);null!==opts&&result.push({plugin:plugin,options:pluginOpts(chart.config,plugin,opts,context)})}return result}function pluginOpts(config,plugin,opts,context){const keys=config.pluginScopeKeys(plugin),scopes=config.getOptionScopes(opts,keys);return config.createResolver(scopes,context,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function getIndexAxis(type,options){const datasetDefaults=defaults.datasets[type]||{},datasetOptions=(options.datasets||{})[type]||{};return datasetOptions.indexAxis||options.indexAxis||datasetDefaults.indexAxis||"x"}function getAxisFromDefaultScaleID(id,indexAxis){let axis=id;return"_index_"===id?axis=indexAxis:"_value_"===id&&(axis="x"===indexAxis?"y":"x"),axis}function getDefaultScaleIDFromAxis(axis,indexAxis){return axis===indexAxis?"_index_":"_value_"}function axisFromPosition(position){return"top"===position||"bottom"===position?"x":"left"===position||"right"===position?"y":void 0}function determineAxis(id,scaleOptions){return"x"===id||"y"===id?id:scaleOptions.axis||axisFromPosition(scaleOptions.position)||id.charAt(0).toLowerCase()}function mergeScaleConfig(config,options){const chartDefaults=overrides[config.type]||{scales:{}},configScales=options.scales||{},chartIndexAxis=getIndexAxis(config.type,options),firstIDs=Object.create(null),scales=Object.create(null);return Object.keys(configScales).forEach(id=>{const scaleConf=configScales[id],axis=determineAxis(id,scaleConf),defaultId=getDefaultScaleIDFromAxis(axis,chartIndexAxis),defaultScaleOptions=chartDefaults.scales||{};firstIDs[axis]=firstIDs[axis]||id,scales[id]=mergeIf(Object.create(null),[{axis:axis},scaleConf,defaultScaleOptions[axis],defaultScaleOptions[defaultId]])}),config.data.datasets.forEach(dataset=>{const type=dataset.type||config.type,indexAxis=dataset.indexAxis||getIndexAxis(type,options),datasetDefaults=overrides[type]||{},defaultScaleOptions=datasetDefaults.scales||{};Object.keys(defaultScaleOptions).forEach(defaultID=>{const axis=getAxisFromDefaultScaleID(defaultID,indexAxis),id=dataset[axis+"AxisID"]||firstIDs[axis]||axis;scales[id]=scales[id]||Object.create(null),mergeIf(scales[id],[{axis:axis},configScales[id],defaultScaleOptions[defaultID]])})}),Object.keys(scales).forEach(key=>{const scale=scales[key];mergeIf(scale,[defaults.scales[scale.type],defaults.scale])}),scales}function initOptions(config){const options=config.options||(config.options={});options.plugins=valueOrDefault(options.plugins,{}),options.scales=mergeScaleConfig(config,options)}function initData(data){return(data=data||{}).datasets=data.datasets||[],data.labels=data.labels||[],data}function initConfig(config){return(config=config||{}).data=initData(config.data),initOptions(config),config}const keyCache=new Map,keysCached=new Set;function cachedKeys(cacheKey,generate){let keys=keyCache.get(cacheKey);return keys||(keys=generate(),keyCache.set(cacheKey,keys),keysCached.add(keys)),keys}const addIfFound=(set,obj,key)=>{const opts=resolveObjectKey(obj,key);void 0!==opts&&set.add(opts)};class Config{constructor(config){this._config=initConfig(config),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(type){this._config.type=type}get data(){return this._config.data}set data(data){this._config.data=initData(data)}get options(){return this._config.options}set options(options){this._config.options=options}get plugins(){return this._config.plugins}update(){const config=this._config;this.clearCache(),initOptions(config)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(datasetType){return cachedKeys(datasetType,()=>[[`datasets.${datasetType}`,""]])}datasetAnimationScopeKeys(datasetType,transition){return cachedKeys(`${datasetType}.transition.${transition}`,()=>[[`datasets.${datasetType}.transitions.${transition}`,`transitions.${transition}`],[`datasets.${datasetType}`,""]])}datasetElementScopeKeys(datasetType,elementType){return cachedKeys(`${datasetType}-${elementType}`,()=>[[`datasets.${datasetType}.elements.${elementType}`,`datasets.${datasetType}`,`elements.${elementType}`,""]])}pluginScopeKeys(plugin){const id=plugin.id,type=this.type;return cachedKeys(`${type}-plugin-${id}`,()=>[[`plugins.${id}`,...plugin.additionalOptionScopes||[]]])}_cachedScopes(mainScope,resetCache){const _scopeCache=this._scopeCache;let cache=_scopeCache.get(mainScope);return cache&&!resetCache||(cache=new Map,_scopeCache.set(mainScope,cache)),cache}getOptionScopes(mainScope,keyLists,resetCache){const{options:options,type:type}=this,cache=this._cachedScopes(mainScope,resetCache),cached=cache.get(keyLists);if(cached)return cached;const scopes=new Set;keyLists.forEach(keys=>{mainScope&&(scopes.add(mainScope),keys.forEach(key=>addIfFound(scopes,mainScope,key))),keys.forEach(key=>addIfFound(scopes,options,key)),keys.forEach(key=>addIfFound(scopes,overrides[type]||{},key)),keys.forEach(key=>addIfFound(scopes,defaults,key)),keys.forEach(key=>addIfFound(scopes,descriptors,key))});const array=Array.from(scopes);return 0===array.length&&array.push(Object.create(null)),keysCached.has(keyLists)&&cache.set(keyLists,array),array}chartOptionScopes(){const{options:options,type:type}=this;return[options,overrides[type]||{},defaults.datasets[type]||{},{type:type},defaults,descriptors]}resolveNamedOptions(scopes,names,context,prefixes=[""]){const result={$shared:!0},{resolver:resolver,subPrefixes:subPrefixes}=getResolver(this._resolverCache,scopes,prefixes);let options=resolver;if(needContext(resolver,names)){result.$shared=!1,context=isFunction(context)?context():context;const subResolver=this.createResolver(scopes,context,subPrefixes);options=_attachContext(resolver,context,subResolver)}for(const prop of names)result[prop]=options[prop];return result}createResolver(scopes,context,prefixes=[""],descriptorDefaults){const{resolver:resolver}=getResolver(this._resolverCache,scopes,prefixes);return isObject(context)?_attachContext(resolver,context,void 0,descriptorDefaults):resolver}}function getResolver(resolverCache,scopes,prefixes){let cache=resolverCache.get(scopes);cache||(cache=new Map,resolverCache.set(scopes,cache));const cacheKey=prefixes.join();let cached=cache.get(cacheKey);if(!cached){const resolver=_createResolver(scopes,prefixes);cached={resolver:resolver,subPrefixes:prefixes.filter(p=>!p.toLowerCase().includes("hover"))},cache.set(cacheKey,cached)}return cached}function needContext(proxy,names){const{isScriptable:isScriptable,isIndexable:isIndexable}=_descriptors(proxy);for(const prop of names)if(isScriptable(prop)&&isFunction(proxy[prop])||isIndexable(prop)&&isArray(proxy[prop]))return!0;return!1}var version="3.5.1";const KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(position,axis){return"top"===position||"bottom"===position||-1===KNOWN_POSITIONS.indexOf(position)&&"x"===axis}function compare2Level(l1,l2){return function(a,b){return a[l1]===b[l1]?a[l2]-b[l2]:a[l1]-b[l1]}}function onAnimationsComplete(context){const chart=context.chart,animationOptions=chart.options.animation;chart.notifyPlugins("afterRender"),callback(animationOptions&&animationOptions.onComplete,[context],chart)}function onAnimationProgress(context){const chart=context.chart,animationOptions=chart.options.animation;callback(animationOptions&&animationOptions.onProgress,[context],chart)}function getCanvas(item){return _isDomSupported()&&"string"==typeof item?item=document.getElementById(item):item&&item.length&&(item=item[0]),item&&item.canvas&&(item=item.canvas),item}const instances={},getChart=key=>{const canvas=getCanvas(key);return Object.values(instances).filter(c=>c.canvas===canvas).pop()};class Chart{constructor(item,userConfig){const me=this,config=this.config=new Config(userConfig),initialCanvas=getCanvas(item),existingChart=getChart(initialCanvas);if(existingChart)throw new Error("Canvas is already in use. Chart with ID '"+existingChart.id+"' must be destroyed before the canvas can be reused.");const options=config.createResolver(config.chartOptionScopes(),me.getContext());this.platform=new(config.platform||_detectPlatform(initialCanvas));const context=me.platform.acquireContext(initialCanvas,options.aspectRatio),canvas=context&&context.canvas,height=canvas&&canvas.height,width=canvas&&canvas.width;this.id=uid(),this.ctx=context,this.canvas=canvas,this.width=width,this.height=height,this._options=options,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 PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce(()=>this.update("resize"),options.resizeDelay||0),instances[me.id]=me,context&&canvas?(animator.listen(me,"complete",onAnimationsComplete),animator.listen(me,"progress",onAnimationProgress),me._initialize(),me.attached&&me.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:aspectRatio,maintainAspectRatio:maintainAspectRatio},width:width,height:height,_aspectRatio:_aspectRatio}=this;return isNullOrUndef(aspectRatio)?maintainAspectRatio&&_aspectRatio?_aspectRatio:height?width/height:null:aspectRatio}get data(){return this.config.data}set data(data){this.config.data=data}get options(){return this._options}set options(options){this.config.options=options}_initialize(){const me=this;return me.notifyPlugins("beforeInit"),me.options.responsive?me.resize():retinaScale(me,me.options.devicePixelRatio),me.bindEvents(),me.notifyPlugins("afterInit"),me}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(width,height){animator.running(this)?this._resizeBeforeDraw={width:width,height:height}:this._resize(width,height)}_resize(width,height){const me=this,options=me.options,canvas=me.canvas,aspectRatio=options.maintainAspectRatio&&me.aspectRatio,newSize=me.platform.getMaximumSize(canvas,width,height,aspectRatio),newRatio=options.devicePixelRatio||me.platform.getDevicePixelRatio();me.width=newSize.width,me.height=newSize.height,me._aspectRatio=me.aspectRatio,retinaScale(me,newRatio,!0)&&(me.notifyPlugins("resize",{size:newSize}),callback(options.onResize,[me,newSize],me),me.attached&&me._doResize()&&me.render())}ensureScalesHaveIDs(){const options=this.options,scalesOptions=options.scales||{};each(scalesOptions,(axisOptions,axisID)=>{axisOptions.id=axisID})}buildOrUpdateScales(){const me=this,options=me.options,scaleOpts=options.scales,scales=me.scales,updated=Object.keys(scales).reduce((obj,id)=>(obj[id]=!1,obj),{});let items=[];scaleOpts&&(items=items.concat(Object.keys(scaleOpts).map(id=>{const scaleOptions=scaleOpts[id],axis=determineAxis(id,scaleOptions),isRadial="r"===axis,isHorizontal="x"===axis;return{options:scaleOptions,dposition:isRadial?"chartArea":isHorizontal?"bottom":"left",dtype:isRadial?"radialLinear":isHorizontal?"category":"linear"}}))),each(items,item=>{const scaleOptions=item.options,id=scaleOptions.id,axis=determineAxis(id,scaleOptions),scaleType=valueOrDefault(scaleOptions.type,item.dtype);void 0!==scaleOptions.position&&positionIsHorizontal(scaleOptions.position,axis)===positionIsHorizontal(item.dposition)||(scaleOptions.position=item.dposition),updated[id]=!0;let scale=null;if(id in scales&&scales[id].type===scaleType)scale=scales[id];else{const scaleClass=registry.getScale(scaleType);scale=new scaleClass({id:id,type:scaleType,ctx:me.ctx,chart:me}),scales[scale.id]=scale}scale.init(scaleOptions,options)}),each(updated,(hasUpdated,id)=>{hasUpdated||delete scales[id]}),each(scales,scale=>{layouts.configure(me,scale,scale.options),layouts.addBox(me,scale)})}_updateMetasets(){const me=this,metasets=me._metasets,numData=me.data.datasets.length,numMeta=metasets.length;if(metasets.sort((a,b)=>a.index-b.index),numMeta>numData){for(let i=numData;i<numMeta;++i)me._destroyDatasetMeta(i);metasets.splice(numData,numMeta-numData)}me._sortedMetasets=metasets.slice(0).sort(compare2Level("order","index"))}_removeUnreferencedMetasets(){const me=this,{_metasets:metasets,data:{datasets:datasets}}=me;metasets.length>datasets.length&&delete me._stacks,metasets.forEach((meta,index)=>{0===datasets.filter(x=>x===meta._dataset).length&&me._destroyDatasetMeta(index)})}buildOrUpdateControllers(){const me=this,newControllers=[],datasets=me.data.datasets;let i,ilen;for(me._removeUnreferencedMetasets(),i=0,ilen=datasets.length;i<ilen;i++){const dataset=datasets[i];let meta=me.getDatasetMeta(i);const type=dataset.type||me.config.type;if(meta.type&&meta.type!==type&&(me._destroyDatasetMeta(i),meta=me.getDatasetMeta(i)),meta.type=type,meta.indexAxis=dataset.indexAxis||getIndexAxis(type,me.options),meta.order=dataset.order||0,meta.index=i,meta.label=""+dataset.label,meta.visible=me.isDatasetVisible(i),meta.controller)meta.controller.updateIndex(i),meta.controller.linkScales();else{const ControllerClass=registry.getController(type),{datasetElementType:datasetElementType,dataElementType:dataElementType}=defaults.datasets[type];Object.assign(ControllerClass.prototype,{dataElementType:registry.getElement(dataElementType),datasetElementType:datasetElementType&&registry.getElement(datasetElementType)}),meta.controller=new ControllerClass(me,i),newControllers.push(meta.controller)}}return me._updateMetasets(),newControllers}_resetElements(){const me=this;each(me.data.datasets,(dataset,datasetIndex)=>{me.getDatasetMeta(datasetIndex).controller.reset()},me)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(mode){const me=this,config=me.config;config.update(),me._options=config.createResolver(config.chartOptionScopes(),me.getContext()),each(me.scales,scale=>{layouts.removeBox(me,scale)});const animsDisabled=me._animationsDisabled=!me.options.animation;me.ensureScalesHaveIDs(),me.buildOrUpdateScales();const existingEvents=new Set(Object.keys(me._listeners)),newEvents=new Set(me.options.events);if(setsEqual(existingEvents,newEvents)&&!!this._responsiveListeners===me.options.responsive||(me.unbindEvents(),me.bindEvents()),me._plugins.invalidate(),!1===me.notifyPlugins("beforeUpdate",{mode:mode,cancelable:!0}))return;const newControllers=me.buildOrUpdateControllers();me.notifyPlugins("beforeElementsUpdate");let minPadding=0;for(let i=0,ilen=me.data.datasets.length;i<ilen;i++){const{controller:controller}=me.getDatasetMeta(i),reset=!animsDisabled&&-1===newControllers.indexOf(controller);controller.buildOrUpdateElements(reset),minPadding=Math.max(+controller.getMaxOverflow(),minPadding)}me._minPadding=minPadding,me._updateLayout(minPadding),animsDisabled||each(newControllers,controller=>{controller.reset()}),me._updateDatasets(mode),me.notifyPlugins("afterUpdate",{mode:mode}),me._layers.sort(compare2Level("z","_idx")),me._lastEvent&&me._eventHandler(me._lastEvent,!0),me.render()}_updateLayout(minPadding){const me=this;if(!1===me.notifyPlugins("beforeLayout",{cancelable:!0}))return;layouts.update(me,me.width,me.height,minPadding);const area=me.chartArea,noArea=area.width<=0||area.height<=0;me._layers=[],each(me.boxes,box=>{noArea&&"chartArea"===box.position||(box.configure&&box.configure(),me._layers.push(...box._layers()))},me),me._layers.forEach((item,index)=>{item._idx=index}),me.notifyPlugins("afterLayout")}_updateDatasets(mode){const me=this,isFunction="function"==typeof mode;if(!1!==me.notifyPlugins("beforeDatasetsUpdate",{mode:mode,cancelable:!0})){for(let i=0,ilen=me.data.datasets.length;i<ilen;++i)me._updateDataset(i,isFunction?mode({datasetIndex:i}):mode);me.notifyPlugins("afterDatasetsUpdate",{mode:mode})}}_updateDataset(index,mode){const me=this,meta=me.getDatasetMeta(index),args={meta:meta,index:index,mode:mode,cancelable:!0};!1!==me.notifyPlugins("beforeDatasetUpdate",args)&&(meta.controller._update(mode),args.cancelable=!1,me.notifyPlugins("afterDatasetUpdate",args))}render(){const me=this;!1!==me.notifyPlugins("beforeRender",{cancelable:!0})&&(animator.has(me)?me.attached&&!animator.running(me)&&animator.start(me):(me.draw(),onAnimationsComplete({chart:me})))}draw(){const me=this;let i;if(me._resizeBeforeDraw){const{width:width,height:height}=me._resizeBeforeDraw;me._resize(width,height),me._resizeBeforeDraw=null}if(me.clear(),me.width<=0||me.height<=0)return;if(!1===me.notifyPlugins("beforeDraw",{cancelable:!0}))return;const layers=me._layers;for(i=0;i<layers.length&&layers[i].z<=0;++i)layers[i].draw(me.chartArea);for(me._drawDatasets();i<layers.length;++i)layers[i].draw(me.chartArea);me.notifyPlugins("afterDraw")}_getSortedDatasetMetas(filterVisible){const me=this,metasets=me._sortedMetasets,result=[];let i,ilen;for(i=0,ilen=metasets.length;i<ilen;++i){const meta=metasets[i];filterVisible&&!meta.visible||result.push(meta)}return result}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){const me=this;if(!1===me.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const metasets=me.getSortedVisibleDatasetMetas();for(let i=metasets.length-1;i>=0;--i)me._drawDataset(metasets[i]);me.notifyPlugins("afterDatasetsDraw")}_drawDataset(meta){const me=this,ctx=me.ctx,clip=meta._clip,useClip=!clip.disabled,area=me.chartArea,args={meta:meta,index:meta.index,cancelable:!0};!1!==me.notifyPlugins("beforeDatasetDraw",args)&&(useClip&&clipArea(ctx,{left:!1===clip.left?0:area.left-clip.left,right:!1===clip.right?me.width:area.right+clip.right,top:!1===clip.top?0:area.top-clip.top,bottom:!1===clip.bottom?me.height:area.bottom+clip.bottom}),meta.controller.draw(),useClip&&unclipArea(ctx),args.cancelable=!1,me.notifyPlugins("afterDatasetDraw",args))}getElementsAtEventForMode(e,mode,options,useFinalPosition){const method=Interaction.modes[mode];return"function"==typeof method?method(this,e,options,useFinalPosition):[]}getDatasetMeta(datasetIndex){const me=this,dataset=me.data.datasets[datasetIndex],metasets=me._metasets;let meta=metasets.filter(x=>x&&x._dataset===dataset).pop();return meta||(meta={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:dataset&&dataset.order||0,index:datasetIndex,_dataset:dataset,_parsed:[],_sorted:!1},metasets.push(meta)),meta}getContext(){return this.$context||(this.$context={chart:this,type:"chart"})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(datasetIndex){const dataset=this.data.datasets[datasetIndex];if(!dataset)return!1;const meta=this.getDatasetMeta(datasetIndex);return"boolean"==typeof meta.hidden?!meta.hidden:!dataset.hidden}setDatasetVisibility(datasetIndex,visible){const meta=this.getDatasetMeta(datasetIndex);meta.hidden=!visible}toggleDataVisibility(index){this._hiddenIndices[index]=!this._hiddenIndices[index]}getDataVisibility(index){return!this._hiddenIndices[index]}_updateVisibility(datasetIndex,dataIndex,visible){const me=this,mode=visible?"show":"hide",meta=me.getDatasetMeta(datasetIndex),anims=meta.controller._resolveAnimations(void 0,mode);defined(dataIndex)?(meta.data[dataIndex].hidden=!visible,me.update()):(me.setDatasetVisibility(datasetIndex,visible),anims.update(meta,{visible:visible}),me.update(ctx=>ctx.datasetIndex===datasetIndex?mode:void 0))}hide(datasetIndex,dataIndex){this._updateVisibility(datasetIndex,dataIndex,!1)}show(datasetIndex,dataIndex){this._updateVisibility(datasetIndex,dataIndex,!0)}_destroyDatasetMeta(datasetIndex){const me=this,meta=me._metasets&&me._metasets[datasetIndex];meta&&meta.controller&&(meta.controller._destroy(),delete me._metasets[datasetIndex])}destroy(){const me=this,{canvas:canvas,ctx:ctx}=me;let i,ilen;for(me.stop(),animator.remove(me),i=0,ilen=me.data.datasets.length;i<ilen;++i)me._destroyDatasetMeta(i);me.config.clearCache(),canvas&&(me.unbindEvents(),clearCanvas(canvas,ctx),me.platform.releaseContext(ctx),me.canvas=null,me.ctx=null),me.notifyPlugins("destroy"),delete instances[me.id]}toBase64Image(...args){return this.canvas.toDataURL(...args)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const me=this,listeners=me._listeners,platform=me.platform,_add=(type,listener)=>{platform.addEventListener(me,type,listener),listeners[type]=listener},listener=function(e,x,y){e.offsetX=x,e.offsetY=y,me._eventHandler(e)};each(me.options.events,type=>_add(type,listener))}bindResponsiveEvents(){const me=this;me._responsiveListeners||(me._responsiveListeners={});const listeners=me._responsiveListeners,platform=me.platform,_add=(type,listener)=>{platform.addEventListener(me,type,listener),listeners[type]=listener},_remove=(type,listener)=>{listeners[type]&&(platform.removeEventListener(me,type,listener),delete listeners[type])},listener=(width,height)=>{me.canvas&&me.resize(width,height)};let detached;const attached=()=>{_remove("attach",attached),me.attached=!0,me.resize(),_add("resize",listener),_add("detach",detached)};detached=()=>{me.attached=!1,_remove("resize",listener),_add("attach",attached)},platform.isAttached(me.canvas)?attached():detached()}unbindEvents(){const me=this;each(me._listeners,(listener,type)=>{me.platform.removeEventListener(me,type,listener)}),me._listeners={},each(me._responsiveListeners,(listener,type)=>{me.platform.removeEventListener(me,type,listener)}),me._responsiveListeners=void 0}updateHoverStyle(items,mode,enabled){const prefix=enabled?"set":"remove";let meta,item,i,ilen;for("dataset"===mode&&(meta=this.getDatasetMeta(items[0].datasetIndex),meta.controller["_"+prefix+"DatasetHoverStyle"]()),i=0,ilen=items.length;i<ilen;++i){item=items[i];const controller=item&&this.getDatasetMeta(item.datasetIndex).controller;controller&&controller[prefix+"HoverStyle"](item.element,item.datasetIndex,item.index)}}getActiveElements(){return this._active||[]}setActiveElements(activeElements){const me=this,lastActive=me._active||[],active=activeElements.map(({datasetIndex:datasetIndex,index:index})=>{const meta=me.getDatasetMeta(datasetIndex);if(!meta)throw new Error("No dataset found at index "+datasetIndex);return{datasetIndex:datasetIndex,element:meta.data[index],index:index}}),changed=!_elementsEqual(active,lastActive);changed&&(me._active=active,me._updateHoverStyles(active,lastActive))}notifyPlugins(hook,args,filter){return this._plugins.notify(this,hook,args,filter)}_updateHoverStyles(active,lastActive,replay){const me=this,hoverOptions=me.options.hover,diff=(a,b)=>a.filter(x=>!b.some(y=>x.datasetIndex===y.datasetIndex&&x.index===y.index)),deactivated=diff(lastActive,active),activated=replay?active:diff(active,lastActive);deactivated.length&&me.updateHoverStyle(deactivated,hoverOptions.mode,!1),activated.length&&hoverOptions.mode&&me.updateHoverStyle(activated,hoverOptions.mode,!0)}_eventHandler(e,replay){const me=this,args={event:e,replay:replay,cancelable:!0},eventFilter=plugin=>(plugin.options.events||this.options.events).includes(e.type);if(!1===me.notifyPlugins("beforeEvent",args,eventFilter))return;const changed=me._handleEvent(e,replay);return args.cancelable=!1,me.notifyPlugins("afterEvent",args,eventFilter),(changed||args.changed)&&me.render(),me}_handleEvent(e,replay){const me=this,{_active:lastActive=[],options:options}=me,hoverOptions=options.hover,useFinalPosition=replay;let active=[],changed=!1,lastEvent=null;return"mouseout"!==e.type&&(active=me.getElementsAtEventForMode(e,hoverOptions.mode,hoverOptions,useFinalPosition),lastEvent="click"===e.type?me._lastEvent:e),me._lastEvent=null,_isPointInArea(e,me.chartArea,me._minPadding)&&(callback(options.onHover,[e,active,me],me),"mouseup"!==e.type&&"click"!==e.type&&"contextmenu"!==e.type||callback(options.onClick,[e,active,me],me)),changed=!_elementsEqual(active,lastActive),(changed||replay)&&(me._active=active,me._updateHoverStyles(active,lastActive,replay)),me._lastEvent=lastEvent,changed}}const invalidatePlugins=()=>each(Chart.instances,chart=>chart._plugins.invalidate()),enumerable=!0;function abstract(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}Object.defineProperties(Chart,{defaults:{enumerable:!0,value:defaults},instances:{enumerable:!0,value:instances},overrides:{enumerable:!0,value:overrides},registry:{enumerable:!0,value:registry},version:{enumerable:!0,value:"3.5.1"},getChart:{enumerable:!0,value:getChart},register:{enumerable:!0,value:(...items)=>{registry.add(...items),invalidatePlugins()}},unregister:{enumerable:!0,value:(...items)=>{registry.remove(...items),invalidatePlugins()}}});class DateAdapter{constructor(options){this.options=options||{}}formats(){return abstract()}parse(value,format){return abstract()}format(timestamp,format){return abstract()}add(timestamp,amount,unit){return abstract()}diff(a,b,unit){return abstract()}startOf(timestamp,unit,weekday){return abstract()}endOf(timestamp,unit){return abstract()}}DateAdapter.override=function(members){Object.assign(DateAdapter.prototype,members)};var _adapters={_date:DateAdapter};function getAllScaleValues(scale){if(!scale._cache.$bar){const metas=scale.getMatchingVisibleMetas("bar");let values=[];for(let i=0,ilen=metas.length;i<ilen;i++)values=values.concat(metas[i].controller.getAllParsedValues(scale));scale._cache.$bar=_arrayUnique(values.sort((a,b)=>a-b))}return scale._cache.$bar}function computeMinSampleSize(scale){const values=getAllScaleValues(scale);let min=scale._length,i,ilen,curr,prev;const updateMinAndPrev=()=>{32767!==curr&&-32768!==curr&&(defined(prev)&&(min=Math.min(min,Math.abs(curr-prev)||min)),prev=curr)};for(i=0,ilen=values.length;i<ilen;++i)curr=scale.getPixelForValue(values[i]),updateMinAndPrev();for(prev=void 0,i=0,ilen=scale.ticks.length;i<ilen;++i)curr=scale.getPixelForTick(i),updateMinAndPrev();return min}function computeFitCategoryTraits(index,ruler,options,stackCount){const thickness=options.barThickness;let size,ratio;return isNullOrUndef(thickness)?(size=ruler.min*options.categoryPercentage,ratio=options.barPercentage):(size=thickness*stackCount,ratio=1),{chunk:size/stackCount,ratio:ratio,start:ruler.pixels[index]-size/2}}function computeFlexCategoryTraits(index,ruler,options,stackCount){const pixels=ruler.pixels,curr=pixels[index];let prev=index>0?pixels[index-1]:null,next=index<pixels.length-1?pixels[index+1]:null;const percent=options.categoryPercentage;null===prev&&(prev=curr-(null===next?ruler.end-ruler.start:next-curr)),null===next&&(next=curr+curr-prev);const start=curr-(curr-Math.min(prev,next))/2*percent,size=Math.abs(next-prev)/2*percent;return{chunk:size/stackCount,ratio:options.barPercentage,start:start}}function parseFloatBar(entry,item,vScale,i){const startValue=vScale.parse(entry[0],i),endValue=vScale.parse(entry[1],i),min=Math.min(startValue,endValue),max=Math.max(startValue,endValue);let barStart=min,barEnd=max;Math.abs(min)>Math.abs(max)&&(barStart=max,barEnd=min),item[vScale.axis]=barEnd,item._custom={barStart:barStart,barEnd:barEnd,start:startValue,end:endValue,min:min,max:max}}function parseValue(entry,item,vScale,i){return isArray(entry)?parseFloatBar(entry,item,vScale,i):item[vScale.axis]=vScale.parse(entry,i),item}function parseArrayOrPrimitive(meta,data,start,count){const iScale=meta.iScale,vScale=meta.vScale,labels=iScale.getLabels(),singleScale=iScale===vScale,parsed=[];let i,ilen,item,entry;for(i=start,ilen=start+count;i<ilen;++i)entry=data[i],item={},item[iScale.axis]=singleScale||iScale.parse(labels[i],i),parsed.push(parseValue(entry,item,vScale,i));return parsed}function isFloatBar(custom){return custom&&void 0!==custom.barStart&&void 0!==custom.barEnd}function barSign(size,vScale,actualBase){return 0!==size?sign(size):(vScale.isHorizontal()?1:-1)*(vScale.min>=actualBase?1:-1)}function borderProps(properties){let reverse,start,end,top,bottom;return properties.horizontal?(reverse=properties.base>properties.x,start="left",end="right"):(reverse=properties.base<properties.y,start="bottom",end="top"),reverse?(top="end",bottom="start"):(top="start",bottom="end"),{start:start,end:end,reverse:reverse,top:top,bottom:bottom}}function setBorderSkipped(properties,options,stack,index){let edge=options.borderSkipped;const res={};if(!edge)return void(properties.borderSkipped=res);const{start:start,end:end,reverse:reverse,top:top,bottom:bottom}=borderProps(properties);"middle"===edge&&stack&&(properties.enableBorderRadius=!0,(stack._top||0)===index?edge=top:(stack._bottom||0)===index?edge=bottom:(res[parseEdge(bottom,start,end,reverse)]=!0,edge=top)),res[parseEdge(edge,start,end,reverse)]=!0,properties.borderSkipped=res}function parseEdge(edge,a,b,reverse){return edge=reverse?startEnd(edge=swap(edge,a,b),b,a):startEnd(edge,a,b)}function swap(orig,v1,v2){return orig===v1?v2:orig===v2?v1:orig}function startEnd(v,start,end){return"start"===v?start:"end"===v?end:v}class BarController extends DatasetController{parsePrimitiveData(meta,data,start,count){return parseArrayOrPrimitive(meta,data,start,count)}parseArrayData(meta,data,start,count){return parseArrayOrPrimitive(meta,data,start,count)}parseObjectData(meta,data,start,count){const{iScale:iScale,vScale:vScale}=meta,{xAxisKey:xAxisKey="x",yAxisKey:yAxisKey="y"}=this._parsing,iAxisKey="x"===iScale.axis?xAxisKey:yAxisKey,vAxisKey="x"===vScale.axis?xAxisKey:yAxisKey,parsed=[];let i,ilen,item,obj;for(i=start,ilen=start+count;i<ilen;++i)obj=data[i],item={},item[iScale.axis]=iScale.parse(resolveObjectKey(obj,iAxisKey),i),parsed.push(parseValue(resolveObjectKey(obj,vAxisKey),item,vScale,i));return parsed}updateRangeFromParsed(range,scale,parsed,stack){super.updateRangeFromParsed(range,scale,parsed,stack);const custom=parsed._custom;custom&&scale===this._cachedMeta.vScale&&(range.min=Math.min(range.min,custom.min),range.max=Math.max(range.max,custom.max))}getMaxOverflow(){return 0}getLabelAndValue(index){const me=this,meta=me._cachedMeta,{iScale:iScale,vScale:vScale}=meta,parsed=me.getParsed(index),custom=parsed._custom,value=isFloatBar(custom)?"["+custom.start+", "+custom.end+"]":""+vScale.getLabelForValue(parsed[vScale.axis]);return{label:""+iScale.getLabelForValue(parsed[iScale.axis]),value:value}}initialize(){const me=this;me.enableOptionSharing=!0,super.initialize();const meta=me._cachedMeta;meta.stack=me.getDataset().stack}update(mode){const me=this,meta=me._cachedMeta;me.updateElements(meta.data,0,meta.data.length,mode)}updateElements(bars,start,count,mode){const me=this,reset="reset"===mode,{index:index,_cachedMeta:{vScale:vScale}}=me,base=vScale.getBasePixel(),horizontal=vScale.isHorizontal(),ruler=me._getRuler(),firstOpts=me.resolveDataElementOptions(start,mode),sharedOptions=me.getSharedOptions(firstOpts),includeOptions=me.includeOptions(mode,sharedOptions);me.updateSharedOptions(sharedOptions,mode,firstOpts);for(let i=start;i<start+count;i++){const parsed=me.getParsed(i),vpixels=reset||isNullOrUndef(parsed[vScale.axis])?{base:base,head:base}:me._calculateBarValuePixels(i),ipixels=me._calculateBarIndexPixels(i,ruler),stack=(parsed._stacks||{})[vScale.axis],properties={horizontal:horizontal,base:vpixels.base,enableBorderRadius:!stack||isFloatBar(parsed._custom)||index===stack._top||index===stack._bottom,x:horizontal?vpixels.head:ipixels.center,y:horizontal?ipixels.center:vpixels.head,height:horizontal?ipixels.size:Math.abs(vpixels.size),width:horizontal?Math.abs(vpixels.size):ipixels.size};includeOptions&&(properties.options=sharedOptions||me.resolveDataElementOptions(i,bars[i].active?"active":mode)),setBorderSkipped(properties,properties.options||bars[i].options,stack,index),me.updateElement(bars[i],i,properties,mode)}}_getStacks(last,dataIndex){const me=this,meta=me._cachedMeta,iScale=meta.iScale,metasets=iScale.getMatchingVisibleMetas(me._type),stacked=iScale.options.stacked,ilen=metasets.length,stacks=[];let i,item;for(i=0;i<ilen;++i)if(item=metasets[i],item.controller.options.grouped){if(void 0!==dataIndex){const val=item.controller.getParsed(dataIndex)[item.controller._cachedMeta.vScale.axis];if(isNullOrUndef(val)||isNaN(val))continue}if((!1===stacked||-1===stacks.indexOf(item.stack)||void 0===stacked&&void 0===item.stack)&&stacks.push(item.stack),item.index===last)break}return stacks.length||stacks.push(void 0),stacks}_getStackCount(index){return this._getStacks(void 0,index).length}_getStackIndex(datasetIndex,name,dataIndex){const stacks=this._getStacks(datasetIndex,dataIndex),index=void 0!==name?stacks.indexOf(name):-1;return-1===index?stacks.length-1:index}_getRuler(){const me=this,opts=me.options,meta=me._cachedMeta,iScale=meta.iScale,pixels=[];let i,ilen;for(i=0,ilen=meta.data.length;i<ilen;++i)pixels.push(iScale.getPixelForValue(me.getParsed(i)[iScale.axis],i));const barThickness=opts.barThickness,min=barThickness||computeMinSampleSize(iScale);return{min:min,pixels:pixels,start:iScale._startPixel,end:iScale._endPixel,stackCount:me._getStackCount(),scale:iScale,grouped:opts.grouped,ratio:barThickness?1:opts.categoryPercentage*opts.barPercentage}}_calculateBarValuePixels(index){const me=this,{_cachedMeta:{vScale:vScale,_stacked:_stacked},options:{base:baseValue,minBarLength:minBarLength}}=me,actualBase=baseValue||0,parsed=me.getParsed(index),custom=parsed._custom,floating=isFloatBar(custom);let value=parsed[vScale.axis],start=0,length=_stacked?me.applyStack(vScale,parsed,_stacked):value,head,size;length!==value&&(start=length-value,length=value),floating&&(value=custom.barStart,length=custom.barEnd-custom.barStart,0!==value&&sign(value)!==sign(custom.barEnd)&&(start=0),start+=value);const startValue=isNullOrUndef(baseValue)||floating?start:baseValue;let base=vScale.getPixelForValue(startValue);if(head=me.chart.getDataVisibility(index)?vScale.getPixelForValue(start+length):base,size=head-base,Math.abs(size)<minBarLength&&(size=barSign(size,vScale,actualBase)*minBarLength,value===actualBase&&(base-=size/2),head=base+size),base===vScale.getPixelForValue(actualBase)){const halfGrid=sign(size)*vScale.getLineWidthForValue(actualBase)/2;base+=halfGrid,size-=halfGrid}return{size:size,base:base,head:head,center:head+size/2}}_calculateBarIndexPixels(index,ruler){const me=this,scale=ruler.scale,options=me.options,skipNull=options.skipNull,maxBarThickness=valueOrDefault(options.maxBarThickness,1/0);let center,size;if(ruler.grouped){const stackCount=skipNull?me._getStackCount(index):ruler.stackCount,range="flex"===options.barThickness?computeFlexCategoryTraits(index,ruler,options,stackCount):computeFitCategoryTraits(index,ruler,options,stackCount),stackIndex=me._getStackIndex(me.index,me._cachedMeta.stack,skipNull?index:void 0);center=range.start+range.chunk*stackIndex+range.chunk/2,size=Math.min(maxBarThickness,range.chunk*range.ratio)}else center=scale.getPixelForValue(me.getParsed(index)[scale.axis],index),size=Math.min(maxBarThickness,ruler.min*ruler.ratio);return{base:center-size/2,head:center+size/2,center:center,size:size}}draw(){const me=this,meta=me._cachedMeta,vScale=meta.vScale,rects=meta.data,ilen=rects.length;let i=0;for(;i<ilen;++i)null!==me.getParsed(i)[vScale.axis]&&rects[i].draw(me._ctx)}}BarController.id="bar",BarController.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},BarController.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class BubbleController extends DatasetController{initialize(){this.enableOptionSharing=!0,super.initialize()}parseObjectData(meta,data,start,count){const{xScale:xScale,yScale:yScale}=meta,{xAxisKey:xAxisKey="x",yAxisKey:yAxisKey="y"}=this._parsing,parsed=[];let i,ilen,item;for(i=start,ilen=start+count;i<ilen;++i)item=data[i],parsed.push({x:xScale.parse(resolveObjectKey(item,xAxisKey),i),y:yScale.parse(resolveObjectKey(item,yAxisKey),i),_custom:item&&item.r&&+item.r});return parsed}getMaxOverflow(){const{data:data,_parsed:_parsed}=this._cachedMeta;let max=0;for(let i=data.length-1;i>=0;--i)max=Math.max(max,data[i].size()/2,_parsed[i]._custom);return max>0&&max}getLabelAndValue(index){const me=this,meta=me._cachedMeta,{xScale:xScale,yScale:yScale}=meta,parsed=me.getParsed(index),x=xScale.getLabelForValue(parsed.x),y=yScale.getLabelForValue(parsed.y),r=parsed._custom;return{label:meta.label,value:"("+x+", "+y+(r?", "+r:"")+")"}}update(mode){const me=this,points=me._cachedMeta.data;me.updateElements(points,0,points.length,mode)}updateElements(points,start,count,mode){const me=this,reset="reset"===mode,{iScale:iScale,vScale:vScale}=me._cachedMeta,firstOpts=me.resolveDataElementOptions(start,mode),sharedOptions=me.getSharedOptions(firstOpts),includeOptions=me.includeOptions(mode,sharedOptions),iAxis=iScale.axis,vAxis=vScale.axis;for(let i=start;i<start+count;i++){const point=points[i],parsed=!reset&&me.getParsed(i),properties={},iPixel=properties[iAxis]=reset?iScale.getPixelForDecimal(.5):iScale.getPixelForValue(parsed[iAxis]),vPixel=properties[vAxis]=reset?vScale.getBasePixel():vScale.getPixelForValue(parsed[vAxis]);properties.skip=isNaN(iPixel)||isNaN(vPixel),includeOptions&&(properties.options=me.resolveDataElementOptions(i,point.active?"active":mode),reset&&(properties.options.radius=0)),me.updateElement(point,i,properties,mode)}me.updateSharedOptions(sharedOptions,mode,firstOpts)}resolveDataElementOptions(index,mode){const parsed=this.getParsed(index);let values=super.resolveDataElementOptions(index,mode);values.$shared&&(values=Object.assign({},values,{$shared:!1}));const radius=values.radius;return"active"!==mode&&(values.radius=0),values.radius+=valueOrDefault(parsed&&parsed._custom,radius),values}}function getRatioAndOffset(rotation,circumference,cutout){let ratioX=1,ratioY=1,offsetX=0,offsetY=0;if(circumference<TAU){const startAngle=rotation,endAngle=startAngle+circumference,startX=Math.cos(startAngle),startY=Math.sin(startAngle),endX=Math.cos(endAngle),endY=Math.sin(endAngle),calcMax=(angle,a,b)=>_angleBetween(angle,startAngle,endAngle,!0)?1:Math.max(a,a*cutout,b,b*cutout),calcMin=(angle,a,b)=>_angleBetween(angle,startAngle,endAngle,!0)?-1:Math.min(a,a*cutout,b,b*cutout),maxX=calcMax(0,startX,endX),maxY=calcMax(HALF_PI,startY,endY),minX=calcMin(PI,startX,endX),minY=calcMin(PI+HALF_PI,startY,endY);ratioX=(maxX-minX)/2,ratioY=(maxY-minY)/2,offsetX=-(maxX+minX)/2,offsetY=-(maxY+minY)/2}return{ratioX:ratioX,ratioY:ratioY,offsetX:offsetX,offsetY:offsetY}}BubbleController.id="bubble",BubbleController.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},BubbleController.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};class DoughnutController extends DatasetController{constructor(chart,datasetIndex){super(chart,datasetIndex),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(start,count){const data=this.getDataset().data,meta=this._cachedMeta;let i,ilen;for(i=start,ilen=start+count;i<ilen;++i)meta._parsed[i]=+data[i]}_getRotation(){return toRadians(this.options.rotation-90)}_getCircumference(){return toRadians(this.options.circumference)}_getRotationExtents(){let min=TAU,max=-TAU;const me=this;for(let i=0;i<me.chart.data.datasets.length;++i)if(me.chart.isDatasetVisible(i)){const controller=me.chart.getDatasetMeta(i).controller,rotation=controller._getRotation(),circumference=controller._getCircumference();min=Math.min(min,rotation),max=Math.max(max,rotation+circumference)}return{rotation:min,circumference:max-min}}update(mode){const me=this,chart=me.chart,{chartArea:chartArea}=chart,meta=me._cachedMeta,arcs=meta.data,spacing=me.getMaxBorderWidth()+me.getMaxOffset(arcs)+me.options.spacing,maxSize=Math.max((Math.min(chartArea.width,chartArea.height)-spacing)/2,0),cutout=Math.min(toPercentage(me.options.cutout,maxSize),1),chartWeight=me._getRingWeight(me.index),{circumference:circumference,rotation:rotation}=me._getRotationExtents(),{ratioX:ratioX,ratioY:ratioY,offsetX:offsetX,offsetY:offsetY}=getRatioAndOffset(rotation,circumference,cutout),maxWidth=(chartArea.width-spacing)/ratioX,maxHeight=(chartArea.height-spacing)/ratioY,maxRadius=Math.max(Math.min(maxWidth,maxHeight)/2,0),outerRadius=toDimension(me.options.radius,maxRadius),innerRadius=Math.max(outerRadius*cutout,0),radiusLength=(outerRadius-innerRadius)/me._getVisibleDatasetWeightTotal();me.offsetX=offsetX*outerRadius,me.offsetY=offsetY*outerRadius,meta.total=me.calculateTotal(),me.outerRadius=outerRadius-radiusLength*me._getRingWeightOffset(me.index),me.innerRadius=Math.max(me.outerRadius-radiusLength*chartWeight,0),me.updateElements(arcs,0,arcs.length,mode)}_circumference(i,reset){const me=this,opts=me.options,meta=me._cachedMeta,circumference=me._getCircumference();return reset&&opts.animation.animateRotate||!this.chart.getDataVisibility(i)||null===meta._parsed[i]||meta.data[i].hidden?0:me.calculateCircumference(meta._parsed[i]*circumference/TAU)}updateElements(arcs,start,count,mode){const me=this,reset="reset"===mode,chart=me.chart,chartArea=chart.chartArea,opts=chart.options,animationOpts=opts.animation,centerX=(chartArea.left+chartArea.right)/2,centerY=(chartArea.top+chartArea.bottom)/2,animateScale=reset&&animationOpts.animateScale,innerRadius=animateScale?0:me.innerRadius,outerRadius=animateScale?0:me.outerRadius,firstOpts=me.resolveDataElementOptions(start,mode),sharedOptions=me.getSharedOptions(firstOpts),includeOptions=me.includeOptions(mode,sharedOptions);let startAngle=me._getRotation(),i;for(i=0;i<start;++i)startAngle+=me._circumference(i,reset);for(i=start;i<start+count;++i){const circumference=me._circumference(i,reset),arc=arcs[i],properties={x:centerX+me.offsetX,y:centerY+me.offsetY,startAngle:startAngle,endAngle:startAngle+circumference,circumference:circumference,outerRadius:outerRadius,innerRadius:innerRadius};includeOptions&&(properties.options=sharedOptions||me.resolveDataElementOptions(i,arc.active?"active":mode)),startAngle+=circumference,me.updateElement(arc,i,properties,mode)}me.updateSharedOptions(sharedOptions,mode,firstOpts)}calculateTotal(){const meta=this._cachedMeta,metaData=meta.data;let total=0,i;for(i=0;i<metaData.length;i++){const value=meta._parsed[i];null===value||isNaN(value)||!this.chart.getDataVisibility(i)||metaData[i].hidden||(total+=Math.abs(value))}return total}calculateCircumference(value){const total=this._cachedMeta.total;return total>0&&!isNaN(value)?TAU*(Math.abs(value)/total):0}getLabelAndValue(index){const me=this,meta=me._cachedMeta,chart=me.chart,labels=chart.data.labels||[],value=formatNumber(meta._parsed[index],chart.options.locale);return{label:labels[index]||"",value:value}}getMaxBorderWidth(arcs){const me=this;let max=0;const chart=me.chart;let i,ilen,meta,controller,options;if(!arcs)for(i=0,ilen=chart.data.datasets.length;i<ilen;++i)if(chart.isDatasetVisible(i)){meta=chart.getDatasetMeta(i),arcs=meta.data,controller=meta.controller,controller!==me&&controller.configure();break}if(!arcs)return 0;for(i=0,ilen=arcs.length;i<ilen;++i)options=controller.resolveDataElementOptions(i),"inner"!==options.borderAlign&&(max=Math.max(max,options.borderWidth||0,options.hoverBorderWidth||0));return max}getMaxOffset(arcs){let max=0;for(let i=0,ilen=arcs.length;i<ilen;++i){const options=this.resolveDataElementOptions(i);max=Math.max(max,options.offset||0,options.hoverOffset||0)}return max}_getRingWeightOffset(datasetIndex){let ringWeightOffset=0;for(let i=0;i<datasetIndex;++i)this.chart.isDatasetVisible(i)&&(ringWeightOffset+=this._getRingWeight(i));return ringWeightOffset}_getRingWeight(datasetIndex){return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}DoughnutController.id="doughnut",DoughnutController.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"},DoughnutController.descriptors={_scriptable:name=>"spacing"!==name,_indexable:name=>"spacing"!==name},DoughnutController.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(chart){const data=chart.data;if(data.labels.length&&data.datasets.length){const{labels:{pointStyle:pointStyle}}=chart.legend.options;return data.labels.map((label,i)=>{const meta=chart.getDatasetMeta(0),style=meta.controller.getStyle(i);return{text:label,fillStyle:style.backgroundColor,strokeStyle:style.borderColor,lineWidth:style.borderWidth,pointStyle:pointStyle,hidden:!chart.getDataVisibility(i),index:i}})}return[]}},onClick(e,legendItem,legend){legend.chart.toggleDataVisibility(legendItem.index),legend.chart.update()}},tooltip:{callbacks:{title:()=>"",label(tooltipItem){let dataLabel=tooltipItem.label;const value=": "+tooltipItem.formattedValue;return isArray(dataLabel)?(dataLabel=dataLabel.slice(),dataLabel[0]+=value):dataLabel+=value,dataLabel}}}}};class LineController extends DatasetController{initialize(){this.enableOptionSharing=!0,super.initialize()}update(mode){const me=this,meta=me._cachedMeta,{dataset:line,data:points=[],_dataset:_dataset}=meta,animationsDisabled=me.chart._animationsDisabled;let{start:start,count:count}=getStartAndCountOfVisiblePoints(meta,points,animationsDisabled);me._drawStart=start,me._drawCount=count,scaleRangesChanged(meta)&&(start=0,count=points.length),line._datasetIndex=me.index,line._decimated=!!_dataset._decimated,line.points=points;const options=me.resolveDatasetElementOptions(mode);me.options.showLine||(options.borderWidth=0),options.segment=me.options.segment,me.updateElement(line,void 0,{animated:!animationsDisabled,options:options},mode),me.updateElements(points,start,count,mode)}updateElements(points,start,count,mode){const me=this,reset="reset"===mode,{iScale:iScale,vScale:vScale,_stacked:_stacked}=me._cachedMeta,firstOpts=me.resolveDataElementOptions(start,mode),sharedOptions=me.getSharedOptions(firstOpts),includeOptions=me.includeOptions(mode,sharedOptions),iAxis=iScale.axis,vAxis=vScale.axis,spanGaps=me.options.spanGaps,maxGapLength=isNumber(spanGaps)?spanGaps:Number.POSITIVE_INFINITY,directUpdate=me.chart._animationsDisabled||reset||"none"===mode;let prevParsed=start>0&&me.getParsed(start-1);for(let i=start;i<start+count;++i){const point=points[i],parsed=me.getParsed(i),properties=directUpdate?point:{},nullData=isNullOrUndef(parsed[vAxis]),iPixel=properties[iAxis]=iScale.getPixelForValue(parsed[iAxis],i),vPixel=properties[vAxis]=reset||nullData?vScale.getBasePixel():vScale.getPixelForValue(_stacked?me.applyStack(vScale,parsed,_stacked):parsed[vAxis],i);properties.skip=isNaN(iPixel)||isNaN(vPixel)||nullData,properties.stop=i>0&&parsed[iAxis]-prevParsed[iAxis]>maxGapLength,properties.parsed=parsed,includeOptions&&(properties.options=sharedOptions||me.resolveDataElementOptions(i,point.active?"active":mode)),directUpdate||me.updateElement(point,i,properties,mode),prevParsed=parsed}me.updateSharedOptions(sharedOptions,mode,firstOpts)}getMaxOverflow(){const me=this,meta=me._cachedMeta,dataset=meta.dataset,border=dataset.options&&dataset.options.borderWidth||0,data=meta.data||[];if(!data.length)return border;const firstPoint=data[0].size(me.resolveDataElementOptions(0)),lastPoint=data[data.length-1].size(me.resolveDataElementOptions(data.length-1));return Math.max(border,firstPoint,lastPoint)/2}draw(){const meta=this._cachedMeta;meta.dataset.updateControlPoints(this.chart.chartArea,meta.iScale.axis),super.draw()}}function getStartAndCountOfVisiblePoints(meta,points,animationsDisabled){const pointCount=points.length;let start=0,count=pointCount;if(meta._sorted){const{iScale:iScale,_parsed:_parsed}=meta,axis=iScale.axis,{min:min,max:max,minDefined:minDefined,maxDefined:maxDefined}=iScale.getUserBounds();minDefined&&(start=_limitValue(Math.min(_lookupByKey(_parsed,iScale.axis,min).lo,animationsDisabled?pointCount:_lookupByKey(points,axis,iScale.getPixelForValue(min)).lo),0,pointCount-1)),count=maxDefined?_limitValue(Math.max(_lookupByKey(_parsed,iScale.axis,max).hi+1,animationsDisabled?0:_lookupByKey(points,axis,iScale.getPixelForValue(max)).hi+1),start,pointCount)-start:pointCount-start}return{start:start,count:count}}function scaleRangesChanged(meta){const{xScale:xScale,yScale:yScale,_scaleRanges:_scaleRanges}=meta,newRanges={xmin:xScale.min,xmax:xScale.max,ymin:yScale.min,ymax:yScale.max};if(!_scaleRanges)return meta._scaleRanges=newRanges,!0;const changed=_scaleRanges.xmin!==xScale.min||_scaleRanges.xmax!==xScale.max||_scaleRanges.ymin!==yScale.min||_scaleRanges.ymax!==yScale.max;return Object.assign(_scaleRanges,newRanges),changed}LineController.id="line",LineController.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},LineController.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class PolarAreaController extends DatasetController{constructor(chart,datasetIndex){super(chart,datasetIndex),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(index){const me=this,meta=me._cachedMeta,chart=me.chart,labels=chart.data.labels||[],value=formatNumber(meta._parsed[index].r,chart.options.locale);return{label:labels[index]||"",value:value}}update(mode){const arcs=this._cachedMeta.data;this._updateRadius(),this.updateElements(arcs,0,arcs.length,mode)}_updateRadius(){const me=this,chart=me.chart,chartArea=chart.chartArea,opts=chart.options,minSize=Math.min(chartArea.right-chartArea.left,chartArea.bottom-chartArea.top),outerRadius=Math.max(minSize/2,0),innerRadius=Math.max(opts.cutoutPercentage?outerRadius/100*opts.cutoutPercentage:1,0),radiusLength=(outerRadius-innerRadius)/chart.getVisibleDatasetCount();me.outerRadius=outerRadius-radiusLength*me.index,me.innerRadius=me.outerRadius-radiusLength}updateElements(arcs,start,count,mode){const me=this,reset="reset"===mode,chart=me.chart,dataset=me.getDataset(),opts=chart.options,animationOpts=opts.animation,scale=me._cachedMeta.rScale,centerX=scale.xCenter,centerY=scale.yCenter,datasetStartAngle=scale.getIndexAngle(0)-.5*PI;let angle=datasetStartAngle,i;const defaultAngle=360/me.countVisibleElements();for(i=0;i<start;++i)angle+=me._computeAngle(i,mode,defaultAngle);for(i=start;i<start+count;i++){const arc=arcs[i];let startAngle=angle,endAngle=angle+me._computeAngle(i,mode,defaultAngle),outerRadius=chart.getDataVisibility(i)?scale.getDistanceFromCenterForValue(dataset.data[i]):0;angle=endAngle,reset&&(animationOpts.animateScale&&(outerRadius=0),animationOpts.animateRotate&&(startAngle=endAngle=datasetStartAngle));const properties={x:centerX,y:centerY,innerRadius:0,outerRadius:outerRadius,startAngle:startAngle,endAngle:endAngle,options:me.resolveDataElementOptions(i,arc.active?"active":mode)};me.updateElement(arc,i,properties,mode)}}countVisibleElements(){const dataset=this.getDataset(),meta=this._cachedMeta;let count=0;return meta.data.forEach((element,index)=>{!isNaN(dataset.data[index])&&this.chart.getDataVisibility(index)&&count++}),count}_computeAngle(index,mode,defaultAngle){return this.chart.getDataVisibility(index)?toRadians(this.resolveDataElementOptions(index,mode).angle||defaultAngle):0}}PolarAreaController.id="polarArea",PolarAreaController.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},PolarAreaController.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(chart){const data=chart.data;if(data.labels.length&&data.datasets.length){const{labels:{pointStyle:pointStyle}}=chart.legend.options;return data.labels.map((label,i)=>{const meta=chart.getDatasetMeta(0),style=meta.controller.getStyle(i);return{text:label,fillStyle:style.backgroundColor,strokeStyle:style.borderColor,lineWidth:style.borderWidth,pointStyle:pointStyle,hidden:!chart.getDataVisibility(i),index:i}})}return[]}},onClick(e,legendItem,legend){legend.chart.toggleDataVisibility(legendItem.index),legend.chart.update()}},tooltip:{callbacks:{title:()=>"",label:context=>context.chart.data.labels[context.dataIndex]+": "+context.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class PieController extends DoughnutController{}PieController.id="pie",PieController.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class RadarController extends DatasetController{getLabelAndValue(index){const me=this,vScale=me._cachedMeta.vScale,parsed=me.getParsed(index);return{label:vScale.getLabels()[index],value:""+vScale.getLabelForValue(parsed[vScale.axis])}}update(mode){const me=this,meta=me._cachedMeta,line=meta.dataset,points=meta.data||[],labels=meta.iScale.getLabels();if(line.points=points,"resize"!==mode){const options=me.resolveDatasetElementOptions(mode);me.options.showLine||(options.borderWidth=0);const properties={_loop:!0,_fullLoop:labels.length===points.length,options:options};me.updateElement(line,void 0,properties,mode)}me.updateElements(points,0,points.length,mode)}updateElements(points,start,count,mode){const me=this,dataset=me.getDataset(),scale=me._cachedMeta.rScale,reset="reset"===mode;for(let i=start;i<start+count;i++){const point=points[i],options=me.resolveDataElementOptions(i,point.active?"active":mode),pointPosition=scale.getPointPositionForValue(i,dataset.data[i]),x=reset?scale.xCenter:pointPosition.x,y=reset?scale.yCenter:pointPosition.y,properties={x:x,y:y,angle:pointPosition.angle,skip:isNaN(x)||isNaN(y),options:options};me.updateElement(point,i,properties,mode)}}}RadarController.id="radar",RadarController.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},RadarController.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class ScatterController extends LineController{}ScatterController.id="scatter",ScatterController.defaults={showLine:!1,fill:!1},ScatterController.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:item=>"("+item.label+", "+item.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var controllers=Object.freeze({__proto__:null,BarController:BarController,BubbleController:BubbleController,DoughnutController:DoughnutController,LineController:LineController,PolarAreaController:PolarAreaController,PieController:PieController,RadarController:RadarController,ScatterController:ScatterController});function clipArc(ctx,element,endAngle){const{startAngle:startAngle,pixelMargin:pixelMargin,x:x,y:y,outerRadius:outerRadius,innerRadius:innerRadius}=element;let angleMargin=pixelMargin/outerRadius;ctx.beginPath(),ctx.arc(x,y,outerRadius,startAngle-angleMargin,endAngle+angleMargin),innerRadius>pixelMargin?(angleMargin=pixelMargin/innerRadius,ctx.arc(x,y,innerRadius,endAngle+angleMargin,startAngle-angleMargin,!0)):ctx.arc(x,y,pixelMargin,endAngle+HALF_PI,startAngle-HALF_PI),ctx.closePath(),ctx.clip()}function toRadiusCorners(value){return _readValueToProps(value,["outerStart","outerEnd","innerStart","innerEnd"])}function parseBorderRadius$1(arc,innerRadius,outerRadius,angleDelta){const o=toRadiusCorners(arc.options.borderRadius),halfThickness=(outerRadius-innerRadius)/2,innerLimit=Math.min(halfThickness,angleDelta*innerRadius/2),computeOuterLimit=val=>{const outerArcLimit=(outerRadius-Math.min(halfThickness,val))*angleDelta/2;return _limitValue(val,0,Math.min(halfThickness,outerArcLimit))};return{outerStart:computeOuterLimit(o.outerStart),outerEnd:computeOuterLimit(o.outerEnd),innerStart:_limitValue(o.innerStart,0,innerLimit),innerEnd:_limitValue(o.innerEnd,0,innerLimit)}}function rThetaToXY(r,theta,x,y){return{x:x+r*Math.cos(theta),y:y+r*Math.sin(theta)}}function pathArc(ctx,element,offset,spacing,end){const{x:x,y:y,startAngle:start,pixelMargin:pixelMargin,innerRadius:innerR}=element,outerRadius=Math.max(element.outerRadius+spacing+offset-pixelMargin,0),innerRadius=innerR>0?innerR+spacing+offset+pixelMargin:0;let spacingOffset=0;const alpha=end-start;if(spacing){const noSpacingInnerRadius=innerR>0?innerR-spacing:0,noSpacingOuterRadius=outerRadius>0?outerRadius-spacing:0,avNogSpacingRadius=(noSpacingInnerRadius+noSpacingOuterRadius)/2,adjustedAngle=0!==avNogSpacingRadius?alpha*avNogSpacingRadius/(avNogSpacingRadius+spacing):alpha;spacingOffset=(alpha-adjustedAngle)/2}const beta=Math.max(.001,alpha*outerRadius-offset/PI)/outerRadius,angleOffset=(alpha-beta)/2,startAngle=start+angleOffset+spacingOffset,endAngle=end-angleOffset-spacingOffset,{outerStart:outerStart,outerEnd:outerEnd,innerStart:innerStart,innerEnd:innerEnd}=parseBorderRadius$1(element,innerRadius,outerRadius,endAngle-startAngle),outerStartAdjustedRadius=outerRadius-outerStart,outerEndAdjustedRadius=outerRadius-outerEnd,outerStartAdjustedAngle=startAngle+outerStart/outerStartAdjustedRadius,outerEndAdjustedAngle=endAngle-outerEnd/outerEndAdjustedRadius,innerStartAdjustedRadius=innerRadius+innerStart,innerEndAdjustedRadius=innerRadius+innerEnd,innerStartAdjustedAngle=startAngle+innerStart/innerStartAdjustedRadius,innerEndAdjustedAngle=endAngle-innerEnd/innerEndAdjustedRadius;if(ctx.beginPath(),ctx.arc(x,y,outerRadius,outerStartAdjustedAngle,outerEndAdjustedAngle),outerEnd>0){const pCenter=rThetaToXY(outerEndAdjustedRadius,outerEndAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,outerEnd,outerEndAdjustedAngle,endAngle+HALF_PI)}const p4=rThetaToXY(innerEndAdjustedRadius,endAngle,x,y);if(ctx.lineTo(p4.x,p4.y),innerEnd>0){const pCenter=rThetaToXY(innerEndAdjustedRadius,innerEndAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,innerEnd,endAngle+HALF_PI,innerEndAdjustedAngle+Math.PI)}if(ctx.arc(x,y,innerRadius,endAngle-innerEnd/innerRadius,startAngle+innerStart/innerRadius,!0),innerStart>0){const pCenter=rThetaToXY(innerStartAdjustedRadius,innerStartAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,innerStart,innerStartAdjustedAngle+Math.PI,startAngle-HALF_PI)}const p8=rThetaToXY(outerStartAdjustedRadius,startAngle,x,y);if(ctx.lineTo(p8.x,p8.y),outerStart>0){const pCenter=rThetaToXY(outerStartAdjustedRadius,outerStartAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,outerStart,startAngle-HALF_PI,outerStartAdjustedAngle)}ctx.closePath()}function drawArc(ctx,element,offset,spacing){const{fullCircles:fullCircles,startAngle:startAngle,circumference:circumference}=element;let endAngle=element.endAngle;if(fullCircles){pathArc(ctx,element,offset,spacing,startAngle+TAU);for(let i=0;i<fullCircles;++i)ctx.fill();isNaN(circumference)||(endAngle=startAngle+circumference%TAU,circumference%TAU==0&&(endAngle+=TAU))}return pathArc(ctx,element,offset,spacing,endAngle),ctx.fill(),endAngle}function drawFullCircleBorders(ctx,element,inner){const{x:x,y:y,startAngle:startAngle,pixelMargin:pixelMargin,fullCircles:fullCircles}=element,outerRadius=Math.max(element.outerRadius-pixelMargin,0),innerRadius=element.innerRadius+pixelMargin;let i;for(inner&&clipArc(ctx,element,startAngle+TAU),ctx.beginPath(),ctx.arc(x,y,innerRadius,startAngle+TAU,startAngle,!0),i=0;i<fullCircles;++i)ctx.stroke();for(ctx.beginPath(),ctx.arc(x,y,outerRadius,startAngle,startAngle+TAU),i=0;i<fullCircles;++i)ctx.stroke()}function drawBorder(ctx,element,offset,spacing,endAngle){const{options:options}=element,inner="inner"===options.borderAlign;options.borderWidth&&(inner?(ctx.lineWidth=2*options.borderWidth,ctx.lineJoin="round"):(ctx.lineWidth=options.borderWidth,ctx.lineJoin="bevel"),element.fullCircles&&drawFullCircleBorders(ctx,element,inner),inner&&clipArc(ctx,element,endAngle),pathArc(ctx,element,offset,spacing,endAngle),ctx.stroke())}class ArcElement extends Element{constructor(cfg){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,cfg&&Object.assign(this,cfg)}inRange(chartX,chartY,useFinalPosition){const point=this.getProps(["x","y"],useFinalPosition),{angle:angle,distance:distance}=getAngleFromPoint(point,{x:chartX,y:chartY}),{startAngle:startAngle,endAngle:endAngle,innerRadius:innerRadius,outerRadius:outerRadius,circumference:circumference}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],useFinalPosition),rAdjust=this.options.spacing/2,betweenAngles=circumference>=TAU||_angleBetween(angle,startAngle,endAngle),withinRadius=distance>=innerRadius+rAdjust&&distance<=outerRadius+rAdjust;return betweenAngles&&withinRadius}getCenterPoint(useFinalPosition){const{x:x,y:y,startAngle:startAngle,endAngle:endAngle,innerRadius:innerRadius,outerRadius:outerRadius}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],useFinalPosition),{offset:offset,spacing:spacing}=this.options,halfAngle=(startAngle+endAngle)/2,halfRadius=(innerRadius+outerRadius+spacing+offset)/2;return{x:x+Math.cos(halfAngle)*halfRadius,y:y+Math.sin(halfAngle)*halfRadius}}tooltipPosition(useFinalPosition){return this.getCenterPoint(useFinalPosition)}draw(ctx){const me=this,{options:options,circumference:circumference}=me,offset=(options.offset||0)/2,spacing=(options.spacing||0)/2;if(me.pixelMargin="inner"===options.borderAlign?.33:0,me.fullCircles=circumference>TAU?Math.floor(circumference/TAU):0,0===circumference||me.innerRadius<0||me.outerRadius<0)return;ctx.save();let radiusOffset=0;if(offset){radiusOffset=offset/2;const halfAngle=(me.startAngle+me.endAngle)/2;ctx.translate(Math.cos(halfAngle)*radiusOffset,Math.sin(halfAngle)*radiusOffset),me.circumference>=PI&&(radiusOffset=offset)}ctx.fillStyle=options.backgroundColor,ctx.strokeStyle=options.borderColor;const endAngle=drawArc(ctx,me,radiusOffset,spacing);drawBorder(ctx,me,radiusOffset,spacing,endAngle),ctx.restore()}}function setStyle(ctx,options,style=options){ctx.lineCap=valueOrDefault(style.borderCapStyle,options.borderCapStyle),ctx.setLineDash(valueOrDefault(style.borderDash,options.borderDash)),ctx.lineDashOffset=valueOrDefault(style.borderDashOffset,options.borderDashOffset),ctx.lineJoin=valueOrDefault(style.borderJoinStyle,options.borderJoinStyle),ctx.lineWidth=valueOrDefault(style.borderWidth,options.borderWidth),ctx.strokeStyle=valueOrDefault(style.borderColor,options.borderColor)}function lineTo(ctx,previous,target){ctx.lineTo(target.x,target.y)}function getLineMethod(options){return options.stepped?_steppedLineTo:options.tension||"monotone"===options.cubicInterpolationMode?_bezierCurveTo:lineTo}function pathVars(points,segment,params={}){const count=points.length,{start:paramsStart=0,end:paramsEnd=count-1}=params,{start:segmentStart,end:segmentEnd}=segment,start=Math.max(paramsStart,segmentStart),end=Math.min(paramsEnd,segmentEnd),outside=paramsStart<segmentStart&&paramsEnd<segmentStart||paramsStart>segmentEnd&&paramsEnd>segmentEnd;return{count:count,start:start,loop:segment.loop,ilen:end<start&&!outside?count+end-start:end-start}}function pathSegment(ctx,line,segment,params){const{points:points,options:options}=line,{count:count,start:start,loop:loop,ilen:ilen}=pathVars(points,segment,params),lineMethod=getLineMethod(options);let{move:move=!0,reverse:reverse}=params||{},i,point,prev;for(i=0;i<=ilen;++i)point=points[(start+(reverse?ilen-i:i))%count],point.skip||(move?(ctx.moveTo(point.x,point.y),move=!1):lineMethod(ctx,prev,point,reverse,options.stepped),prev=point);return loop&&(point=points[(start+(reverse?ilen:0))%count],lineMethod(ctx,prev,point,reverse,options.stepped)),!!loop}function fastPathSegment(ctx,line,segment,params){const points=line.points,{count:count,start:start,ilen:ilen}=pathVars(points,segment,params),{move:move=!0,reverse:reverse}=params||{};let avgX=0,countX=0,i,point,prevX,minY,maxY,lastY;const pointIndex=index=>(start+(reverse?ilen-index:index))%count,drawX=()=>{minY!==maxY&&(ctx.lineTo(avgX,maxY),ctx.lineTo(avgX,minY),ctx.lineTo(avgX,lastY))};for(move&&(point=points[pointIndex(0)],ctx.moveTo(point.x,point.y)),i=0;i<=ilen;++i){if(point=points[pointIndex(i)],point.skip)continue;const x=point.x,y=point.y,truncX=0|x;truncX===prevX?(y<minY?minY=y:y>maxY&&(maxY=y),avgX=(countX*avgX+x)/++countX):(drawX(),ctx.lineTo(x,y),prevX=truncX,countX=0,minY=maxY=y),lastY=y}drawX()}function _getSegmentMethod(line){const opts=line.options,borderDash=opts.borderDash&&opts.borderDash.length,useFastPath=!(line._decimated||line._loop||opts.tension||"monotone"===opts.cubicInterpolationMode||opts.stepped||borderDash);return useFastPath?fastPathSegment:pathSegment}function _getInterpolationMethod(options){return options.stepped?_steppedInterpolation:options.tension||"monotone"===options.cubicInterpolationMode?_bezierInterpolation:_pointInLine}function strokePathWithCache(ctx,line,start,count){let path=line._path;path||(path=line._path=new Path2D,line.path(path,start,count)&&path.closePath()),setStyle(ctx,line.options),ctx.stroke(path)}function strokePathDirect(ctx,line,start,count){const{segments:segments,options:options}=line,segmentMethod=_getSegmentMethod(line);for(const segment of segments)setStyle(ctx,options,segment.style),ctx.beginPath(),segmentMethod(ctx,line,segment,{start:start,end:start+count-1})&&ctx.closePath(),ctx.stroke()}ArcElement.id="arc",ArcElement.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},ArcElement.defaultRoutes={backgroundColor:"backgroundColor"};const usePath2D="function"==typeof Path2D;function draw(ctx,line,start,count){usePath2D&&1===line.segments.length?strokePathWithCache(ctx,line,start,count):strokePathDirect(ctx,line,start,count)}class LineElement extends Element{constructor(cfg){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,cfg&&Object.assign(this,cfg)}updateControlPoints(chartArea,indexAxis){const me=this,options=me.options;if((options.tension||"monotone"===options.cubicInterpolationMode)&&!options.stepped&&!me._pointsUpdated){const loop=options.spanGaps?me._loop:me._fullLoop;_updateBezierControlPoints(me._points,options,chartArea,loop,indexAxis),me._pointsUpdated=!0}}set points(points){const me=this;me._points=points,delete me._segments,delete me._path,me._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this,this.options.segment))}first(){const segments=this.segments,points=this.points;return segments.length&&points[segments[0].start]}last(){const segments=this.segments,points=this.points,count=segments.length;return count&&points[segments[count-1].end]}interpolate(point,property){const me=this,options=me.options,value=point[property],points=me.points,segments=_boundSegments(me,{property:property,start:value,end:value});if(!segments.length)return;const result=[],_interpolate=_getInterpolationMethod(options);let i,ilen;for(i=0,ilen=segments.length;i<ilen;++i){const{start:start,end:end}=segments[i],p1=points[start],p2=points[end];if(p1===p2){result.push(p1);continue}const t=Math.abs((value-p1[property])/(p2[property]-p1[property])),interpolated=_interpolate(p1,p2,t,options.stepped);interpolated[property]=point[property],result.push(interpolated)}return 1===result.length?result[0]:result}pathSegment(ctx,segment,params){const segmentMethod=_getSegmentMethod(this);return segmentMethod(ctx,this,segment,params)}path(ctx,start,count){const me=this,segments=me.segments,segmentMethod=_getSegmentMethod(me);let loop=me._loop;start=start||0,count=count||me.points.length-start;for(const segment of segments)loop&=segmentMethod(ctx,me,segment,{start:start,end:start+count-1});return!!loop}draw(ctx,chartArea,start,count){const me=this,options=me.options||{},points=me.points||[];points.length&&options.borderWidth&&(ctx.save(),draw(ctx,me,start,count),ctx.restore(),me.animated&&(me._pointsUpdated=!1,me._path=void 0))}}function inRange$1(el,pos,axis,useFinalPosition){const options=el.options,{[axis]:value}=el.getProps([axis],useFinalPosition);return Math.abs(pos-value)<options.radius+options.hitRadius}LineElement.id="line",LineElement.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},LineElement.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},LineElement.descriptors={_scriptable:!0,_indexable:name=>"borderDash"!==name&&"fill"!==name};class PointElement extends Element{constructor(cfg){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,cfg&&Object.assign(this,cfg)}inRange(mouseX,mouseY,useFinalPosition){const options=this.options,{x:x,y:y}=this.getProps(["x","y"],useFinalPosition);return Math.pow(mouseX-x,2)+Math.pow(mouseY-y,2)<Math.pow(options.hitRadius+options.radius,2)}inXRange(mouseX,useFinalPosition){return inRange$1(this,mouseX,"x",useFinalPosition)}inYRange(mouseY,useFinalPosition){return inRange$1(this,mouseY,"y",useFinalPosition)}getCenterPoint(useFinalPosition){const{x:x,y:y}=this.getProps(["x","y"],useFinalPosition);return{x:x,y:y}}size(options){let radius=(options=options||this.options||{}).radius||0;radius=Math.max(radius,radius&&options.hoverRadius||0);const borderWidth=radius&&options.borderWidth||0;return 2*(radius+borderWidth)}draw(ctx,area){const me=this,options=me.options;me.skip||options.radius<.1||!_isPointInArea(me,area,me.size(options)/2)||(ctx.strokeStyle=options.borderColor,ctx.lineWidth=options.borderWidth,ctx.fillStyle=options.backgroundColor,drawPoint(ctx,options,me.x,me.y))}getRange(){const options=this.options||{};return options.radius+options.hitRadius}}function getBarBounds(bar,useFinalPosition){const{x:x,y:y,base:base,width:width,height:height}=bar.getProps(["x","y","base","width","height"],useFinalPosition);let left,right,top,bottom,half;return bar.horizontal?(half=height/2,left=Math.min(x,base),right=Math.max(x,base),top=y-half,bottom=y+half):(half=width/2,left=x-half,right=x+half,top=Math.min(y,base),bottom=Math.max(y,base)),{left:left,top:top,right:right,bottom:bottom}}function skipOrLimit(skip,value,min,max){return skip?0:_limitValue(value,min,max)}function parseBorderWidth(bar,maxW,maxH){const value=bar.options.borderWidth,skip=bar.borderSkipped,o=toTRBL(value);return{t:skipOrLimit(skip.top,o.top,0,maxH),r:skipOrLimit(skip.right,o.right,0,maxW),b:skipOrLimit(skip.bottom,o.bottom,0,maxH),l:skipOrLimit(skip.left,o.left,0,maxW)}}function parseBorderRadius(bar,maxW,maxH){const{enableBorderRadius:enableBorderRadius}=bar.getProps(["enableBorderRadius"]),value=bar.options.borderRadius,o=toTRBLCorners(value),maxR=Math.min(maxW,maxH),skip=bar.borderSkipped,enableBorder=enableBorderRadius||isObject(value);return{topLeft:skipOrLimit(!enableBorder||skip.top||skip.left,o.topLeft,0,maxR),topRight:skipOrLimit(!enableBorder||skip.top||skip.right,o.topRight,0,maxR),bottomLeft:skipOrLimit(!enableBorder||skip.bottom||skip.left,o.bottomLeft,0,maxR),bottomRight:skipOrLimit(!enableBorder||skip.bottom||skip.right,o.bottomRight,0,maxR)}}function boundingRects(bar){const bounds=getBarBounds(bar),width=bounds.right-bounds.left,height=bounds.bottom-bounds.top,border=parseBorderWidth(bar,width/2,height/2),radius=parseBorderRadius(bar,width/2,height/2);return{outer:{x:bounds.left,y:bounds.top,w:width,h:height,radius:radius},inner:{x:bounds.left+border.l,y:bounds.top+border.t,w:width-border.l-border.r,h:height-border.t-border.b,radius:{topLeft:Math.max(0,radius.topLeft-Math.max(border.t,border.l)),topRight:Math.max(0,radius.topRight-Math.max(border.t,border.r)),bottomLeft:Math.max(0,radius.bottomLeft-Math.max(border.b,border.l)),bottomRight:Math.max(0,radius.bottomRight-Math.max(border.b,border.r))}}}}function inRange(bar,x,y,useFinalPosition){const skipX=null===x,skipY=null===y,skipBoth=skipX&&skipY,bounds=bar&&!skipBoth&&getBarBounds(bar,useFinalPosition);return bounds&&(skipX||x>=bounds.left&&x<=bounds.right)&&(skipY||y>=bounds.top&&y<=bounds.bottom)}function hasRadius(radius){return radius.topLeft||radius.topRight||radius.bottomLeft||radius.bottomRight}function addNormalRectPath(ctx,rect){ctx.rect(rect.x,rect.y,rect.w,rect.h)}function inflateRect(rect,amount,refRect={}){const x=rect.x!==refRect.x?-amount:0,y=rect.y!==refRect.y?-amount:0,w=(rect.x+rect.w!==refRect.x+refRect.w?amount:0)-x,h=(rect.y+rect.h!==refRect.y+refRect.h?amount:0)-y;return{x:rect.x+x,y:rect.y+y,w:rect.w+w,h:rect.h+h,radius:rect.radius}}PointElement.id="point",PointElement.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},PointElement.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class BarElement extends Element{constructor(cfg){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,cfg&&Object.assign(this,cfg)}draw(ctx){const options=this.options,{inner:inner,outer:outer}=boundingRects(this),addRectPath=hasRadius(outer.radius)?addRoundedRectPath:addNormalRectPath,inflateAmount=.33;ctx.save(),outer.w===inner.w&&outer.h===inner.h||(ctx.beginPath(),addRectPath(ctx,inflateRect(outer,.33,inner)),ctx.clip(),addRectPath(ctx,inflateRect(inner,-.33,outer)),ctx.fillStyle=options.borderColor,ctx.fill("evenodd")),ctx.beginPath(),addRectPath(ctx,inflateRect(inner,.33,outer)),ctx.fillStyle=options.backgroundColor,ctx.fill(),ctx.restore()}inRange(mouseX,mouseY,useFinalPosition){return inRange(this,mouseX,mouseY,useFinalPosition)}inXRange(mouseX,useFinalPosition){return inRange(this,mouseX,null,useFinalPosition)}inYRange(mouseY,useFinalPosition){return inRange(this,null,mouseY,useFinalPosition)}getCenterPoint(useFinalPosition){const{x:x,y:y,base:base,horizontal:horizontal}=this.getProps(["x","y","base","horizontal"],useFinalPosition);return{x:horizontal?(x+base)/2:x,y:horizontal?y:(y+base)/2}}getRange(axis){return"x"===axis?this.width/2:this.height/2}}BarElement.id="bar",BarElement.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,enableBorderRadius:!0,pointStyle:void 0},BarElement.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var elements=Object.freeze({__proto__:null,ArcElement:ArcElement,LineElement:LineElement,PointElement:PointElement,BarElement:BarElement});function lttbDecimation(data,start,count,availableWidth,options){const samples=options.samples||availableWidth;if(samples>=count)return data.slice(start,start+count);const decimated=[],bucketWidth=(count-2)/(samples-2);let sampledIndex=0;const endIndex=start+count-1;let a=start,i,maxAreaPoint,maxArea,area,nextA;for(decimated[sampledIndex++]=data[a],i=0;i<samples-2;i++){let avgX=0,avgY=0,j;const avgRangeStart=Math.floor((i+1)*bucketWidth)+1+start,avgRangeEnd=Math.min(Math.floor((i+2)*bucketWidth)+1,count)+start,avgRangeLength=avgRangeEnd-avgRangeStart;for(j=avgRangeStart;j<avgRangeEnd;j++)avgX+=data[j].x,avgY+=data[j].y;avgX/=avgRangeLength,avgY/=avgRangeLength;const rangeOffs=Math.floor(i*bucketWidth)+1+start,rangeTo=Math.min(Math.floor((i+1)*bucketWidth)+1,count)+start,{x:pointAx,y:pointAy}=data[a];for(maxArea=area=-1,j=rangeOffs;j<rangeTo;j++)area=.5*Math.abs((pointAx-avgX)*(data[j].y-pointAy)-(pointAx-data[j].x)*(avgY-pointAy)),area>maxArea&&(maxArea=area,maxAreaPoint=data[j],nextA=j);decimated[sampledIndex++]=maxAreaPoint,a=nextA}return decimated[sampledIndex++]=data[endIndex],decimated}function minMaxDecimation(data,start,count,availableWidth){let avgX=0,countX=0,i,point,x,y,prevX,minIndex,maxIndex,startIndex,minY,maxY;const decimated=[],endIndex=start+count-1,xMin=data[start].x,xMax=data[endIndex].x,dx=xMax-xMin;for(i=start;i<start+count;++i){point=data[i],x=(point.x-xMin)/dx*availableWidth,y=point.y;const truncX=0|x;if(truncX===prevX)y<minY?(minY=y,minIndex=i):y>maxY&&(maxY=y,maxIndex=i),avgX=(countX*avgX+point.x)/++countX;else{const lastIndex=i-1;if(!isNullOrUndef(minIndex)&&!isNullOrUndef(maxIndex)){const intermediateIndex1=Math.min(minIndex,maxIndex),intermediateIndex2=Math.max(minIndex,maxIndex);intermediateIndex1!==startIndex&&intermediateIndex1!==lastIndex&&decimated.push({...data[intermediateIndex1],x:avgX}),intermediateIndex2!==startIndex&&intermediateIndex2!==lastIndex&&decimated.push({...data[intermediateIndex2],x:avgX})}i>0&&lastIndex!==startIndex&&decimated.push(data[lastIndex]),decimated.push(point),prevX=truncX,countX=0,minY=maxY=y,minIndex=maxIndex=startIndex=i}}return decimated}function cleanDecimatedDataset(dataset){if(dataset._decimated){const data=dataset._data;delete dataset._decimated,delete dataset._data,Object.defineProperty(dataset,"data",{value:data})}}function cleanDecimatedData(chart){chart.data.datasets.forEach(dataset=>{cleanDecimatedDataset(dataset)})}function getStartAndCountOfVisiblePointsSimplified(meta,points){const pointCount=points.length;let start=0,count;const{iScale:iScale}=meta,{min:min,max:max,minDefined:minDefined,maxDefined:maxDefined}=iScale.getUserBounds();return minDefined&&(start=_limitValue(_lookupByKey(points,iScale.axis,min).lo,0,pointCount-1)),count=maxDefined?_limitValue(_lookupByKey(points,iScale.axis,max).hi+1,start,pointCount)-start:pointCount-start,{start:start,count:count}}var plugin_decimation={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(chart,args,options)=>{if(!options.enabled)return void cleanDecimatedData(chart);const availableWidth=chart.width;chart.data.datasets.forEach((dataset,datasetIndex)=>{const{_data:_data,indexAxis:indexAxis}=dataset,meta=chart.getDatasetMeta(datasetIndex),data=_data||dataset.data;if("y"===resolve([indexAxis,chart.options.indexAxis]))return;if("line"!==meta.type)return;const xAxis=chart.scales[meta.xAxisID];if("linear"!==xAxis.type&&"time"!==xAxis.type)return;if(chart.options.parsing)return;let{start:start,count:count}=getStartAndCountOfVisiblePointsSimplified(meta,data);const threshold=options.threshold||4*availableWidth;if(count<=threshold)return void cleanDecimatedDataset(dataset);let decimated;switch(isNullOrUndef(_data)&&(dataset._data=data,delete dataset.data,Object.defineProperty(dataset,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(d){this._data=d}})),options.algorithm){case"lttb":decimated=lttbDecimation(data,start,count,availableWidth,options);break;case"min-max":decimated=minMaxDecimation(data,start,count,availableWidth);break;default:throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`)}dataset._decimated=decimated})},destroy(chart){cleanDecimatedData(chart)}};function getLineByIndex(chart,index){const meta=chart.getDatasetMeta(index),visible=meta&&chart.isDatasetVisible(index);return visible?meta.dataset:null}function parseFillOption(line){const options=line.options,fillOption=options.fill;let fill=valueOrDefault(fillOption&&fillOption.target,fillOption);return void 0===fill&&(fill=!!options.backgroundColor),!1!==fill&&null!==fill&&(!0===fill?"origin":fill)}function decodeFill(line,index,count){const fill=parseFillOption(line);if(isObject(fill))return!isNaN(fill.value)&&fill;let target=parseFloat(fill);return isNumberFinite(target)&&Math.floor(target)===target?("-"!==fill[0]&&"+"!==fill[0]||(target=index+target),!(target===index||target<0||target>=count)&&target):["origin","start","end","stack","shape"].indexOf(fill)>=0&&fill}function computeLinearBoundary(source){const{scale:scale={},fill:fill}=source;let target=null,horizontal;return"start"===fill?target=scale.bottom:"end"===fill?target=scale.top:isObject(fill)?target=scale.getPixelForValue(fill.value):scale.getBasePixel&&(target=scale.getBasePixel()),isNumberFinite(target)?(horizontal=scale.isHorizontal(),{x:horizontal?target:null,y:horizontal?null:target}):null}class simpleArc{constructor(opts){this.x=opts.x,this.y=opts.y,this.radius=opts.radius}pathSegment(ctx,bounds,opts){const{x:x,y:y,radius:radius}=this;return bounds=bounds||{start:0,end:TAU},ctx.arc(x,y,radius,bounds.end,bounds.start,!0),!opts.bounds}interpolate(point){const{x:x,y:y,radius:radius}=this,angle=point.angle;return{x:x+Math.cos(angle)*radius,y:y+Math.sin(angle)*radius,angle:angle}}}function computeCircularBoundary(source){const{scale:scale,fill:fill}=source,options=scale.options,length=scale.getLabels().length,target=[],start=options.reverse?scale.max:scale.min,end=options.reverse?scale.min:scale.max;let i,center,value;if(value="start"===fill?start:"end"===fill?end:isObject(fill)?fill.value:scale.getBaseValue(),options.grid.circular)return center=scale.getPointPositionForValue(0,start),new simpleArc({x:center.x,y:center.y,radius:scale.getDistanceFromCenterForValue(value)});for(i=0;i<length;++i)target.push(scale.getPointPositionForValue(i,value));return target}function computeBoundary(source){const scale=source.scale||{};return scale.getPointPositionForValue?computeCircularBoundary(source):computeLinearBoundary(source)}function findSegmentEnd(start,end,points){for(;end>start;end--){const point=points[end];if(!isNaN(point.x)&&!isNaN(point.y))break}return end}function pointsFromSegments(boundary,line){const{x:x=null,y:y=null}=boundary||{},linePoints=line.points,points=[];return line.segments.forEach(({start:start,end:end})=>{end=findSegmentEnd(start,end,linePoints);const first=linePoints[start],last=linePoints[end];null!==y?(points.push({x:first.x,y:y}),points.push({x:last.x,y:y})):null!==x&&(points.push({x:x,y:first.y}),points.push({x:x,y:last.y}))}),points}function buildStackLine(source){const{chart:chart,scale:scale,index:index,line:line}=source,points=[],segments=line.segments,sourcePoints=line.points,linesBelow=getLinesBelow(chart,index);linesBelow.push(createBoundaryLine({x:null,y:scale.bottom},line));for(let i=0;i<segments.length;i++){const segment=segments[i];for(let j=segment.start;j<=segment.end;j++)addPointsBelow(points,sourcePoints[j],linesBelow)}return new LineElement({points:points,options:{}})}const isLineAndNotInHideAnimation=meta=>"line"===meta.type&&!meta.hidden;function getLinesBelow(chart,index){const below=[],metas=chart.getSortedVisibleDatasetMetas();for(let i=0;i<metas.length;i++){const meta=metas[i];if(meta.index===index)break;isLineAndNotInHideAnimation(meta)&&below.unshift(meta.dataset)}return below}function addPointsBelow(points,sourcePoint,linesBelow){const postponed=[];for(let j=0;j<linesBelow.length;j++){const line=linesBelow[j],{first:first,last:last,point:point}=findPoint(line,sourcePoint,"x");if(!(!point||first&&last))if(first)postponed.unshift(point);else if(points.push(point),!last)break}points.push(...postponed)}function findPoint(line,sourcePoint,property){const point=line.interpolate(sourcePoint,property);if(!point)return{};const pointValue=point[property],segments=line.segments,linePoints=line.points;let first=!1,last=!1;for(let i=0;i<segments.length;i++){const segment=segments[i],firstValue=linePoints[segment.start][property],lastValue=linePoints[segment.end][property];if(pointValue>=firstValue&&pointValue<=lastValue){first=pointValue===firstValue,last=pointValue===lastValue;break}}return{first:first,last:last,point:point}}function getTarget(source){const{chart:chart,fill:fill,line:line}=source;if(isNumberFinite(fill))return getLineByIndex(chart,fill);if("stack"===fill)return buildStackLine(source);if("shape"===fill)return!0;const boundary=computeBoundary(source);return boundary instanceof simpleArc?boundary:createBoundaryLine(boundary,line)}function createBoundaryLine(boundary,line){let points=[],_loop=!1;return isArray(boundary)?(_loop=!0,points=boundary):points=pointsFromSegments(boundary,line),points.length?new LineElement({points:points,options:{tension:0},_loop:_loop,_fullLoop:_loop}):null}function resolveTarget(sources,index,propagate){const source=sources[index];let fill=source.fill;const visited=[index];let target;if(!propagate)return fill;for(;!1!==fill&&-1===visited.indexOf(fill);){if(!isNumberFinite(fill))return fill;if(target=sources[fill],!target)return!1;if(target.visible)return fill;visited.push(fill),fill=target.fill}return!1}function _clip(ctx,target,clipY){ctx.beginPath(),target.path(ctx),ctx.lineTo(target.last().x,clipY),ctx.lineTo(target.first().x,clipY),ctx.closePath(),ctx.clip()}function getBounds(property,first,last,loop){if(loop)return;let start=first[property],end=last[property];return"angle"===property&&(start=_normalizeAngle(start),end=_normalizeAngle(end)),{property:property,start:start,end:end}}function _getEdge(a,b,prop,fn){return a&&b?fn(a[prop],b[prop]):a?a[prop]:b?b[prop]:0}function _segments(line,target,property){const segments=line.segments,points=line.points,tpoints=target.points,parts=[];for(const segment of segments){let{start:start,end:end}=segment;end=findSegmentEnd(start,end,points);const bounds=getBounds(property,points[start],points[end],segment.loop);if(!target.segments){parts.push({source:segment,target:bounds,start:points[start],end:points[end]});continue}const targetSegments=_boundSegments(target,bounds);for(const tgt of targetSegments){const subBounds=getBounds(property,tpoints[tgt.start],tpoints[tgt.end],tgt.loop),fillSources=_boundSegment(segment,points,subBounds);for(const fillSource of fillSources)parts.push({source:fillSource,target:tgt,start:{[property]:_getEdge(bounds,subBounds,"start",Math.max)},end:{[property]:_getEdge(bounds,subBounds,"end",Math.min)}})}}return parts}function clipBounds(ctx,scale,bounds){const{top:top,bottom:bottom}=scale.chart.chartArea,{property:property,start:start,end:end}=bounds||{};"x"===property&&(ctx.beginPath(),ctx.rect(start,top,end-start,bottom-top),ctx.clip())}function interpolatedLineTo(ctx,target,point,property){const interpolatedPoint=target.interpolate(point,property);interpolatedPoint&&ctx.lineTo(interpolatedPoint.x,interpolatedPoint.y)}function _fill(ctx,cfg){const{line:line,target:target,property:property,color:color,scale:scale}=cfg,segments=_segments(line,target,property);for(const{source:src,target:tgt,start:start,end:end}of segments){const{style:{backgroundColor:backgroundColor=color}={}}=src,notShape=!0!==target;ctx.save(),ctx.fillStyle=backgroundColor,clipBounds(ctx,scale,notShape&&getBounds(property,start,end)),ctx.beginPath();const lineLoop=!!line.pathSegment(ctx,src);let loop;if(notShape){lineLoop?ctx.closePath():interpolatedLineTo(ctx,target,end,property);const targetLoop=!!target.pathSegment(ctx,tgt,{move:lineLoop,reverse:!0});loop=lineLoop&&targetLoop,loop||interpolatedLineTo(ctx,target,start,property)}ctx.closePath(),ctx.fill(loop?"evenodd":"nonzero"),ctx.restore()}}function doFill(ctx,cfg){const{line:line,target:target,above:above,below:below,area:area,scale:scale}=cfg,property=line._loop?"angle":cfg.axis;ctx.save(),"x"===property&&below!==above&&(_clip(ctx,target,area.top),_fill(ctx,{line:line,target:target,color:above,scale:scale,property:property}),ctx.restore(),ctx.save(),_clip(ctx,target,area.bottom)),_fill(ctx,{line:line,target:target,color:below,scale:scale,property:property}),ctx.restore()}function drawfill(ctx,source,area){const target=getTarget(source),{line:line,scale:scale,axis:axis}=source,lineOpts=line.options,fillOption=lineOpts.fill,color=lineOpts.backgroundColor,{above:above=color,below:below=color}=fillOption||{};target&&line.points.length&&(clipArea(ctx,area),doFill(ctx,{line:line,target:target,above:above,below:below,area:area,scale:scale,axis:axis}),unclipArea(ctx))}var plugin_filler={id:"filler",afterDatasetsUpdate(chart,_args,options){const count=(chart.data.datasets||[]).length,sources=[];let meta,i,line,source;for(i=0;i<count;++i)meta=chart.getDatasetMeta(i),line=meta.dataset,source=null,line&&line.options&&line instanceof LineElement&&(source={visible:chart.isDatasetVisible(i),index:i,fill:decodeFill(line,i,count),chart:chart,axis:meta.controller.options.indexAxis,scale:meta.vScale,line:line}),meta.$filler=source,sources.push(source);for(i=0;i<count;++i)source=sources[i],source&&!1!==source.fill&&(source.fill=resolveTarget(sources,i,options.propagate))},beforeDraw(chart,_args,options){const draw="beforeDraw"===options.drawTime,metasets=chart.getSortedVisibleDatasetMetas(),area=chart.chartArea;for(let i=metasets.length-1;i>=0;--i){const source=metasets[i].$filler;source&&(source.line.updateControlPoints(area,source.axis),draw&&drawfill(chart.ctx,source,area))}},beforeDatasetsDraw(chart,_args,options){if("beforeDatasetsDraw"!==options.drawTime)return;const metasets=chart.getSortedVisibleDatasetMetas();for(let i=metasets.length-1;i>=0;--i){const source=metasets[i].$filler;source&&drawfill(chart.ctx,source,chart.chartArea)}},beforeDatasetDraw(chart,args,options){const source=args.meta.$filler;source&&!1!==source.fill&&"beforeDatasetDraw"===options.drawTime&&drawfill(chart.ctx,source,chart.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const getBoxSize=(labelOpts,fontSize)=>{let{boxHeight:boxHeight=fontSize,boxWidth:boxWidth=fontSize}=labelOpts;return labelOpts.usePointStyle&&(boxHeight=Math.min(boxHeight,fontSize),boxWidth=Math.min(boxWidth,fontSize)),{boxWidth:boxWidth,boxHeight:boxHeight,itemHeight:Math.max(fontSize,boxHeight)}},itemsEqual=(a,b)=>null!==a&&null!==b&&a.datasetIndex===b.datasetIndex&&a.index===b.index;class Legend extends Element{constructor(config){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=config.chart,this.options=config.options,this.ctx=config.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(maxWidth,maxHeight,margins){const me=this;me.maxWidth=maxWidth,me.maxHeight=maxHeight,me._margins=margins,me.setDimensions(),me.buildLabels(),me.fit()}setDimensions(){const me=this;me.isHorizontal()?(me.width=me.maxWidth,me.left=me._margins.left,me.right=me.width):(me.height=me.maxHeight,me.top=me._margins.top,me.bottom=me.height)}buildLabels(){const me=this,labelOpts=me.options.labels||{};let legendItems=callback(labelOpts.generateLabels,[me.chart],me)||[];labelOpts.filter&&(legendItems=legendItems.filter(item=>labelOpts.filter(item,me.chart.data))),labelOpts.sort&&(legendItems=legendItems.sort((a,b)=>labelOpts.sort(a,b,me.chart.data))),me.options.reverse&&legendItems.reverse(),me.legendItems=legendItems}fit(){const me=this,{options:options,ctx:ctx}=me;if(!options.display)return void(me.width=me.height=0);const labelOpts=options.labels,labelFont=toFont(labelOpts.font),fontSize=labelFont.size,titleHeight=me._computeTitleHeight(),{boxWidth:boxWidth,itemHeight:itemHeight}=getBoxSize(labelOpts,fontSize);let width,height;ctx.font=labelFont.string,me.isHorizontal()?(width=me.maxWidth,height=me._fitRows(titleHeight,fontSize,boxWidth,itemHeight)+10):(height=me.maxHeight,width=me._fitCols(titleHeight,fontSize,boxWidth,itemHeight)+10),me.width=Math.min(width,options.maxWidth||me.maxWidth),me.height=Math.min(height,options.maxHeight||me.maxHeight)}_fitRows(titleHeight,fontSize,boxWidth,itemHeight){const me=this,{ctx:ctx,maxWidth:maxWidth,options:{labels:{padding:padding}}}=me,hitboxes=me.legendHitBoxes=[],lineWidths=me.lineWidths=[0],lineHeight=itemHeight+padding;let totalHeight=titleHeight;ctx.textAlign="left",ctx.textBaseline="middle";let row=-1,top=-lineHeight;return me.legendItems.forEach((legendItem,i)=>{const itemWidth=boxWidth+fontSize/2+ctx.measureText(legendItem.text).width;(0===i||lineWidths[lineWidths.length-1]+itemWidth+2*padding>maxWidth)&&(totalHeight+=lineHeight,lineWidths[lineWidths.length-(i>0?0:1)]=0,top+=lineHeight,row++),hitboxes[i]={left:0,top:top,row:row,width:itemWidth,height:itemHeight},lineWidths[lineWidths.length-1]+=itemWidth+padding}),totalHeight}_fitCols(titleHeight,fontSize,boxWidth,itemHeight){const me=this,{ctx:ctx,maxHeight:maxHeight,options:{labels:{padding:padding}}}=me,hitboxes=me.legendHitBoxes=[],columnSizes=me.columnSizes=[],heightLimit=maxHeight-titleHeight;let totalWidth=padding,currentColWidth=0,currentColHeight=0,left=0,col=0;return me.legendItems.forEach((legendItem,i)=>{const itemWidth=boxWidth+fontSize/2+ctx.measureText(legendItem.text).width;i>0&&currentColHeight+itemHeight+2*padding>heightLimit&&(totalWidth+=currentColWidth+padding,columnSizes.push({width:currentColWidth,height:currentColHeight}),left+=currentColWidth+padding,col++,currentColWidth=currentColHeight=0),hitboxes[i]={left:left,top:currentColHeight,col:col,width:itemWidth,height:itemHeight},currentColWidth=Math.max(currentColWidth,itemWidth),currentColHeight+=itemHeight+padding}),totalWidth+=currentColWidth,columnSizes.push({width:currentColWidth,height:currentColHeight}),totalWidth}adjustHitBoxes(){const me=this;if(!me.options.display)return;const titleHeight=me._computeTitleHeight(),{legendHitBoxes:hitboxes,options:{align:align,labels:{padding:padding},rtl:rtl}}=me,rtlHelper=getRtlAdapter(rtl,me.left,me.width);if(this.isHorizontal()){let row=0,left=_alignStartEnd(align,me.left+padding,me.right-me.lineWidths[row]);for(const hitbox of hitboxes)row!==hitbox.row&&(row=hitbox.row,left=_alignStartEnd(align,me.left+padding,me.right-me.lineWidths[row])),hitbox.top+=me.top+titleHeight+padding,hitbox.left=rtlHelper.leftForLtr(rtlHelper.x(left),hitbox.width),left+=hitbox.width+padding}else{let col=0,top=_alignStartEnd(align,me.top+titleHeight+padding,me.bottom-me.columnSizes[col].height);for(const hitbox of hitboxes)hitbox.col!==col&&(col=hitbox.col,top=_alignStartEnd(align,me.top+titleHeight+padding,me.bottom-me.columnSizes[col].height)),hitbox.top=top,hitbox.left+=me.left+padding,hitbox.left=rtlHelper.leftForLtr(rtlHelper.x(hitbox.left),hitbox.width),top+=hitbox.height+padding}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){const me=this;if(me.options.display){const ctx=me.ctx;clipArea(ctx,me),me._draw(),unclipArea(ctx)}}_draw(){const me=this,{options:opts,columnSizes:columnSizes,lineWidths:lineWidths,ctx:ctx}=me,{align:align,labels:labelOpts}=opts,defaultColor=defaults.color,rtlHelper=getRtlAdapter(opts.rtl,me.left,me.width),labelFont=toFont(labelOpts.font),{color:fontColor,padding:padding}=labelOpts,fontSize=labelFont.size,halfFontSize=fontSize/2;let cursor;me.drawTitle(),ctx.textAlign=rtlHelper.textAlign("left"),ctx.textBaseline="middle",ctx.lineWidth=.5,ctx.font=labelFont.string;const{boxWidth:boxWidth,boxHeight:boxHeight,itemHeight:itemHeight}=getBoxSize(labelOpts,fontSize),drawLegendBox=function(x,y,legendItem){if(isNaN(boxWidth)||boxWidth<=0||isNaN(boxHeight)||boxHeight<0)return;ctx.save();const lineWidth=valueOrDefault(legendItem.lineWidth,1);if(ctx.fillStyle=valueOrDefault(legendItem.fillStyle,defaultColor),ctx.lineCap=valueOrDefault(legendItem.lineCap,"butt"),ctx.lineDashOffset=valueOrDefault(legendItem.lineDashOffset,0),ctx.lineJoin=valueOrDefault(legendItem.lineJoin,"miter"),ctx.lineWidth=lineWidth,ctx.strokeStyle=valueOrDefault(legendItem.strokeStyle,defaultColor),ctx.setLineDash(valueOrDefault(legendItem.lineDash,[])),labelOpts.usePointStyle){const drawOptions={radius:boxWidth*Math.SQRT2/2,pointStyle:legendItem.pointStyle,rotation:legendItem.rotation,borderWidth:lineWidth},centerX=rtlHelper.xPlus(x,boxWidth/2),centerY=y+halfFontSize;drawPoint(ctx,drawOptions,centerX,centerY)}else{const yBoxTop=y+Math.max((fontSize-boxHeight)/2,0),xBoxLeft=rtlHelper.leftForLtr(x,boxWidth),borderRadius=toTRBLCorners(legendItem.borderRadius);ctx.beginPath(),Object.values(borderRadius).some(v=>0!==v)?addRoundedRectPath(ctx,{x:xBoxLeft,y:yBoxTop,w:boxWidth,h:boxHeight,radius:borderRadius}):ctx.rect(xBoxLeft,yBoxTop,boxWidth,boxHeight),ctx.fill(),0!==lineWidth&&ctx.stroke()}ctx.restore()},fillText=function(x,y,legendItem){renderText(ctx,legendItem.text,x,y+itemHeight/2,labelFont,{strikethrough:legendItem.hidden,textAlign:rtlHelper.textAlign(legendItem.textAlign)})},isHorizontal=me.isHorizontal(),titleHeight=this._computeTitleHeight();cursor=isHorizontal?{x:_alignStartEnd(align,me.left+padding,me.right-lineWidths[0]),y:me.top+padding+titleHeight,line:0}:{x:me.left+padding,y:_alignStartEnd(align,me.top+titleHeight+padding,me.bottom-columnSizes[0].height),line:0},overrideTextDirection(me.ctx,opts.textDirection);const lineHeight=itemHeight+padding;me.legendItems.forEach((legendItem,i)=>{ctx.strokeStyle=legendItem.fontColor||fontColor,ctx.fillStyle=legendItem.fontColor||fontColor;const textWidth=ctx.measureText(legendItem.text).width,textAlign=rtlHelper.textAlign(legendItem.textAlign||(legendItem.textAlign=labelOpts.textAlign)),width=boxWidth+halfFontSize+textWidth;let x=cursor.x,y=cursor.y;rtlHelper.setWidth(me.width),isHorizontal?i>0&&x+width+padding>me.right&&(y=cursor.y+=lineHeight,cursor.line++,x=cursor.x=_alignStartEnd(align,me.left+padding,me.right-lineWidths[cursor.line])):i>0&&y+lineHeight>me.bottom&&(x=cursor.x=x+columnSizes[cursor.line].width+padding,cursor.line++,y=cursor.y=_alignStartEnd(align,me.top+titleHeight+padding,me.bottom-columnSizes[cursor.line].height));const realX=rtlHelper.x(x);drawLegendBox(realX,y,legendItem),x=_textX(textAlign,x+boxWidth+halfFontSize,isHorizontal?x+width:me.right,opts.rtl),fillText(rtlHelper.x(x),y,legendItem),isHorizontal?cursor.x+=width+padding:cursor.y+=lineHeight}),restoreTextDirection(me.ctx,opts.textDirection)}drawTitle(){const me=this,opts=me.options,titleOpts=opts.title,titleFont=toFont(titleOpts.font),titlePadding=toPadding(titleOpts.padding);if(!titleOpts.display)return;const rtlHelper=getRtlAdapter(opts.rtl,me.left,me.width),ctx=me.ctx,position=titleOpts.position,halfFontSize=titleFont.size/2,topPaddingPlusHalfFontSize=titlePadding.top+halfFontSize;let y,left=me.left,maxWidth=me.width;if(this.isHorizontal())maxWidth=Math.max(...me.lineWidths),y=me.top+topPaddingPlusHalfFontSize,left=_alignStartEnd(opts.align,left,me.right-maxWidth);else{const maxHeight=me.columnSizes.reduce((acc,size)=>Math.max(acc,size.height),0);y=topPaddingPlusHalfFontSize+_alignStartEnd(opts.align,me.top,me.bottom-maxHeight-opts.labels.padding-me._computeTitleHeight())}const x=_alignStartEnd(position,left,left+maxWidth);ctx.textAlign=rtlHelper.textAlign(_toLeftRightCenter(position)),ctx.textBaseline="middle",ctx.strokeStyle=titleOpts.color,ctx.fillStyle=titleOpts.color,ctx.font=titleFont.string,renderText(ctx,titleOpts.text,x,y,titleFont)}_computeTitleHeight(){const titleOpts=this.options.title,titleFont=toFont(titleOpts.font),titlePadding=toPadding(titleOpts.padding);return titleOpts.display?titleFont.lineHeight+titlePadding.height:0}_getLegendItemAt(x,y){const me=this;let i,hitBox,lh;if(x>=me.left&&x<=me.right&&y>=me.top&&y<=me.bottom)for(lh=me.legendHitBoxes,i=0;i<lh.length;++i)if(hitBox=lh[i],x>=hitBox.left&&x<=hitBox.left+hitBox.width&&y>=hitBox.top&&y<=hitBox.top+hitBox.height)return me.legendItems[i];return null}handleEvent(e){const me=this,opts=me.options;if(!isListened(e.type,opts))return;const hoveredItem=me._getLegendItemAt(e.x,e.y);if("mousemove"===e.type){const previous=me._hoveredItem,sameItem=itemsEqual(previous,hoveredItem);previous&&!sameItem&&callback(opts.onLeave,[e,previous,me],me),me._hoveredItem=hoveredItem,hoveredItem&&!sameItem&&callback(opts.onHover,[e,hoveredItem,me],me)}else hoveredItem&&callback(opts.onClick,[e,hoveredItem,me],me)}}function isListened(type,opts){return!("mousemove"!==type||!opts.onHover&&!opts.onLeave)||!(!opts.onClick||"click"!==type&&"mouseup"!==type)}var plugin_legend={id:"legend",_element:Legend,start(chart,_args,options){const legend=chart.legend=new Legend({ctx:chart.ctx,options:options,chart:chart});layouts.configure(chart,legend,options),layouts.addBox(chart,legend)},stop(chart){layouts.removeBox(chart,chart.legend),delete chart.legend},beforeUpdate(chart,_args,options){const legend=chart.legend;layouts.configure(chart,legend,options),legend.options=options},afterUpdate(chart){const legend=chart.legend;legend.buildLabels(),legend.adjustHitBoxes()},afterEvent(chart,args){args.replay||chart.legend.handleEvent(args.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,legendItem,legend){const index=legendItem.datasetIndex,ci=legend.chart;ci.isDatasetVisible(index)?(ci.hide(index),legendItem.hidden=!0):(ci.show(index),legendItem.hidden=!1)},onHover:null,onLeave:null,labels:{color:ctx=>ctx.chart.options.color,boxWidth:40,padding:10,generateLabels(chart){const datasets=chart.data.datasets,{labels:{usePointStyle:usePointStyle,pointStyle:pointStyle,textAlign:textAlign,color:color}}=chart.legend.options;return chart._getSortedDatasetMetas().map(meta=>{const style=meta.controller.getStyle(usePointStyle?0:void 0),borderWidth=toPadding(style.borderWidth);return{text:datasets[meta.index].label,fillStyle:style.backgroundColor,fontColor:color,hidden:!meta.visible,lineCap:style.borderCapStyle,lineDash:style.borderDash,lineDashOffset:style.borderDashOffset,lineJoin:style.borderJoinStyle,lineWidth:(borderWidth.width+borderWidth.height)/4,strokeStyle:style.borderColor,pointStyle:pointStyle||style.pointStyle,rotation:style.rotation,textAlign:textAlign||style.textAlign,borderRadius:0,datasetIndex:meta.index}},this)}},title:{color:ctx=>ctx.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:name=>!name.startsWith("on"),labels:{_scriptable:name=>!["generateLabels","filter","sort"].includes(name)}}};class Title extends Element{constructor(config){super(),this.chart=config.chart,this.options=config.options,this.ctx=config.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(maxWidth,maxHeight){const me=this,opts=me.options;if(me.left=0,me.top=0,!opts.display)return void(me.width=me.height=me.right=me.bottom=0);me.width=me.right=maxWidth,me.height=me.bottom=maxHeight;const lineCount=isArray(opts.text)?opts.text.length:1;me._padding=toPadding(opts.padding);const textSize=lineCount*toFont(opts.font).lineHeight+me._padding.height;me.isHorizontal()?me.height=textSize:me.width=textSize}isHorizontal(){const pos=this.options.position;return"top"===pos||"bottom"===pos}_drawArgs(offset){const{top:top,left:left,bottom:bottom,right:right,options:options}=this,align=options.align;let rotation=0,maxWidth,titleX,titleY;return this.isHorizontal()?(titleX=_alignStartEnd(align,left,right),titleY=top+offset,maxWidth=right-left):("left"===options.position?(titleX=left+offset,titleY=_alignStartEnd(align,bottom,top),rotation=-.5*PI):(titleX=right-offset,titleY=_alignStartEnd(align,top,bottom),rotation=.5*PI),maxWidth=bottom-top),{titleX:titleX,titleY:titleY,maxWidth:maxWidth,rotation:rotation}}draw(){const me=this,ctx=me.ctx,opts=me.options;if(!opts.display)return;const fontOpts=toFont(opts.font),lineHeight=fontOpts.lineHeight,offset=lineHeight/2+me._padding.top,{titleX:titleX,titleY:titleY,maxWidth:maxWidth,rotation:rotation}=me._drawArgs(offset);renderText(ctx,opts.text,0,0,fontOpts,{color:opts.color,maxWidth:maxWidth,rotation:rotation,textAlign:_toLeftRightCenter(opts.align),textBaseline:"middle",translation:[titleX,titleY]})}}function createTitle(chart,titleOpts){const title=new Title({ctx:chart.ctx,options:titleOpts,chart:chart});layouts.configure(chart,title,titleOpts),layouts.addBox(chart,title),chart.titleBlock=title}var plugin_title={id:"title",_element:Title,start(chart,_args,options){createTitle(chart,options)},stop(chart){const titleBlock=chart.titleBlock;layouts.removeBox(chart,titleBlock),delete chart.titleBlock},beforeUpdate(chart,_args,options){const title=chart.titleBlock;layouts.configure(chart,title,options),title.options=options},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}};const map=new WeakMap;var plugin_subtitle={id:"subtitle",start(chart,_args,options){const title=new Title({ctx:chart.ctx,options:options,chart:chart});layouts.configure(chart,title,options),layouts.addBox(chart,title),map.set(chart,title)},stop(chart){layouts.removeBox(chart,map.get(chart)),map.delete(chart)},beforeUpdate(chart,_args,options){const title=map.get(chart);layouts.configure(chart,title,options),title.options=options},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}};const positioners={average(items){if(!items.length)return!1;let i,len,x=0,y=0,count=0;for(i=0,len=items.length;i<len;++i){const el=items[i].element;if(el&&el.hasValue()){const pos=el.tooltipPosition();x+=pos.x,y+=pos.y,++count}}return{x:x/count,y:y/count}},nearest(items,eventPosition){if(!items.length)return!1;let x=eventPosition.x,y=eventPosition.y,minDistance=Number.POSITIVE_INFINITY,i,len,nearestElement;for(i=0,len=items.length;i<len;++i){const el=items[i].element;if(el&&el.hasValue()){const center=el.getCenterPoint(),d=distanceBetweenPoints(eventPosition,center);d<minDistance&&(minDistance=d,nearestElement=el)}}if(nearestElement){const tp=nearestElement.tooltipPosition();x=tp.x,y=tp.y}return{x:x,y:y}}};function pushOrConcat(base,toPush){return toPush&&(isArray(toPush)?Array.prototype.push.apply(base,toPush):base.push(toPush)),base}function splitNewlines(str){return("string"==typeof str||str instanceof String)&&str.indexOf("\n")>-1?str.split("\n"):str}function createTooltipItem(chart,item){const{element:element,datasetIndex:datasetIndex,index:index}=item,controller=chart.getDatasetMeta(datasetIndex).controller,{label:label,value:value}=controller.getLabelAndValue(index);return{chart:chart,label:label,parsed:controller.getParsed(index),raw:chart.data.datasets[datasetIndex].data[index],formattedValue:value,dataset:controller.getDataset(),dataIndex:index,datasetIndex:datasetIndex,element:element}}function getTooltipSize(tooltip,options){const ctx=tooltip._chart.ctx,{body:body,footer:footer,title:title}=tooltip,{boxWidth:boxWidth,boxHeight:boxHeight}=options,bodyFont=toFont(options.bodyFont),titleFont=toFont(options.titleFont),footerFont=toFont(options.footerFont),titleLineCount=title.length,footerLineCount=footer.length,bodyLineItemCount=body.length,padding=toPadding(options.padding);let height=padding.height,width=0,combinedBodyLength=body.reduce((count,bodyItem)=>count+bodyItem.before.length+bodyItem.lines.length+bodyItem.after.length,0);if(combinedBodyLength+=tooltip.beforeBody.length+tooltip.afterBody.length,titleLineCount&&(height+=titleLineCount*titleFont.lineHeight+(titleLineCount-1)*options.titleSpacing+options.titleMarginBottom),combinedBodyLength){const bodyLineHeight=options.displayColors?Math.max(boxHeight,bodyFont.lineHeight):bodyFont.lineHeight;height+=bodyLineItemCount*bodyLineHeight+(combinedBodyLength-bodyLineItemCount)*bodyFont.lineHeight+(combinedBodyLength-1)*options.bodySpacing}footerLineCount&&(height+=options.footerMarginTop+footerLineCount*footerFont.lineHeight+(footerLineCount-1)*options.footerSpacing);let widthPadding=0;const maxLineWidth=function(line){width=Math.max(width,ctx.measureText(line).width+widthPadding)};return ctx.save(),ctx.font=titleFont.string,each(tooltip.title,maxLineWidth),ctx.font=bodyFont.string,each(tooltip.beforeBody.concat(tooltip.afterBody),maxLineWidth),widthPadding=options.displayColors?boxWidth+2:0,each(body,bodyItem=>{each(bodyItem.before,maxLineWidth),each(bodyItem.lines,maxLineWidth),each(bodyItem.after,maxLineWidth)}),widthPadding=0,ctx.font=footerFont.string,each(tooltip.footer,maxLineWidth),ctx.restore(),width+=padding.width,{width:width,height:height}}function determineYAlign(chart,size){const{y:y,height:height}=size;return y<height/2?"top":y>chart.height-height/2?"bottom":"center"}function doesNotFitWithAlign(xAlign,chart,options,size){const{x:x,width:width}=size,caret=options.caretSize+options.caretPadding;return"left"===xAlign&&x+width+caret>chart.width||("right"===xAlign&&x-width-caret<0||void 0)}function determineXAlign(chart,options,size,yAlign){const{x:x,width:width}=size,{width:chartWidth,chartArea:{left:left,right:right}}=chart;let xAlign="center";return"center"===yAlign?xAlign=x<=(left+right)/2?"left":"right":x<=width/2?xAlign="left":x>=chartWidth-width/2&&(xAlign="right"),doesNotFitWithAlign(xAlign,chart,options,size)&&(xAlign="center"),xAlign}function determineAlignment(chart,options,size){const yAlign=options.yAlign||determineYAlign(chart,size);return{xAlign:options.xAlign||determineXAlign(chart,options,size,yAlign),yAlign:yAlign}}function alignX(size,xAlign){let{x:x,width:width}=size;return"right"===xAlign?x-=width:"center"===xAlign&&(x-=width/2),x}function alignY(size,yAlign,paddingAndSize){let{y:y,height:height}=size;return"top"===yAlign?y+=paddingAndSize:y-="bottom"===yAlign?height+paddingAndSize:height/2,y}function getBackgroundPoint(options,size,alignment,chart){const{caretSize:caretSize,caretPadding:caretPadding,cornerRadius:cornerRadius}=options,{xAlign:xAlign,yAlign:yAlign}=alignment,paddingAndSize=caretSize+caretPadding,radiusAndPadding=cornerRadius+caretPadding;let x=alignX(size,xAlign);const y=alignY(size,yAlign,paddingAndSize);return"center"===yAlign?"left"===xAlign?x+=paddingAndSize:"right"===xAlign&&(x-=paddingAndSize):"left"===xAlign?x-=radiusAndPadding:"right"===xAlign&&(x+=radiusAndPadding),{x:_limitValue(x,0,chart.width-size.width),y:_limitValue(y,0,chart.height-size.height)}}function getAlignedX(tooltip,align,options){const padding=toPadding(options.padding);return"center"===align?tooltip.x+tooltip.width/2:"right"===align?tooltip.x+tooltip.width-padding.right:tooltip.x+padding.left}function getBeforeAfterBodyLines(callback){return pushOrConcat([],splitNewlines(callback))}function createTooltipContext(parent,tooltip,tooltipItems){return Object.assign(Object.create(parent),{tooltip:tooltip,tooltipItems:tooltipItems,type:"tooltip"})}function overrideCallbacks(callbacks,context){const override=context&&context.dataset&&context.dataset.tooltip&&context.dataset.tooltip.callbacks;return override?callbacks.override(override):callbacks}class Tooltip extends Element{constructor(config){super(),this.opacity=0,this._active=[],this._chart=config._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=config.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(options){this.options=options,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const me=this,cached=me._cachedAnimations;if(cached)return cached;const chart=me._chart,options=me.options.setContext(me.getContext()),opts=options.enabled&&chart.options.animation&&options.animations,animations=new Animations(me._chart,opts);return opts._cacheable&&(me._cachedAnimations=Object.freeze(animations)),animations}getContext(){const me=this;return me.$context||(me.$context=createTooltipContext(me._chart.getContext(),me,me._tooltipItems))}getTitle(context,options){const me=this,{callbacks:callbacks}=options,beforeTitle=callbacks.beforeTitle.apply(me,[context]),title=callbacks.title.apply(me,[context]),afterTitle=callbacks.afterTitle.apply(me,[context]);let lines=[];return lines=pushOrConcat(lines,splitNewlines(beforeTitle)),lines=pushOrConcat(lines,splitNewlines(title)),lines=pushOrConcat(lines,splitNewlines(afterTitle)),lines}getBeforeBody(tooltipItems,options){return getBeforeAfterBodyLines(options.callbacks.beforeBody.apply(this,[tooltipItems]))}getBody(tooltipItems,options){const me=this,{callbacks:callbacks}=options,bodyItems=[];return each(tooltipItems,context=>{const bodyItem={before:[],lines:[],after:[]},scoped=overrideCallbacks(callbacks,context);pushOrConcat(bodyItem.before,splitNewlines(scoped.beforeLabel.call(me,context))),pushOrConcat(bodyItem.lines,scoped.label.call(me,context)),pushOrConcat(bodyItem.after,splitNewlines(scoped.afterLabel.call(me,context))),bodyItems.push(bodyItem)}),bodyItems}getAfterBody(tooltipItems,options){return getBeforeAfterBodyLines(options.callbacks.afterBody.apply(this,[tooltipItems]))}getFooter(tooltipItems,options){const me=this,{callbacks:callbacks}=options,beforeFooter=callbacks.beforeFooter.apply(me,[tooltipItems]),footer=callbacks.footer.apply(me,[tooltipItems]),afterFooter=callbacks.afterFooter.apply(me,[tooltipItems]);let lines=[];return lines=pushOrConcat(lines,splitNewlines(beforeFooter)),lines=pushOrConcat(lines,splitNewlines(footer)),lines=pushOrConcat(lines,splitNewlines(afterFooter)),lines}_createItems(options){const me=this,active=me._active,data=me._chart.data,labelColors=[],labelPointStyles=[],labelTextColors=[];let tooltipItems=[],i,len;for(i=0,len=active.length;i<len;++i)tooltipItems.push(createTooltipItem(me._chart,active[i]));return options.filter&&(tooltipItems=tooltipItems.filter((element,index,array)=>options.filter(element,index,array,data))),options.itemSort&&(tooltipItems=tooltipItems.sort((a,b)=>options.itemSort(a,b,data))),each(tooltipItems,context=>{const scoped=overrideCallbacks(options.callbacks,context);labelColors.push(scoped.labelColor.call(me,context)),labelPointStyles.push(scoped.labelPointStyle.call(me,context)),labelTextColors.push(scoped.labelTextColor.call(me,context))}),me.labelColors=labelColors,me.labelPointStyles=labelPointStyles,me.labelTextColors=labelTextColors,me.dataPoints=tooltipItems,tooltipItems}update(changed,replay){const me=this,options=me.options.setContext(me.getContext()),active=me._active;let properties,tooltipItems=[];if(active.length){const position=positioners[options.position].call(me,active,me._eventPosition);tooltipItems=me._createItems(options),me.title=me.getTitle(tooltipItems,options),me.beforeBody=me.getBeforeBody(tooltipItems,options),me.body=me.getBody(tooltipItems,options),me.afterBody=me.getAfterBody(tooltipItems,options),me.footer=me.getFooter(tooltipItems,options);const size=me._size=getTooltipSize(me,options),positionAndSize=Object.assign({},position,size),alignment=determineAlignment(me._chart,options,positionAndSize),backgroundPoint=getBackgroundPoint(options,positionAndSize,alignment,me._chart);me.xAlign=alignment.xAlign,me.yAlign=alignment.yAlign,properties={opacity:1,x:backgroundPoint.x,y:backgroundPoint.y,width:size.width,height:size.height,caretX:position.x,caretY:position.y}}else 0!==me.opacity&&(properties={opacity:0});me._tooltipItems=tooltipItems,me.$context=void 0,properties&&me._resolveAnimations().update(me,properties),changed&&options.external&&options.external.call(me,{chart:me._chart,tooltip:me,replay:replay})}drawCaret(tooltipPoint,ctx,size,options){const caretPosition=this.getCaretPosition(tooltipPoint,size,options);ctx.lineTo(caretPosition.x1,caretPosition.y1),ctx.lineTo(caretPosition.x2,caretPosition.y2),ctx.lineTo(caretPosition.x3,caretPosition.y3)}getCaretPosition(tooltipPoint,size,options){const{xAlign:xAlign,yAlign:yAlign}=this,{cornerRadius:cornerRadius,caretSize:caretSize}=options,{x:ptX,y:ptY}=tooltipPoint,{width:width,height:height}=size;let x1,x2,x3,y1,y2,y3;return"center"===yAlign?(y2=ptY+height/2,"left"===xAlign?(x1=ptX,x2=x1-caretSize,y1=y2+caretSize,y3=y2-caretSize):(x1=ptX+width,x2=x1+caretSize,y1=y2-caretSize,y3=y2+caretSize),x3=x1):(x2="left"===xAlign?ptX+cornerRadius+caretSize:"right"===xAlign?ptX+width-cornerRadius-caretSize:this.caretX,"top"===yAlign?(y1=ptY,y2=y1-caretSize,x1=x2-caretSize,x3=x2+caretSize):(y1=ptY+height,y2=y1+caretSize,x1=x2+caretSize,x3=x2-caretSize),y3=y1),{x1:x1,x2:x2,x3:x3,y1:y1,y2:y2,y3:y3}}drawTitle(pt,ctx,options){const me=this,title=me.title,length=title.length;let titleFont,titleSpacing,i;if(length){const rtlHelper=getRtlAdapter(options.rtl,me.x,me.width);for(pt.x=getAlignedX(me,options.titleAlign,options),ctx.textAlign=rtlHelper.textAlign(options.titleAlign),ctx.textBaseline="middle",titleFont=toFont(options.titleFont),titleSpacing=options.titleSpacing,ctx.fillStyle=options.titleColor,ctx.font=titleFont.string,i=0;i<length;++i)ctx.fillText(title[i],rtlHelper.x(pt.x),pt.y+titleFont.lineHeight/2),pt.y+=titleFont.lineHeight+titleSpacing,i+1===length&&(pt.y+=options.titleMarginBottom-titleSpacing)}}_drawColorBox(ctx,pt,i,rtlHelper,options){const me=this,labelColors=me.labelColors[i],labelPointStyle=me.labelPointStyles[i],{boxHeight:boxHeight,boxWidth:boxWidth}=options,bodyFont=toFont(options.bodyFont),colorX=getAlignedX(me,"left",options),rtlColorX=rtlHelper.x(colorX),yOffSet=boxHeight<bodyFont.lineHeight?(bodyFont.lineHeight-boxHeight)/2:0,colorY=pt.y+yOffSet;if(options.usePointStyle){const drawOptions={radius:Math.min(boxWidth,boxHeight)/2,pointStyle:labelPointStyle.pointStyle,rotation:labelPointStyle.rotation,borderWidth:1},centerX=rtlHelper.leftForLtr(rtlColorX,boxWidth)+boxWidth/2,centerY=colorY+boxHeight/2;ctx.strokeStyle=options.multiKeyBackground,ctx.fillStyle=options.multiKeyBackground,drawPoint(ctx,drawOptions,centerX,centerY),ctx.strokeStyle=labelColors.borderColor,ctx.fillStyle=labelColors.backgroundColor,drawPoint(ctx,drawOptions,centerX,centerY)}else{ctx.lineWidth=labelColors.borderWidth||1,ctx.strokeStyle=labelColors.borderColor,ctx.setLineDash(labelColors.borderDash||[]),ctx.lineDashOffset=labelColors.borderDashOffset||0;const outerX=rtlHelper.leftForLtr(rtlColorX,boxWidth),innerX=rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX,1),boxWidth-2),borderRadius=toTRBLCorners(labelColors.borderRadius);Object.values(borderRadius).some(v=>0!==v)?(ctx.beginPath(),ctx.fillStyle=options.multiKeyBackground,addRoundedRectPath(ctx,{x:outerX,y:colorY,w:boxWidth,h:boxHeight,radius:borderRadius}),ctx.fill(),ctx.stroke(),ctx.fillStyle=labelColors.backgroundColor,ctx.beginPath(),addRoundedRectPath(ctx,{x:innerX,y:colorY+1,w:boxWidth-2,h:boxHeight-2,radius:borderRadius}),ctx.fill()):(ctx.fillStyle=options.multiKeyBackground,ctx.fillRect(outerX,colorY,boxWidth,boxHeight),ctx.strokeRect(outerX,colorY,boxWidth,boxHeight),ctx.fillStyle=labelColors.backgroundColor,ctx.fillRect(innerX,colorY+1,boxWidth-2,boxHeight-2))}ctx.fillStyle=me.labelTextColors[i]}drawBody(pt,ctx,options){const me=this,{body:body}=me,{bodySpacing:bodySpacing,bodyAlign:bodyAlign,displayColors:displayColors,boxHeight:boxHeight,boxWidth:boxWidth}=options,bodyFont=toFont(options.bodyFont);let bodyLineHeight=bodyFont.lineHeight,xLinePadding=0;const rtlHelper=getRtlAdapter(options.rtl,me.x,me.width),fillLineOfText=function(line){ctx.fillText(line,rtlHelper.x(pt.x+xLinePadding),pt.y+bodyLineHeight/2),pt.y+=bodyLineHeight+bodySpacing},bodyAlignForCalculation=rtlHelper.textAlign(bodyAlign);let bodyItem,textColor,lines,i,j,ilen,jlen;for(ctx.textAlign=bodyAlign,ctx.textBaseline="middle",ctx.font=bodyFont.string,pt.x=getAlignedX(me,bodyAlignForCalculation,options),ctx.fillStyle=options.bodyColor,each(me.beforeBody,fillLineOfText),xLinePadding=displayColors&&"right"!==bodyAlignForCalculation?"center"===bodyAlign?boxWidth/2+1:boxWidth+2:0,i=0,ilen=body.length;i<ilen;++i){for(bodyItem=body[i],textColor=me.labelTextColors[i],ctx.fillStyle=textColor,each(bodyItem.before,fillLineOfText),lines=bodyItem.lines,displayColors&&lines.length&&(me._drawColorBox(ctx,pt,i,rtlHelper,options),bodyLineHeight=Math.max(bodyFont.lineHeight,boxHeight)),j=0,jlen=lines.length;j<jlen;++j)fillLineOfText(lines[j]),bodyLineHeight=bodyFont.lineHeight;each(bodyItem.after,fillLineOfText)}xLinePadding=0,bodyLineHeight=bodyFont.lineHeight,each(me.afterBody,fillLineOfText),pt.y-=bodySpacing}drawFooter(pt,ctx,options){const me=this,footer=me.footer,length=footer.length;let footerFont,i;if(length){const rtlHelper=getRtlAdapter(options.rtl,me.x,me.width);for(pt.x=getAlignedX(me,options.footerAlign,options),pt.y+=options.footerMarginTop,ctx.textAlign=rtlHelper.textAlign(options.footerAlign),ctx.textBaseline="middle",footerFont=toFont(options.footerFont),ctx.fillStyle=options.footerColor,ctx.font=footerFont.string,i=0;i<length;++i)ctx.fillText(footer[i],rtlHelper.x(pt.x),pt.y+footerFont.lineHeight/2),pt.y+=footerFont.lineHeight+options.footerSpacing}}drawBackground(pt,ctx,tooltipSize,options){const{xAlign:xAlign,yAlign:yAlign}=this,{x:x,y:y}=pt,{width:width,height:height}=tooltipSize,radius=options.cornerRadius;ctx.fillStyle=options.backgroundColor,ctx.strokeStyle=options.borderColor,ctx.lineWidth=options.borderWidth,ctx.beginPath(),ctx.moveTo(x+radius,y),"top"===yAlign&&this.drawCaret(pt,ctx,tooltipSize,options),ctx.lineTo(x+width-radius,y),ctx.quadraticCurveTo(x+width,y,x+width,y+radius),"center"===yAlign&&"right"===xAlign&&this.drawCaret(pt,ctx,tooltipSize,options),ctx.lineTo(x+width,y+height-radius),ctx.quadraticCurveTo(x+width,y+height,x+width-radius,y+height),"bottom"===yAlign&&this.drawCaret(pt,ctx,tooltipSize,options),ctx.lineTo(x+radius,y+height),ctx.quadraticCurveTo(x,y+height,x,y+height-radius),"center"===yAlign&&"left"===xAlign&&this.drawCaret(pt,ctx,tooltipSize,options),ctx.lineTo(x,y+radius),ctx.quadraticCurveTo(x,y,x+radius,y),ctx.closePath(),ctx.fill(),options.borderWidth>0&&ctx.stroke()}_updateAnimationTarget(options){const me=this,chart=me._chart,anims=me.$animations,animX=anims&&anims.x,animY=anims&&anims.y;if(animX||animY){const position=positioners[options.position].call(me,me._active,me._eventPosition);if(!position)return;const size=me._size=getTooltipSize(me,options),positionAndSize=Object.assign({},position,me._size),alignment=determineAlignment(chart,options,positionAndSize),point=getBackgroundPoint(options,positionAndSize,alignment,chart);animX._to===point.x&&animY._to===point.y||(me.xAlign=alignment.xAlign,me.yAlign=alignment.yAlign,me.width=size.width,me.height=size.height,me.caretX=position.x,me.caretY=position.y,me._resolveAnimations().update(me,point))}}draw(ctx){const me=this,options=me.options.setContext(me.getContext());let opacity=me.opacity;if(!opacity)return;me._updateAnimationTarget(options);const tooltipSize={width:me.width,height:me.height},pt={x:me.x,y:me.y};opacity=Math.abs(opacity)<.001?0:opacity;const padding=toPadding(options.padding),hasTooltipContent=me.title.length||me.beforeBody.length||me.body.length||me.afterBody.length||me.footer.length;options.enabled&&hasTooltipContent&&(ctx.save(),ctx.globalAlpha=opacity,me.drawBackground(pt,ctx,tooltipSize,options),overrideTextDirection(ctx,options.textDirection),pt.y+=padding.top,me.drawTitle(pt,ctx,options),me.drawBody(pt,ctx,options),me.drawFooter(pt,ctx,options),restoreTextDirection(ctx,options.textDirection),ctx.restore())}getActiveElements(){return this._active||[]}setActiveElements(activeElements,eventPosition){const me=this,lastActive=me._active,active=activeElements.map(({datasetIndex:datasetIndex,index:index})=>{const meta=me._chart.getDatasetMeta(datasetIndex);if(!meta)throw new Error("Cannot find a dataset at index "+datasetIndex);return{datasetIndex:datasetIndex,element:meta.data[index],index:index}}),changed=!_elementsEqual(lastActive,active),positionChanged=me._positionChanged(active,eventPosition);(changed||positionChanged)&&(me._active=active,me._eventPosition=eventPosition,me.update(!0))}handleEvent(e,replay){const me=this,options=me.options,lastActive=me._active||[];let changed=!1,active=[];"mouseout"!==e.type&&(active=me._chart.getElementsAtEventForMode(e,options.mode,options,replay),options.reverse&&active.reverse());const positionChanged=me._positionChanged(active,e);return changed=replay||!_elementsEqual(active,lastActive)||positionChanged,changed&&(me._active=active,(options.enabled||options.external)&&(me._eventPosition={x:e.x,y:e.y},me.update(!0,replay))),changed}_positionChanged(active,e){const{caretX:caretX,caretY:caretY,options:options}=this,position=positioners[options.position].call(this,active,e);return!1!==position&&(caretX!==position.x||caretY!==position.y)}}Tooltip.positioners=positioners;var plugin_tooltip={id:"tooltip",_element:Tooltip,positioners:positioners,afterInit(chart,_args,options){options&&(chart.tooltip=new Tooltip({_chart:chart,options:options}))},beforeUpdate(chart,_args,options){chart.tooltip&&chart.tooltip.initialize(options)},reset(chart,_args,options){chart.tooltip&&chart.tooltip.initialize(options)},afterDraw(chart){const tooltip=chart.tooltip,args={tooltip:tooltip};!1!==chart.notifyPlugins("beforeTooltipDraw",args)&&(tooltip&&tooltip.draw(chart.ctx),chart.notifyPlugins("afterTooltipDraw",args))},afterEvent(chart,args){if(chart.tooltip){const useFinalPosition=args.replay;chart.tooltip.handleEvent(args.event,useFinalPosition)&&(args.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:(ctx,opts)=>opts.bodyFont.size,boxWidth:(ctx,opts)=>opts.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:noop,title(tooltipItems){if(tooltipItems.length>0){const item=tooltipItems[0],labels=item.chart.data.labels,labelCount=labels?labels.length:0;if(this&&this.options&&"dataset"===this.options.mode)return item.dataset.label||"";if(item.label)return item.label;if(labelCount>0&&item.dataIndex<labelCount)return labels[item.dataIndex]}return""},afterTitle:noop,beforeBody:noop,beforeLabel:noop,label(tooltipItem){if(this&&this.options&&"dataset"===this.options.mode)return tooltipItem.label+": "+tooltipItem.formattedValue||tooltipItem.formattedValue;let label=tooltipItem.dataset.label||"";label&&(label+=": ");const value=tooltipItem.formattedValue;return isNullOrUndef(value)||(label+=value),label},labelColor(tooltipItem){const meta=tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex),options=meta.controller.getStyle(tooltipItem.dataIndex);return{borderColor:options.borderColor,backgroundColor:options.backgroundColor,borderWidth:options.borderWidth,borderDash:options.borderDash,borderDashOffset:options.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(tooltipItem){const meta=tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex),options=meta.controller.getStyle(tooltipItem.dataIndex);return{pointStyle:options.pointStyle,rotation:options.rotation}},afterLabel:noop,afterBody:noop,beforeFooter:noop,footer:noop,afterFooter:noop}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:name=>"filter"!==name&&"itemSort"!==name&&"external"!==name,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},plugins=Object.freeze({__proto__:null,Decimation:plugin_decimation,Filler:plugin_filler,Legend:plugin_legend,SubTitle:plugin_subtitle,Title:plugin_title,Tooltip:plugin_tooltip});const addIfString=(labels,raw,index)=>"string"==typeof raw?labels.push(raw)-1:isNaN(raw)?null:index;function findOrAddLabel(labels,raw,index){const first=labels.indexOf(raw);if(-1===first)return addIfString(labels,raw,index);const last=labels.lastIndexOf(raw);return first!==last?index:first}const validIndex=(index,max)=>null===index?null:_limitValue(Math.round(index),0,max);class CategoryScale extends Scale{constructor(cfg){super(cfg),this._startValue=void 0,this._valueRange=0}parse(raw,index){if(isNullOrUndef(raw))return null;const labels=this.getLabels();return index=isFinite(index)&&labels[index]===raw?index:findOrAddLabel(labels,raw,valueOrDefault(index,raw)),validIndex(index,labels.length-1)}determineDataLimits(){const me=this,{minDefined:minDefined,maxDefined:maxDefined}=me.getUserBounds();let{min:min,max:max}=me.getMinMax(!0);"ticks"===me.options.bounds&&(minDefined||(min=0),maxDefined||(max=me.getLabels().length-1)),me.min=min,me.max=max}buildTicks(){const me=this,min=me.min,max=me.max,offset=me.options.offset,ticks=[];let labels=me.getLabels();labels=0===min&&max===labels.length-1?labels:labels.slice(min,max+1),me._valueRange=Math.max(labels.length-(offset?0:1),1),me._startValue=me.min-(offset?.5:0);for(let value=min;value<=max;value++)ticks.push({value:value});return ticks}getLabelForValue(value){const me=this,labels=me.getLabels();return value>=0&&value<labels.length?labels[value]:value}configure(){const me=this;super.configure(),me.isHorizontal()||(me._reversePixels=!me._reversePixels)}getPixelForValue(value){const me=this;return"number"!=typeof value&&(value=me.parse(value)),null===value?NaN:me.getPixelForDecimal((value-me._startValue)/me._valueRange)}getPixelForTick(index){const me=this,ticks=me.ticks;return index<0||index>ticks.length-1?null:me.getPixelForValue(ticks[index].value)}getValueForPixel(pixel){const me=this;return Math.round(me._startValue+me.getDecimalForPixel(pixel)*me._valueRange)}getBasePixel(){return this.bottom}}function generateTicks$1(generationOptions,dataRange){const ticks=[],MIN_SPACING=1e-14,{bounds:bounds,step:step,min:min,max:max,precision:precision,count:count,maxTicks:maxTicks,maxDigits:maxDigits,includeBounds:includeBounds}=generationOptions,unit=step||1,maxSpaces=maxTicks-1,{min:rmin,max:rmax}=dataRange,minDefined=!isNullOrUndef(min),maxDefined=!isNullOrUndef(max),countDefined=!isNullOrUndef(count),minSpacing=(rmax-rmin)/(maxDigits+1);let spacing=niceNum((rmax-rmin)/maxSpaces/unit)*unit,factor,niceMin,niceMax,numSpaces;if(spacing<1e-14&&!minDefined&&!maxDefined)return[{value:rmin},{value:rmax}];numSpaces=Math.ceil(rmax/spacing)-Math.floor(rmin/spacing),numSpaces>maxSpaces&&(spacing=niceNum(numSpaces*spacing/maxSpaces/unit)*unit),isNullOrUndef(precision)||(factor=Math.pow(10,precision),spacing=Math.ceil(spacing*factor)/factor),"ticks"===bounds?(niceMin=Math.floor(rmin/spacing)*spacing,niceMax=Math.ceil(rmax/spacing)*spacing):(niceMin=rmin,niceMax=rmax),minDefined&&maxDefined&&step&&almostWhole((max-min)/step,spacing/1e3)?(numSpaces=Math.round(Math.min((max-min)/spacing,maxTicks)),spacing=(max-min)/numSpaces,niceMin=min,niceMax=max):countDefined?(niceMin=minDefined?min:niceMin,niceMax=maxDefined?max:niceMax,numSpaces=count-1,spacing=(niceMax-niceMin)/numSpaces):(numSpaces=(niceMax-niceMin)/spacing,numSpaces=almostEquals(numSpaces,Math.round(numSpaces),spacing/1e3)?Math.round(numSpaces):Math.ceil(numSpaces));const decimalPlaces=Math.max(_decimalPlaces(spacing),_decimalPlaces(niceMin));factor=Math.pow(10,isNullOrUndef(precision)?decimalPlaces:precision),niceMin=Math.round(niceMin*factor)/factor,niceMax=Math.round(niceMax*factor)/factor;let j=0;for(minDefined&&(includeBounds&&niceMin!==min?(ticks.push({value:min}),niceMin<min&&j++,almostEquals(Math.round((niceMin+j*spacing)*factor)/factor,min,relativeLabelSize(min,minSpacing,generationOptions))&&j++):niceMin<min&&j++);j<numSpaces;++j)ticks.push({value:Math.round((niceMin+j*spacing)*factor)/factor});return maxDefined&&includeBounds&&niceMax!==max?almostEquals(ticks[ticks.length-1].value,max,relativeLabelSize(max,minSpacing,generationOptions))?ticks[ticks.length-1].value=max:ticks.push({value:max}):maxDefined&&niceMax!==max||ticks.push({value:niceMax}),ticks}function relativeLabelSize(value,minSpacing,{horizontal:horizontal,minRotation:minRotation}){const rad=toRadians(minRotation),ratio=(horizontal?Math.sin(rad):Math.cos(rad))||.001,length=.75*minSpacing*(""+value).length;return Math.min(minSpacing/ratio,length)}CategoryScale.id="category",CategoryScale.defaults={ticks:{callback:CategoryScale.prototype.getLabelForValue}};class LinearScaleBase extends Scale{constructor(cfg){super(cfg),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(raw,index){return isNullOrUndef(raw)?null:("number"==typeof raw||raw instanceof Number)&&!isFinite(+raw)?null:+raw}handleTickRangeOptions(){const me=this,{beginAtZero:beginAtZero}=me.options,{minDefined:minDefined,maxDefined:maxDefined}=me.getUserBounds();let{min:min,max:max}=me;const setMin=v=>min=minDefined?min:v,setMax=v=>max=maxDefined?max:v;if(beginAtZero){const minSign=sign(min),maxSign=sign(max);minSign<0&&maxSign<0?setMax(0):minSign>0&&maxSign>0&&setMin(0)}if(min===max){let offset=1;(max>=Number.MAX_SAFE_INTEGER||min<=Number.MIN_SAFE_INTEGER)&&(offset=Math.abs(.05*max)),setMax(max+offset),beginAtZero||setMin(min-offset)}me.min=min,me.max=max}getTickLimit(){const me=this,tickOpts=me.options.ticks;let{maxTicksLimit:maxTicksLimit,stepSize:stepSize}=tickOpts,maxTicks;return stepSize?maxTicks=Math.ceil(me.max/stepSize)-Math.floor(me.min/stepSize)+1:(maxTicks=me.computeTickLimit(),maxTicksLimit=maxTicksLimit||11),maxTicksLimit&&(maxTicks=Math.min(maxTicksLimit,maxTicks)),maxTicks}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const me=this,opts=me.options,tickOpts=opts.ticks;let maxTicks=me.getTickLimit();maxTicks=Math.max(2,maxTicks);const numericGeneratorOptions={maxTicks:maxTicks,bounds:opts.bounds,min:opts.min,max:opts.max,precision:tickOpts.precision,step:tickOpts.stepSize,count:tickOpts.count,maxDigits:me._maxDigits(),horizontal:me.isHorizontal(),minRotation:tickOpts.minRotation||0,includeBounds:!1!==tickOpts.includeBounds},dataRange=me._range||me,ticks=generateTicks$1(numericGeneratorOptions,dataRange);return"ticks"===opts.bounds&&_setMinAndMaxByKey(ticks,me,"value"),opts.reverse?(ticks.reverse(),me.start=me.max,me.end=me.min):(me.start=me.min,me.end=me.max),ticks}configure(){const me=this,ticks=me.ticks;let start=me.min,end=me.max;if(super.configure(),me.options.offset&&ticks.length){const offset=(end-start)/Math.max(ticks.length-1,1)/2;start-=offset,end+=offset}me._startValue=start,me._endValue=end,me._valueRange=end-start}getLabelForValue(value){return formatNumber(value,this.chart.options.locale)}}class LinearScale extends LinearScaleBase{determineDataLimits(){const me=this,{min:min,max:max}=me.getMinMax(!0);me.min=isNumberFinite(min)?min:0,me.max=isNumberFinite(max)?max:1,me.handleTickRangeOptions()}computeTickLimit(){const me=this,horizontal=me.isHorizontal(),length=horizontal?me.width:me.height,minRotation=toRadians(me.options.ticks.minRotation),ratio=(horizontal?Math.sin(minRotation):Math.cos(minRotation))||.001,tickFont=me._resolveTickFontOptions(0);return Math.ceil(length/Math.min(40,tickFont.lineHeight/ratio))}getPixelForValue(value){return null===value?NaN:this.getPixelForDecimal((value-this._startValue)/this._valueRange)}getValueForPixel(pixel){return this._startValue+this.getDecimalForPixel(pixel)*this._valueRange}}function isMajor(tickVal){const remain=tickVal/Math.pow(10,Math.floor(log10(tickVal)));return 1===remain}function generateTicks(generationOptions,dataRange){const endExp=Math.floor(log10(dataRange.max)),endSignificand=Math.ceil(dataRange.max/Math.pow(10,endExp)),ticks=[];let tickVal=finiteOrDefault(generationOptions.min,Math.pow(10,Math.floor(log10(dataRange.min)))),exp=Math.floor(log10(tickVal)),significand=Math.floor(tickVal/Math.pow(10,exp)),precision=exp<0?Math.pow(10,Math.abs(exp)):1;do{ticks.push({value:tickVal,major:isMajor(tickVal)}),++significand,10===significand&&(significand=1,++exp,precision=exp>=0?1:precision),tickVal=Math.round(significand*Math.pow(10,exp)*precision)/precision}while(exp<endExp||exp===endExp&&significand<endSignificand);const lastTick=finiteOrDefault(generationOptions.max,tickVal);return ticks.push({value:lastTick,major:isMajor(tickVal)}),ticks}LinearScale.id="linear",LinearScale.defaults={ticks:{callback:Ticks.formatters.numeric}};class LogarithmicScale extends Scale{constructor(cfg){super(cfg),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(raw,index){const value=LinearScaleBase.prototype.parse.apply(this,[raw,index]);if(0!==value)return isNumberFinite(value)&&value>0?value:null;this._zero=!0}determineDataLimits(){const me=this,{min:min,max:max}=me.getMinMax(!0);me.min=isNumberFinite(min)?Math.max(0,min):null,me.max=isNumberFinite(max)?Math.max(0,max):null,me.options.beginAtZero&&(me._zero=!0),me.handleTickRangeOptions()}handleTickRangeOptions(){const me=this,{minDefined:minDefined,maxDefined:maxDefined}=me.getUserBounds();let min=me.min,max=me.max;const setMin=v=>min=minDefined?min:v,setMax=v=>max=maxDefined?max:v,exp=(v,m)=>Math.pow(10,Math.floor(log10(v))+m);min===max&&(min<=0?(setMin(1),setMax(10)):(setMin(exp(min,-1)),setMax(exp(max,1)))),min<=0&&setMin(exp(max,-1)),max<=0&&setMax(exp(min,1)),me._zero&&me.min!==me._suggestedMin&&min===exp(me.min,0)&&setMin(exp(min,-1)),me.min=min,me.max=max}buildTicks(){const me=this,opts=me.options,generationOptions={min:me._userMin,max:me._userMax},ticks=generateTicks(generationOptions,me);return"ticks"===opts.bounds&&_setMinAndMaxByKey(ticks,me,"value"),opts.reverse?(ticks.reverse(),me.start=me.max,me.end=me.min):(me.start=me.min,me.end=me.max),ticks}getLabelForValue(value){return void 0===value?"0":formatNumber(value,this.chart.options.locale)}configure(){const me=this,start=me.min;super.configure(),me._startValue=log10(start),me._valueRange=log10(me.max)-log10(start)}getPixelForValue(value){const me=this;return void 0!==value&&0!==value||(value=me.min),null===value||isNaN(value)?NaN:me.getPixelForDecimal(value===me.min?0:(log10(value)-me._startValue)/me._valueRange)}getValueForPixel(pixel){const me=this,decimal=me.getDecimalForPixel(pixel);return Math.pow(10,me._startValue+decimal*me._valueRange)}}function getTickBackdropHeight(opts){const tickOpts=opts.ticks;if(tickOpts.display&&opts.display){const padding=toPadding(tickOpts.backdropPadding);return valueOrDefault(tickOpts.font&&tickOpts.font.size,defaults.font.size)+padding.height}return 0}function measureLabelSize(ctx,font,label){return label=isArray(label)?label:[label],{w:_longestText(ctx,font.string,label),h:label.length*font.lineHeight}}function determineLimits(angle,pos,size,min,max){return angle===min||angle===max?{start:pos-size/2,end:pos+size/2}:angle<min||angle>max?{start:pos-size,end:pos}:{start:pos,end:pos+size}}function fitWithPointLabels(scale){const furthestLimits={l:0,r:scale.width,t:0,b:scale.height-scale.paddingTop},furthestAngles={},labelSizes=[],padding=[],valueCount=scale.getLabels().length;for(let i=0;i<valueCount;i++){const opts=scale.options.pointLabels.setContext(scale.getPointLabelContext(i));padding[i]=opts.padding;const pointPosition=scale.getPointPosition(i,scale.drawingArea+padding[i]),plFont=toFont(opts.font),textSize=measureLabelSize(scale.ctx,plFont,scale._pointLabels[i]);labelSizes[i]=textSize;const angleRadians=scale.getIndexAngle(i),angle=toDegrees(angleRadians),hLimits=determineLimits(angle,pointPosition.x,textSize.w,0,180),vLimits=determineLimits(angle,pointPosition.y,textSize.h,90,270);hLimits.start<furthestLimits.l&&(furthestLimits.l=hLimits.start,furthestAngles.l=angleRadians),hLimits.end>furthestLimits.r&&(furthestLimits.r=hLimits.end,furthestAngles.r=angleRadians),vLimits.start<furthestLimits.t&&(furthestLimits.t=vLimits.start,furthestAngles.t=angleRadians),vLimits.end>furthestLimits.b&&(furthestLimits.b=vLimits.end,furthestAngles.b=angleRadians)}scale._setReductions(scale.drawingArea,furthestLimits,furthestAngles),scale._pointLabelItems=buildPointLabelItems(scale,labelSizes,padding)}function buildPointLabelItems(scale,labelSizes,padding){const items=[],valueCount=scale.getLabels().length,opts=scale.options,tickBackdropHeight=getTickBackdropHeight(opts),outerDistance=scale.getDistanceFromCenterForValue(opts.ticks.reverse?scale.min:scale.max);for(let i=0;i<valueCount;i++){const extra=0===i?tickBackdropHeight/2:0,pointLabelPosition=scale.getPointPosition(i,outerDistance+extra+padding[i]),angle=toDegrees(scale.getIndexAngle(i)),size=labelSizes[i],y=yForAngle(pointLabelPosition.y,size.h,angle),textAlign=getTextAlignForAngle(angle),left=leftForTextAlign(pointLabelPosition.x,size.w,textAlign);items.push({x:pointLabelPosition.x,y:y,textAlign:textAlign,left:left,top:y,right:left+size.w,bottom:y+size.h})}return items}function getTextAlignForAngle(angle){return 0===angle||180===angle?"center":angle<180?"left":"right"}function leftForTextAlign(x,w,align){return"right"===align?x-=w:"center"===align&&(x-=w/2),x}function yForAngle(y,h,angle){return 90===angle||270===angle?y-=h/2:(angle>270||angle<90)&&(y-=h),y}function drawPointLabels(scale,labelCount){const{ctx:ctx,options:{pointLabels:pointLabels}}=scale;for(let i=labelCount-1;i>=0;i--){const optsAtIndex=pointLabels.setContext(scale.getPointLabelContext(i)),plFont=toFont(optsAtIndex.font),{x:x,y:y,textAlign:textAlign,left:left,top:top,right:right,bottom:bottom}=scale._pointLabelItems[i],{backdropColor:backdropColor}=optsAtIndex;if(!isNullOrUndef(backdropColor)){const padding=toPadding(optsAtIndex.backdropPadding);ctx.fillStyle=backdropColor,ctx.fillRect(left-padding.left,top-padding.top,right-left+padding.width,bottom-top+padding.height)}renderText(ctx,scale._pointLabels[i],x,y+plFont.lineHeight/2,plFont,{color:optsAtIndex.color,textAlign:textAlign,textBaseline:"middle"})}}function pathRadiusLine(scale,radius,circular,labelCount){const{ctx:ctx}=scale;if(circular)ctx.arc(scale.xCenter,scale.yCenter,radius,0,TAU);else{let pointPosition=scale.getPointPosition(0,radius);ctx.moveTo(pointPosition.x,pointPosition.y);for(let i=1;i<labelCount;i++)pointPosition=scale.getPointPosition(i,radius),ctx.lineTo(pointPosition.x,pointPosition.y)}}function drawRadiusLine(scale,gridLineOpts,radius,labelCount){const ctx=scale.ctx,circular=gridLineOpts.circular,{color:color,lineWidth:lineWidth}=gridLineOpts;!circular&&!labelCount||!color||!lineWidth||radius<0||(ctx.save(),ctx.strokeStyle=color,ctx.lineWidth=lineWidth,ctx.setLineDash(gridLineOpts.borderDash),ctx.lineDashOffset=gridLineOpts.borderDashOffset,ctx.beginPath(),pathRadiusLine(scale,radius,circular,labelCount),ctx.closePath(),ctx.stroke(),ctx.restore())}function numberOrZero(param){return isNumber(param)?param:0}function createPointLabelContext(parent,index,label){return Object.assign(Object.create(parent),{label:label,index:index,type:"pointLabel"})}LogarithmicScale.id="logarithmic",LogarithmicScale.defaults={ticks:{callback:Ticks.formatters.logarithmic,major:{enabled:!0}}};class RadialLinearScale extends LinearScaleBase{constructor(cfg){super(cfg),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const me=this;me.width=me.maxWidth,me.height=me.maxHeight,me.paddingTop=getTickBackdropHeight(me.options)/2,me.xCenter=Math.floor(me.width/2),me.yCenter=Math.floor((me.height-me.paddingTop)/2),me.drawingArea=Math.min(me.height-me.paddingTop,me.width)/2}determineDataLimits(){const me=this,{min:min,max:max}=me.getMinMax(!1);me.min=isNumberFinite(min)&&!isNaN(min)?min:0,me.max=isNumberFinite(max)&&!isNaN(max)?max:0,me.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/getTickBackdropHeight(this.options))}generateTickLabels(ticks){const me=this;LinearScaleBase.prototype.generateTickLabels.call(me,ticks),me._pointLabels=me.getLabels().map((value,index)=>{const label=callback(me.options.pointLabels.callback,[value,index],me);return label||0===label?label:""})}fit(){const me=this,opts=me.options;opts.display&&opts.pointLabels.display?fitWithPointLabels(me):me.setCenterPoint(0,0,0,0)}_setReductions(largestPossibleRadius,furthestLimits,furthestAngles){const me=this;let radiusReductionLeft=furthestLimits.l/Math.sin(furthestAngles.l),radiusReductionRight=Math.max(furthestLimits.r-me.width,0)/Math.sin(furthestAngles.r),radiusReductionTop=-furthestLimits.t/Math.cos(furthestAngles.t),radiusReductionBottom=-Math.max(furthestLimits.b-(me.height-me.paddingTop),0)/Math.cos(furthestAngles.b);radiusReductionLeft=numberOrZero(radiusReductionLeft),radiusReductionRight=numberOrZero(radiusReductionRight),radiusReductionTop=numberOrZero(radiusReductionTop),radiusReductionBottom=numberOrZero(radiusReductionBottom),me.drawingArea=Math.max(largestPossibleRadius/2,Math.min(Math.floor(largestPossibleRadius-(radiusReductionLeft+radiusReductionRight)/2),Math.floor(largestPossibleRadius-(radiusReductionTop+radiusReductionBottom)/2))),me.setCenterPoint(radiusReductionLeft,radiusReductionRight,radiusReductionTop,radiusReductionBottom)}setCenterPoint(leftMovement,rightMovement,topMovement,bottomMovement){const me=this,maxRight=me.width-rightMovement-me.drawingArea,maxLeft=leftMovement+me.drawingArea,maxTop=topMovement+me.drawingArea,maxBottom=me.height-me.paddingTop-bottomMovement-me.drawingArea;me.xCenter=Math.floor((maxLeft+maxRight)/2+me.left),me.yCenter=Math.floor((maxTop+maxBottom)/2+me.top+me.paddingTop)}getIndexAngle(index){const angleMultiplier=TAU/this.getLabels().length,startAngle=this.options.startAngle||0;return _normalizeAngle(index*angleMultiplier+toRadians(startAngle))}getDistanceFromCenterForValue(value){const me=this;if(isNullOrUndef(value))return NaN;const scalingFactor=me.drawingArea/(me.max-me.min);return me.options.reverse?(me.max-value)*scalingFactor:(value-me.min)*scalingFactor}getValueForDistanceFromCenter(distance){if(isNullOrUndef(distance))return NaN;const me=this,scaledDistance=distance/(me.drawingArea/(me.max-me.min));return me.options.reverse?me.max-scaledDistance:me.min+scaledDistance}getPointLabelContext(index){const me=this,pointLabels=me._pointLabels||[];if(index>=0&&index<pointLabels.length){const pointLabel=pointLabels[index];return createPointLabelContext(me.getContext(),index,pointLabel)}}getPointPosition(index,distanceFromCenter){const me=this,angle=me.getIndexAngle(index)-HALF_PI;return{x:Math.cos(angle)*distanceFromCenter+me.xCenter,y:Math.sin(angle)*distanceFromCenter+me.yCenter,angle:angle}}getPointPositionForValue(index,value){return this.getPointPosition(index,this.getDistanceFromCenterForValue(value))}getBasePosition(index){return this.getPointPositionForValue(index||0,this.getBaseValue())}getPointLabelPosition(index){const{left:left,top:top,right:right,bottom:bottom}=this._pointLabelItems[index];return{left:left,top:top,right:right,bottom:bottom}}drawBackground(){const me=this,{backgroundColor:backgroundColor,grid:{circular:circular}}=me.options;if(backgroundColor){const ctx=me.ctx;ctx.save(),ctx.beginPath(),pathRadiusLine(me,me.getDistanceFromCenterForValue(me._endValue),circular,me.getLabels().length),ctx.closePath(),ctx.fillStyle=backgroundColor,ctx.fill(),ctx.restore()}}drawGrid(){const me=this,ctx=me.ctx,opts=me.options,{angleLines:angleLines,grid:grid}=opts,labelCount=me.getLabels().length;let i,offset,position;if(opts.pointLabels.display&&drawPointLabels(me,labelCount),grid.display&&me.ticks.forEach((tick,index)=>{if(0!==index){offset=me.getDistanceFromCenterForValue(tick.value);const optsAtIndex=grid.setContext(me.getContext(index-1));drawRadiusLine(me,optsAtIndex,offset,labelCount)}}),angleLines.display){for(ctx.save(),i=me.getLabels().length-1;i>=0;i--){const optsAtIndex=angleLines.setContext(me.getPointLabelContext(i)),{color:color,lineWidth:lineWidth}=optsAtIndex;lineWidth&&color&&(ctx.lineWidth=lineWidth,ctx.strokeStyle=color,ctx.setLineDash(optsAtIndex.borderDash),ctx.lineDashOffset=optsAtIndex.borderDashOffset,offset=me.getDistanceFromCenterForValue(opts.ticks.reverse?me.min:me.max),position=me.getPointPosition(i,offset),ctx.beginPath(),ctx.moveTo(me.xCenter,me.yCenter),ctx.lineTo(position.x,position.y),ctx.stroke())}ctx.restore()}}drawBorder(){}drawLabels(){const me=this,ctx=me.ctx,opts=me.options,tickOpts=opts.ticks;if(!tickOpts.display)return;const startAngle=me.getIndexAngle(0);let offset,width;ctx.save(),ctx.translate(me.xCenter,me.yCenter),ctx.rotate(startAngle),ctx.textAlign="center",ctx.textBaseline="middle",me.ticks.forEach((tick,index)=>{if(0===index&&!opts.reverse)return;const optsAtIndex=tickOpts.setContext(me.getContext(index)),tickFont=toFont(optsAtIndex.font);if(offset=me.getDistanceFromCenterForValue(me.ticks[index].value),optsAtIndex.showLabelBackdrop){ctx.font=tickFont.string,width=ctx.measureText(tick.label).width,ctx.fillStyle=optsAtIndex.backdropColor;const padding=toPadding(optsAtIndex.backdropPadding);ctx.fillRect(-width/2-padding.left,-offset-tickFont.size/2-padding.top,width+padding.width,tickFont.size+padding.height)}renderText(ctx,tick.label,0,-offset,tickFont,{color:optsAtIndex.color})}),ctx.restore()}drawTitle(){}}RadialLinearScale.id="radialLinear",RadialLinearScale.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ticks.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:label=>label,padding:5}},RadialLinearScale.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},RadialLinearScale.descriptors={angleLines:{_fallback:"grid"}};const INTERVALS={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}},UNITS=Object.keys(INTERVALS);function sorter(a,b){return a-b}function parse(scale,input){if(isNullOrUndef(input))return null;const adapter=scale._adapter,{parser:parser,round:round,isoWeekday:isoWeekday}=scale._parseOpts;let value=input;return"function"==typeof parser&&(value=parser(value)),isNumberFinite(value)||(value="string"==typeof parser?adapter.parse(value,parser):adapter.parse(value)),null===value?null:(round&&(value="week"!==round||!isNumber(isoWeekday)&&!0!==isoWeekday?adapter.startOf(value,round):adapter.startOf(value,"isoWeek",isoWeekday)),+value)}function determineUnitForAutoTicks(minUnit,min,max,capacity){const ilen=UNITS.length;for(let i=UNITS.indexOf(minUnit);i<ilen-1;++i){const interval=INTERVALS[UNITS[i]],factor=interval.steps?interval.steps:Number.MAX_SAFE_INTEGER;if(interval.common&&Math.ceil((max-min)/(factor*interval.size))<=capacity)return UNITS[i]}return UNITS[ilen-1]}function determineUnitForFormatting(scale,numTicks,minUnit,min,max){for(let i=UNITS.length-1;i>=UNITS.indexOf(minUnit);i--){const unit=UNITS[i];if(INTERVALS[unit].common&&scale._adapter.diff(max,min,unit)>=numTicks-1)return unit}return UNITS[minUnit?UNITS.indexOf(minUnit):0]}function determineMajorUnit(unit){for(let i=UNITS.indexOf(unit)+1,ilen=UNITS.length;i<ilen;++i)if(INTERVALS[UNITS[i]].common)return UNITS[i]}function addTick(ticks,time,timestamps){if(timestamps){if(timestamps.length){const{lo:lo,hi:hi}=_lookup(timestamps,time),timestamp=timestamps[lo]>=time?timestamps[lo]:timestamps[hi];ticks[timestamp]=!0}}else ticks[time]=!0}function setMajorTicks(scale,ticks,map,majorUnit){const adapter=scale._adapter,first=+adapter.startOf(ticks[0].value,majorUnit),last=ticks[ticks.length-1].value;let major,index;for(major=first;major<=last;major=+adapter.add(major,1,majorUnit))index=map[major],index>=0&&(ticks[index].major=!0);return ticks}function ticksFromTimestamps(scale,values,majorUnit){const ticks=[],map={},ilen=values.length;let i,value;for(i=0;i<ilen;++i)value=values[i],map[value]=i,ticks.push({value:value,major:!1});return 0!==ilen&&majorUnit?setMajorTicks(scale,ticks,map,majorUnit):ticks}class TimeScale extends Scale{constructor(props){super(props),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(scaleOpts,opts){const time=scaleOpts.time||(scaleOpts.time={}),adapter=this._adapter=new _adapters._date(scaleOpts.adapters.date);mergeIf(time.displayFormats,adapter.formats()),this._parseOpts={parser:time.parser,round:time.round,isoWeekday:time.isoWeekday},super.init(scaleOpts),this._normalized=opts.normalized}parse(raw,index){return void 0===raw?null:parse(this,raw)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const me=this,options=me.options,adapter=me._adapter,unit=options.time.unit||"day";let{min:min,max:max,minDefined:minDefined,maxDefined:maxDefined}=me.getUserBounds();function _applyBounds(bounds){minDefined||isNaN(bounds.min)||(min=Math.min(min,bounds.min)),maxDefined||isNaN(bounds.max)||(max=Math.max(max,bounds.max))}minDefined&&maxDefined||(_applyBounds(me._getLabelBounds()),"ticks"===options.bounds&&"labels"===options.ticks.source||_applyBounds(me.getMinMax(!1))),min=isNumberFinite(min)&&!isNaN(min)?min:+adapter.startOf(Date.now(),unit),max=isNumberFinite(max)&&!isNaN(max)?max:+adapter.endOf(Date.now(),unit)+1,me.min=Math.min(min,max-1),me.max=Math.max(min+1,max)}_getLabelBounds(){const arr=this.getLabelTimestamps();let min=Number.POSITIVE_INFINITY,max=Number.NEGATIVE_INFINITY;return arr.length&&(min=arr[0],max=arr[arr.length-1]),{min:min,max:max}}buildTicks(){const me=this,options=me.options,timeOpts=options.time,tickOpts=options.ticks,timestamps="labels"===tickOpts.source?me.getLabelTimestamps():me._generate();"ticks"===options.bounds&&timestamps.length&&(me.min=me._userMin||timestamps[0],me.max=me._userMax||timestamps[timestamps.length-1]);const min=me.min,max=me.max,ticks=_filterBetween(timestamps,min,max);return me._unit=timeOpts.unit||(tickOpts.autoSkip?determineUnitForAutoTicks(timeOpts.minUnit,me.min,me.max,me._getLabelCapacity(min)):determineUnitForFormatting(me,ticks.length,timeOpts.minUnit,me.min,me.max)),me._majorUnit=tickOpts.major.enabled&&"year"!==me._unit?determineMajorUnit(me._unit):void 0,me.initOffsets(timestamps),options.reverse&&ticks.reverse(),ticksFromTimestamps(me,ticks,me._majorUnit)}initOffsets(timestamps){const me=this;let start=0,end=0,first,last;me.options.offset&&timestamps.length&&(first=me.getDecimalForValue(timestamps[0]),start=1===timestamps.length?1-first:(me.getDecimalForValue(timestamps[1])-first)/2,last=me.getDecimalForValue(timestamps[timestamps.length-1]),end=1===timestamps.length?last:(last-me.getDecimalForValue(timestamps[timestamps.length-2]))/2);const limit=timestamps.length<3?.5:.25;start=_limitValue(start,0,limit),end=_limitValue(end,0,limit),me._offsets={start:start,end:end,factor:1/(start+1+end)}}_generate(){const me=this,adapter=me._adapter,min=me.min,max=me.max,options=me.options,timeOpts=options.time,minor=timeOpts.unit||determineUnitForAutoTicks(timeOpts.minUnit,min,max,me._getLabelCapacity(min)),stepSize=valueOrDefault(timeOpts.stepSize,1),weekday="week"===minor&&timeOpts.isoWeekday,hasWeekday=isNumber(weekday)||!0===weekday,ticks={};let first=min,time,count;if(hasWeekday&&(first=+adapter.startOf(first,"isoWeek",weekday)),first=+adapter.startOf(first,hasWeekday?"day":minor),adapter.diff(max,min,minor)>1e5*stepSize)throw new Error(min+" and "+max+" are too far apart with stepSize of "+stepSize+" "+minor);const timestamps="data"===options.ticks.source&&me.getDataTimestamps();for(time=first,count=0;time<max;time=+adapter.add(time,stepSize,minor),count++)addTick(ticks,time,timestamps);return time!==max&&"ticks"!==options.bounds&&1!==count||addTick(ticks,time,timestamps),Object.keys(ticks).sort((a,b)=>a-b).map(x=>+x)}getLabelForValue(value){const me=this,adapter=me._adapter,timeOpts=me.options.time;return timeOpts.tooltipFormat?adapter.format(value,timeOpts.tooltipFormat):adapter.format(value,timeOpts.displayFormats.datetime)}_tickFormatFunction(time,index,ticks,format){const me=this,options=me.options,formats=options.time.displayFormats,unit=me._unit,majorUnit=me._majorUnit,minorFormat=unit&&formats[unit],majorFormat=majorUnit&&formats[majorUnit],tick=ticks[index],major=majorUnit&&majorFormat&&tick&&tick.major,label=me._adapter.format(time,format||(major?majorFormat:minorFormat)),formatter=options.ticks.callback;return formatter?callback(formatter,[label,index,ticks],me):label}generateTickLabels(ticks){let i,ilen,tick;for(i=0,ilen=ticks.length;i<ilen;++i)tick=ticks[i],tick.label=this._tickFormatFunction(tick.value,i,ticks)}getDecimalForValue(value){const me=this;return null===value?NaN:(value-me.min)/(me.max-me.min)}getPixelForValue(value){const me=this,offsets=me._offsets,pos=me.getDecimalForValue(value);return me.getPixelForDecimal((offsets.start+pos)*offsets.factor)}getValueForPixel(pixel){const me=this,offsets=me._offsets,pos=me.getDecimalForPixel(pixel)/offsets.factor-offsets.end;return me.min+pos*(me.max-me.min)}_getLabelSize(label){const me=this,ticksOpts=me.options.ticks,tickLabelWidth=me.ctx.measureText(label).width,angle=toRadians(me.isHorizontal()?ticksOpts.maxRotation:ticksOpts.minRotation),cosRotation=Math.cos(angle),sinRotation=Math.sin(angle),tickFontSize=me._resolveTickFontOptions(0).size;return{w:tickLabelWidth*cosRotation+tickFontSize*sinRotation,h:tickLabelWidth*sinRotation+tickFontSize*cosRotation}}_getLabelCapacity(exampleTime){const me=this,timeOpts=me.options.time,displayFormats=timeOpts.displayFormats,format=displayFormats[timeOpts.unit]||displayFormats.millisecond,exampleLabel=me._tickFormatFunction(exampleTime,0,ticksFromTimestamps(me,[exampleTime],me._majorUnit),format),size=me._getLabelSize(exampleLabel),capacity=Math.floor(me.isHorizontal()?me.width/size.w:me.height/size.h)-1;return capacity>0?capacity:1}getDataTimestamps(){const me=this;let timestamps=me._cache.data||[],i,ilen;if(timestamps.length)return timestamps;const metas=me.getMatchingVisibleMetas();if(me._normalized&&metas.length)return me._cache.data=metas[0].controller.getAllParsedValues(me);for(i=0,ilen=metas.length;i<ilen;++i)timestamps=timestamps.concat(metas[i].controller.getAllParsedValues(me));return me._cache.data=me.normalize(timestamps)}getLabelTimestamps(){const me=this,timestamps=me._cache.labels||[];let i,ilen;if(timestamps.length)return timestamps;const labels=me.getLabels();for(i=0,ilen=labels.length;i<ilen;++i)timestamps.push(parse(me,labels[i]));return me._cache.labels=me._normalized?timestamps:me.normalize(timestamps)}normalize(values){return _arrayUnique(values.sort(sorter))}}function interpolate(table,val,reverse){let lo=0,hi=table.length-1,prevSource,nextSource,prevTarget,nextTarget;reverse?(val>=table[lo].pos&&val<=table[hi].pos&&({lo:lo,hi:hi}=_lookupByKey(table,"pos",val)),({pos:prevSource,time:prevTarget}=table[lo]),({pos:nextSource,time:nextTarget}=table[hi])):(val>=table[lo].time&&val<=table[hi].time&&({lo:lo,hi:hi}=_lookupByKey(table,"time",val)),({time:prevSource,pos:prevTarget}=table[lo]),({time:nextSource,pos:nextTarget}=table[hi]));const span=nextSource-prevSource;return span?prevTarget+(nextTarget-prevTarget)*(val-prevSource)/span:prevTarget}TimeScale.id="time",TimeScale.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class TimeSeriesScale extends TimeScale{constructor(props){super(props),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const me=this,timestamps=me._getTimestampsForTable(),table=me._table=me.buildLookupTable(timestamps);me._minPos=interpolate(table,me.min),me._tableRange=interpolate(table,me.max)-me._minPos,super.initOffsets(timestamps)}buildLookupTable(timestamps){const{min:min,max:max}=this,items=[],table=[];let i,ilen,prev,curr,next;for(i=0,ilen=timestamps.length;i<ilen;++i)curr=timestamps[i],curr>=min&&curr<=max&&items.push(curr);if(items.length<2)return[{time:min,pos:0},{time:max,pos:1}];for(i=0,ilen=items.length;i<ilen;++i)next=items[i+1],prev=items[i-1],curr=items[i],Math.round((next+prev)/2)!==curr&&table.push({time:curr,pos:i/(ilen-1)});return table}_getTimestampsForTable(){const me=this;let timestamps=me._cache.all||[];if(timestamps.length)return timestamps;const data=me.getDataTimestamps(),label=me.getLabelTimestamps();return timestamps=data.length&&label.length?me.normalize(data.concat(label)):data.length?data:label,timestamps=me._cache.all=timestamps,timestamps}getDecimalForValue(value){return(interpolate(this._table,value)-this._minPos)/this._tableRange}getValueForPixel(pixel){const me=this,offsets=me._offsets,decimal=me.getDecimalForPixel(pixel)/offsets.factor-offsets.end;return interpolate(me._table,decimal*me._tableRange+me._minPos,!0)}}TimeSeriesScale.id="timeseries",TimeSeriesScale.defaults=TimeScale.defaults;var scales=Object.freeze({__proto__:null,CategoryScale:CategoryScale,LinearScale:LinearScale,LogarithmicScale:LogarithmicScale,RadialLinearScale:RadialLinearScale,TimeScale:TimeScale,TimeSeriesScale:TimeSeriesScale});return Chart.register(controllers,scales,elements,plugins),Chart.helpers={...helpers},Chart._adapters=_adapters,Chart.Animation=Animation,Chart.Animations=Animations,Chart.animator=animator,Chart.controllers=registry.controllers.items,Chart.DatasetController=DatasetController,Chart.Element=Element,Chart.elements=elements,Chart.Interaction=Interaction,Chart.layouts=layouts,Chart.platforms=platforms,Chart.Scale=Scale,Chart.Ticks=Ticks,Object.assign(Chart,controllers,scales,elements,plugins,platforms),Chart.Chart=Chart,"undefined"!=typeof window&&(window.Chart=Chart),Chart})),
/*!
 * chartjs-plugin-datalabels v2.0.0
 * https://chartjs-plugin-datalabels.netlify.app
 * (c) 2017-2021 chartjs-plugin-datalabels contributors
 * Released under the MIT license
 */
function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory(require("chart.js/helpers"),require("chart.js")):"function"==typeof define&&define.amd?define(["chart.js/helpers","chart.js"],factory):(global="undefined"!=typeof globalThis?globalThis:global||self).ChartDataLabels=factory(global.Chart.helpers,global.Chart)}(this,(function(helpers,chart_js){"use strict";var devicePixelRatio=function(){if("undefined"!=typeof window){if(window.devicePixelRatio)return window.devicePixelRatio;var screen=window.screen;if(screen)return(screen.deviceXDPI||1)/(screen.logicalXDPI||1)}return 1}(),utils_toTextLines=function(inputs){var lines=[],input;for(inputs=[].concat(inputs);inputs.length;)"string"==typeof(input=inputs.pop())?lines.unshift.apply(lines,input.split("\n")):Array.isArray(input)?inputs.push.apply(inputs,input):helpers.isNullOrUndef(inputs)||lines.unshift(""+input);return lines},utils_textSize=function(ctx,lines,font){var items=[].concat(lines),ilen=items.length,prev=ctx.font,width=0,i;for(ctx.font=font.string,i=0;i<ilen;++i)width=Math.max(ctx.measureText(items[i]).width,width);return ctx.font=prev,{height:ilen*font.lineHeight,width:width}},utils_bound=function(min,value,max){return Math.max(min,Math.min(value,max))},utils_arrayDiff=function(a0,a1){var prev=a0.slice(),updates=[],i,j,ilen,v;for(i=0,ilen=a1.length;i<ilen;++i)v=a1[i],-1===(j=prev.indexOf(v))?updates.push([v,1]):prev.splice(j,1);for(i=0,ilen=prev.length;i<ilen;++i)updates.push([prev[i],-1]);return updates},utils_rasterize;function orient(point,origin){var x0=origin.x,y0=origin.y;if(null===x0)return{x:0,y:-1};if(null===y0)return{x:1,y:0};var dx=point.x-x0,dy=point.y-y0,ln=Math.sqrt(dx*dx+dy*dy);return{x:ln?dx/ln:0,y:ln?dy/ln:-1}}function aligned(x,y,vx,vy,align){switch(align){case"center":vx=vy=0;break;case"bottom":vx=0,vy=1;break;case"right":vx=1,vy=0;break;case"left":vx=-1,vy=0;break;case"top":vx=0,vy=-1;break;case"start":vx=-vx,vy=-vy;break;case"end":break;default:align*=Math.PI/180,vx=Math.cos(align),vy=Math.sin(align)}return{x:x,y:y,vx:vx,vy:vy}}var R_INSIDE=0,R_LEFT=1,R_RIGHT=2,R_BOTTOM=4,R_TOP=8;function region(x,y,rect){var res=0;return x<rect.left?res|=1:x>rect.right&&(res|=2),y<rect.top?res|=8:y>rect.bottom&&(res|=4),res}function clipped(segment,area){for(var x0=segment.x0,y0=segment.y0,x1=segment.x1,y1=segment.y1,r0=region(x0,y0,area),r1=region(x1,y1,area),r,x,y;r0|r1&&!(r0&r1);)8&(r=r0||r1)?(x=x0+(x1-x0)*(area.top-y0)/(y1-y0),y=area.top):4&r?(x=x0+(x1-x0)*(area.bottom-y0)/(y1-y0),y=area.bottom):2&r?(y=y0+(y1-y0)*(area.right-x0)/(x1-x0),x=area.right):1&r&&(y=y0+(y1-y0)*(area.left-x0)/(x1-x0),x=area.left),r===r0?r0=region(x0=x,y0=y,area):r1=region(x1=x,y1=y,area);return{x0:x0,x1:x1,y0:y0,y1:y1}}function compute$1(range,config){var anchor=config.anchor,segment=range,x,y;return config.clamp&&(segment=clipped(segment,config.area)),"start"===anchor?(x=segment.x0,y=segment.y0):"end"===anchor?(x=segment.x1,y=segment.y1):(x=(segment.x0+segment.x1)/2,y=(segment.y0+segment.y1)/2),aligned(x,y,range.vx,range.vy,config.align)}var positioners_arc=function(el,config){var angle=(el.startAngle+el.endAngle)/2,vx=Math.cos(angle),vy=Math.sin(angle),r0=el.innerRadius,r1=el.outerRadius;return compute$1({x0:el.x+vx*r0,y0:el.y+vy*r0,x1:el.x+vx*r1,y1:el.y+vy*r1,vx:vx,vy:vy},config)},positioners_point=function(el,config){var v=orient(el,config.origin),rx=v.x*el.options.radius,ry=v.y*el.options.radius;return compute$1({x0:el.x-rx,y0:el.y-ry,x1:el.x+rx,y1:el.y+ry,vx:v.x,vy:v.y},config)},positioners_bar=function(el,config){var v=orient(el,config.origin),x=el.x,y=el.y,sx=0,sy=0;return el.horizontal?(x=Math.min(el.x,el.base),sx=Math.abs(el.base-el.x)):(y=Math.min(el.y,el.base),sy=Math.abs(el.base-el.y)),compute$1({x0:x,y0:y+sy,x1:x+sx,y1:y,vx:v.x,vy:v.y},config)},positioners_fallback=function(el,config){var v=orient(el,config.origin);return compute$1({x0:el.x,y0:el.y,x1:el.x,y1:el.y,vx:v.x,vy:v.y},config)},rasterize=function(v){return Math.round(v*devicePixelRatio)/devicePixelRatio};function boundingRects(model){var borderWidth=model.borderWidth||0,padding=model.padding,th=model.size.height,tw=model.size.width,tx=-tw/2,ty=-th/2;return{frame:{x:tx-padding.left-borderWidth,y:ty-padding.top-borderWidth,w:tw+padding.width+2*borderWidth,h:th+padding.height+2*borderWidth},text:{x:tx,y:ty,w:tw,h:th}}}function getScaleOrigin(el,context){var scale=context.chart.getDatasetMeta(context.datasetIndex).vScale;if(!scale)return null;if(void 0!==scale.xCenter&&void 0!==scale.yCenter)return{x:scale.xCenter,y:scale.yCenter};var pixel=scale.getBasePixel();return el.horizontal?{x:pixel,y:null}:{x:null,y:pixel}}function getPositioner(el){return el instanceof chart_js.ArcElement?positioners_arc:el instanceof chart_js.PointElement?positioners_point:el instanceof chart_js.BarElement?positioners_bar:positioners_fallback}function drawRoundedRect(ctx,x,y,w,h,radius){var HALF_PI=Math.PI/2;if(radius){var r=Math.min(radius,h/2,w/2),left=x+r,top=y+r,right=x+w-r,bottom=y+h-r;ctx.moveTo(x,top),left<right&&top<bottom?(ctx.arc(left,top,r,-Math.PI,-HALF_PI),ctx.arc(right,top,r,-HALF_PI,0),ctx.arc(right,bottom,r,0,HALF_PI),ctx.arc(left,bottom,r,HALF_PI,Math.PI)):left<right?(ctx.moveTo(left,y),ctx.arc(right,top,r,-HALF_PI,HALF_PI),ctx.arc(left,top,r,HALF_PI,Math.PI+HALF_PI)):top<bottom?(ctx.arc(left,top,r,-Math.PI,0),ctx.arc(left,bottom,r,0,Math.PI)):ctx.arc(left,top,r,-Math.PI,Math.PI),ctx.closePath(),ctx.moveTo(x,y)}else ctx.rect(x,y,w,h)}function drawFrame(ctx,rect,model){var bgColor=model.backgroundColor,borderColor=model.borderColor,borderWidth=model.borderWidth;(bgColor||borderColor&&borderWidth)&&(ctx.beginPath(),drawRoundedRect(ctx,rasterize(rect.x)+borderWidth/2,rasterize(rect.y)+borderWidth/2,rasterize(rect.w)-borderWidth,rasterize(rect.h)-borderWidth,model.borderRadius),ctx.closePath(),bgColor&&(ctx.fillStyle=bgColor,ctx.fill()),borderColor&&borderWidth&&(ctx.strokeStyle=borderColor,ctx.lineWidth=borderWidth,ctx.lineJoin="miter",ctx.stroke()))}function textGeometry(rect,align,font){var h=font.lineHeight,w=rect.w,x=rect.x,y;return"center"===align?x+=w/2:"end"!==align&&"right"!==align||(x+=w),{h:h,w:w,x:x,y:rect.y+h/2}}function drawTextLine(ctx,text,cfg){var shadow=ctx.shadowBlur,stroked=cfg.stroked,x=rasterize(cfg.x),y=rasterize(cfg.y),w=rasterize(cfg.w);stroked&&ctx.strokeText(text,x,y,w),cfg.filled&&(shadow&&stroked&&(ctx.shadowBlur=0),ctx.fillText(text,x,y,w),shadow&&stroked&&(ctx.shadowBlur=shadow))}function drawText(ctx,lines,rect,model){var align=model.textAlign,color=model.color,filled=!!color,font=model.font,ilen=lines.length,strokeColor=model.textStrokeColor,strokeWidth=model.textStrokeWidth,stroked=strokeColor&&strokeWidth,i;if(ilen&&(filled||stroked))for(rect=textGeometry(rect,align,font),ctx.font=font.string,ctx.textAlign=align,ctx.textBaseline="middle",ctx.shadowBlur=model.textShadowBlur,ctx.shadowColor=model.textShadowColor,filled&&(ctx.fillStyle=color),stroked&&(ctx.lineJoin="round",ctx.lineWidth=strokeWidth,ctx.strokeStyle=strokeColor),i=0,ilen=lines.length;i<ilen;++i)drawTextLine(ctx,lines[i],{stroked:stroked,filled:filled,w:rect.w,x:rect.x,y:rect.y+rect.h*i})}var Label=function(config,ctx,el,index){var me=this;me._config=config,me._index=index,me._model=null,me._rects=null,me._ctx=ctx,me._el=el};helpers.merge(Label.prototype,{_modelize:function(display,lines,config,context){var me=this,index=me._index,font=helpers.toFont(helpers.resolve([config.font,{}],context,index)),color=helpers.resolve([config.color,chart_js.defaults.color],context,index);return{align:helpers.resolve([config.align,"center"],context,index),anchor:helpers.resolve([config.anchor,"center"],context,index),area:context.chart.chartArea,backgroundColor:helpers.resolve([config.backgroundColor,null],context,index),borderColor:helpers.resolve([config.borderColor,null],context,index),borderRadius:helpers.resolve([config.borderRadius,0],context,index),borderWidth:helpers.resolve([config.borderWidth,0],context,index),clamp:helpers.resolve([config.clamp,!1],context,index),clip:helpers.resolve([config.clip,!1],context,index),color:color,display:display,font:font,lines:lines,offset:helpers.resolve([config.offset,0],context,index),opacity:helpers.resolve([config.opacity,1],context,index),origin:getScaleOrigin(me._el,context),padding:helpers.toPadding(helpers.resolve([config.padding,0],context,index)),positioner:getPositioner(me._el),rotation:helpers.resolve([config.rotation,0],context,index)*(Math.PI/180),size:utils_textSize(me._ctx,lines,font),textAlign:helpers.resolve([config.textAlign,"start"],context,index),textShadowBlur:helpers.resolve([config.textShadowBlur,0],context,index),textShadowColor:helpers.resolve([config.textShadowColor,color],context,index),textStrokeColor:helpers.resolve([config.textStrokeColor,color],context,index),textStrokeWidth:helpers.resolve([config.textStrokeWidth,0],context,index)}},update:function(context){var me=this,model=null,rects=null,index=me._index,config=me._config,value,label,lines,display=helpers.resolve([config.display,!0],context,index);display&&(value=context.dataset.data[index],label=helpers.valueOrDefault(helpers.callback(config.formatter,[value,context]),value),(lines=helpers.isNullOrUndef(label)?[]:utils_toTextLines(label)).length&&(rects=boundingRects(model=me._modelize(display,lines,config,context)))),me._model=model,me._rects=rects},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(chart,center){var me=this,ctx=chart.ctx,model=me._model,rects=me._rects,area;this.visible()&&(ctx.save(),model.clip&&(area=model.area,ctx.beginPath(),ctx.rect(area.left,area.top,area.right-area.left,area.bottom-area.top),ctx.clip()),ctx.globalAlpha=utils_bound(0,model.opacity,1),ctx.translate(rasterize(center.x),rasterize(center.y)),ctx.rotate(model.rotation),drawFrame(ctx,rects.frame,model),drawText(ctx,model.lines,rects.text,model),ctx.restore())}});var MIN_INTEGER=Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991;function rotated(point,center,angle){var cos=Math.cos(angle),sin=Math.sin(angle),cx=center.x,cy=center.y;return{x:cx+cos*(point.x-cx)-sin*(point.y-cy),y:cy+sin*(point.x-cx)+cos*(point.y-cy)}}function projected(points,axis){var min=MAX_INTEGER,max=MIN_INTEGER,origin=axis.origin,i,pt,vx,vy,dp;for(i=0;i<points.length;++i)vx=(pt=points[i]).x-origin.x,vy=pt.y-origin.y,dp=axis.vx*vx+axis.vy*vy,min=Math.min(min,dp),max=Math.max(max,dp);return{min:min,max:max}}function toAxis(p0,p1){var vx=p1.x-p0.x,vy=p1.y-p0.y,ln=Math.sqrt(vx*vx+vy*vy);return{vx:(p1.x-p0.x)/ln,vy:(p1.y-p0.y)/ln,origin:p0,ln:ln}}var HitBox=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};function coordinates(el,model,geometry){var point=model.positioner(el,model),vx=point.vx,vy=point.vy;if(!vx&&!vy)return{x:point.x,y:point.y};var w=geometry.w,h=geometry.h,rotation=model.rotation,dx=Math.abs(w/2*Math.cos(rotation))+Math.abs(h/2*Math.sin(rotation)),dy=Math.abs(w/2*Math.sin(rotation))+Math.abs(h/2*Math.cos(rotation)),vs=1/Math.max(Math.abs(vx),Math.abs(vy));return dx*=vx*vs,dy*=vy*vs,dx+=model.offset*vx,dy+=model.offset*vy,{x:point.x+dx,y:point.y+dy}}function collide(labels,collider){var i,j,s0,s1;for(i=labels.length-1;i>=0;--i)for(s0=labels[i].$layout,j=i-1;j>=0&&s0._visible;--j)(s1=labels[j].$layout)._visible&&s0._box.intersects(s1._box)&&collider(s0,s1);return labels}function compute(labels){var i,ilen,label,state,geometry,center,proxy;for(i=0,ilen=labels.length;i<ilen;++i)(state=(label=labels[i]).$layout)._visible&&(proxy=new Proxy(label._el,{get:(el,p)=>el.getProps([p],!0)[p]}),geometry=label.geometry(),center=coordinates(proxy,label.model(),geometry),state._box.update(center,geometry,label.rotation()));return collide(labels,(function(s0,s1){var h0=s0._hidable,h1=s1._hidable;h0&&h1||h1?s1._visible=!1:h0&&(s0._visible=!1)}))}helpers.merge(HitBox.prototype,{center:function(){var r=this._rect;return{x:r.x+r.w/2,y:r.y+r.h/2}},update:function(center,rect,rotation){this._rotation=rotation,this._rect={x:rect.x+center.x,y:rect.y+center.y,w:rect.w,h:rect.h}},contains:function(point){var me=this,margin=1,rect=me._rect;return!((point=rotated(point,me.center(),-me._rotation)).x<rect.x-1||point.y<rect.y-1||point.x>rect.x+rect.w+2||point.y>rect.y+rect.h+2)},intersects:function(other){var r0=this._points(),r1=other._points(),axes=[toAxis(r0[0],r0[1]),toAxis(r0[0],r0[3])],i,pr0,pr1;for(this._rotation!==other._rotation&&axes.push(toAxis(r1[0],r1[1]),toAxis(r1[0],r1[3])),i=0;i<axes.length;++i)if(pr0=projected(r0,axes[i]),pr1=projected(r1,axes[i]),pr0.max<pr1.min||pr1.max<pr0.min)return!1;return!0},_points:function(){var me=this,rect=me._rect,angle=me._rotation,center=me.center();return[rotated({x:rect.x,y:rect.y},center,angle),rotated({x:rect.x+rect.w,y:rect.y},center,angle),rotated({x:rect.x+rect.w,y:rect.y+rect.h},center,angle),rotated({x:rect.x,y:rect.y+rect.h},center,angle)]}});var layout={prepare:function(datasets){var labels=[],i,j,ilen,jlen,label;for(i=0,ilen=datasets.length;i<ilen;++i)for(j=0,jlen=datasets[i].length;j<jlen;++j)label=datasets[i][j],labels.push(label),label.$layout={_box:new HitBox,_hidable:!1,_visible:!0,_set:i,_idx:j};return labels.sort((function(a,b){var sa=a.$layout,sb=b.$layout;return sa._idx===sb._idx?sb._set-sa._set:sb._idx-sa._idx})),this.update(labels),labels},update:function(labels){var dirty=!1,i,ilen,label,model,state;for(i=0,ilen=labels.length;i<ilen;++i)model=(label=labels[i]).model(),(state=label.$layout)._hidable=model&&"auto"===model.display,state._visible=label.visible(),dirty|=state._hidable;dirty&&compute(labels)},lookup:function(labels,point){var i,state;for(i=labels.length-1;i>=0;--i)if((state=labels[i].$layout)&&state._visible&&state._box.contains(point))return labels[i];return null},draw:function(chart,labels){var i,ilen,label,state,geometry,center;for(i=0,ilen=labels.length;i<ilen;++i)(state=(label=labels[i]).$layout)._visible&&(geometry=label.geometry(),center=coordinates(label._el,label.model(),geometry),state._box.update(center,geometry,label.rotation()),label.draw(chart,center))}},formatter,defaults,EXPANDO_KEY="$datalabels",DEFAULT_KEY="$default",plugin;function configure(dataset,options){var override=dataset.datalabels,listeners={},configs=[],labels,keys;return!1===override?null:(!0===override&&(override={}),options=helpers.merge({},[options,override]),labels=options.labels||{},keys=Object.keys(labels),delete options.labels,keys.length?keys.forEach((function(key){labels[key]&&configs.push(helpers.merge({},[options,labels[key],{_key:key}]))})):configs.push(options),listeners=configs.reduce((function(target,config){return helpers.each(config.listeners||{},(function(fn,event){target[event]=target[event]||{},target[event][config._key||"$default"]=fn})),delete config.listeners,target}),{}),{labels:configs,listeners:listeners})}function dispatchEvent(chart,listeners,label){if(listeners){var context=label.$context,groups=label.$groups,callback;listeners[groups._set]&&(callback=listeners[groups._set][groups._key])&&!0===helpers.callback(callback,[context])&&(chart.$datalabels._dirty=!0,label.update(context))}}function dispatchMoveEvents(chart,listeners,previous,label){var enter,leave;(previous||label)&&(previous?label?previous!==label&&(leave=enter=!0):leave=!0:enter=!0,leave&&dispatchEvent(chart,listeners.leave,previous),enter&&dispatchEvent(chart,listeners.enter,label))}function handleMoveEvents(chart,event){var expando=chart.$datalabels,listeners=expando._listeners,previous,label;if(listeners.enter||listeners.leave){if("mousemove"===event.type)label=layout.lookup(expando._labels,event);else if("mouseout"!==event.type)return;previous=expando._hovered,expando._hovered=label,dispatchMoveEvents(chart,listeners,previous,label)}}function handleClickEvents(chart,event){var expando=chart.$datalabels,handlers=expando._listeners.click,label=handlers&&layout.lookup(expando._labels,event);label&&dispatchEvent(chart,handlers,label)}return{id:"datalabels",defaults:{align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:function(value){if(helpers.isNullOrUndef(value))return null;var label=value,keys,klen,k;if(helpers.isObject(value))if(helpers.isNullOrUndef(value.label))if(helpers.isNullOrUndef(value.r))for(label="",k=0,klen=(keys=Object.keys(value)).length;k<klen;++k)label+=(0!==k?", ":"")+keys[k]+": "+value[keys[k]];else label=value.r;else label=value.label;return""+label},labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},beforeInit:function(chart){chart.$datalabels={_actives:[]}},beforeUpdate:function(chart){var expando=chart.$datalabels;expando._listened=!1,expando._listeners={},expando._datasets=[],expando._labels=[]},afterDatasetUpdate:function(chart,args,options){var datasetIndex=args.index,expando=chart.$datalabels,labels=expando._datasets[datasetIndex]=[],visible=chart.isDatasetVisible(datasetIndex),dataset=chart.data.datasets[datasetIndex],config=configure(dataset,options),elements=args.meta.data||[],ctx=chart.ctx,i,j,ilen,jlen,cfg,key,el,label;for(ctx.save(),i=0,ilen=elements.length;i<ilen;++i)if((el=elements[i]).$datalabels=[],visible&&el&&chart.getDataVisibility(i)&&!el.skip)for(j=0,jlen=config.labels.length;j<jlen;++j)key=(cfg=config.labels[j])._key,(label=new Label(cfg,ctx,el,i)).$groups={_set:datasetIndex,_key:key||"$default"},label.$context={active:!1,chart:chart,dataIndex:i,dataset:dataset,datasetIndex:datasetIndex},label.update(label.$context),el.$datalabels.push(label),labels.push(label);ctx.restore(),helpers.merge(expando._listeners,config.listeners,{merger:function(event,target,source){target[event]=target[event]||{},target[event][args.index]=source[event],expando._listened=!0}})},afterUpdate:function(chart,options){chart.$datalabels._labels=layout.prepare(chart.$datalabels._datasets,options)},afterDatasetsDraw:function(chart){layout.draw(chart,chart.$datalabels._labels)},beforeEvent:function(chart,args){if(chart.$datalabels._listened){var event=args.event;switch(event.type){case"mousemove":case"mouseout":handleMoveEvents(chart,event);break;case"click":handleClickEvents(chart,event)}}},afterEvent:function(chart){var expando=chart.$datalabels,previous=expando._actives,actives=expando._actives=chart.getActiveElements(),updates=utils_arrayDiff(previous,actives),i,ilen,j,jlen,update,label,labels;for(i=0,ilen=updates.length;i<ilen;++i)if((update=updates[i])[1])for(j=0,jlen=(labels=update[0].element.$datalabels||[]).length;j<jlen;++j)(label=labels[j]).$context.active=1===update[1],label.update(label.$context);(expando._dirty||updates.length)&&(layout.update(expando._labels),chart.render()),delete expando._dirty}}})),
/*!
 * tipso - A Lightweight Responsive jQuery Tooltip Plugin v1.0.8
 * Copyright (c) 2014-2015 Bojan Petkovski
 * http://tipso.object505.com
 * Licensed under the MIT license
 * http://object505.mit-license.org/
 */
function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof exports?module.exports=factory(require("jquery")):factory(jQuery)}((function($){var pluginName="tipso",defaults={speed:400,background:"#55b555",titleBackground:"#333333",color:"#ffffff",titleColor:"#ffffff",titleContent:"",showArrow:!0,position:"top",width:200,maxWidth:"",delay:200,hideDelay:0,animationIn:"",animationOut:"",offsetX:0,offsetY:0,arrowWidth:8,tooltipHover:!1,content:null,ajaxContentUrl:null,ajaxContentBuffer:0,contentElementId:null,useTitle:!1,templateEngineFunc:null,onBeforeShow:null,onShow:null,onHide:null};function Plugin(element,options){this.element=element,this.$element=$(this.element),this.doc=$(document),this.win=$(window),this.settings=$.extend({},defaults,options),"object"==typeof this.$element.data("tipso")&&$.extend(this.settings,this.$element.data("tipso"));for(var data_keys=Object.keys(this.$element.data()),data_attrs={},i=0;i<data_keys.length;i++){var key=data_keys[i].replace("tipso","");if(""!==key)for(var settings_key in data_attrs[key=key.charAt(0).toLowerCase()+key.slice(1)]=this.$element.data(data_keys[i]),this.settings)settings_key.toLowerCase()==key&&(this.settings[settings_key]=data_attrs[key])}this._defaults=defaults,this._name="tipso",this._title=this.$element.attr("title"),this.mode="hide",this.ieFade=!supportsTransitions,this.settings.preferedPosition=this.settings.position,this.init()}function realHeight(obj){var clone=obj.clone();clone.css("visibility","hidden"),$("body").append(clone);var height=clone.outerHeight(),width=clone.outerWidth();return clone.remove(),{width:width,height:height}}$.extend(Plugin.prototype,{init:function(){var obj=this,$e=this.$element,$doc=this.doc;if($e.addClass("tipso_style").removeAttr("title"),obj.settings.tooltipHover){var waitForHover=null,hoverHelper=null;$e.on("mouseover.tipso",(function(){clearTimeout(waitForHover),clearTimeout(hoverHelper),hoverHelper=setTimeout((function(){obj.show()}),150)})),$e.on("mouseout.tipso",(function(){clearTimeout(waitForHover),clearTimeout(hoverHelper),waitForHover=setTimeout((function(){obj.hide()}),200),obj.tooltip().on("mouseover.tipso",(function(){obj.mode="tooltipHover"})).on("mouseout.tipso",(function(){obj.mode="show",clearTimeout(waitForHover),waitForHover=setTimeout((function(){obj.hide()}),200)}))}))}else $e.on("mouseover.tipso",(function(){obj.show()})),$e.on("mouseout.tipso",(function(){obj.hide()}));obj.settings.ajaxContentUrl&&(obj.ajaxContent=null)},tooltip:function(){return this.tipso_bubble||(this.tipso_bubble=$('<div class="tipso_bubble"><div class="tipso_title"></div><div class="tipso_content"></div><div class="tipso_arrow"></div></div>')),this.tipso_bubble},show:function(){var tipso_bubble=this.tooltip(),obj=this,$win=this.win;!1===obj.settings.showArrow?tipso_bubble.find(".tipso_arrow").hide():tipso_bubble.find(".tipso_arrow").show(),"hide"===obj.mode&&($.isFunction(obj.settings.onBeforeShow)&&obj.settings.onBeforeShow(obj.$element,obj.element,obj),obj.settings.size&&tipso_bubble.addClass(obj.settings.size),obj.settings.width?tipso_bubble.css({background:obj.settings.background,color:obj.settings.color,width:obj.settings.width}).hide():obj.settings.maxWidth?tipso_bubble.css({background:obj.settings.background,color:obj.settings.color,maxWidth:obj.settings.maxWidth}).hide():tipso_bubble.css({background:obj.settings.background,color:obj.settings.color,width:200}).hide(),tipso_bubble.find(".tipso_title").css({background:obj.settings.titleBackground,color:obj.settings.titleColor}),tipso_bubble.find(".tipso_content").html(obj.content()),tipso_bubble.find(".tipso_title").html(obj.titleContent()),reposition(obj),$win.on("resize.tipso",(function tipsoResizeHandler(){obj.settings.position=obj.settings.preferedPosition,reposition(obj)})),window.clearTimeout(obj.timeout),obj.timeout=null,obj.timeout=window.setTimeout((function(){obj.ieFade||""===obj.settings.animationIn||""===obj.settings.animationOut?tipso_bubble.appendTo("body").stop(!0,!0).fadeIn(obj.settings.speed,(function(){obj.mode="show",$.isFunction(obj.settings.onShow)&&obj.settings.onShow(obj.$element,obj.element,obj)})):tipso_bubble.remove().appendTo("body").stop(!0,!0).removeClass("animated "+obj.settings.animationOut).addClass("noAnimation").removeClass("noAnimation").addClass("animated "+obj.settings.animationIn).fadeIn(obj.settings.speed,(function(){$(this).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",(function(){$(this).removeClass("animated "+obj.settings.animationIn)})),obj.mode="show",$.isFunction(obj.settings.onShow)&&obj.settings.onShow(obj.$element,obj.element,obj),$win.off("resize.tipso",null,"tipsoResizeHandler")}))}),obj.settings.delay))},hide:function(force){var obj=this,$win=this.win,tipso_bubble=this.tooltip(),hideDelay=obj.settings.hideDelay;force&&(hideDelay=0,obj.mode="show"),window.clearTimeout(obj.timeout),obj.timeout=null,obj.timeout=window.setTimeout((function(){"tooltipHover"!==obj.mode&&(obj.ieFade||""===obj.settings.animationIn||""===obj.settings.animationOut?tipso_bubble.stop(!0,!0).fadeOut(obj.settings.speed,(function(){$(this).remove(),$.isFunction(obj.settings.onHide)&&"show"===obj.mode&&obj.settings.onHide(obj.$element,obj.element,obj),obj.mode="hide",$win.off("resize.tipso",null,"tipsoResizeHandler")})):tipso_bubble.stop(!0,!0).removeClass("animated "+obj.settings.animationIn).addClass("noAnimation").removeClass("noAnimation").addClass("animated "+obj.settings.animationOut).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",(function(){$(this).removeClass("animated "+obj.settings.animationOut).remove(),$.isFunction(obj.settings.onHide)&&"show"===obj.mode&&obj.settings.onHide(obj.$element,obj.element,obj),obj.mode="hide",$win.off("resize.tipso",null,"tipsoResizeHandler")})))}),hideDelay)},close:function(){this.hide(!0)},destroy:function(){var $e=this.$element,$win=this.win,$doc=this.doc;$e.off(".tipso"),$win.off("resize.tipso",null,"tipsoResizeHandler"),$e.removeData("tipso"),$e.removeClass("tipso_style").attr("title",this._title)},titleContent:function(){var content,$e=this.$element,obj=this;return content=obj.settings.titleContent?obj.settings.titleContent:$e.data("tipso-title")},content:function(){var content,$e=this.$element,obj=this,title=this._title;return obj.settings.ajaxContentUrl?obj._ajaxContent?content=obj._ajaxContent:(obj._ajaxContent=content=$.ajax({type:"GET",url:obj.settings.ajaxContentUrl,async:!1}).responseText,obj.settings.ajaxContentBuffer>0?setTimeout((function(){obj._ajaxContent=null}),obj.settings.ajaxContentBuffer):obj._ajaxContent=null):obj.settings.contentElementId?content=$("#"+obj.settings.contentElementId).text():obj.settings.content?content=obj.settings.content:!0===obj.settings.useTitle?content=title:"string"==typeof $e.data("tipso")&&(content=$e.data("tipso")),null!==obj.settings.templateEngineFunc&&(content=obj.settings.templateEngineFunc(content)),content},update:function(key,value){var obj=this;if(!value)return obj.settings[key];obj.settings[key]=value}});var supportsTransitions=function(){var s=document.createElement("p").style,v=["ms","O","Moz","Webkit"];if(""===s.transition)return!0;for(;v.length;)if(v.pop()+"Transition"in s)return!0;return!1}();function removeCornerClasses(obj){obj.removeClass("top_right_corner bottom_right_corner top_left_corner bottom_left_corner"),obj.find(".tipso_title").removeClass("top_right_corner bottom_right_corner top_left_corner bottom_left_corner")}function reposition(thisthat){var tipso_bubble=thisthat.tooltip(),$e=thisthat.$element,obj=thisthat,$win=$(window),arrow=10,pos_top,pos_left,diff,arrow_color=obj.settings.background,title_content=obj.titleContent(),tipso_arrow,tipso_arrow,tipso_arrow;switch(void 0!==title_content&&""!==title_content&&(arrow_color=obj.settings.titleBackground),$e.parent().outerWidth()>$win.outerWidth()&&($win=$e.parent()),obj.settings.position){case"top-right":pos_left=$e.offset().left+$e.outerWidth(),pos_top=$e.offset().top-realHeight(tipso_bubble).height-10,tipso_bubble.find(".tipso_arrow").css({marginLeft:-obj.settings.arrowWidth,marginTop:""}),pos_top<$win.scrollTop()?(pos_top=$e.offset().top+$e.outerHeight()+10,tipso_bubble.find(".tipso_arrow").css({"border-bottom-color":arrow_color,"border-top-color":"transparent","border-left-color":"transparent","border-right-color":"transparent"}),removeCornerClasses(tipso_bubble),tipso_bubble.addClass("bottom_right_corner"),tipso_bubble.find(".tipso_title").addClass("bottom_right_corner"),tipso_bubble.find(".tipso_arrow").css({"border-left-color":arrow_color}),tipso_bubble.removeClass("top-right top bottom left right"),tipso_bubble.addClass("bottom")):(tipso_bubble.find(".tipso_arrow").css({"border-top-color":obj.settings.background,"border-bottom-color":"transparent ","border-left-color":"transparent","border-right-color":"transparent"}),removeCornerClasses(tipso_bubble),tipso_bubble.addClass("top_right_corner"),tipso_bubble.find(".tipso_arrow").css({"border-left-color":obj.settings.background}),tipso_bubble.removeClass("top bottom left right"),tipso_bubble.addClass("top"));break;case"top-left":pos_left=$e.offset().left-realHeight(tipso_bubble).width,pos_top=$e.offset().top-realHeight(tipso_bubble).height-10,tipso_bubble.find(".tipso_arrow").css({marginLeft:-obj.settings.arrowWidth,marginTop:""}),pos_top<$win.scrollTop()?(pos_top=$e.offset().top+$e.outerHeight()+10,tipso_bubble.find(".tipso_arrow").css({"border-bottom-color":arrow_color,"border-top-color":"transparent","border-left-color":"transparent","border-right-color":"transparent"}),removeCornerClasses(tipso_bubble),tipso_bubble.addClass("bottom_left_corner"),tipso_bubble.find(".tipso_title").addClass("bottom_left_corner"),tipso_bubble.find(".tipso_arrow").css({"border-right-color":arrow_color}),tipso_bubble.removeClass("top-right top bottom left right"),tipso_bubble.addClass("bottom")):(tipso_bubble.find(".tipso_arrow").css({"border-top-color":obj.settings.background,"border-bottom-color":"transparent ","border-left-color":"transparent","border-right-color":"transparent"}),removeCornerClasses(tipso_bubble),tipso_bubble.addClass("top_left_corner"),tipso_bubble.find(".tipso_arrow").css({"border-right-color":obj.settings.background}),tipso_bubble.removeClass("top bottom left right"),tipso_bubble.addClass("top"));break;case"bottom-right":pos_left=$e.offset().left+$e.outerWidth(),pos_top=$e.offset().top+$e.outerHeight()+10,tipso_bubble.find(".tipso_arrow").css({marginLeft:-obj.settings.arrowWidth,marginTop:""}),pos_top+realHeight(tipso_bubble).height>$win.scrollTop()+$win.outerHeight()?(pos_top=$e.offset().top-realHeight(tipso_bubble).height-10,tipso_bubble.find(".tipso_arrow").css({"border-bottom-color":"transparent","border-top-color":obj.settings.background,"border-left-color":"transparent","border-right-color":"transparent"}),removeCornerClasses(tipso_bubble),tipso_bubble.addClass("top_right_corner"),tipso_bubble.find(".tipso_title").addClass("top_left_corner"),tipso_bubble.find(".tipso_arrow").css({"border-left-color":obj.settings.background}),tipso_bubble.removeClass("top-right top bottom left right"),tipso_bubble.addClass("top")):(tipso_bubble.find(".tipso_arrow").css({"border-top-color":"transparent","border-bottom-color":arrow_color,"border-left-color":"transparent","border-right-color":"transparent"}),removeCornerClasses(tipso_bubble),tipso_bubble.addClass("bottom_right_corner"),tipso_bubble.find(".tipso_title").addClass("bottom_right_corner"),tipso_bubble.find(".tipso_arrow").css({"border-left-color":arrow_color}),tipso_bubble.removeClass("top bottom left right"),tipso_bubble.addClass("bottom"));break;case"bottom-left":pos_left=$e.offset().left-realHeight(tipso_bubble).width,pos_top=$e.offset().top+$e.outerHeight()+10,tipso_bubble.find(".tipso_arrow").css({marginLeft:-obj.settings.arrowWidth,marginTop:""}),pos_top+realHeight(tipso_bubble).height>$win.scrollTop()+$win.outerHeight()?(pos_top=$e.offset().top-realHeight(tipso_bubble).height-10,tipso_bubble.find(".tipso_arrow").css({"border-bottom-color":"transparent","border-top-color":obj.settings.background,"border-left-color":"transparent","border-right-color":"transparent"}),removeCornerClasses(tipso_bubble),tipso_bubble.addClass("top_left_corner"),tipso_bubble.find(".tipso_title").addClass("top_left_corner"),tipso_bubble.find(".tipso_arrow").css({"border-right-color":obj.settings.background}),tipso_bubble.removeClass("top-right top bottom left right"),tipso_bubble.addClass("top")):(tipso_bubble.find(".tipso_arrow").css({"border-top-color":"transparent","border-bottom-color":arrow_color,"border-left-color":"transparent","border-right-color":"transparent"}),removeCornerClasses(tipso_bubble),tipso_bubble.addClass("bottom_left_corner"),tipso_bubble.find(".tipso_title").addClass("bottom_left_corner"),tipso_bubble.find(".tipso_arrow").css({"border-right-color":arrow_color}),tipso_bubble.removeClass("top bottom left right"),tipso_bubble.addClass("bottom"));break;case"top":pos_left=$e.offset().left+$e.outerWidth()/2-realHeight(tipso_bubble).width/2,pos_top=$e.offset().top-realHeight(tipso_bubble).height-10,tipso_bubble.find(".tipso_arrow").css({marginLeft:-obj.settings.arrowWidth,marginTop:""}),pos_top<$win.scrollTop()?(pos_top=$e.offset().top+$e.outerHeight()+10,tipso_bubble.find(".tipso_arrow").css({"border-bottom-color":arrow_color,"border-top-color":"transparent","border-left-color":"transparent","border-right-color":"transparent"}),tipso_bubble.removeClass("top bottom left right"),tipso_bubble.addClass("bottom")):(tipso_bubble.find(".tipso_arrow").css({"border-top-color":obj.settings.background,"border-bottom-color":"transparent","border-left-color":"transparent","border-right-color":"transparent"}),tipso_bubble.removeClass("top bottom left right"),tipso_bubble.addClass("top"));break;case"bottom":pos_left=$e.offset().left+$e.outerWidth()/2-realHeight(tipso_bubble).width/2,pos_top=$e.offset().top+$e.outerHeight()+10,tipso_bubble.find(".tipso_arrow").css({marginLeft:-obj.settings.arrowWidth,marginTop:""}),pos_top+realHeight(tipso_bubble).height>$win.scrollTop()+$win.outerHeight()?(pos_top=$e.offset().top-realHeight(tipso_bubble).height-10,tipso_bubble.find(".tipso_arrow").css({"border-top-color":obj.settings.background,"border-bottom-color":"transparent","border-left-color":"transparent","border-right-color":"transparent"}),tipso_bubble.removeClass("top bottom left right"),tipso_bubble.addClass("top")):(tipso_bubble.find(".tipso_arrow").css({"border-bottom-color":arrow_color,"border-top-color":"transparent","border-left-color":"transparent","border-right-color":"transparent"}),tipso_bubble.removeClass("top bottom left right"),tipso_bubble.addClass(obj.settings.position));break;case"left":pos_left=$e.offset().left-realHeight(tipso_bubble).width-10,pos_top=$e.offset().top+$e.outerHeight()/2-realHeight(tipso_bubble).height/2,tipso_bubble.find(".tipso_arrow").css({marginTop:-obj.settings.arrowWidth,marginLeft:""}),pos_left<$win.scrollLeft()?(pos_left=$e.offset().left+$e.outerWidth()+10,tipso_bubble.find(".tipso_arrow").css({"border-right-color":obj.settings.background,"border-left-color":"transparent","border-top-color":"transparent","border-bottom-color":"transparent"}),tipso_bubble.removeClass("top bottom left right"),tipso_bubble.addClass("right")):(tipso_bubble.find(".tipso_arrow").css({"border-left-color":obj.settings.background,"border-right-color":"transparent","border-top-color":"transparent","border-bottom-color":"transparent"}),tipso_bubble.removeClass("top bottom left right"),tipso_bubble.addClass(obj.settings.position));break;case"right":pos_left=$e.offset().left+$e.outerWidth()+10,pos_top=$e.offset().top+$e.outerHeight()/2-realHeight(tipso_bubble).height/2,tipso_bubble.find(".tipso_arrow").css({marginTop:-obj.settings.arrowWidth,marginLeft:""}),pos_left+10+obj.settings.width>$win.scrollLeft()+$win.outerWidth()?(pos_left=$e.offset().left-realHeight(tipso_bubble).width-10,tipso_bubble.find(".tipso_arrow").css({"border-left-color":obj.settings.background,"border-right-color":"transparent","border-top-color":"transparent","border-bottom-color":"transparent"}),tipso_bubble.removeClass("top bottom left right"),tipso_bubble.addClass("left")):(tipso_bubble.find(".tipso_arrow").css({"border-right-color":obj.settings.background,"border-left-color":"transparent","border-top-color":"transparent","border-bottom-color":"transparent"}),tipso_bubble.removeClass("top bottom left right"),tipso_bubble.addClass(obj.settings.position))}("top-right"===obj.settings.position&&tipso_bubble.find(".tipso_arrow").css({"margin-left":-obj.settings.width/2}),"top-left"===obj.settings.position)&&(tipso_arrow=tipso_bubble.find(".tipso_arrow").eq(0)).css({"margin-left":obj.settings.width/2-2*obj.settings.arrowWidth});"bottom-right"===obj.settings.position&&(tipso_arrow=tipso_bubble.find(".tipso_arrow").eq(0)).css({"margin-left":-obj.settings.width/2,"margin-top":""});"bottom-left"===obj.settings.position&&(tipso_arrow=tipso_bubble.find(".tipso_arrow").eq(0)).css({"margin-left":obj.settings.width/2-2*obj.settings.arrowWidth,"margin-top":""});pos_left<$win.scrollLeft()&&("bottom"===obj.settings.position||"top"===obj.settings.position)&&(tipso_bubble.find(".tipso_arrow").css({marginLeft:pos_left-obj.settings.arrowWidth}),pos_left=0),pos_left+obj.settings.width>$win.outerWidth()&&("bottom"===obj.settings.position||"top"===obj.settings.position)&&(diff=$win.outerWidth()-(pos_left+obj.settings.width),tipso_bubble.find(".tipso_arrow").css({marginLeft:-diff-obj.settings.arrowWidth,marginTop:""}),pos_left+=diff),pos_left<$win.scrollLeft()&&("left"===obj.settings.position||"right"===obj.settings.position||"top-right"===obj.settings.position||"top-left"===obj.settings.position||"bottom-right"===obj.settings.position||"bottom-left"===obj.settings.position)&&(pos_left=$e.offset().left+$e.outerWidth()/2-realHeight(tipso_bubble).width/2,tipso_bubble.find(".tipso_arrow").css({marginLeft:-obj.settings.arrowWidth,marginTop:""}),(pos_top=$e.offset().top-realHeight(tipso_bubble).height-10)<$win.scrollTop()?(pos_top=$e.offset().top+$e.outerHeight()+10,tipso_bubble.find(".tipso_arrow").css({"border-bottom-color":arrow_color,"border-top-color":"transparent","border-left-color":"transparent","border-right-color":"transparent"}),tipso_bubble.removeClass("top bottom left right"),removeCornerClasses(tipso_bubble),tipso_bubble.addClass("bottom")):(tipso_bubble.find(".tipso_arrow").css({"border-top-color":obj.settings.background,"border-bottom-color":"transparent","border-left-color":"transparent","border-right-color":"transparent"}),tipso_bubble.removeClass("top bottom left right"),removeCornerClasses(tipso_bubble),tipso_bubble.addClass("top")),pos_left+obj.settings.width>$win.outerWidth()&&(diff=$win.outerWidth()-(pos_left+obj.settings.width),tipso_bubble.find(".tipso_arrow").css({marginLeft:-diff-obj.settings.arrowWidth,marginTop:""}),pos_left+=diff),pos_left<$win.scrollLeft()&&(tipso_bubble.find(".tipso_arrow").css({marginLeft:pos_left-obj.settings.arrowWidth}),pos_left=0)),pos_left+obj.settings.width>$win.outerWidth()&&("left"===obj.settings.position||"right"===obj.settings.position||"top-right"===obj.settings.position||"top-left"===obj.settings.position||"bottom-right"===obj.settings.position||"bottom-right"===obj.settings.position)&&(pos_left=$e.offset().left+$e.outerWidth()/2-realHeight(tipso_bubble).width/2,tipso_bubble.find(".tipso_arrow").css({marginLeft:-obj.settings.arrowWidth,marginTop:""}),(pos_top=$e.offset().top-realHeight(tipso_bubble).height-10)<$win.scrollTop()?(pos_top=$e.offset().top+$e.outerHeight()+10,tipso_bubble.find(".tipso_arrow").css({"border-bottom-color":arrow_color,"border-top-color":"transparent","border-left-color":"transparent","border-right-color":"transparent"}),removeCornerClasses(tipso_bubble),tipso_bubble.removeClass("top bottom left right"),tipso_bubble.addClass("bottom")):(tipso_bubble.find(".tipso_arrow").css({"border-top-color":obj.settings.background,"border-bottom-color":"transparent","border-left-color":"transparent","border-right-color":"transparent"}),removeCornerClasses(tipso_bubble),tipso_bubble.removeClass("top bottom left right"),tipso_bubble.addClass("top")),pos_left+obj.settings.width>$win.outerWidth()&&(diff=$win.outerWidth()-(pos_left+obj.settings.width),tipso_bubble.find(".tipso_arrow").css({marginLeft:-diff-obj.settings.arrowWidth,marginTop:""}),pos_left+=diff),pos_left<$win.scrollLeft()&&(tipso_bubble.find(".tipso_arrow").css({marginLeft:pos_left-obj.settings.arrowWidth}),pos_left=0)),tipso_bubble.css({left:pos_left+obj.settings.offsetX,top:pos_top+obj.settings.offsetY}),pos_top<$win.scrollTop()&&("right"===obj.settings.position||"left"===obj.settings.position)&&($e.tipso("update","position","bottom"),reposition(obj)),pos_top+realHeight(tipso_bubble).height>$win.scrollTop()+$win.outerHeight()&&("right"===obj.settings.position||"left"===obj.settings.position)&&($e.tipso("update","position","top"),reposition(obj))}$.tipso=$.fn.tipso=function(options){var args=arguments,returns;return void 0===options||"object"==typeof options?(this instanceof $||$.extend(defaults,options),this.each((function(){$.data(this,"plugin_tipso")||$.data(this,"plugin_tipso",new Plugin(this,options))}))):"string"==typeof options&&"_"!==options[0]&&"init"!==options?(this.each((function(){var instance=$.data(this,"plugin_tipso");instance||(instance=$.data(this,"plugin_tipso",new Plugin(this,options))),instance instanceof Plugin&&"function"==typeof instance[options]&&(returns=instance[options].apply(instance,Array.prototype.slice.call(args,1))),"destroy"===options&&$.data(this,"plugin_tipso",null)})),void 0!==returns?returns:this):void 0}})),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t||self).gridjs={})}(this,(function(t){function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,o(t,e)}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function u(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return a(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)?a(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}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 l,c,p,h,f,d,_={},m=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function v(t,e){for(var n in e)t[n]=e[n];return t}function y(t){var e=t.parentNode;e&&e.removeChild(t)}function b(t,e,n){var r,i,o,s=arguments,a={};for(o in e)"key"==o?r=e[o]:"ref"==o?i=e[o]:a[o]=e[o];if(arguments.length>3)for(n=[n],o=3;o<arguments.length;o++)n.push(s[o]);if(null!=n&&(a.children=n),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===a[o]&&(a[o]=t.defaultProps[o]);return w(t,a,r,i,null)}function w(t,e,n,r,i){var o={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++l.__v:i};return null!=l.vnode&&l.vnode(o),o}function P(t){return t.children}function k(t,e){this.props=t,this.context=e}function S(t,e){if(null==e)return t.__?S(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?S(t):null}function C(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return C(t)}}function x(t){(!t.__d&&(t.__d=!0)&&p.push(t)&&!N.__r++||f!==l.debounceRendering)&&((f=l.debounceRendering)||h)(N)}function N(){for(var t;N.__r=p.length;)t=p.sort((function(t,e){return t.__v.__b-e.__v.__b})),p=[],t.some((function(t){var e,n,r,i,o,s;t.__d&&(o=(i=(e=t).__v).__e,(s=e.__P)&&(n=[],(r=v({},i)).__v=i.__v+1,I(s,i,r,e.__n,void 0!==s.ownerSVGElement,null!=i.__h?[o]:null,n,null==o?S(i):o,i.__h),U(n,i),i.__e!=o&&C(i)))}))}function E(t,e,n,r,i,o,s,a,u,l){var c,p,h,f,d,g,v,y=r&&r.__k||m,b=y.length;for(n.__k=[],c=0;c<e.length;c++)if(null!=(f=n.__k[c]=null==(f=e[c])||"boolean"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?w(null,f,null,null,f):Array.isArray(f)?w(P,{children:f},null,null,null):f.__b>0?w(f.type,f.props,f.key,null,f.__v):f)){if(f.__=n,f.__b=n.__b+1,null===(h=y[c])||h&&f.key==h.key&&f.type===h.type)y[c]=void 0;else for(p=0;p<b;p++){if((h=y[p])&&f.key==h.key&&f.type===h.type){y[p]=void 0;break}h=null}I(t,f,h=h||_,i,o,s,a,u,l),d=f.__e,(p=f.ref)&&h.ref!=p&&(v||(v=[]),h.ref&&v.push(h.ref,null,f),v.push(p,f.__c||d,f)),null!=d?(null==g&&(g=d),"function"==typeof f.type&&null!=f.__k&&f.__k===h.__k?f.__d=u=F(f,u,t):u=T(t,f,h,y,d,u),l||"option"!==n.type?"function"==typeof n.type&&(n.__d=u):t.value=""):u&&h.__e==u&&u.parentNode!=t&&(u=S(h))}for(n.__e=g,c=b;c--;)null!=y[c]&&("function"==typeof n.type&&null!=y[c].__e&&y[c].__e==n.__d&&(n.__d=S(r,c+1)),M(y[c],y[c]));if(v)for(c=0;c<v.length;c++)H(v[c],v[++c],v[++c])}function F(t,e,n){var r,i;for(r=0;r<t.__k.length;r++)(i=t.__k[r])&&(i.__=t,e="function"==typeof i.type?F(i,e,n):T(n,i,i,t.__k,i.__e,e));return e}function T(t,e,n,r,i,o){var s,a,u;if(void 0!==e.__d)s=e.__d,e.__d=void 0;else if(null==n||i!=o||null==i.parentNode)t:if(null==o||o.parentNode!==t)t.appendChild(i),s=null;else{for(a=o,u=0;(a=a.nextSibling)&&u<r.length;u+=2)if(a==i)break t;t.insertBefore(i,o),s=o}return void 0!==s?s:i.nextSibling}function D(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||g.test(e)?n:n+"px"}function R(t,e,n,r,i){var o;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||D(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||D(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?r||t.addEventListener(e,o?A:L,o):t.removeEventListener(e,o?A:L,o);else if("dangerouslySetInnerHTML"!==e){if(i)e=e.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null!=n&&(!1!==n||"a"===e[0]&&"r"===e[1])?t.setAttribute(e,n):t.removeAttribute(e))}}function L(t){this.l[t.type+!1](l.event?l.event(t):t)}function A(t){this.l[t.type+!0](l.event?l.event(t):t)}function I(t,e,n,r,i,o,s,a,u){var c,p,h,f,d,g,b,w,S,C,x,N=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(u=n.__h,a=e.__e=n.__e,e.__h=null,o=[a]),(c=l.__b)&&c(e);try{t:if("function"==typeof N){if(w=e.props,S=(c=N.contextType)&&r[c.__c],C=c?S?S.props.value:c.__:r,n.__c?b=(p=e.__c=n.__c).__=p.__E:("prototype"in N&&N.prototype.render?e.__c=p=new N(w,C):(e.__c=p=new k(w,C),p.constructor=N,p.render=O),S&&S.sub(p),p.props=w,p.state||(p.state={}),p.context=C,p.__n=r,h=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=N.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=v({},p.__s)),v(p.__s,N.getDerivedStateFromProps(w,p.__s))),f=p.props,d=p.state,h)null==N.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==N.getDerivedStateFromProps&&w!==f&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,C),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,C)||e.__v===n.__v){p.props=w,p.state=p.__s,e.__v!==n.__v&&(p.__d=!1),p.__v=e,e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),p.__h.length&&s.push(p);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,C),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(f,d,g)}))}p.context=C,p.props=w,p.state=p.__s,(c=l.__r)&&c(e),p.__d=!1,p.__v=e,p.__P=t,c=p.render(p.props,p.state,p.context),p.state=p.__s,null!=p.getChildContext&&(r=v(v({},r),p.getChildContext())),h||null==p.getSnapshotBeforeUpdate||(g=p.getSnapshotBeforeUpdate(f,d)),x=null!=c&&c.type===P&&null==c.key?c.props.children:c,E(t,Array.isArray(x)?x:[x],e,n,r,i,o,s,a,u),p.base=e.__e,e.__h=null,p.__h.length&&s.push(p),b&&(p.__E=p.__=null),p.__e=!1}else null==o&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=function(t,e,n,r,i,o,s,a){var u,l,c,p,h=n.props,f=e.props,d=e.type,g=0;if("svg"===d&&(i=!0),null!=o)for(;g<o.length;g++)if((u=o[g])&&(u===t||(d?u.localName==d:3==u.nodeType))){t=u,o[g]=null;break}if(null==t){if(null===d)return document.createTextNode(f);t=i?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,f.is&&f),o=null,a=!1}if(null===d)h===f||a&&t.data===f||(t.data=f);else{if(o=o&&m.slice.call(t.childNodes),l=(h=n.props||_).dangerouslySetInnerHTML,c=f.dangerouslySetInnerHTML,!a){if(null!=o)for(h={},p=0;p<t.attributes.length;p++)h[t.attributes[p].name]=t.attributes[p].value;(c||l)&&(c&&(l&&c.__html==l.__html||c.__html===t.innerHTML)||(t.innerHTML=c&&c.__html||""))}if(function(t,e,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in e||R(t,o,null,n[o],r);for(o in e)i&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===e[o]||R(t,o,e[o],n[o],r)}(t,f,h,i,a),c)e.__k=[];else if(g=e.props.children,E(t,Array.isArray(g)?g:[g],e,n,r,i&&"foreignObject"!==d,o,s,t.firstChild,a),null!=o)for(g=o.length;g--;)null!=o[g]&&y(o[g]);a||("value"in f&&void 0!==(g=f.value)&&(g!==t.value||"progress"===d&&!g)&&R(t,"value",g,h.value,!1),"checked"in f&&void 0!==(g=f.checked)&&g!==t.checked&&R(t,"checked",g,h.checked,!1))}return t}(n.__e,e,n,r,i,o,s,u);(c=l.diffed)&&c(e)}catch(t){e.__v=null,(u||null!=o)&&(e.__e=a,e.__h=!!u,o[o.indexOf(a)]=null),l.__e(t,e,n)}}function U(t,e){l.__c&&l.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){l.__e(t,e.__v)}}))}function H(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){l.__e(t,n)}}function M(t,e,n){var r,i,o;if(l.unmount&&l.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||H(r,null,e)),n||"function"==typeof t.type||(n=null!=(i=t.__e)),t.__e=t.__d=void 0,null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){l.__e(t,e)}r.base=r.__P=null}if(r=t.__k)for(o=0;o<r.length;o++)r[o]&&M(r[o],e,n);null!=i&&y(i)}function O(t,e,n){return this.constructor(t,n)}function j(t,e,n){var r,i,o;l.__&&l.__(t,e),i=(r="function"==typeof n)?null:n&&n.__k||e.__k,o=[],I(e,t=(!r&&n||e).__k=b(P,null,[t]),i||_,_,void 0!==e.ownerSVGElement,!r&&n?[n]:i?null:e.firstChild?m.slice.call(e.childNodes):null,o,!r&&n?n:i?i.__e:e.firstChild,r),U(o,t)}function W(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}l={__e:function(t,e){for(var n,r,i;e=e.__;)if((n=e.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(t)),i=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t),i=n.__d),i)return n.__E=n}catch(e){t=e}throw t},__v:0},c=function(t){return null!=t&&void 0===t.constructor},k.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof t&&(t=t(v({},n),this.props)),t&&v(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),x(this))},k.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),x(this))},k.prototype.render=P,p=[],h="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,N.__r=0,d=0;var B=function(){function t(t){this._id=void 0,this._id=t||W()}return n(t,[{key:"id",get:function(){return this._id}}]),t}(),z={search:{placeholder:"Type a keyword..."},sort:{sortAsc:"Sort column ascending",sortDesc:"Sort column descending"},pagination:{previous:"Previous",next:"Next",navigate:function(t,e){return"Page "+t+" of "+e},page:function(t){return"Page "+t},showing:"Showing",of:"of",to:"to",results:"results"},loading:"Loading...",noRecordsFound:"No matching records found",error:"An error happened while fetching the data"},q=function(){function t(t){this._language=void 0,this._defaultLanguage=void 0,this._language=t,this._defaultLanguage=z}var e=t.prototype;return e.getString=function(t,e){if(!e||!t)return null;var n=t.split("."),r=n[0];if(e[r]){var i=e[r];return"string"==typeof i?function(){return i}:"function"==typeof i?i:this.getString(n.slice(1).join("."),i)}return null},e.translate=function(t){var e,n=this.getString(t,this._language);return(e=n||this.getString(t,this._defaultLanguage))?e.apply(void 0,[].slice.call(arguments,1)):t},t}(),G=function(t){function e(e,n){var r,i;return(r=t.call(this,e,n)||this).config=void 0,r._=void 0,r.config=function(t){if(!t)return null;var e=Object.keys(t);return e.length?t[e[0]].props.value:null}(n),r.config&&(r._=(i=r.config.translator,function(t){return i.translate.apply(i,[t].concat([].slice.call(arguments,1)))})),r}return i(e,t),e}(k),X=function(t){function e(){return t.apply(this,arguments)||this}return i(e,t),e.prototype.render=function(){return b(this.props.parentElement,{dangerouslySetInnerHTML:{__html:this.props.content}})},e}(G);function $(t,e){return b(X,{content:t,parentElement:e})}X.defaultProps={parentElement:"span"};var K,V=function(t){function e(e){var n;return(n=t.call(this)||this).data=void 0,n.update(e),n}i(e,t);var n=e.prototype;return n.cast=function(t){return t instanceof HTMLElement?$(t.outerHTML):t},n.update=function(t){return this.data=this.cast(t),this},e}(B),Y=function(t){function e(e){var n;return(n=t.call(this)||this)._cells=void 0,n.cells=e||[],n}i(e,t);var r=e.prototype;return r.cell=function(t){return this._cells[t]},r.toArray=function(){return this.cells.map((function(t){return t.data}))},e.fromCells=function(t){return new e(t.map((function(t){return new V(t.data)})))},n(e,[{key:"cells",get:function(){return this._cells},set:function(t){this._cells=t}},{key:"length",get:function(){return this.cells.length}}]),e}(B),Z=function(t){function e(e){var n;return(n=t.call(this)||this)._rows=void 0,n._length=void 0,n.rows=e instanceof Array?e:e instanceof Y?[e]:[],n}return i(e,t),e.prototype.toArray=function(){return this.rows.map((function(t){return t.toArray()}))},e.fromRows=function(t){return new e(t.map((function(t){return Y.fromCells(t.cells)})))},e.fromArray=function(t){return new e((t=function(t){return!t[0]||t[0]instanceof Array?t:[t]}(t)).map((function(t){return new Y(t.map((function(t){return new V(t)})))})))},n(e,[{key:"rows",get:function(){return this._rows},set:function(t){this._rows=t}},{key:"length",get:function(){return this._length||this.rows.length},set:function(t){this._length=t}}]),e}(B),J=function(){function t(){this.callbacks=void 0}var e=t.prototype;return e.init=function(t){this.callbacks||(this.callbacks={}),t&&!this.callbacks[t]&&(this.callbacks[t]=[])},e.on=function(t,e){return this.init(t),this.callbacks[t].push(e),this},e.off=function(t,e){var n=t;return this.init(),this.callbacks[n]&&0!==this.callbacks[n].length?(this.callbacks[n]=this.callbacks[n].filter((function(t){return t!=e})),this):this},e.emit=function(t){var e=arguments,n=t;return this.init(n),this.callbacks[n].length>0&&(this.callbacks[n].forEach((function(t){return t.apply(void 0,[].slice.call(e,1))})),!0)},t}();!function(t){t[t.Initiator=0]="Initiator",t[t.ServerFilter=1]="ServerFilter",t[t.ServerSort=2]="ServerSort",t[t.ServerLimit=3]="ServerLimit",t[t.Extractor=4]="Extractor",t[t.Transformer=5]="Transformer",t[t.Filter=6]="Filter",t[t.Sort=7]="Sort",t[t.Limit=8]="Limit"}(K||(K={}));var Q=function(t){function e(e){var n;return(n=t.call(this)||this).id=void 0,n._props=void 0,n._props={},n.id=W(),e&&n.setProps(e),n}i(e,t);var r=e.prototype;return r.process=function(){var t=[].slice.call(arguments);this.validateProps instanceof Function&&this.validateProps.apply(this,t),this.emit.apply(this,["beforeProcess"].concat(t));var e=this._process.apply(this,t);return this.emit.apply(this,["afterProcess"].concat(t)),e},r.setProps=function(t){return Object.assign(this._props,t),this.emit("propsUpdated",this),this},n(e,[{key:"props",get:function(){return this._props}}]),e}(J),tt=function(t){function e(){return t.apply(this,arguments)||this}return i(e,t),e.prototype._process=function(t){return this.props.keyword?(e=String(this.props.keyword).trim(),n=this.props.columns,r=this.props.ignoreHiddenColumns,i=t,o=this.props.selector,e=e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),new Z(i.rows.filter((function(t,i){return t.cells.some((function(t,s){if(!t)return!1;if(r&&n&&n[s]&&"object"==typeof n[s]&&n[s].hidden)return!1;var a="";if("function"==typeof o)a=o(t.data,i,s);else if("object"==typeof t.data){var u=t.data;u&&u.props&&u.props.content&&(a=u.props.content)}else a=String(t.data);return new RegExp(e,"gi").test(a)}))})))):t;var e,n,r,i,o},n(e,[{key:"type",get:function(){return K.Filter}}]),e}(Q);function et(){var t="gridjs";return""+t+[].slice.call(arguments).reduce((function(t,e){return t+"-"+e}),"")}function nt(){return[].slice.call(arguments).filter((function(t){return t})).reduce((function(t,e){return(t||"")+" "+e}),"").trim()||null}var rt,it=function(t){function e(e){var n;return(n=t.call(this)||this)._state=void 0,n.dispatcher=void 0,n.dispatcher=e,n._state=n.getInitialState(),e.register(n._handle.bind(s(n))),n}i(e,t);var r=e.prototype;return r._handle=function(t){this.handle(t.type,t.payload)},r.setState=function(t){var e=this._state;this._state=t,this.emit("updated",t,e)},n(e,[{key:"state",get:function(){return this._state}}]),e}(J),ot=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var n=e.prototype;return n.getInitialState=function(){return{keyword:null}},n.handle=function(t,e){"SEARCH_KEYWORD"===t&&this.search(e.keyword)},n.search=function(t){this.setState({keyword:t})},e}(it),st=function(){function t(t){this.dispatcher=void 0,this.dispatcher=t}return t.prototype.dispatch=function(t,e){this.dispatcher.dispatch({type:t,payload:e})},t}(),at=function(t){function e(){return t.apply(this,arguments)||this}return i(e,t),e.prototype.search=function(t){this.dispatch("SEARCH_KEYWORD",{keyword:t})},e}(st),ut=function(t){function e(){return t.apply(this,arguments)||this}return i(e,t),e.prototype._process=function(t){if(!this.props.keyword)return t;var e={};return this.props.url&&(e.url=this.props.url(t.url,this.props.keyword)),this.props.body&&(e.body=this.props.body(t.body,this.props.keyword)),r({},t,e)},n(e,[{key:"type",get:function(){return K.ServerFilter}}]),e}(Q),lt=new(function(){function t(){}var e=t.prototype;return e.format=function(t,e){return"[Grid.js] ["+e.toUpperCase()+"]: "+t},e.error=function(t,e){void 0===e&&(e=!1);var n=this.format(t,"error");if(e)throw Error(n);console.error(n)},e.warn=function(t){console.warn(this.format(t,"warn"))},e.info=function(t){console.info(this.format(t,"info"))},t}()),ct=function(t){function e(){return t.apply(this,arguments)||this}return i(e,t),e}(G);t.PluginPosition=void 0,(rt=t.PluginPosition||(t.PluginPosition={}))[rt.Header=0]="Header",rt[rt.Footer=1]="Footer",rt[rt.Cell=2]="Cell";var pt=function(){function t(){this.plugins=void 0,this.plugins=[]}var e=t.prototype;return e.get=function(t){var e=this.plugins.filter((function(e){return e.id===t}));return e.length>0?e[0]:null},e.add=function(t){return t.id?null!==this.get(t.id)?(lt.error("Duplicate plugin ID: "+t.id),this):(this.plugins.push(t),this):(lt.error("Plugin ID cannot be empty"),this)},e.remove=function(t){return this.plugins.splice(this.plugins.indexOf(this.get(t)),1),this},e.list=function(t){return(null!=t||null!=t?this.plugins.filter((function(e){return e.position===t})):this.plugins).sort((function(t,e){return t.order-e.order}))},t}(),ht=function(t){function e(){return t.apply(this,arguments)||this}return i(e,t),e.prototype.render=function(){var t=this;if(this.props.pluginId){var e=this.config.plugin.get(this.props.pluginId);return e?b(P,{},b(e.component,r({plugin:e},e.props,this.props.props))):null}return void 0!==this.props.position?b(P,{},this.config.plugin.list(this.props.position).map((function(e){return b(e.component,r({plugin:e},e.props,t.props.props))}))):null},e}(G),ft=function(t){function e(e,n){var r;(r=t.call(this,e,n)||this).searchProcessor=void 0,r.actions=void 0,r.store=void 0,r.storeUpdatedFn=void 0,r.actions=new at(r.config.dispatcher),r.store=new ot(r.config.dispatcher);var i,o=e.keyword;return e.enabled&&(o&&r.actions.search(o),r.storeUpdatedFn=r.storeUpdated.bind(s(r)),r.store.on("updated",r.storeUpdatedFn),i=e.server?new ut({keyword:e.keyword,url:e.server.url,body:e.server.body}):new tt({keyword:e.keyword,columns:r.config.header&&r.config.header.columns,ignoreHiddenColumns:e.ignoreHiddenColumns||void 0===e.ignoreHiddenColumns,selector:e.selector}),r.searchProcessor=i,r.config.pipeline.register(i)),r}i(e,t);var n=e.prototype;return n.componentWillUnmount=function(){this.config.pipeline.unregister(this.searchProcessor),this.store.off("updated",this.storeUpdatedFn)},n.storeUpdated=function(t){this.searchProcessor.setProps({keyword:t.keyword})},n.onChange=function(t){this.actions.search(t.target.value)},n.render=function(){if(!this.props.enabled)return null;var t,e,n,r=this.onChange.bind(this);return this.searchProcessor instanceof ut&&(t=r,e=this.props.debounceTimeout,r=function(){var r=arguments;return new Promise((function(i){n&&clearTimeout(n),n=setTimeout((function(){return i(t.apply(void 0,[].slice.call(r)))}),e)}))}),b("div",{className:et(nt("search",this.config.className.search))},b("input",{type:"search",placeholder:this._("search.placeholder"),"aria-label":this._("search.placeholder"),onInput:r,className:nt(et("input"),et("search","input")),value:this.store.state.keyword}))},e}(ct);ft.defaultProps={debounceTimeout:250};var dt=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var r=e.prototype;return r.validateProps=function(){if(isNaN(Number(this.props.limit))||isNaN(Number(this.props.page)))throw Error("Invalid parameters passed")},r._process=function(t){var e=this.props.page;return new Z(t.rows.slice(e*this.props.limit,(e+1)*this.props.limit))},n(e,[{key:"type",get:function(){return K.Limit}}]),e}(Q),_t=function(t){function e(){return t.apply(this,arguments)||this}return i(e,t),e.prototype._process=function(t){var e={};return this.props.url&&(e.url=this.props.url(t.url,this.props.page,this.props.limit)),this.props.body&&(e.body=this.props.body(t.body,this.props.page,this.props.limit)),r({},t,e)},n(e,[{key:"type",get:function(){return K.ServerLimit}}]),e}(Q),mt=function(t){function e(e,n){var r;return(r=t.call(this,e,n)||this).processor=void 0,r.onUpdateFn=void 0,r.setTotalFromTabularFn=void 0,r.state={limit:e.limit,page:e.page||0,total:0},r}i(e,t);var r=e.prototype;return r.componentWillMount=function(){var t,e=this;this.props.enabled&&(this.setTotalFromTabularFn=this.setTotalFromTabular.bind(this),this.props.server?(t=new _t({limit:this.state.limit,page:this.state.page,url:this.props.server.url,body:this.props.server.body}),this.config.pipeline.on("afterProcess",this.setTotalFromTabularFn)):(t=new dt({limit:this.state.limit,page:this.state.page})).on("beforeProcess",this.setTotalFromTabularFn),this.processor=t,this.config.pipeline.register(t),this.config.pipeline.on("error",(function(){e.setState({total:0,page:0})})))},r.setTotalFromTabular=function(t){this.setTotal(t.length)},r.onUpdate=function(t){this.props.resetPageOnUpdate&&t!==this.processor&&this.setPage(0)},r.componentDidMount=function(){this.onUpdateFn=this.onUpdate.bind(this),this.config.pipeline.on("updated",this.onUpdateFn)},r.componentWillUnmount=function(){this.config.pipeline.unregister(this.processor),this.config.pipeline.off("updated",this.onUpdateFn)},r.setPage=function(t){if(t>=this.pages||t<0||t===this.state.page)return null;this.setState({page:t}),this.processor.setProps({page:t})},r.setTotal=function(t){this.setState({total:t})},r.renderPages=function(){var t=this;if(this.props.buttonsCount<=0)return null;var e=Math.min(this.pages,this.props.buttonsCount),n=Math.min(this.state.page,Math.floor(e/2));return this.state.page+Math.floor(e/2)>=this.pages&&(n=e-(this.pages-this.state.page)),b(P,null,this.pages>e&&this.state.page-n>0&&b(P,null,b("button",{tabIndex:0,role:"button",onClick:this.setPage.bind(this,0),title:this._("pagination.firstPage"),"aria-label":this._("pagination.firstPage"),className:this.config.className.paginationButton},this._("1")),b("button",{tabIndex:-1,className:nt(et("spread"),this.config.className.paginationButton)},"...")),Array.from(Array(e).keys()).map((function(e){return t.state.page+(e-n)})).map((function(e){return b("button",{tabIndex:0,role:"button",onClick:t.setPage.bind(t,e),className:nt(t.state.page===e?nt(et("currentPage"),t.config.className.paginationButtonCurrent):null,t.config.className.paginationButton),title:t._("pagination.page",e+1),"aria-label":t._("pagination.page",e+1)},t._(""+(e+1)))})),this.pages>e&&this.pages>this.state.page+n+1&&b(P,null,b("button",{tabIndex:-1,className:nt(et("spread"),this.config.className.paginationButton)},"..."),b("button",{tabIndex:0,role:"button",onClick:this.setPage.bind(this,this.pages-1),title:this._("pagination.page",this.pages),"aria-label":this._("pagination.page",this.pages),className:this.config.className.paginationButton},this._(""+this.pages))))},r.renderSummary=function(){return b(P,null,this.props.summary&&this.state.total>0&&b("div",{role:"status","aria-live":"polite",className:nt(et("summary"),this.config.className.paginationSummary),title:this._("pagination.navigate",this.state.page+1,this.pages)},this._("pagination.showing")," ",b("b",null,this._(""+(this.state.page*this.state.limit+1)))," ",this._("pagination.to")," ",b("b",null,this._(""+Math.min((this.state.page+1)*this.state.limit,this.state.total)))," ",this._("pagination.of")," ",b("b",null,this._(""+this.state.total))," ",this._("pagination.results")))},r.render=function(){return this.props.enabled?b("div",{className:nt(et("pagination"),this.config.className.pagination)},this.renderSummary(),b("div",{className:et("pages")},this.props.prevButton&&b("button",{tabIndex:0,role:"button",disabled:0===this.state.page,onClick:this.setPage.bind(this,this.state.page-1),title:this._("pagination.previous"),"aria-label":this._("pagination.previous"),className:nt(this.config.className.paginationButton,this.config.className.paginationButtonPrev)},this._("pagination.previous")),this.renderPages(),this.props.nextButton&&b("button",{tabIndex:0,role:"button",disabled:this.pages===this.state.page+1||0===this.pages,onClick:this.setPage.bind(this,this.state.page+1),title:this._("pagination.next"),"aria-label":this._("pagination.next"),className:nt(this.config.className.paginationButton,this.config.className.paginationButtonNext)},this._("pagination.next")))):null},n(e,[{key:"pages",get:function(){return Math.ceil(this.state.total/this.state.limit)}}]),e}(ct);function gt(t,e){return"string"==typeof t?t.indexOf("%")>-1?e/100*parseInt(t,10):parseInt(t,10):t}function vt(t){return t?Math.floor(t)+"px":""}mt.defaultProps={summary:!0,nextButton:!0,prevButton:!0,buttonsCount:3,limit:10,resetPageOnUpdate:!0};var yt=function(t){function e(e,n){var r;return(r=t.call(this,e,n)||this).tableElement=void 0,r.tableClassName=void 0,r.tableStyle=void 0,r.tableElement=r.props.tableRef.current.base.cloneNode(!0),r.tableElement.style.position="absolute",r.tableElement.style.width="100%",r.tableElement.style.zIndex="-2147483640",r.tableElement.style.visibility="hidden",r.tableClassName=r.tableElement.className,r.tableStyle=r.tableElement.style.cssText,r}i(e,t);var n=e.prototype;return n.widths=function(){this.tableElement.className=this.tableClassName+" "+et("shadowTable"),this.tableElement.style.tableLayout="auto",this.tableElement.style.width="auto",this.tableElement.style.padding="0",this.tableElement.style.margin="0",this.tableElement.style.border="none",this.tableElement.style.outline="none";var t=Array.from(this.base.parentNode.querySelectorAll("thead th")).reduce((function(t,e){var n;return e.style.width=e.clientWidth+"px",r(((n={})[e.getAttribute("data-column-id")]={minWidth:e.clientWidth},n),t)}),{});return this.tableElement.className=this.tableClassName,this.tableElement.style.cssText=this.tableStyle,this.tableElement.style.tableLayout="auto",Array.from(this.base.parentNode.querySelectorAll("thead th")).reduce((function(t,e){return t[e.getAttribute("data-column-id")].width=e.clientWidth,t}),t)},n.render=function(){var t=this;return this.props.tableRef.current?b("div",{ref:function(e){e&&e.appendChild(t.tableElement)}}):null},e}(G);function bt(t){if(!t)return"";var e=t.split(" ");return 1===e.length&&/([a-z][A-Z])+/g.test(t)?t:e.map((function(t,e){return 0==e?t.toLowerCase():t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()})).join("")}var wt=function(e){function o(){var t;return(t=e.call(this)||this)._columns=void 0,t._columns=[],t}i(o,e);var s=o.prototype;return s.adjustWidth=function(t){var e=t.container,n=t.tableRef,r=t.tempRef,i=t.tempRef||!0;if(!e)return this;var s=e.clientWidth,a={current:null},l={};if(n.current&&i){var c=b(yt,{tableRef:n});c.ref=a,j(c,r.current),l=a.current.widths()}for(var p,h=u(o.tabularFormat(this.columns).reduce((function(t,e){return t.concat(e)}),[]));!(p=h()).done;){var f=p.value;f.columns&&f.columns.length>0||(!f.width&&i?f.id in l&&(f.width=vt(l[f.id].width),f.minWidth=vt(l[f.id].minWidth)):f.width=vt(gt(f.width,s)))}return n.current&&i&&j(null,r.current),this},s.setSort=function(t,e){for(var n,i=u(e||this.columns||[]);!(n=i()).done;){var o=n.value;o.columns&&o.columns.length>0&&(o.sort={enabled:!1}),void 0===o.sort&&t.sort&&(o.sort={enabled:!0}),o.sort?"object"==typeof o.sort&&(o.sort=r({enabled:!0},o.sort)):o.sort={enabled:!1},o.columns&&this.setSort(t,o.columns)}},s.setFixedHeader=function(t,e){for(var n,r=u(e||this.columns||[]);!(n=r()).done;){var i=n.value;void 0===i.fixedHeader&&(i.fixedHeader=t.fixedHeader),i.columns&&this.setFixedHeader(t,i.columns)}},s.setResizable=function(t,e){for(var n,r=u(e||this.columns||[]);!(n=r()).done;){var i=n.value;void 0===i.resizable&&(i.resizable=t.resizable),i.columns&&this.setResizable(t,i.columns)}},s.setID=function(t){for(var e,n=u(t||this.columns||[]);!(e=n()).done;){var r=e.value;r.id||"string"!=typeof r.name||(r.id=bt(r.name)),r.id||lt.error('Could not find a valid ID for one of the columns. Make sure a valid "id" is set for all columns.'),r.columns&&this.setID(r.columns)}},s.populatePlugins=function(e,n){for(var i,o=u(n);!(i=o()).done;){var s=i.value;void 0!==s.plugin&&e.plugin.add(r({id:s.id,props:{}},s.plugin,{position:t.PluginPosition.Cell}))}},o.fromColumns=function(t){for(var e,n=new o,r=u(t);!(e=r()).done;){var i=e.value;if("string"==typeof i||c(i))n.columns.push({name:i});else if("object"==typeof i){var s=i;s.columns&&(s.columns=o.fromColumns(s.columns).columns),"object"==typeof s.plugin&&void 0===s.data&&(s.data=null),n.columns.push(i)}}return n},o.fromUserConfig=function(t){var e=new o;return t.from?e.columns=o.fromHTMLTable(t.from).columns:t.columns?e.columns=o.fromColumns(t.columns).columns:!t.data||"object"!=typeof t.data[0]||t.data[0]instanceof Array||(e.columns=Object.keys(t.data[0]).map((function(t){return{name:t}}))),e.columns.length?(e.setID(),e.setSort(t),e.setFixedHeader(t),e.setResizable(t),e.populatePlugins(t,e.columns),e):null},o.fromHTMLTable=function(t){for(var e,n=new o,r=u(t.querySelector("thead").querySelectorAll("th"));!(e=r()).done;){var i=e.value;n.columns.push({name:i.innerHTML,width:i.width})}return n},o.tabularFormat=function(t){var e=[],n=t||[],r=[];if(n&&n.length){e.push(n);for(var i,o=u(n);!(i=o()).done;){var s=i.value;s.columns&&s.columns.length&&(r=r.concat(s.columns))}r.length&&(e=e.concat(this.tabularFormat(r)))}return e},o.leafColumns=function(t){var e=[],n=t||[];if(n&&n.length)for(var r,i=u(n);!(r=i()).done;){var o=r.value;o.columns&&0!==o.columns.length||e.push(o),o.columns&&(e=e.concat(this.leafColumns(o.columns)))}return e},o.maximumDepth=function(t){return this.tabularFormat([t]).length-1},n(o,[{key:"columns",get:function(){return this._columns},set:function(t){this._columns=t}},{key:"visibleColumns",get:function(){return this._columns.filter((function(t){return!t.hidden}))}}]),o}(B),Pt=function(){function t(){this._callbacks=void 0,this._isDispatching=void 0,this._isHandled=void 0,this._isPending=void 0,this._lastID=void 0,this._pendingPayload=void 0,this._callbacks={},this._isDispatching=!1,this._isHandled={},this._isPending={},this._lastID=1}var e=t.prototype;return e.register=function(t){var e="ID_"+this._lastID++;return this._callbacks[e]=t,e},e.unregister=function(t){if(!this._callbacks[t])throw Error("Dispatcher.unregister(...): "+t+" does not map to a registered callback.");delete this._callbacks[t]},e.waitFor=function(t){if(!this._isDispatching)throw Error("Dispatcher.waitFor(...): Must be invoked while dispatching.");for(var e=0;e<t.length;e++){var n=t[e];if(this._isPending[n]){if(!this._isHandled[n])throw Error("Dispatcher.waitFor(...): Circular dependency detected while ' +\n            'waiting for "+n+".")}else{if(!this._callbacks[n])throw Error("Dispatcher.waitFor(...): "+n+" does not map to a registered callback.");this._invokeCallback(n)}}},e.dispatch=function(t){if(this._isDispatching)throw Error("Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch.");this._startDispatching(t);try{for(var e in this._callbacks)this._isPending[e]||this._invokeCallback(e)}finally{this._stopDispatching()}},e.isDispatching=function(){return this._isDispatching},e._invokeCallback=function(t){this._isPending[t]=!0,this._callbacks[t](this._pendingPayload),this._isHandled[t]=!0},e._startDispatching=function(t){for(var e in this._callbacks)this._isPending[e]=!1,this._isHandled[e]=!1;this._pendingPayload=t,this._isDispatching=!0},e._stopDispatching=function(){delete this._pendingPayload,this._isDispatching=!1},t}(),kt=function(){},St=function(t){function e(e){var n;return(n=t.call(this)||this).data=void 0,n.set(e),n}i(e,t);var n=e.prototype;return n.get=function(){try{return Promise.resolve(this.data()).then((function(t){return{data:t,total:t.length}}))}catch(t){return Promise.reject(t)}},n.set=function(t){return t instanceof Array?this.data=function(){return t}:t instanceof Function&&(this.data=t),this},e}(kt),Ct=function(t){function e(e){var n;return(n=t.call(this)||this).options=void 0,n.options=e,n}i(e,t);var n=e.prototype;return n.handler=function(t){return"function"==typeof this.options.handle?this.options.handle(t):t.ok?t.json():(lt.error("Could not fetch data: "+t.status+" - "+t.statusText,!0),null)},n.get=function(t){var e=r({},this.options,t);return"function"==typeof e.data?e.data(e):fetch(e.url,e).then(this.handler.bind(this)).then((function(t){return{data:e.then(t),total:"function"==typeof e.total?e.total(t):void 0}}))},e}(kt),xt=function(){function t(){}return t.createFromUserConfig=function(t){var e=null;return t.data&&(e=new St(t.data)),t.from&&(e=new St(this.tableElementToArray(t.from)),t.from.style.display="none"),t.server&&(e=new Ct(t.server)),e||lt.error("Could not determine the storage type",!0),e},t.tableElementToArray=function(t){for(var e,n,r=[],i=u(t.querySelector("tbody").querySelectorAll("tr"));!(e=i()).done;){for(var o,s=[],a=u(e.value.querySelectorAll("td"));!(o=a()).done;){var l=o.value;1===l.childNodes.length&&l.childNodes[0].nodeType===Node.TEXT_NODE?s.push((n=l.innerHTML,(new DOMParser).parseFromString(n,"text/html").documentElement.textContent)):s.push($(l.innerHTML))}r.push(s)}return r},t}(),Nt="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Et(t,e,n){if(!t.s){if(n instanceof Ft){if(!n.s)return void(n.o=Et.bind(null,t,e));1&e&&(e=n.s),n=n.v}if(n&&n.then)return void n.then(Et.bind(null,t,e),Et.bind(null,t,2));t.s=e,t.v=n;var r=t.o;r&&r(t)}}var Ft=function(){function t(){}return t.prototype.then=function(e,n){var r=new t,i=this.s;if(i){var o=1&i?e:n;if(o){try{Et(r,1,o(this.v))}catch(t){Et(r,2,t)}return r}return this}return this.o=function(t){try{var i=t.v;1&t.s?Et(r,1,e?e(i):i):n?Et(r,1,n(i)):Et(r,2,i)}catch(t){Et(r,2,t)}},r},t}();function Tt(t){return t instanceof Ft&&1&t.s}var Dt,Rt=function(t){function e(e){var n;return(n=t.call(this)||this)._steps=new Map,n.cache=new Map,n.lastProcessorIndexUpdated=-1,e&&e.forEach((function(t){return n.register(t)})),n}i(e,t);var r=e.prototype;return r.clearCache=function(){this.cache=new Map,this.lastProcessorIndexUpdated=-1},r.register=function(t,e){if(void 0===e&&(e=null),null===t.type)throw Error("Processor type is not defined");t.on("propsUpdated",this.processorPropsUpdated.bind(this)),this.addProcessorByPriority(t,e),this.afterRegistered(t)},r.unregister=function(t){if(t){var e=this._steps.get(t.type);e&&e.length&&(this._steps.set(t.type,e.filter((function(e){return e!=t}))),this.emit("updated",t))}},r.addProcessorByPriority=function(t,e){var n=this._steps.get(t.type);if(!n){var r=[];this._steps.set(t.type,r),n=r}if(null===e||e<0)n.push(t);else if(n[e]){var i=n.slice(0,e-1),o=n.slice(e+1);this._steps.set(t.type,i.concat(t).concat(o))}else n[e]=t},r.getStepsByType=function(t){return this.steps.filter((function(e){return e.type===t}))},r.getSortedProcessorTypes=function(){return Object.keys(K).filter((function(t){return!isNaN(Number(t))})).map((function(t){return Number(t)}))},r.process=function(t){try{var e=this,n=function(t){return e.lastProcessorIndexUpdated=i.length,e.emit("afterProcess",o),o},r=e.lastProcessorIndexUpdated,i=e.steps,o=t,s=function(t,n){try{var s=function(t,e,n){if("function"==typeof t[Nt]){var r,i,o,s=t[Nt]();if(function t(n){try{for(;!(r=s.next()).done;)if((n=e(r.value))&&n.then){if(!Tt(n))return void n.then(t,o||(o=Et.bind(null,i=new Ft,2)));n=n.v}i?Et(i,1,n):i=n}catch(t){Et(i||(i=new Ft),2,t)}}(),s.return){var a=function(t){try{r.done||s.return()}catch(t){}return t};if(i&&i.then)return i.then(a,(function(t){throw a(t)}));a()}return i}if(!("length"in t))throw new TypeError("Object is not iterable");for(var u=[],l=0;l<t.length;l++)u.push(t[l]);return function(t,e,n){var r,i,o=-1;return function n(s){try{for(;++o<t.length;)if((s=e(o))&&s.then){if(!Tt(s))return void s.then(n,i||(i=Et.bind(null,r=new Ft,2)));s=s.v}r?Et(r,1,s):r=s}catch(t){Et(r||(r=new Ft),2,t)}}(),r}(u,(function(t){return e(u[t])}))}(i,(function(t){var n=e.findProcessorIndexByID(t.id),i=function(){if(n>=r)return Promise.resolve(t.process(o)).then((function(n){e.cache.set(t.id,o=n)}));o=e.cache.get(t.id)}();if(i&&i.then)return i.then((function(){}))}))}catch(t){return n(t)}return s&&s.then?s.then(void 0,n):s}(0,(function(t){throw lt.error(t),e.emit("error",o),t}));return Promise.resolve(s&&s.then?s.then(n):n())}catch(t){return Promise.reject(t)}},r.findProcessorIndexByID=function(t){return this.steps.findIndex((function(e){return e.id==t}))},r.setLastProcessorIndex=function(t){var e=this.findProcessorIndexByID(t.id);this.lastProcessorIndexUpdated>e&&(this.lastProcessorIndexUpdated=e)},r.processorPropsUpdated=function(t){this.setLastProcessorIndex(t),this.emit("propsUpdated"),this.emit("updated",t)},r.afterRegistered=function(t){this.setLastProcessorIndex(t),this.emit("afterRegister"),this.emit("updated",t)},n(e,[{key:"steps",get:function(){for(var t,e=[],n=u(this.getSortedProcessorTypes());!(t=n()).done;){var r=this._steps.get(t.value);r&&r.length&&(e=e.concat(r))}return e.filter((function(t){return t}))}}]),e}(J),Lt=function(t){function e(){return t.apply(this,arguments)||this}return i(e,t),e.prototype._process=function(t){try{return Promise.resolve(this.props.storage.get(t))}catch(t){return Promise.reject(t)}},n(e,[{key:"type",get:function(){return K.Extractor}}]),e}(Q),At=function(t){function e(){return t.apply(this,arguments)||this}return i(e,t),e.prototype._process=function(t){var e=Z.fromArray(t.data);return e.length=t.total,e},n(e,[{key:"type",get:function(){return K.Transformer}}]),e}(Q),It=function(t){function e(){return t.apply(this,arguments)||this}return i(e,t),e.prototype._process=function(){return Object.entries(this.props.serverStorageOptions).filter((function(t){return"function"!=typeof t[1]})).reduce((function(t,e){var n;return r({},t,((n={})[e[0]]=e[1],n))}),{})},n(e,[{key:"type",get:function(){return K.Initiator}}]),e}(Q),Ut=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var r=e.prototype;return r.castData=function(t){if(!t||!t.length)return[];if(!this.props.header||!this.props.header.columns)return t;var e=wt.leafColumns(this.props.header.columns);return t[0]instanceof Array?t.map((function(t){var n=0;return e.map((function(e,r){return void 0!==e.data?(n++,"function"==typeof e.data?e.data(t):e.data):t[r-n]}))})):"object"!=typeof t[0]||t[0]instanceof Array?[]:t.map((function(t){return e.map((function(e,n){return void 0!==e.data?"function"==typeof e.data?e.data(t):e.data:e.id?t[e.id]:(lt.error("Could not find the correct cell for column at position "+n+".\n                          Make sure either 'id' or 'selector' is defined for all columns."),null)}))}))},r._process=function(t){return{data:this.castData(t.data),total:t.total}},n(e,[{key:"type",get:function(){return K.Transformer}}]),e}(Q),Ht=function(){function t(){}return t.createFromConfig=function(t){var e=new Rt;return t.storage instanceof Ct&&e.register(new It({serverStorageOptions:t.server})),e.register(new Lt({storage:t.storage})),e.register(new Ut({header:t.header})),e.register(new At),e},t}(),Mt=function(){function e(t){this._userConfig=void 0,Object.assign(this,r({},e.defaultConfig(),t)),this._userConfig={}}var n=e.prototype;return n.assign=function(t){for(var e=0,n=Object.keys(t);e<n.length;e++){var r=n[e];"_userConfig"!==r&&(this[r]=t[r])}return this},n.update=function(t){return t?(this._userConfig=r({},this._userConfig,t),this.assign(e.fromUserConfig(this._userConfig)),this):this},e.defaultConfig=function(){return{plugin:new pt,dispatcher:new Pt,tableRef:{current:null},tempRef:{current:null},width:"100%",height:"auto",autoWidth:!0,style:{},className:{}}},e.fromUserConfig=function(n){var i=new e(n);return i._userConfig=n,"boolean"==typeof n.sort&&n.sort&&i.assign({sort:{multiColumn:!0}}),i.assign({header:wt.fromUserConfig(i)}),i.assign({storage:xt.createFromUserConfig(n)}),i.assign({pipeline:Ht.createFromConfig(i)}),i.assign({translator:new q(n.language)}),i.plugin.add({id:"search",position:t.PluginPosition.Header,component:ft,props:r({enabled:!0===n.search||n.search instanceof Object},n.search)}),i.plugin.add({id:"pagination",position:t.PluginPosition.Footer,component:mt,props:r({enabled:!0===n.pagination||n.pagination instanceof Object},n.pagination)}),n.plugins&&n.plugins.forEach((function(t){return i.plugin.add(t)})),i},e}();!function(t){t[t.Init=0]="Init",t[t.Loading=1]="Loading",t[t.Loaded=2]="Loaded",t[t.Rendered=3]="Rendered",t[t.Error=4]="Error"}(Dt||(Dt={}));var Ot,jt,Wt,Bt=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var n=e.prototype;return n.content=function(){return this.props.column&&"function"==typeof this.props.column.formatter?this.props.column.formatter(this.props.cell.data,this.props.row,this.props.column):this.props.column&&this.props.column.plugin?b(ht,{pluginId:this.props.column.id,props:{column:this.props.column,cell:this.props.cell,row:this.props.row}}):this.props.cell.data},n.handleClick=function(t){this.props.messageCell||this.config.eventEmitter.emit("cellClick",t,this.props.cell,this.props.column,this.props.row)},n.getCustomAttributes=function(t){return t?"function"==typeof t.attributes?t.attributes(this.props.cell.data,this.props.row,this.props.column):t.attributes:{}},n.render=function(){return b("td",r({role:this.props.role,colSpan:this.props.colSpan,"data-column-id":this.props.column&&this.props.column.id,className:nt(et("td"),this.props.className,this.config.className.td),style:r({},this.props.style,this.config.style.td),onClick:this.handleClick.bind(this)},this.getCustomAttributes(this.props.column)),this.content())},e}(G),zt=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var n=e.prototype;return n.getColumn=function(t){if(this.props.header){var e=wt.leafColumns(this.props.header.columns);if(e)return e[t]}return null},n.handleClick=function(t){this.props.messageRow||this.config.eventEmitter.emit("rowClick",t,this.props.row)},n.getChildren=function(){var t=this;return this.props.children?this.props.children:b(P,null,this.props.row.cells.map((function(e,n){var r=t.getColumn(n);return r&&r.hidden?null:b(Bt,{key:e.id,cell:e,row:t.props.row,column:r})})))},n.render=function(){return b("tr",{className:nt(et("tr"),this.config.className.tr),onClick:this.handleClick.bind(this)},this.getChildren())},e}(G),qt=function(t){function e(){return t.apply(this,arguments)||this}return i(e,t),e.prototype.render=function(){return b(zt,{messageRow:!0},b(Bt,{role:"alert",colSpan:this.props.colSpan,messageCell:!0,cell:new V(this.props.message),className:nt(et("message"),this.props.className?this.props.className:null)}))},e}(G),Gt=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var n=e.prototype;return n.headerLength=function(){return this.props.header?this.props.header.visibleColumns.length:0},n.render=function(){var t=this;return b("tbody",{className:nt(et("tbody"),this.config.className.tbody)},this.props.data&&this.props.data.rows.map((function(e){return b(zt,{key:e.id,row:e,header:t.props.header})})),this.props.status===Dt.Loading&&(!this.props.data||0===this.props.data.length)&&b(qt,{message:this._("loading"),colSpan:this.headerLength(),className:nt(et("loading"),this.config.className.loading)}),this.props.status===Dt.Rendered&&this.props.data&&0===this.props.data.length&&b(qt,{message:this._("noRecordsFound"),colSpan:this.headerLength(),className:nt(et("notfound"),this.config.className.notfound)}),this.props.status===Dt.Error&&b(qt,{message:this._("error"),colSpan:this.headerLength(),className:nt(et("error"),this.config.className.error)}))},e}(G),Xt=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var r=e.prototype;return r.validateProps=function(){for(var t,e=u(this.props.columns);!(t=e()).done;){var n=t.value;void 0===n.direction&&(n.direction=1),1!==n.direction&&-1!==n.direction&&lt.error("Invalid sort direction "+n.direction)}},r.compare=function(t,e){return t>e?1:t<e?-1:0},r.compareWrapper=function(t,e){for(var n,r=0,i=u(this.props.columns);!(n=i()).done;){var o=n.value;if(0!==r)break;var s=t.cells[o.index].data,a=e.cells[o.index].data;r|="function"==typeof o.compare?o.compare(s,a)*o.direction:this.compare(s,a)*o.direction}return r},r._process=function(t){var e=[].concat(t.rows);e.sort(this.compareWrapper.bind(this));var n=new Z(e);return n.length=t.length,n},n(e,[{key:"type",get:function(){return K.Sort}}]),e}(Q),$t=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var n=e.prototype;return n.getInitialState=function(){return[]},n.handle=function(t,e){"SORT_COLUMN"===t?this.sortColumn(e.index,e.direction,e.multi,e.compare):"SORT_COLUMN_TOGGLE"===t&&this.sortToggle(e.index,e.multi,e.compare)},n.sortToggle=function(t,e,n){var r=[].concat(this.state).find((function(e){return e.index===t}));this.sortColumn(t,r&&1===r.direction?-1:1,e,n)},n.sortColumn=function(t,e,n,r){var i=[].concat(this.state),o=i.length,s=i.find((function(e){return e.index===t})),a=!1,u=!1,l=!1,c=!1;if(void 0!==s?n?-1===s.direction?l=!0:c=!0:1===o?c=!0:o>1&&(u=!0,a=!0):0===o?a=!0:o>0&&!n?(a=!0,u=!0):o>0&&n&&(a=!0),u&&(i=[]),a)i.push({index:t,direction:e,compare:r});else if(c){var p=i.indexOf(s);i[p].direction=e}else if(l){var h=i.indexOf(s);i.splice(h,1)}this.setState(i)},e}(it),Kt=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var n=e.prototype;return n.sortColumn=function(t,e,n,r){this.dispatch("SORT_COLUMN",{index:t,direction:e,multi:n,compare:r})},n.sortToggle=function(t,e,n){this.dispatch("SORT_COLUMN_TOGGLE",{index:t,multi:e,compare:n})},e}(st),Vt=function(t){function e(){return t.apply(this,arguments)||this}return i(e,t),e.prototype._process=function(t){var e={};return this.props.url&&(e.url=this.props.url(t.url,this.props.columns)),this.props.body&&(e.body=this.props.body(t.body,this.props.columns)),r({},t,e)},n(e,[{key:"type",get:function(){return K.ServerSort}}]),e}(Q),Yt=function(t){function e(e,n){var r;return(r=t.call(this,e,n)||this).sortProcessor=void 0,r.actions=void 0,r.store=void 0,r.updateStateFn=void 0,r.updateSortProcessorFn=void 0,r.actions=new Kt(r.config.dispatcher),r.store=new $t(r.config.dispatcher),e.enabled&&(r.sortProcessor=r.getOrCreateSortProcessor(),r.updateStateFn=r.updateState.bind(s(r)),r.store.on("updated",r.updateStateFn),r.state={direction:0}),r}i(e,t);var n=e.prototype;return n.componentWillUnmount=function(){this.config.pipeline.unregister(this.sortProcessor),this.store.off("updated",this.updateStateFn),this.updateSortProcessorFn&&this.store.off("updated",this.updateSortProcessorFn)},n.updateState=function(){var t=this,e=this.store.state.find((function(e){return e.index===t.props.index}));this.setState(e?{direction:e.direction}:{direction:0})},n.updateSortProcessor=function(t){this.sortProcessor.setProps({columns:t})},n.getOrCreateSortProcessor=function(){var t=K.Sort;this.config.sort&&"object"==typeof this.config.sort.server&&(t=K.ServerSort);var e,n=this.config.pipeline.getStepsByType(t);return n.length>0?e=n[0]:(this.updateSortProcessorFn=this.updateSortProcessor.bind(this),this.store.on("updated",this.updateSortProcessorFn),e=t===K.ServerSort?new Vt(r({columns:this.store.state},this.config.sort.server)):new Xt({columns:this.store.state}),this.config.pipeline.register(e)),e},n.changeDirection=function(t){t.preventDefault(),t.stopPropagation(),this.actions.sortToggle(this.props.index,!0===t.shiftKey&&this.config.sort.multiColumn,this.props.compare)},n.render=function(){if(!this.props.enabled)return null;var t=this.state.direction,e="neutral";return 1===t?e="asc":-1===t&&(e="desc"),b("button",{tabIndex:-1,"aria-label":this._("sort.sort"+(1===t?"Desc":"Asc")),title:this._("sort.sort"+(1===t?"Desc":"Asc")),className:nt(et("sort"),et("sort",e),this.config.className.sort),onClick:this.changeDirection.bind(this)})},e}(G),Zt=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).moveFn=void 0,e.upFn=void 0,e}i(e,t);var n=e.prototype;return n.getPageX=function(t){return t instanceof MouseEvent?Math.floor(t.pageX):Math.floor(t.changedTouches[0].pageX)},n.start=function(t){var e,n,r,i,o;t.stopPropagation(),this.setState({offsetStart:parseInt(this.props.thRef.current.style.width,10)-this.getPageX(t)}),this.upFn=this.end.bind(this),this.moveFn=(e=this.move.bind(this),void 0===(n=10)&&(n=100),function(){var t=[].slice.call(arguments);r?(clearTimeout(i),i=setTimeout((function(){Date.now()-o>=n&&(e.apply(void 0,t),o=Date.now())}),Math.max(n-(Date.now()-o),0))):(e.apply(void 0,t),o=Date.now(),r=!0)}),document.addEventListener("mouseup",this.upFn),document.addEventListener("touchend",this.upFn),document.addEventListener("mousemove",this.moveFn),document.addEventListener("touchmove",this.moveFn)},n.move=function(t){t.stopPropagation();var e=this.props.thRef.current;this.state.offsetStart+this.getPageX(t)>=parseInt(e.style.minWidth,10)&&(e.style.width=this.state.offsetStart+this.getPageX(t)+"px")},n.end=function(t){t.stopPropagation(),document.removeEventListener("mouseup",this.upFn),document.removeEventListener("mousemove",this.moveFn),document.removeEventListener("touchmove",this.moveFn),document.removeEventListener("touchend",this.upFn)},n.render=function(){return b("div",{className:nt(et("th"),et("resizable")),onMouseDown:this.start.bind(this),onTouchStart:this.start.bind(this),onClick:function(t){return t.stopPropagation()}})},e}(G),Jt=function(t){function e(e,n){var r;return(r=t.call(this,e,n)||this).sortRef={current:null},r.thRef={current:null},r.state={style:{}},r}i(e,t);var n=e.prototype;return n.isSortable=function(){return this.props.column.sort.enabled},n.isResizable=function(){return this.props.column.resizable},n.onClick=function(t){t.stopPropagation(),this.isSortable()&&this.sortRef.current.changeDirection(t)},n.keyDown=function(t){this.isSortable()&&13===t.which&&this.onClick(t)},n.componentDidMount=function(){var t=this;setTimeout((function(){if(t.props.column.fixedHeader&&t.thRef.current){var e=t.thRef.current.offsetTop;"number"==typeof e&&t.setState({style:{top:e}})}}),0)},n.content=function(){return void 0!==this.props.column.name?this.props.column.name:void 0!==this.props.column.plugin?b(ht,{pluginId:this.props.column.plugin.id,props:{column:this.props.column}}):null},n.getCustomAttributes=function(){var t=this.props.column;return t?"function"==typeof t.attributes?t.attributes(null,null,this.props.column):t.attributes:{}},n.render=function(){var t={};return this.isSortable()&&(t.tabIndex=0),b("th",r({ref:this.thRef,"data-column-id":this.props.column&&this.props.column.id,className:nt(et("th"),this.isSortable()?et("th","sort"):null,this.props.column.fixedHeader?et("th","fixed"):null,this.config.className.th),onClick:this.onClick.bind(this),style:r({},this.config.style.th,{minWidth:this.props.column.minWidth,width:this.props.column.width},this.state.style,this.props.style),onKeyDown:this.keyDown.bind(this),rowSpan:this.props.rowSpan>1?this.props.rowSpan:void 0,colSpan:this.props.colSpan>1?this.props.colSpan:void 0},this.getCustomAttributes(),t),b("div",{className:et("th","content")},this.content()),this.isSortable()&&b(Yt,r({ref:this.sortRef,index:this.props.index},this.props.column.sort)),this.isResizable()&&this.props.index<this.config.header.visibleColumns.length-1&&b(Zt,{column:this.props.column,thRef:this.thRef}))},e}(G),Qt=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var n=e.prototype;return n.renderColumn=function(t,e,n,r){var i=function(t,e,n){var r=wt.maximumDepth(t),i=n-e;return{rowSpan:Math.floor(i-r-r/i),colSpan:t.columns&&t.columns.length||1}}(t,e,r);return b(Jt,{column:t,index:n,colSpan:i.colSpan,rowSpan:i.rowSpan})},n.renderRow=function(t,e,n){var r=this,i=wt.leafColumns(this.props.header.columns);return b(zt,null,t.map((function(t){return t.hidden?null:r.renderColumn(t,e,i.indexOf(t),n)})))},n.renderRows=function(){var t=this,e=wt.tabularFormat(this.props.header.columns);return e.map((function(n,r){return t.renderRow(n,r,e.length)}))},n.render=function(){return this.props.header?b("thead",{key:this.props.header.id,className:nt(et("thead"),this.config.className.thead)},this.renderRows()):null},e}(G),te=function(t){function e(){return t.apply(this,arguments)||this}return i(e,t),e.prototype.render=function(){return b("table",{role:"grid",className:nt(et("table"),this.config.className.table),style:r({},this.config.style.table,{height:this.props.height})},b(Qt,{header:this.props.header}),b(Gt,{data:this.props.data,status:this.props.status,header:this.props.header}))},e}(G),ee=function(e){function n(t,n){var r;return(r=e.call(this,t,n)||this).headerRef={current:null},r.state={isActive:!0},r}i(n,e);var o=n.prototype;return o.componentDidMount=function(){0===this.headerRef.current.children.length&&this.setState({isActive:!1})},o.render=function(){return this.state.isActive?b("div",{ref:this.headerRef,className:nt(et("head"),this.config.className.header),style:r({},this.config.style.header)},b(ht,{position:t.PluginPosition.Header})):null},n}(G),ne=function(e){function n(t,n){var r;return(r=e.call(this,t,n)||this).footerRef={current:null},r.state={isActive:!0},r}i(n,e);var o=n.prototype;return o.componentDidMount=function(){0===this.footerRef.current.children.length&&this.setState({isActive:!1})},o.render=function(){return this.state.isActive?b("div",{ref:this.footerRef,className:nt(et("footer"),this.config.className.footer),style:r({},this.config.style.footer)},b(ht,{position:t.PluginPosition.Footer})):null},n}(G),re=function(t){function e(e,n){var r;return(r=t.call(this,e,n)||this).configContext=void 0,r.processPipelineFn=void 0,r.configContext=function(t,e){var n={__c:e="__cC"+d++,__:null,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,r;return this.getChildContext||(n=[],(r={})[e]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some(x)},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}(),r.state={status:Dt.Loading,header:e.header,data:null},r}i(e,t);var n=e.prototype;return n.processPipeline=function(){try{var t=this;t.props.config.eventEmitter.emit("beforeLoad"),t.setState({status:Dt.Loading});var e=function(e,n){try{var r=Promise.resolve(t.props.pipeline.process()).then((function(e){t.setState({data:e,status:Dt.Loaded}),t.props.config.eventEmitter.emit("load",e)}))}catch(t){return n(t)}return r&&r.then?r.then(void 0,n):r}(0,(function(e){lt.error(e),t.setState({status:Dt.Error,data:null})}));return Promise.resolve(e&&e.then?e.then((function(){})):void 0)}catch(t){return Promise.reject(t)}},n.componentDidMount=function(){try{var t=this,e=t.props.config;return Promise.resolve(t.processPipeline()).then((function(){e.header&&t.state.data&&t.state.data.length&&t.setState({header:e.header.adjustWidth(e)}),t.processPipelineFn=t.processPipeline.bind(t),t.props.pipeline.on("updated",t.processPipelineFn)}))}catch(t){return Promise.reject(t)}},n.componentWillUnmount=function(){this.props.pipeline.off("updated",this.processPipelineFn)},n.componentDidUpdate=function(t,e){e.status!=Dt.Rendered&&this.state.status==Dt.Loaded&&(this.setState({status:Dt.Rendered}),this.props.config.eventEmitter.emit("ready"))},n.render=function(){return b(this.configContext.Provider,{value:this.props.config},b("div",{role:"complementary",className:nt("gridjs",et("container"),this.state.status===Dt.Loading?et("loading"):null,this.props.config.className.container),style:r({},this.props.config.style.container,{width:this.props.width})},this.state.status===Dt.Loading&&b("div",{className:et("loading-bar")}),b(ee,null),b("div",{className:et("wrapper"),style:{height:this.props.height}},b(te,{ref:this.props.config.tableRef,data:this.state.data,header:this.state.header,width:this.props.width,height:this.props.height,status:this.state.status})),b(ne,null),b("div",{ref:this.props.config.tempRef,id:"gridjs-temp",className:et("temp")})))},e}(G),ie=function(t){function e(e){var n;return(n=t.call(this)||this).config=void 0,n.plugin=void 0,n.config=new Mt({instance:s(n),eventEmitter:s(n)}).update(e),n.plugin=n.config.plugin,n}i(e,t);var n=e.prototype;return n.updateConfig=function(t){return this.config.update(t),this},n.createElement=function(){return b(re,{config:this.config,pipeline:this.config.pipeline,header:this.config.header,width:this.config.width,height:this.config.height})},n.forceRender=function(){return this.config&&this.config.container||lt.error("Container is empty. Make sure you call render() before forceRender()",!0),this.config.pipeline.clearCache(),j(null,this.config.container),j(this.createElement(),this.config.container),this},n.render=function(t){return t||lt.error("Container element cannot be null",!0),t.childNodes.length>0?(lt.error("The container element "+t+" is not empty. Make sure the container is empty and call render() again"),this):(this.config.container=t,j(this.createElement(),t),this)},e}(J),oe=0,se=[],ae=l.__b,ue=l.__r,le=l.diffed,ce=l.__c,pe=l.unmount;function he(t,e){l.__h&&l.__h(jt,t,oe||e),oe=0;var n=jt.__H||(jt.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function fe(){se.forEach((function(t){if(t.__P)try{t.__H.__h.forEach(_e),t.__H.__h.forEach(me),t.__H.__h=[]}catch(e){t.__H.__h=[],l.__e(e,t.__v)}})),se=[]}l.__b=function(t){jt=null,ae&&ae(t)},l.__r=function(t){ue&&ue(t),Ot=0;var e=(jt=t.__c).__H;e&&(e.__h.forEach(_e),e.__h.forEach(me),e.__h=[])},l.diffed=function(t){le&&le(t);var e=t.__c;e&&e.__H&&e.__H.__h.length&&(1!==se.push(e)&&Wt===l.requestAnimationFrame||((Wt=l.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(r),de&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);de&&(e=requestAnimationFrame(n))})(fe)),jt=void 0},l.__c=function(t,e){e.some((function(t){try{t.__h.forEach(_e),t.__h=t.__h.filter((function(t){return!t.__||me(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],l.__e(n,t.__v)}})),ce&&ce(t,e)},l.unmount=function(t){pe&&pe(t);var e=t.__c;if(e&&e.__H)try{e.__H.__.forEach(_e)}catch(t){l.__e(t,e.__v)}};var de="function"==typeof requestAnimationFrame;function _e(t){var e=jt;"function"==typeof t.__c&&t.__c(),jt=e}function me(t){var e=jt;t.__c=t.__(),jt=e}function ge(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}t.BaseActions=st,t.BaseComponent=G,t.BaseStore=it,t.Cell=V,t.Component=k,t.Config=Mt,t.Dispatcher=Pt,t.Grid=ie,t.PluginBaseComponent=ct,t.Row=Y,t.className=et,t.createElement=b,t.createRef=function(){return{current:null}},t.h=b,t.html=$,t.useEffect=function(t,e){var n=he(Ot++,3);!l.__s&&ge(n.__H,e)&&(n.__=t,n.__H=e,jt.__H.__h.push(n))},t.useRef=function(t){return oe=5,function(t,e){var n=he(Ot++,7);return ge(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}((function(){return{current:t}}),[])}}));