@nebula.js/sn-histogram 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/sn-histogram v1.0.0
2
+ * @nebula.js/sn-histogram v1.0.1
3
3
  * Copyright (c) 2025 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -14,18 +14,16 @@
14
14
  * https://jquery.org/license
15
15
  *
16
16
  * Date: 2023-08-28T13:37Z
17
- */var s=(r||(r=1,function(e){!function(t,n){e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}}("undefined"!=typeof window?window:o,(function(e,t){var n=[],r=Object.getPrototypeOf,i=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},s=n.push,a=n.indexOf,l={},c=l.toString,u=l.hasOwnProperty,h=u.toString,d=h.call(Object),f={},p=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},g=function(e){return null!=e&&e===e.window},m=e.document,y={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||m).createElement("script");if(o.text=e,t)for(r in y)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function v(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var x="3.7.1",w=/HTML$/i,k=function(e,t){return new k.fn.init(e,t)};function M(e){var t=!!e&&"length"in e&&e.length,n=v(e);return!p(e)&&!g(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function _(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}k.fn=k.prototype={jquery:x,constructor:k,length:0,toArray:function(){return i.call(this)},get:function(e){return null==e?i.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=k.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return k.each(this,e)},map:function(e){return this.pushStack(k.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(k.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(k.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},k.extend=k.fn.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},a=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[a]||{},a++),"object"==typeof s||p(s)||(s={}),a===l&&(s=this,a--);a<l;a++)if(null!=(e=arguments[a]))for(t in e)r=e[t],"__proto__"!==t&&s!==r&&(c&&r&&(k.isPlainObject(r)||(i=Array.isArray(r)))?(n=s[t],o=i&&!Array.isArray(n)?[]:i||k.isPlainObject(n)?n:{},i=!1,s[t]=k.extend(c,o,r)):void 0!==r&&(s[t]=r));return s},k.extend({expando:"jQuery"+(x+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e)||(t=r(e))&&("function"!=typeof(n=u.call(t,"constructor")&&t.constructor)||h.call(n)!==d))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(M(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)for(;t=e[r++];)n+=k.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?k.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:a.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!w.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,s=!n;i<o;i++)!t(e[i],i)!==s&&r.push(e[i]);return r},map:function(e,t,n){var r,i,s=0,a=[];if(M(e))for(r=e.length;s<r;s++)null!=(i=t(e[s],s,n))&&a.push(i);else for(s in e)null!=(i=t(e[s],s,n))&&a.push(i);return o(a)},guid:1,support:f}),"function"==typeof Symbol&&(k.fn[Symbol.iterator]=n[Symbol.iterator]),k.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){l["[object "+t+"]"]=t.toLowerCase()}));var S=n.pop,q=n.sort,D=n.splice,C="[\\x20\\t\\r\\n\\f]",E=new RegExp("^"+C+"+|((?:^|[^\\\\])(?:\\\\.)*)"+C+"+$","g");k.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var A=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function T(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}k.escapeSelector=function(e){return(e+"").replace(A,T)};var N=m,R=s;!function(){var t,r,o,s,l,c,h,d,p,g,m=R,y=k.expando,b=0,v=0,x=ee(),w=ee(),M=ee(),A=ee(),T=function(e,t){return e===t&&(l=!0),0},O="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",I="(?:\\\\[\\da-fA-F]{1,6}"+C+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",P="\\["+C+"*("+I+")(?:"+C+"*([*^$|!~]?=)"+C+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+C+"*\\]",L=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",j=new RegExp(C+"+","g"),z=new RegExp("^"+C+"*,"+C+"*"),F=new RegExp("^"+C+"*([>+~]|"+C+")"+C+"*"),H=new RegExp(C+"|>"),B=new RegExp(L),V=new RegExp("^"+I+"$"),$={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+L),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+C+"*(even|odd|(([+-]|)(\\d*)n|)"+C+"*(?:([+-]|)"+C+"*(\\d+)|))"+C+"*\\)|)","i"),bool:new RegExp("^(?:"+O+")$","i"),needsContext:new RegExp("^"+C+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+C+"*((?:-\\d)?\\d*)"+C+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,U=/^h\d$/i,Y=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,X=new RegExp("\\\\[\\da-fA-F]{1,6}"+C+"?|\\\\([^\\r\\n\\f])","g"),G=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},J=function(){le()},Z=de((function(e){return!0===e.disabled&&_(e,"fieldset")}),{dir:"parentNode",next:"legend"});try{m.apply(n=i.call(N.childNodes),N.childNodes),n[N.childNodes.length].nodeType}catch(e){m={apply:function(e,t){R.apply(e,i.call(t))},call:function(e){R.apply(e,i.call(arguments,1))}}}function Q(e,t,n,r){var i,o,s,a,l,u,h,g=t&&t.ownerDocument,b=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==b&&9!==b&&11!==b)return n;if(!r&&(le(t),t=t||c,d)){if(11!==b&&(l=Y.exec(e)))if(i=l[1]){if(9===b){if(!(s=t.getElementById(i)))return n;if(s.id===i)return m.call(n,s),n}else if(g&&(s=g.getElementById(i))&&Q.contains(t,s)&&s.id===i)return m.call(n,s),n}else{if(l[2])return m.apply(n,t.getElementsByTagName(e)),n;if((i=l[3])&&t.getElementsByClassName)return m.apply(n,t.getElementsByClassName(i)),n}if(!(A[e+" "]||p&&p.test(e))){if(h=e,g=t,1===b&&(H.test(e)||F.test(e))){for((g=K.test(e)&&ae(t.parentNode)||t)==t&&f.scope||((a=t.getAttribute("id"))?a=k.escapeSelector(a):t.setAttribute("id",a=y)),o=(u=ue(e)).length;o--;)u[o]=(a?"#"+a:":scope")+" "+he(u[o]);h=u.join(",")}try{return m.apply(n,g.querySelectorAll(h)),n}catch(t){A(e,!0)}finally{a===y&&t.removeAttribute("id")}}}return be(e.replace(E,"$1"),t,n,r)}function ee(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function te(e){return e[y]=!0,e}function ne(e){var t=c.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function re(e){return function(t){return _(t,"input")&&t.type===e}}function ie(e){return function(t){return(_(t,"input")||_(t,"button"))&&t.type===e}}function oe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Z(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function se(e){return te((function(t){return t=+t,te((function(n,r){for(var i,o=e([],n.length,t),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))}))}))}function ae(e){return e&&void 0!==e.getElementsByTagName&&e}function le(e){var t,n=e?e.ownerDocument||e:N;return n!=c&&9===n.nodeType&&n.documentElement?(h=(c=n).documentElement,d=!k.isXMLDoc(c),g=h.matches||h.webkitMatchesSelector||h.msMatchesSelector,h.msMatchesSelector&&N!=c&&(t=c.defaultView)&&t.top!==t&&t.addEventListener("unload",J),f.getById=ne((function(e){return h.appendChild(e).id=k.expando,!c.getElementsByName||!c.getElementsByName(k.expando).length})),f.disconnectedMatch=ne((function(e){return g.call(e,"*")})),f.scope=ne((function(){return c.querySelectorAll(":scope")})),f.cssHas=ne((function(){try{return c.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}})),f.getById?(r.filter.ID=function(e){var t=e.replace(X,G);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(X,G);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},r.find.CLASS=function(e,t){if(void 0!==t.getElementsByClassName&&d)return t.getElementsByClassName(e)},p=[],ne((function(e){var t;h.appendChild(e).innerHTML="<a id='"+y+"' href='' disabled='disabled'></a><select id='"+y+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||p.push("\\["+C+"*(?:value|"+O+")"),e.querySelectorAll("[id~="+y+"-]").length||p.push("~="),e.querySelectorAll("a#"+y+"+*").length||p.push(".#.+[+~]"),e.querySelectorAll(":checked").length||p.push(":checked"),(t=c.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&p.push(":enabled",":disabled"),(t=c.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||p.push("\\["+C+"*name"+C+"*="+C+"*(?:''|\"\")")})),f.cssHas||p.push(":has"),p=p.length&&new RegExp(p.join("|")),T=function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!f.sortDetached&&t.compareDocumentPosition(e)===n?e===c||e.ownerDocument==N&&Q.contains(N,e)?-1:t===c||t.ownerDocument==N&&Q.contains(N,t)?1:s?a.call(s,e)-a.call(s,t):0:4&n?-1:1)},c):c}for(t in Q.matches=function(e,t){return Q(e,null,null,t)},Q.matchesSelector=function(e,t){if(le(e),d&&!A[t+" "]&&(!p||!p.test(t)))try{var n=g.call(e,t);if(n||f.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return Q(t,c,null,[e]).length>0},Q.contains=function(e,t){return(e.ownerDocument||e)!=c&&le(e),k.contains(e,t)},Q.attr=function(e,t){(e.ownerDocument||e)!=c&&le(e);var n=r.attrHandle[t.toLowerCase()],i=n&&u.call(r.attrHandle,t.toLowerCase())?n(e,t,!d):void 0;return void 0!==i?i:e.getAttribute(t)},Q.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},k.uniqueSort=function(e){var t,n=[],r=0,o=0;if(l=!f.sortStable,s=!f.sortStable&&i.call(e,0),q.call(e,T),l){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)D.call(e,n[r],1)}return s=null,e},k.fn.uniqueSort=function(){return this.pushStack(k.uniqueSort(i.apply(this)))},r=k.expr={cacheLength:50,createPseudo:te,match:$,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(X,G),e[3]=(e[3]||e[4]||e[5]||"").replace(X,G),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||Q.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&Q.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return $.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&B.test(n)&&(t=ue(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(X,G).toLowerCase();return"*"===e?function(){return!0}:function(e){return _(e,t)}},CLASS:function(e){var t=x[e+" "];return t||(t=new RegExp("(^|"+C+")"+e+"("+C+"|$)"))&&x(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=Q.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(j," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,h,d,f,p=o!==s?"nextSibling":"previousSibling",g=t.parentNode,m=a&&t.nodeName.toLowerCase(),v=!l&&!a,x=!1;if(g){if(o){for(;p;){for(h=t;h=h[p];)if(a?_(h,m):1===h.nodeType)return!1;f=p="only"===e&&!f&&"nextSibling"}return!0}if(f=[s?g.firstChild:g.lastChild],s&&v){for(x=(d=(c=(u=g[y]||(g[y]={}))[e]||[])[0]===b&&c[1])&&c[2],h=d&&g.childNodes[d];h=++d&&h&&h[p]||(x=d=0)||f.pop();)if(1===h.nodeType&&++x&&h===t){u[e]=[b,d,x];break}}else if(v&&(x=d=(c=(u=t[y]||(t[y]={}))[e]||[])[0]===b&&c[1]),!1===x)for(;(h=++d&&h&&h[p]||(x=d=0)||f.pop())&&(!(a?_(h,m):1===h.nodeType)||!++x||(v&&((u=h[y]||(h[y]={}))[e]=[b,x]),h!==t)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||Q.error("unsupported pseudo: "+e);return i[y]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?te((function(e,n){for(var r,o=i(e,t),s=o.length;s--;)e[r=a.call(e,o[s])]=!(n[r]=o[s])})):function(e){return i(e,0,n)}):i}},pseudos:{not:te((function(e){var t=[],n=[],r=ye(e.replace(E,"$1"));return r[y]?te((function(e,t,n,i){for(var o,s=r(e,null,i,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}})),has:te((function(e){return function(t){return Q(e,t).length>0}})),contains:te((function(e){return e=e.replace(X,G),function(t){return(t.textContent||k.text(t)).indexOf(e)>-1}})),lang:te((function(e){return V.test(e||"")||Q.error("unsupported lang: "+e),e=e.replace(X,G).toLowerCase(),function(t){var n;do{if(n=d?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===function(){try{return c.activeElement}catch(e){}}()&&c.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:oe(!1),disabled:oe(!0),checked:function(e){return _(e,"input")&&!!e.checked||_(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return U.test(e.nodeName)},input:function(e){return W.test(e.nodeName)},button:function(e){return _(e,"input")&&"button"===e.type||_(e,"button")},text:function(e){var t;return _(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:se((function(){return[0]})),last:se((function(e,t){return[t-1]})),eq:se((function(e,t,n){return[n<0?n+t:n]})),even:se((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:se((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:se((function(e,t,n){var r;for(r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e})),gt:se((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}},r.pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=re(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=ie(t);function ce(){}function ue(e,t){var n,i,o,s,a,l,c,u=w[e+" "];if(u)return t?0:u.slice(0);for(a=e,l=[],c=r.preFilter;a;){for(s in n&&!(i=z.exec(a))||(i&&(a=a.slice(i[0].length)||a),l.push(o=[])),n=!1,(i=F.exec(a))&&(n=i.shift(),o.push({value:n,type:i[0].replace(E," ")}),a=a.slice(n.length)),r.filter)!(i=$[s].exec(a))||c[s]&&!(i=c[s](i))||(n=i.shift(),o.push({value:n,type:s,matches:i}),a=a.slice(n.length));if(!n)break}return t?a.length:a?Q.error(e):w(e,l).slice(0)}function he(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function de(e,t,n){var r=t.dir,i=t.next,o=i||r,s=n&&"parentNode"===o,a=v++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||s)return e(t,n,i);return!1}:function(t,n,l){var c,u,h=[b,a];if(l){for(;t=t[r];)if((1===t.nodeType||s)&&e(t,n,l))return!0}else for(;t=t[r];)if(1===t.nodeType||s)if(u=t[y]||(t[y]={}),i&&_(t,i))t=t[r]||t;else{if((c=u[o])&&c[0]===b&&c[1]===a)return h[2]=c[2];if(u[o]=h,h[2]=e(t,n,l))return!0}return!1}}function fe(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function pe(e,t,n,r,i){for(var o,s=[],a=0,l=e.length,c=null!=t;a<l;a++)(o=e[a])&&(n&&!n(o,r,i)||(s.push(o),c&&t.push(a)));return s}function ge(e,t,n,r,i,o){return r&&!r[y]&&(r=ge(r)),i&&!i[y]&&(i=ge(i,o)),te((function(o,s,l,c){var u,h,d,f,p=[],g=[],y=s.length,b=o||function(e,t,n){for(var r=0,i=t.length;r<i;r++)Q(e,t[r],n);return n}(t||"*",l.nodeType?[l]:l,[]),v=!e||!o&&t?b:pe(b,p,e,l,c);if(n?n(v,f=i||(o?e:y||r)?[]:s,l,c):f=v,r)for(u=pe(f,g),r(u,[],l,c),h=u.length;h--;)(d=u[h])&&(f[g[h]]=!(v[g[h]]=d));if(o){if(i||e){if(i){for(u=[],h=f.length;h--;)(d=f[h])&&u.push(v[h]=d);i(null,f=[],u,c)}for(h=f.length;h--;)(d=f[h])&&(u=i?a.call(o,d):p[h])>-1&&(o[u]=!(s[u]=d))}}else f=pe(f===s?f.splice(y,f.length):f),i?i(null,s,f,c):m.apply(s,f)}))}function me(e){for(var t,n,i,s=e.length,l=r.relative[e[0].type],c=l||r.relative[" "],u=l?1:0,h=de((function(e){return e===t}),c,!0),d=de((function(e){return a.call(t,e)>-1}),c,!0),f=[function(e,n,r){var i=!l&&(r||n!=o)||((t=n).nodeType?h(e,n,r):d(e,n,r));return t=null,i}];u<s;u++)if(n=r.relative[e[u].type])f=[de(fe(f),n)];else{if((n=r.filter[e[u].type].apply(null,e[u].matches))[y]){for(i=++u;i<s&&!r.relative[e[i].type];i++);return ge(u>1&&fe(f),u>1&&he(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(E,"$1"),n,u<i&&me(e.slice(u,i)),i<s&&me(e=e.slice(i)),i<s&&he(e))}f.push(n)}return fe(f)}function ye(e,t){var n,i=[],s=[],a=M[e+" "];if(!a){for(t||(t=ue(e)),n=t.length;n--;)(a=me(t[n]))[y]?i.push(a):s.push(a);a=M(e,function(e,t){var n=t.length>0,i=e.length>0,s=function(s,a,l,u,h){var f,p,g,y=0,v="0",x=s&&[],w=[],M=o,_=s||i&&r.find.TAG("*",h),q=b+=null==M?1:Math.random()||.1,D=_.length;for(h&&(o=a==c||a||h);v!==D&&null!=(f=_[v]);v++){if(i&&f){for(p=0,a||f.ownerDocument==c||(le(f),l=!d);g=e[p++];)if(g(f,a||c,l)){m.call(u,f);break}h&&(b=q)}n&&((f=!g&&f)&&y--,s&&x.push(f))}if(y+=v,n&&v!==y){for(p=0;g=t[p++];)g(x,w,a,l);if(s){if(y>0)for(;v--;)x[v]||w[v]||(w[v]=S.call(u));w=pe(w)}m.apply(u,w),h&&!s&&w.length>0&&y+t.length>1&&k.uniqueSort(u)}return h&&(b=q,o=M),x};return n?te(s):s}(s,i)),a.selector=e}return a}function be(e,t,n,i){var o,s,a,l,c,u="function"==typeof e&&e,h=!i&&ue(e=u.selector||e);if(n=n||[],1===h.length){if((s=h[0]=h[0].slice(0)).length>2&&"ID"===(a=s[0]).type&&9===t.nodeType&&d&&r.relative[s[1].type]){if(!(t=(r.find.ID(a.matches[0].replace(X,G),t)||[])[0]))return n;u&&(t=t.parentNode),e=e.slice(s.shift().value.length)}for(o=$.needsContext.test(e)?0:s.length;o--&&(a=s[o],!r.relative[l=a.type]);)if((c=r.find[l])&&(i=c(a.matches[0].replace(X,G),K.test(s[0].type)&&ae(t.parentNode)||t))){if(s.splice(o,1),!(e=i.length&&he(s)))return m.apply(n,i),n;break}}return(u||ye(e,h))(i,t,!d,n,!t||K.test(e)&&ae(t.parentNode)||t),n}ce.prototype=r.filters=r.pseudos,r.setFilters=new ce,f.sortStable=y.split("").sort(T).join("")===y,le(),f.sortDetached=ne((function(e){return 1&e.compareDocumentPosition(c.createElement("fieldset"))})),k.find=Q,k.expr[":"]=k.expr.pseudos,k.unique=k.uniqueSort,Q.compile=ye,Q.select=be,Q.setDocument=le,Q.tokenize=ue,Q.escape=k.escapeSelector,Q.getText=k.text,Q.isXML=k.isXMLDoc,Q.selectors=k.expr,Q.support=k.support,Q.uniqueSort=k.uniqueSort}();var O=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&k(e).is(n))break;r.push(e)}return r},I=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},P=k.expr.match.needsContext,L=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return p(t)?k.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?k.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?k.grep(e,(function(e){return a.call(t,e)>-1!==n})):k.filter(t,e,n)}k.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?k.find.matchesSelector(r,e)?[r]:[]:k.find.matches(e,k.grep(t,(function(e){return 1===e.nodeType})))},k.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(k(e).filter((function(){for(t=0;t<r;t++)if(k.contains(i[t],this))return!0})));for(n=this.pushStack([]),t=0;t<r;t++)k.find(e,i[t],n);return r>1?k.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&P.test(e)?k(e):e||[],!1).length}});var z,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||z,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:F.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:m,!0)),L.test(r[1])&&k.isPlainObject(t))for(r in t)p(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=m.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):p(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)};H.prototype=k.fn,z=k(m);var B=/^(?:parents|prev(?:Until|All))/,V={children:!0,contents:!0,next:!0,prev:!0};function $(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(k.contains(this,t[e]))return!0}))},closest:function(e,t){var n,r=0,i=this.length,o=[],s="string"!=typeof e&&k(e);if(!P.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&k.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?k.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?a.call(k(e),this[0]):a.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(k.uniqueSort(k.merge(this.get(),k(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),k.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return O(e,"parentNode")},parentsUntil:function(e,t,n){return O(e,"parentNode",n)},next:function(e){return $(e,"nextSibling")},prev:function(e){return $(e,"previousSibling")},nextAll:function(e){return O(e,"nextSibling")},prevAll:function(e){return O(e,"previousSibling")},nextUntil:function(e,t,n){return O(e,"nextSibling",n)},prevUntil:function(e,t,n){return O(e,"previousSibling",n)},siblings:function(e){return I((e.parentNode||{}).firstChild,e)},children:function(e){return I(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(_(e,"template")&&(e=e.content||e),k.merge([],e.childNodes))}},(function(e,t){k.fn[e]=function(n,r){var i=k.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=k.filter(r,i)),this.length>1&&(V[e]||k.uniqueSort(i),B.test(e)&&i.reverse()),this.pushStack(i)}}));var W=/[^\x20\t\r\n\f]+/g;function U(e){return e}function Y(e){throw e}function K(e,t,n,r){var i;try{e&&p(i=e.promise)?i.call(e).done(t).fail(n):e&&p(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}k.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return k.each(e.match(W)||[],(function(e,n){t[n]=!0})),t}(e):k.extend({},e);var t,n,r,i,o=[],s=[],a=-1,l=function(){for(i=i||e.once,r=t=!0;s.length;a=-1)for(n=s.shift();++a<o.length;)!1===o[a].apply(n[0],n[1])&&e.stopOnFalse&&(a=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},c={add:function(){return o&&(n&&!t&&(a=o.length-1,s.push(n)),function t(n){k.each(n,(function(n,r){p(r)?e.unique&&c.has(r)||o.push(r):r&&r.length&&"string"!==v(r)&&t(r)}))}(arguments),n&&!t&&l()),this},remove:function(){return k.each(arguments,(function(e,t){for(var n;(n=k.inArray(t,o,n))>-1;)o.splice(n,1),n<=a&&a--})),this},has:function(e){return e?k.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=s=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},k.extend({Deferred:function(t){var n=[["notify","progress",k.Callbacks("memory"),k.Callbacks("memory"),2],["resolve","done",k.Callbacks("once memory"),k.Callbacks("once memory"),0,"resolved"],["reject","fail",k.Callbacks("once memory"),k.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return k.Deferred((function(t){k.each(n,(function(n,r){var i=p(e[r[4]])&&e[r[4]];o[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&p(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(t,r,i){var o=0;function s(t,n,r,i){return function(){var a=this,l=arguments,c=function(){var e,c;if(!(t<o)){if((e=r.apply(a,l))===n.promise())throw new TypeError("Thenable self-resolution");c=e&&("object"==typeof e||"function"==typeof e)&&e.then,p(c)?i?c.call(e,s(o,n,U,i),s(o,n,Y,i)):(o++,c.call(e,s(o,n,U,i),s(o,n,Y,i),s(o,n,U,n.notifyWith))):(r!==U&&(a=void 0,l=[e]),(i||n.resolveWith)(a,l))}},u=i?c:function(){try{c()}catch(e){k.Deferred.exceptionHook&&k.Deferred.exceptionHook(e,u.error),t+1>=o&&(r!==Y&&(a=void 0,l=[e]),n.rejectWith(a,l))}};t?u():(k.Deferred.getErrorHook?u.error=k.Deferred.getErrorHook():k.Deferred.getStackHook&&(u.error=k.Deferred.getStackHook()),e.setTimeout(u))}}return k.Deferred((function(e){n[0][3].add(s(0,e,p(i)?i:U,e.notifyWith)),n[1][3].add(s(0,e,p(t)?t:U)),n[2][3].add(s(0,e,p(r)?r:Y))})).promise()},promise:function(e){return null!=e?k.extend(e,i):i}},o={};return k.each(n,(function(e,t){var s=t[2],a=t[5];i[t[1]]=s.add,a&&s.add((function(){r=a}),n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),s.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=s.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),o=i.call(arguments),s=k.Deferred(),a=function(e){return function(n){r[e]=this,o[e]=arguments.length>1?i.call(arguments):n,--t||s.resolveWith(r,o)}};if(t<=1&&(K(e,s.done(a(n)).resolve,s.reject,!t),"pending"===s.state()||p(o[n]&&o[n].then)))return s.then();for(;n--;)K(o[n],a(n),s.reject);return s.promise()}});var X=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;k.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&X.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},k.readyException=function(t){e.setTimeout((function(){throw t}))};var G=k.Deferred();function J(){m.removeEventListener("DOMContentLoaded",J),e.removeEventListener("load",J),k.ready()}k.fn.ready=function(e){return G.then(e).catch((function(e){k.readyException(e)})),this},k.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--k.readyWait:k.isReady)||(k.isReady=!0,!0!==e&&--k.readyWait>0||G.resolveWith(m,[k]))}}),k.ready.then=G.then,"complete"===m.readyState||"loading"!==m.readyState&&!m.documentElement.doScroll?e.setTimeout(k.ready):(m.addEventListener("DOMContentLoaded",J),e.addEventListener("load",J));var Z=function(e,t,n,r,i,o,s){var a=0,l=e.length,c=null==n;if("object"===v(n))for(a in i=!0,n)Z(e,t,a,n[a],!0,o,s);else if(void 0!==r&&(i=!0,p(r)||(s=!0),c&&(s?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(k(e),n)})),t))for(;a<l;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:c?t.call(e):l?t(e[0],n):o},Q=/^-ms-/,ee=/-([a-z])/g;function te(e,t){return t.toUpperCase()}function ne(e){return e.replace(Q,"ms-").replace(ee,te)}var re=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function ie(){this.expando=k.expando+ie.uid++}ie.uid=1,ie.prototype={cache:function(e){var t=e[this.expando];return t||(t={},re(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[ne(t)]=n;else for(r in t)i[ne(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][ne(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(ne):(t=ne(t))in r?[t]:t.match(W)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||k.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!k.isEmptyObject(t)}};var oe=new ie,se=new ie,ae=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,le=/[A-Z]/g;function ce(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(le,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:ae.test(e)?JSON.parse(e):e)}(n)}catch(e){}se.set(e,t,n)}else n=void 0;return n}k.extend({hasData:function(e){return se.hasData(e)||oe.hasData(e)},data:function(e,t,n){return se.access(e,t,n)},removeData:function(e,t){se.remove(e,t)},_data:function(e,t,n){return oe.access(e,t,n)},_removeData:function(e,t){oe.remove(e,t)}}),k.fn.extend({data:function(e,t){var n,r,i,o=this[0],s=o&&o.attributes;if(void 0===e){if(this.length&&(i=se.get(o),1===o.nodeType&&!oe.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(r=s[n].name).indexOf("data-")&&(r=ne(r.slice(5)),ce(o,r,i[r]));oe.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each((function(){se.set(this,e)})):Z(this,(function(t){var n;if(o&&void 0===t)return void 0!==(n=se.get(o,e))||void 0!==(n=ce(o,e))?n:void 0;this.each((function(){se.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){se.remove(this,e)}))}}),k.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=oe.get(e,t),n&&(!r||Array.isArray(n)?r=oe.access(e,t,k.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=k.queue(e,t),r=n.length,i=n.shift(),o=k._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){k.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return oe.get(e,n)||oe.access(e,n,{empty:k.Callbacks("once memory").add((function(){oe.remove(e,[t+"queue",n])}))})}}),k.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?k.queue(this[0],e):void 0===t?this:this.each((function(){var n=k.queue(this,e,t);k._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&k.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){k.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=k.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)(n=oe.get(o[s],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(t)}});var ue=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,he=new RegExp("^(?:([+-])=|)("+ue+")([a-z%]*)$","i"),de=["Top","Right","Bottom","Left"],fe=m.documentElement,pe=function(e){return k.contains(e.ownerDocument,e)},ge={composed:!0};fe.getRootNode&&(pe=function(e){return k.contains(e.ownerDocument,e)||e.getRootNode(ge)===e.ownerDocument});var me=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&pe(e)&&"none"===k.css(e,"display")};function ye(e,t,n,r){var i,o,s=20,a=r?function(){return r.cur()}:function(){return k.css(e,t,"")},l=a(),c=n&&n[3]||(k.cssNumber[t]?"":"px"),u=e.nodeType&&(k.cssNumber[t]||"px"!==c&&+l)&&he.exec(k.css(e,t));if(u&&u[3]!==c){for(l/=2,c=c||u[3],u=+l||1;s--;)k.style(e,t,u+c),(1-o)*(1-(o=a()/l||.5))<=0&&(s=0),u/=o;u*=2,k.style(e,t,u+c),n=n||[]}return n&&(u=+u||+l||0,i=n[1]?u+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=u,r.end=i)),i}var be={};function ve(e){var t,n=e.ownerDocument,r=e.nodeName,i=be[r];return i||(t=n.body.appendChild(n.createElement(r)),i=k.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),be[r]=i,i)}function xe(e,t){for(var n,r,i=[],o=0,s=e.length;o<s;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=oe.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&me(r)&&(i[o]=ve(r))):"none"!==n&&(i[o]="none",oe.set(r,"display",n)));for(o=0;o<s;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}k.fn.extend({show:function(){return xe(this,!0)},hide:function(){return xe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){me(this)?k(this).show():k(this).hide()}))}});var we,ke,Me=/^(?:checkbox|radio)$/i,_e=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Se=/^$|^module$|\/(?:java|ecma)script/i;we=m.createDocumentFragment().appendChild(m.createElement("div")),(ke=m.createElement("input")).setAttribute("type","radio"),ke.setAttribute("checked","checked"),ke.setAttribute("name","t"),we.appendChild(ke),f.checkClone=we.cloneNode(!0).cloneNode(!0).lastChild.checked,we.innerHTML="<textarea>x</textarea>",f.noCloneChecked=!!we.cloneNode(!0).lastChild.defaultValue,we.innerHTML="<option></option>",f.option=!!we.lastChild;var qe={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 De(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&_(e,t)?k.merge([e],n):n}function Ce(e,t){for(var n=0,r=e.length;n<r;n++)oe.set(e[n],"globalEval",!t||oe.get(t[n],"globalEval"))}qe.tbody=qe.tfoot=qe.colgroup=qe.caption=qe.thead,qe.th=qe.td,f.option||(qe.optgroup=qe.option=[1,"<select multiple='multiple'>","</select>"]);var Ee=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,s,a,l,c,u,h=t.createDocumentFragment(),d=[],f=0,p=e.length;f<p;f++)if((o=e[f])||0===o)if("object"===v(o))k.merge(d,o.nodeType?[o]:o);else if(Ee.test(o)){for(s=s||h.appendChild(t.createElement("div")),a=(_e.exec(o)||["",""])[1].toLowerCase(),l=qe[a]||qe._default,s.innerHTML=l[1]+k.htmlPrefilter(o)+l[2],u=l[0];u--;)s=s.lastChild;k.merge(d,s.childNodes),(s=h.firstChild).textContent=""}else d.push(t.createTextNode(o));for(h.textContent="",f=0;o=d[f++];)if(r&&k.inArray(o,r)>-1)i&&i.push(o);else if(c=pe(o),s=De(h.appendChild(o),"script"),c&&Ce(s),n)for(u=0;o=s[u++];)Se.test(o.type||"")&&n.push(o);return h}var Te=/^([^.]*)(?:\.(.+)|)/;function Ne(){return!0}function Re(){return!1}function Oe(e,t,n,r,i,o){var s,a;if("object"==typeof t){for(a in"string"!=typeof n&&(r=r||n,n=void 0),t)Oe(e,a,n,r,t[a],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Re;else if(!i)return e;return 1===o&&(s=i,i=function(e){return k().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=k.guid++)),e.each((function(){k.event.add(this,t,i,r,n)}))}function Ie(e,t,n){n?(oe.set(e,t,!1),k.event.add(e,t,{namespace:!1,handler:function(e){var n,r=oe.get(this,t);if(1&e.isTrigger&&this[t]){if(r)(k.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=i.call(arguments),oe.set(this,t,r),this[t](),n=oe.get(this,t),oe.set(this,t,!1),r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else r&&(oe.set(this,t,k.event.trigger(r[0],r.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Ne)}})):void 0===oe.get(e,t)&&k.event.add(e,t,Ne)}k.event={global:{},add:function(e,t,n,r,i){var o,s,a,l,c,u,h,d,f,p,g,m=oe.get(e);if(re(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(fe,i),n.guid||(n.guid=k.guid++),(l=m.events)||(l=m.events=Object.create(null)),(s=m.handle)||(s=m.handle=function(t){return void 0!==k&&k.event.triggered!==t.type?k.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(W)||[""]).length;c--;)f=g=(a=Te.exec(t[c])||[])[1],p=(a[2]||"").split(".").sort(),f&&(h=k.event.special[f]||{},f=(i?h.delegateType:h.bindType)||f,h=k.event.special[f]||{},u=k.extend({type:f,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:p.join(".")},o),(d=l[f])||((d=l[f]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(e,r,p,s)||e.addEventListener&&e.addEventListener(f,s)),h.add&&(h.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,u):d.push(u),k.event.global[f]=!0)},remove:function(e,t,n,r,i){var o,s,a,l,c,u,h,d,f,p,g,m=oe.hasData(e)&&oe.get(e);if(m&&(l=m.events)){for(c=(t=(t||"").match(W)||[""]).length;c--;)if(f=g=(a=Te.exec(t[c])||[])[1],p=(a[2]||"").split(".").sort(),f){for(h=k.event.special[f]||{},d=l[f=(r?h.delegateType:h.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=d.length;o--;)u=d[o],!i&&g!==u.origType||n&&n.guid!==u.guid||a&&!a.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(d.splice(o,1),u.selector&&d.delegateCount--,h.remove&&h.remove.call(e,u));s&&!d.length&&(h.teardown&&!1!==h.teardown.call(e,p,m.handle)||k.removeEvent(e,f,m.handle),delete l[f])}else for(f in l)k.event.remove(e,f+t[c],n,r,!0);k.isEmptyObject(l)&&oe.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,s,a=new Array(arguments.length),l=k.event.fix(e),c=(oe.get(this,"events")||Object.create(null))[l.type]||[],u=k.event.special[l.type]||{};for(a[0]=l,t=1;t<arguments.length;t++)a[t]=arguments[t];if(l.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,l)){for(s=k.event.handlers.call(this,l,c),t=0;(i=s[t++])&&!l.isPropagationStopped();)for(l.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,void 0!==(r=((k.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a))&&!1===(l.result=r)&&(l.preventDefault(),l.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,l),l.result}},handlers:function(e,t){var n,r,i,o,s,a=[],l=t.delegateCount,c=e.target;if(l&&c.nodeType&&!("click"===e.type&&e.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(o=[],s={},n=0;n<l;n++)void 0===s[i=(r=t[n]).selector+" "]&&(s[i]=r.needsContext?k(i,this).index(c)>-1:k.find(i,this,null,[c]).length),s[i]&&o.push(r);o.length&&a.push({elem:c,handlers:o})}return c=this,l<t.length&&a.push({elem:c,handlers:t.slice(l)}),a},addProp:function(e,t){Object.defineProperty(k.Event.prototype,e,{enumerable:!0,configurable:!0,get:p(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[k.expando]?e:new k.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return Me.test(t.type)&&t.click&&_(t,"input")&&Ie(t,"click",!0),!1},trigger:function(e){var t=this||e;return Me.test(t.type)&&t.click&&_(t,"input")&&Ie(t,"click"),!0},_default:function(e){var t=e.target;return Me.test(t.type)&&t.click&&_(t,"input")&&oe.get(t,"click")||_(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},k.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},k.Event=function(e,t){if(!(this instanceof k.Event))return new k.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ne:Re,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&k.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[k.expando]=!0},k.Event.prototype={constructor:k.Event,isDefaultPrevented:Re,isPropagationStopped:Re,isImmediatePropagationStopped:Re,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ne,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ne,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ne,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},k.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},k.event.addProp),k.each({focus:"focusin",blur:"focusout"},(function(e,t){function n(e){if(m.documentMode){var n=oe.get(this,"handle"),r=k.event.fix(e);r.type="focusin"===e.type?"focus":"blur",r.isSimulated=!0,n(e),r.target===r.currentTarget&&n(r)}else k.event.simulate(t,e.target,k.event.fix(e))}k.event.special[e]={setup:function(){var r;if(Ie(this,e,!0),!m.documentMode)return!1;(r=oe.get(this,t))||this.addEventListener(t,n),oe.set(this,t,(r||0)+1)},trigger:function(){return Ie(this,e),!0},teardown:function(){var e;if(!m.documentMode)return!1;(e=oe.get(this,t)-1)?oe.set(this,t,e):(this.removeEventListener(t,n),oe.remove(this,t))},_default:function(t){return oe.get(t.target,e)},delegateType:t},k.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=m.documentMode?this:r,o=oe.get(i,t);o||(m.documentMode?this.addEventListener(t,n):r.addEventListener(e,n,!0)),oe.set(i,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=m.documentMode?this:r,o=oe.get(i,t)-1;o?oe.set(i,t,o):(m.documentMode?this.removeEventListener(t,n):r.removeEventListener(e,n,!0),oe.remove(i,t))}}})),k.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){k.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return r&&(r===this||k.contains(this,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}})),k.fn.extend({on:function(e,t,n,r){return Oe(this,e,t,n,r)},one:function(e,t,n,r){return Oe(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,k(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Re),this.each((function(){k.event.remove(this,e,n,t)}))}});var Pe=/<script|<style|<link/i,Le=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function ze(e,t){return _(e,"table")&&_(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Fe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Be(e,t){var n,r,i,o,s,a;if(1===t.nodeType){if(oe.hasData(e)&&(a=oe.get(e).events))for(i in oe.remove(t,"handle events"),a)for(n=0,r=a[i].length;n<r;n++)k.event.add(t,i,a[i][n]);se.hasData(e)&&(o=se.access(e),s=k.extend({},o),se.set(t,s))}}function Ve(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Me.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function $e(e,t,n,r){t=o(t);var i,s,a,l,c,u,h=0,d=e.length,g=d-1,m=t[0],y=p(m);if(y||d>1&&"string"==typeof m&&!f.checkClone&&Le.test(m))return e.each((function(i){var o=e.eq(i);y&&(t[0]=m.call(this,i,o.html())),$e(o,t,n,r)}));if(d&&(s=(i=Ae(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=s),s||r)){for(l=(a=k.map(De(i,"script"),Fe)).length;h<d;h++)c=i,h!==g&&(c=k.clone(c,!0,!0),l&&k.merge(a,De(c,"script"))),n.call(e[h],c,h);if(l)for(u=a[a.length-1].ownerDocument,k.map(a,He),h=0;h<l;h++)c=a[h],Se.test(c.type||"")&&!oe.access(c,"globalEval")&&k.contains(u,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?k._evalUrl&&!c.noModule&&k._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},u):b(c.textContent.replace(je,""),c,u))}return e}function We(e,t,n){for(var r,i=t?k.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||k.cleanData(De(r)),r.parentNode&&(n&&pe(r)&&Ce(De(r,"script")),r.parentNode.removeChild(r));return e}k.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,s,a=e.cloneNode(!0),l=pe(e);if(!(f.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(s=De(a),r=0,i=(o=De(e)).length;r<i;r++)Ve(o[r],s[r]);if(t)if(n)for(o=o||De(e),s=s||De(a),r=0,i=o.length;r<i;r++)Be(o[r],s[r]);else Be(e,a);return(s=De(a,"script")).length>0&&Ce(s,!l&&De(e,"script")),a},cleanData:function(e){for(var t,n,r,i=k.event.special,o=0;void 0!==(n=e[o]);o++)if(re(n)){if(t=n[oe.expando]){if(t.events)for(r in t.events)i[r]?k.event.remove(n,r):k.removeEvent(n,r,t.handle);n[oe.expando]=void 0}n[se.expando]&&(n[se.expando]=void 0)}}}),k.fn.extend({detach:function(e){return We(this,e,!0)},remove:function(e){return We(this,e)},text:function(e){return Z(this,(function(e){return void 0===e?k.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return $e(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||ze(this,e).appendChild(e)}))},prepend:function(){return $e(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ze(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return $e(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return $e(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(k.cleanData(De(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return k.clone(this,e,t)}))},html:function(e){return Z(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Pe.test(e)&&!qe[(_e.exec(e)||["",""])[1].toLowerCase()]){e=k.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(k.cleanData(De(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return $e(this,arguments,(function(t){var n=this.parentNode;k.inArray(this,e)<0&&(k.cleanData(De(this)),n&&n.replaceChild(t,this))}),e)}}),k.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){k.fn[e]=function(e){for(var n,r=[],i=k(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),k(i[a])[t](n),s.apply(r,n.get());return this.pushStack(r)}}));var Ue=new RegExp("^("+ue+")(?!px)[a-z%]+$","i"),Ye=/^--/,Ke=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Xe=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ge=new RegExp(de.join("|"),"i");function Je(e,t,n){var r,i,o,s,a=Ye.test(t),l=e.style;return(n=n||Ke(e))&&(s=n.getPropertyValue(t)||n[t],a&&s&&(s=s.replace(E,"$1")||void 0),""!==s||pe(e)||(s=k.style(e,t)),!f.pixelBoxStyles()&&Ue.test(s)&&Ge.test(t)&&(r=l.width,i=l.minWidth,o=l.maxWidth,l.minWidth=l.maxWidth=l.width=s,s=n.width,l.width=r,l.minWidth=i,l.maxWidth=o)),void 0!==s?s+"":s}function Ze(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(u){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",fe.appendChild(c).appendChild(u);var t=e.getComputedStyle(u);r="1%"!==t.top,l=12===n(t.marginLeft),u.style.right="60%",s=36===n(t.right),i=36===n(t.width),u.style.position="absolute",o=12===n(u.offsetWidth/3),fe.removeChild(c),u=null}}function n(e){return Math.round(parseFloat(e))}var r,i,o,s,a,l,c=m.createElement("div"),u=m.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",f.clearCloneStyle="content-box"===u.style.backgroundClip,k.extend(f,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,r,i;return null==a&&(t=m.createElement("table"),n=m.createElement("tr"),r=m.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="box-sizing:content-box;border:1px solid",n.style.height="1px",r.style.height="9px",r.style.display="block",fe.appendChild(t).appendChild(n).appendChild(r),i=e.getComputedStyle(n),a=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===n.offsetHeight,fe.removeChild(t)),a}}))}();var Qe=["Webkit","Moz","ms"],et=m.createElement("div").style,tt={};function nt(e){var t=k.cssProps[e]||tt[e];return t||(e in et?e:tt[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=Qe.length;n--;)if((e=Qe[n]+t)in et)return e}(e)||e)}var rt=/^(none|table(?!-c[ea]).+)/,it={position:"absolute",visibility:"hidden",display:"block"},ot={letterSpacing:"0",fontWeight:"400"};function st(e,t,n){var r=he.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function at(e,t,n,r,i,o){var s="width"===t?1:0,a=0,l=0,c=0;if(n===(r?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(c+=k.css(e,n+de[s],!0,i)),r?("content"===n&&(l-=k.css(e,"padding"+de[s],!0,i)),"margin"!==n&&(l-=k.css(e,"border"+de[s]+"Width",!0,i))):(l+=k.css(e,"padding"+de[s],!0,i),"padding"!==n?l+=k.css(e,"border"+de[s]+"Width",!0,i):a+=k.css(e,"border"+de[s]+"Width",!0,i));return!r&&o>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-a-.5))||0),l+c}function lt(e,t,n){var r=Ke(e),i=(!f.boxSizingReliable()||n)&&"border-box"===k.css(e,"boxSizing",!1,r),o=i,s=Je(e,t,r),a="offset"+t[0].toUpperCase()+t.slice(1);if(Ue.test(s)){if(!n)return s;s="auto"}return(!f.boxSizingReliable()&&i||!f.reliableTrDimensions()&&_(e,"tr")||"auto"===s||!parseFloat(s)&&"inline"===k.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===k.css(e,"boxSizing",!1,r),(o=a in e)&&(s=e[a])),(s=parseFloat(s)||0)+at(e,t,n||(i?"border":"content"),o,r,s)+"px"}function ct(e,t,n,r,i){return new ct.prototype.init(e,t,n,r,i)}k.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Je(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!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,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,a=ne(t),l=Ye.test(t),c=e.style;if(l||(t=nt(a)),s=k.cssHooks[t]||k.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(i=s.get(e,!1,r))?i:c[t];"string"==(o=typeof n)&&(i=he.exec(n))&&i[1]&&(n=ye(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=i&&i[3]||(k.cssNumber[a]?"":"px")),f.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,r))||(l?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,r){var i,o,s,a=ne(t);return Ye.test(t)||(t=nt(a)),(s=k.cssHooks[t]||k.cssHooks[a])&&"get"in s&&(i=s.get(e,!0,n)),void 0===i&&(i=Je(e,t,r)),"normal"===i&&t in ot&&(i=ot[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),k.each(["height","width"],(function(e,t){k.cssHooks[t]={get:function(e,n,r){if(n)return!rt.test(k.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?lt(e,t,r):Xe(e,it,(function(){return lt(e,t,r)}))},set:function(e,n,r){var i,o=Ke(e),s=!f.scrollboxSize()&&"absolute"===o.position,a=(s||r)&&"border-box"===k.css(e,"boxSizing",!1,o),l=r?at(e,t,r,a,o):0;return a&&s&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-at(e,t,"border",!1,o)-.5)),l&&(i=he.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=k.css(e,t)),st(0,n,l)}}})),k.cssHooks.marginLeft=Ze(f.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Je(e,"marginLeft"))||e.getBoundingClientRect().left-Xe(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),k.each({margin:"",padding:"",border:"Width"},(function(e,t){k.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+de[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(k.cssHooks[e+t].set=st)})),k.fn.extend({css:function(e,t){return Z(this,(function(e,t,n){var r,i,o={},s=0;if(Array.isArray(t)){for(r=Ke(e),i=t.length;s<i;s++)o[t[s]]=k.css(e,t[s],!1,r);return o}return void 0!==n?k.style(e,t,n):k.css(e,t)}),e,t,arguments.length>1)}}),k.Tween=ct,ct.prototype={constructor:ct,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||k.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(k.cssNumber[n]?"":"px")},cur:function(){var e=ct.propHooks[this.prop];return e&&e.get?e.get(this):ct.propHooks._default.get(this)},run:function(e){var t,n=ct.propHooks[this.prop];return this.options.duration?this.pos=t=k.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ct.propHooks._default.set(this),this}},ct.prototype.init.prototype=ct.prototype,ct.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=k.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){k.fx.step[e.prop]?k.fx.step[e.prop](e):1!==e.elem.nodeType||!k.cssHooks[e.prop]&&null==e.elem.style[nt(e.prop)]?e.elem[e.prop]=e.now:k.style(e.elem,e.prop,e.now+e.unit)}}},ct.propHooks.scrollTop=ct.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},k.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},k.fx=ct.prototype.init,k.fx.step={};var ut,ht,dt=/^(?:toggle|show|hide)$/,ft=/queueHooks$/;function pt(){ht&&(!1===m.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(pt):e.setTimeout(pt,k.fx.interval),k.fx.tick())}function gt(){return e.setTimeout((function(){ut=void 0})),ut=Date.now()}function mt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=de[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function yt(e,t,n){for(var r,i=(bt.tweeners[t]||[]).concat(bt.tweeners["*"]),o=0,s=i.length;o<s;o++)if(r=i[o].call(n,t,e))return r}function bt(e,t,n){var r,i,o=0,s=bt.prefilters.length,a=k.Deferred().always((function(){delete l.elem})),l=function(){if(i)return!1;for(var t=ut||gt(),n=Math.max(0,c.startTime+c.duration-t),r=1-(n/c.duration||0),o=0,s=c.tweens.length;o<s;o++)c.tweens[o].run(r);return a.notifyWith(e,[c,r,n]),r<1&&s?n:(s||a.notifyWith(e,[c,1,0]),a.resolveWith(e,[c]),!1)},c=a.promise({elem:e,props:k.extend({},t),opts:k.extend(!0,{specialEasing:{},easing:k.easing._default},n),originalProperties:t,originalOptions:n,startTime:ut||gt(),duration:n.duration,tweens:[],createTween:function(t,n){var r=k.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(r),r},stop:function(t){var n=0,r=t?c.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)c.tweens[n].run(1);return t?(a.notifyWith(e,[c,1,0]),a.resolveWith(e,[c,t])):a.rejectWith(e,[c,t]),this}}),u=c.props;for(function(e,t){var n,r,i,o,s;for(n in e)if(i=t[r=ne(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(s=k.cssHooks[r])&&"expand"in s)for(n in o=s.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(u,c.opts.specialEasing);o<s;o++)if(r=bt.prefilters[o].call(c,e,u,c.opts))return p(r.stop)&&(k._queueHooks(c.elem,c.opts.queue).stop=r.stop.bind(r)),r;return k.map(u,yt,c),p(c.opts.start)&&c.opts.start.call(e,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),k.fx.timer(k.extend(l,{elem:e,anim:c,queue:c.opts.queue})),c}k.Animation=k.extend(bt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ye(n.elem,e,he.exec(t),n),n}]},tweener:function(e,t){p(e)?(t=e,e=["*"]):e=e.match(W);for(var n,r=0,i=e.length;r<i;r++)n=e[r],bt.tweeners[n]=bt.tweeners[n]||[],bt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,s,a,l,c,u,h="width"in t||"height"in t,d=this,f={},p=e.style,g=e.nodeType&&me(e),m=oe.get(e,"fxshow");for(r in n.queue||(null==(s=k._queueHooks(e,"fx")).unqueued&&(s.unqueued=0,a=s.empty.fire,s.empty.fire=function(){s.unqueued||a()}),s.unqueued++,d.always((function(){d.always((function(){s.unqueued--,k.queue(e,"fx").length||s.empty.fire()}))}))),t)if(i=t[r],dt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!m||void 0===m[r])continue;g=!0}f[r]=m&&m[r]||k.style(e,r)}if((l=!k.isEmptyObject(t))||!k.isEmptyObject(f))for(r in h&&1===e.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(c=m&&m.display)&&(c=oe.get(e,"display")),"none"===(u=k.css(e,"display"))&&(c?u=c:(xe([e],!0),c=e.style.display||c,u=k.css(e,"display"),xe([e]))),("inline"===u||"inline-block"===u&&null!=c)&&"none"===k.css(e,"float")&&(l||(d.done((function(){p.display=c})),null==c&&(u=p.display,c="none"===u?"":u)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",d.always((function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}))),l=!1,f)l||(m?"hidden"in m&&(g=m.hidden):m=oe.access(e,"fxshow",{display:c}),o&&(m.hidden=!g),g&&xe([e],!0),d.done((function(){for(r in g||xe([e]),oe.remove(e,"fxshow"),f)k.style(e,r,f[r])}))),l=yt(g?m[r]:0,r,d),r in m||(m[r]=l.start,g&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?bt.prefilters.unshift(e):bt.prefilters.push(e)}}),k.speed=function(e,t,n){var r=e&&"object"==typeof e?k.extend({},e):{complete:n||!n&&t||p(e)&&e,duration:e,easing:n&&t||t&&!p(t)&&t};return k.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in k.fx.speeds?r.duration=k.fx.speeds[r.duration]:r.duration=k.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){p(r.old)&&r.old.call(this),r.queue&&k.dequeue(this,r.queue)},r},k.fn.extend({fadeTo:function(e,t,n,r){return this.filter(me).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=k.isEmptyObject(e),o=k.speed(t,n,r),s=function(){var t=bt(this,k.extend({},e),o);(i||oe.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each((function(){var t=!0,i=null!=e&&e+"queueHooks",o=k.timers,s=oe.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&ft.test(i)&&r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||k.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=oe.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=k.timers,s=r?r.length:0;for(n.finish=!0,k.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<s;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish}))}}),k.each(["toggle","show","hide"],(function(e,t){var n=k.fn[t];k.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(mt(t,!0),e,r,i)}})),k.each({slideDown:mt("show"),slideUp:mt("hide"),slideToggle:mt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){k.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}})),k.timers=[],k.fx.tick=function(){var e,t=0,n=k.timers;for(ut=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||k.fx.stop(),ut=void 0},k.fx.timer=function(e){k.timers.push(e),k.fx.start()},k.fx.interval=13,k.fx.start=function(){ht||(ht=!0,pt())},k.fx.stop=function(){ht=null},k.fx.speeds={slow:600,fast:200,_default:400},k.fn.delay=function(t,n){return t=k.fx&&k.fx.speeds[t]||t,n=n||"fx",this.queue(n,(function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}}))},function(){var e=m.createElement("input"),t=m.createElement("select").appendChild(m.createElement("option"));e.type="checkbox",f.checkOn=""!==e.value,f.optSelected=t.selected,(e=m.createElement("input")).value="t",e.type="radio",f.radioValue="t"===e.value}();var vt,xt=k.expr.attrHandle;k.fn.extend({attr:function(e,t){return Z(this,k.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){k.removeAttr(this,e)}))}}),k.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?k.prop(e,t,n):(1===o&&k.isXMLDoc(e)||(i=k.attrHooks[t.toLowerCase()]||(k.expr.match.bool.test(t)?vt:void 0)),void 0!==n?null===n?void k.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=k.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!f.radioValue&&"radio"===t&&_(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(W);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),vt={set:function(e,t,n){return!1===t?k.removeAttr(e,n):e.setAttribute(n,n),n}},k.each(k.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=xt[t]||k.find.attr;xt[t]=function(e,t,r){var i,o,s=t.toLowerCase();return r||(o=xt[s],xt[s]=i,i=null!=n(e,t,r)?s:null,xt[s]=o),i}}));var wt=/^(?:input|select|textarea|button)$/i,kt=/^(?:a|area)$/i;function Mt(e){return(e.match(W)||[]).join(" ")}function _t(e){return e.getAttribute&&e.getAttribute("class")||""}function St(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(W)||[]}k.fn.extend({prop:function(e,t){return Z(this,k.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[k.propFix[e]||e]}))}}),k.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&k.isXMLDoc(e)||(t=k.propFix[t]||t,i=k.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=k.find.attr(e,"tabindex");return t?parseInt(t,10):wt.test(e.nodeName)||kt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),f.optSelected||(k.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),k.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){k.propFix[this.toLowerCase()]=this})),k.fn.extend({addClass:function(e){var t,n,r,i,o,s;return p(e)?this.each((function(t){k(this).addClass(e.call(this,t,_t(this)))})):(t=St(e)).length?this.each((function(){if(r=_t(this),n=1===this.nodeType&&" "+Mt(r)+" "){for(o=0;o<t.length;o++)i=t[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");s=Mt(n),r!==s&&this.setAttribute("class",s)}})):this},removeClass:function(e){var t,n,r,i,o,s;return p(e)?this.each((function(t){k(this).removeClass(e.call(this,t,_t(this)))})):arguments.length?(t=St(e)).length?this.each((function(){if(r=_t(this),n=1===this.nodeType&&" "+Mt(r)+" "){for(o=0;o<t.length;o++)for(i=t[o];n.indexOf(" "+i+" ")>-1;)n=n.replace(" "+i+" "," ");s=Mt(n),r!==s&&this.setAttribute("class",s)}})):this:this.attr("class","")},toggleClass:function(e,t){var n,r,i,o,s=typeof e,a="string"===s||Array.isArray(e);return p(e)?this.each((function(n){k(this).toggleClass(e.call(this,n,_t(this),t),t)})):"boolean"==typeof t&&a?t?this.addClass(e):this.removeClass(e):(n=St(e),this.each((function(){if(a)for(o=k(this),i=0;i<n.length;i++)r=n[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==e&&"boolean"!==s||((r=_t(this))&&oe.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===e?"":oe.get(this,"__className__")||""))})))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+Mt(_t(n))+" ").indexOf(t)>-1)return!0;return!1}});var qt=/\r/g;k.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=p(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,k(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=k.map(i,(function(e){return null==e?"":e+""}))),(t=k.valHooks[this.type]||k.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=k.valHooks[i.type]||k.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(qt,""):null==n?"":n:void 0}}),k.extend({valHooks:{option:{get:function(e){var t=k.find.attr(e,"value");return null!=t?t:Mt(k.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,s="select-one"===e.type,a=s?null:[],l=s?o+1:i.length;for(r=o<0?l:s?o:0;r<l;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!_(n.parentNode,"optgroup"))){if(t=k(n).val(),s)return t;a.push(t)}return a},set:function(e,t){for(var n,r,i=e.options,o=k.makeArray(t),s=i.length;s--;)((r=i[s]).selected=k.inArray(k.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),k.each(["radio","checkbox"],(function(){k.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=k.inArray(k(e).val(),t)>-1}},f.checkOn||(k.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var Dt=e.location,Ct={guid:Date.now()},Et=/\?/;k.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return r=n&&n.getElementsByTagName("parsererror")[0],n&&!r||k.error("Invalid XML: "+(r?k.map(r.childNodes,(function(e){return e.textContent})).join("\n"):t)),n};var At=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};k.extend(k.event,{trigger:function(t,n,r,i){var o,s,a,l,c,h,d,f,y=[r||m],b=u.call(t,"type")?t.type:t,v=u.call(t,"namespace")?t.namespace.split("."):[];if(s=f=a=r=r||m,3!==r.nodeType&&8!==r.nodeType&&!At.test(b+k.event.triggered)&&(b.indexOf(".")>-1&&(v=b.split("."),b=v.shift(),v.sort()),c=b.indexOf(":")<0&&"on"+b,(t=t[k.expando]?t:new k.Event(b,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=v.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:k.makeArray(n,[t]),d=k.event.special[b]||{},i||!d.trigger||!1!==d.trigger.apply(r,n))){if(!i&&!d.noBubble&&!g(r)){for(l=d.delegateType||b,At.test(l+b)||(s=s.parentNode);s;s=s.parentNode)y.push(s),a=s;a===(r.ownerDocument||m)&&y.push(a.defaultView||a.parentWindow||e)}for(o=0;(s=y[o++])&&!t.isPropagationStopped();)f=s,t.type=o>1?l:d.bindType||b,(h=(oe.get(s,"events")||Object.create(null))[t.type]&&oe.get(s,"handle"))&&h.apply(s,n),(h=c&&s[c])&&h.apply&&re(s)&&(t.result=h.apply(s,n),!1===t.result&&t.preventDefault());return t.type=b,i||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(y.pop(),n)||!re(r)||c&&p(r[b])&&!g(r)&&((a=r[c])&&(r[c]=null),k.event.triggered=b,t.isPropagationStopped()&&f.addEventListener(b,Tt),r[b](),t.isPropagationStopped()&&f.removeEventListener(b,Tt),k.event.triggered=void 0,a&&(r[c]=a)),t.result}},simulate:function(e,t,n){var r=k.extend(new k.Event,n,{type:e,isSimulated:!0});k.event.trigger(r,null,t)}}),k.fn.extend({trigger:function(e,t){return this.each((function(){k.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return k.event.trigger(e,t,n,!0)}});var Nt=/\[\]$/,Rt=/\r?\n/g,Ot=/^(?:submit|button|image|reset|file)$/i,It=/^(?:input|select|textarea|keygen)/i;function Pt(e,t,n,r){var i;if(Array.isArray(t))k.each(t,(function(t,i){n||Nt.test(e)?r(e,i):Pt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==v(t))r(e,t);else for(i in t)Pt(e+"["+i+"]",t[i],n,r)}k.param=function(e,t){var n,r=[],i=function(e,t){var n=p(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!k.isPlainObject(e))k.each(e,(function(){i(this.name,this.value)}));else for(n in e)Pt(n,e[n],t,i);return r.join("&")},k.fn.extend({serialize:function(){return k.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=k.prop(this,"elements");return e?k.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!k(this).is(":disabled")&&It.test(this.nodeName)&&!Ot.test(e)&&(this.checked||!Me.test(e))})).map((function(e,t){var n=k(this).val();return null==n?null:Array.isArray(n)?k.map(n,(function(e){return{name:t.name,value:e.replace(Rt,"\r\n")}})):{name:t.name,value:n.replace(Rt,"\r\n")}})).get()}});var Lt=/%20/g,jt=/#.*$/,zt=/([?&])_=[^&]*/,Ft=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ht=/^(?:GET|HEAD)$/,Bt=/^\/\//,Vt={},$t={},Wt="*/".concat("*"),Ut=m.createElement("a");function Yt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(W)||[];if(p(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Kt(e,t,n,r){var i={},o=e===$t;function s(a){var l;return i[a]=!0,k.each(e[a]||[],(function(e,a){var c=a(t,n,r);return"string"!=typeof c||o||i[c]?o?!(l=c):void 0:(t.dataTypes.unshift(c),s(c),!1)})),l}return s(t.dataTypes[0])||!i["*"]&&s("*")}function Xt(e,t){var n,r,i=k.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&k.extend(!0,e,r),e}Ut.href=Dt.href,k.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Dt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Dt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Wt,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":k.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Xt(Xt(e,k.ajaxSettings),t):Xt(k.ajaxSettings,e)},ajaxPrefilter:Yt(Vt),ajaxTransport:Yt($t),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var r,i,o,s,a,l,c,u,h,d,f=k.ajaxSetup({},n),p=f.context||f,g=f.context&&(p.nodeType||p.jquery)?k(p):k.event,y=k.Deferred(),b=k.Callbacks("once memory"),v=f.statusCode||{},x={},w={},M="canceled",_={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s)for(s={};t=Ft.exec(o);)s[t[1].toLowerCase()+" "]=(s[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=s[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(e,t){return null==c&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==c&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)_.always(e[_.status]);else for(t in e)v[t]=[v[t],e[t]];return this},abort:function(e){var t=e||M;return r&&r.abort(t),S(0,t),this}};if(y.promise(_),f.url=((t||f.url||Dt.href)+"").replace(Bt,Dt.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(W)||[""],null==f.crossDomain){l=m.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Ut.protocol+"//"+Ut.host!=l.protocol+"//"+l.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=k.param(f.data,f.traditional)),Kt(Vt,f,n,_),c)return _;for(h in(u=k.event&&f.global)&&0==k.active++&&k.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Ht.test(f.type),i=f.url.replace(jt,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Lt,"+")):(d=f.url.slice(i.length),f.data&&(f.processData||"string"==typeof f.data)&&(i+=(Et.test(i)?"&":"?")+f.data,delete f.data),!1===f.cache&&(i=i.replace(zt,"$1"),d=(Et.test(i)?"&":"?")+"_="+Ct.guid+++d),f.url=i+d),f.ifModified&&(k.lastModified[i]&&_.setRequestHeader("If-Modified-Since",k.lastModified[i]),k.etag[i]&&_.setRequestHeader("If-None-Match",k.etag[i])),(f.data&&f.hasContent&&!1!==f.contentType||n.contentType)&&_.setRequestHeader("Content-Type",f.contentType),_.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Wt+"; q=0.01":""):f.accepts["*"]),f.headers)_.setRequestHeader(h,f.headers[h]);if(f.beforeSend&&(!1===f.beforeSend.call(p,_,f)||c))return _.abort();if(M="abort",b.add(f.complete),_.done(f.success),_.fail(f.error),r=Kt($t,f,n,_)){if(_.readyState=1,u&&g.trigger("ajaxSend",[_,f]),c)return _;f.async&&f.timeout>0&&(a=e.setTimeout((function(){_.abort("timeout")}),f.timeout));try{c=!1,r.send(x,S)}catch(e){if(c)throw e;S(-1,e)}}else S(-1,"No Transport");function S(t,n,s,l){var h,d,m,x,w,M=n;c||(c=!0,a&&e.clearTimeout(a),r=void 0,o=l||"",_.readyState=t>0?4:0,h=t>=200&&t<300||304===t,s&&(x=function(e,t,n){for(var r,i,o,s,a=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}s||(s=i)}o=o||s}if(o)return o!==l[0]&&l.unshift(o),n[o]}(f,_,s)),!h&&k.inArray("script",f.dataTypes)>-1&&k.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),x=function(e,t,n,r){var i,o,s,a,l,c={},u=e.dataTypes.slice();if(u[1])for(s in e.converters)c[s.toLowerCase()]=e.converters[s];for(o=u.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=u.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(s=c[l+" "+o]||c["* "+o]))for(i in c)if((a=i.split(" "))[1]===o&&(s=c[l+" "+a[0]]||c["* "+a[0]])){!0===s?s=c[i]:!0!==c[i]&&(o=a[0],u.unshift(a[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(e){return{state:"parsererror",error:s?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(f,x,_,h),h?(f.ifModified&&((w=_.getResponseHeader("Last-Modified"))&&(k.lastModified[i]=w),(w=_.getResponseHeader("etag"))&&(k.etag[i]=w)),204===t||"HEAD"===f.type?M="nocontent":304===t?M="notmodified":(M=x.state,d=x.data,h=!(m=x.error))):(m=M,!t&&M||(M="error",t<0&&(t=0))),_.status=t,_.statusText=(n||M)+"",h?y.resolveWith(p,[d,M,_]):y.rejectWith(p,[_,M,m]),_.statusCode(v),v=void 0,u&&g.trigger(h?"ajaxSuccess":"ajaxError",[_,f,h?d:m]),b.fireWith(p,[_,M]),u&&(g.trigger("ajaxComplete",[_,f]),--k.active||k.event.trigger("ajaxStop")))}return _},getJSON:function(e,t,n){return k.get(e,t,n,"json")},getScript:function(e,t){return k.get(e,void 0,t,"script")}}),k.each(["get","post"],(function(e,t){k[t]=function(e,n,r,i){return p(n)&&(i=i||r,r=n,n=void 0),k.ajax(k.extend({url:e,type:t,dataType:i,data:n,success:r},k.isPlainObject(e)&&e))}})),k.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),k._evalUrl=function(e,t,n){return k.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){k.globalEval(e,t,n)}})},k.fn.extend({wrapAll:function(e){var t;return this[0]&&(p(e)&&(e=e.call(this[0])),t=k(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return p(e)?this.each((function(t){k(this).wrapInner(e.call(this,t))})):this.each((function(){var t=k(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=p(e);return this.each((function(n){k(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){k(this).replaceWith(this.childNodes)})),this}}),k.expr.pseudos.hidden=function(e){return!k.expr.pseudos.visible(e)},k.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},k.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Gt={0:200,1223:204},Jt=k.ajaxSettings.xhr();f.cors=!!Jt&&"withCredentials"in Jt,f.ajax=Jt=!!Jt,k.ajaxTransport((function(t){var n,r;if(f.cors||Jt&&!t.crossDomain)return{send:function(i,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(s,i[s]);n=function(e){return function(){n&&(n=r=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Gt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),r=a.onerror=a.ontimeout=n("error"),void 0!==a.onabort?a.onabort=r:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout((function(){n&&r()}))},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}})),k.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),k.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return k.globalEval(e),e}}}),k.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),k.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=k("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),m.head.appendChild(t[0])},abort:function(){n&&n()}}}));var Zt,Qt=[],en=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Qt.pop()||k.expando+"_"+Ct.guid++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",(function(t,n,r){var i,o,s,a=!1!==t.jsonp&&(en.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&en.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=p(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(en,"$1"+i):!1!==t.jsonp&&(t.url+=(Et.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||k.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){s=arguments},r.always((function(){void 0===o?k(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Qt.push(i)),s&&p(o)&&o(s[0]),s=o=void 0})),"script"})),f.createHTMLDocument=((Zt=m.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Zt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(f.createHTMLDocument?((r=(t=m.implementation.createHTMLDocument("")).createElement("base")).href=m.location.href,t.head.appendChild(r)):t=m),o=!n&&[],(i=L.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,s=this,a=e.indexOf(" ");return a>-1&&(r=Mt(e.slice(a)),e=e.slice(0,a)),p(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),s.length>0&&k.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done((function(e){o=arguments,s.html(r?k("<div>").append(k.parseHTML(e)).find(r):e)})).always(n&&function(e,t){s.each((function(){n.apply(this,o||[e.responseText,t,e])}))}),this},k.expr.pseudos.animated=function(e){return k.grep(k.timers,(function(t){return e===t.elem})).length},k.offset={setOffset:function(e,t,n){var r,i,o,s,a,l,c=k.css(e,"position"),u=k(e),h={};"static"===c&&(e.style.position="relative"),a=u.offset(),o=k.css(e,"top"),l=k.css(e,"left"),("absolute"===c||"fixed"===c)&&(o+l).indexOf("auto")>-1?(s=(r=u.position()).top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(l)||0),p(t)&&(t=t.call(e,n,k.extend({},a))),null!=t.top&&(h.top=t.top-a.top+s),null!=t.left&&(h.left=t.left-a.left+i),"using"in t?t.using.call(e,h):u.css(h)}},k.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){k.offset.setOffset(this,e,t)}));var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===k.css(e,"position");)e=e.offsetParent;return e||fe}))}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;k.fn[e]=function(r){return Z(this,(function(e,r,i){var o;if(g(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i}),e,r,arguments.length)}})),k.each(["top","left"],(function(e,t){k.cssHooks[t]=Ze(f.pixelPosition,(function(e,n){if(n)return n=Je(e,t),Ue.test(n)?k(e).position()[t]+"px":n}))})),k.each({Height:"height",Width:"width"},(function(e,t){k.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){k.fn[r]=function(i,o){var s=arguments.length&&(n||"boolean"!=typeof i),a=n||(!0===i||!0===o?"margin":"border");return Z(this,(function(t,n,i){var o;return g(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?k.css(t,n,a):k.style(t,n,i,a)}),t,s?i:void 0,s)}}))})),k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){k.fn[t]=function(e){return this.on(t,e)}})),k.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){k.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}));var tn=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;k.proxy=function(e,t){var n,r,o;if("string"==typeof t&&(n=e[t],t=e,e=n),p(e))return r=i.call(arguments,2),o=function(){return e.apply(t||this,r.concat(i.call(arguments)))},o.guid=e.guid=e.guid||k.guid++,o},k.holdReady=function(e){e?k.readyWait++:k.ready(!0)},k.isArray=Array.isArray,k.parseJSON=JSON.parse,k.nodeName=_,k.isFunction=p,k.isWindow=g,k.camelCase=ne,k.type=v,k.now=Date.now,k.isNumeric=function(e){var t=k.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},k.trim=function(e){return null==e?"":(e+"").replace(tn,"$1")};var nn=e.jQuery,rn=e.$;return k.noConflict=function(t){return e.$===k&&(e.$=rn),t&&e.jQuery===k&&(e.jQuery=nn),k},void 0===t&&(e.jQuery=e.$=k),k}))}(i)),i.exports),a=n(s),l={"Visualization.Histogram.MeasureAxisLabel":{id:"Visualization.Histogram.MeasureAxisLabel",locale:{"en-US":"Frequency","zh-TW":"頻率","zh-CN":"频率","tr-TR":"Sıklık","sv-SE":"Frekvens","it-IT":"Frequenza","es-ES":"Frecuencia","de-DE":"Häufigkeit","pl-PL":"Częstotliwość","nl-NL":"Frequentie","ko-KR":"빈도","pt-BR":"Frequência","fr-FR":"Fréquence","ja-JP":"レコード数","ru-RU":"Частота"}},"waterfall.legend.positiveValue.label":{id:"waterfall.legend.positiveValue.label",locale:{"en-US":"Positive","zh-TW":"正值","zh-CN":"正","tr-TR":"Pozitif","sv-SE":"Positiv","it-IT":"Positivi","es-ES":"Positivo","de-DE":"Positiv","pl-PL":"Dodatnie","nl-NL":"Positief","ko-KR":"양수","pt-BR":"Positivo","fr-FR":"Positive","ja-JP":"正","ru-RU":"Положительное"}},"waterfall.legend.negativeValue.label":{id:"waterfall.legend.negativeValue.label",locale:{"en-US":"Negative","zh-TW":"負值","zh-CN":"负","tr-TR":"Negatif","sv-SE":"Negativ","it-IT":"Negativi","es-ES":"Negativo","de-DE":"Negativ","pl-PL":"Ujemne","nl-NL":"Negatief","ko-KR":"음수","pt-BR":"Negativo","fr-FR":"Négative","ja-JP":"負","ru-RU":"Отрицательное"}},"waterfall.legend.subtotal.label":{id:"waterfall.legend.subtotal.label",locale:{"en-US":"Subtotal","zh-TW":"小計","zh-CN":"小计","tr-TR":"Ara Toplam","sv-SE":"Deltotal","it-IT":"Subtotale","es-ES":"Subtotal","de-DE":"Teilsumme","pl-PL":"Suma częściowa","nl-NL":"Subtotaal","ko-KR":"소계","pt-BR":"Subtotal","fr-FR":"Sous-total","ja-JP":"小計","ru-RU":"Подытог"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"en-US":"Currently showing a limited data set.","zh-TW":"目前顯示的是有限的資料集。","zh-CN":"当前正显示有限的数据集。","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","sv-SE":"Just nu visas en begränsad uppsättning data.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","pt-BR":"Mostrando um conjunto de dados limitado.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","ja-JP":"現在、限定的なデータ セットを表示しています。","ru-RU":"В настоящее время отображается ограниченный набор данных."}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"en-US":"The chart is not displayed because it contains only undefined values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。","zh-CN":"未显示图表,因为它仅包含未定义的值。","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości niezdefiniowane.","nl-NL":"De grafiek wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения."}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"en-US":"The chart is not displayed because it contains only negative or zero values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。","zh-CN":"未显示图表,因为它仅包含负值或零值。","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa eller nollvärden","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","es-ES":"El gráfico no se muestra porque sólo contiene valores negativos o valores cero.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości ujemne lub zerowe.","nl-NL":"De grafiek wordt niet weergegeven omdat het alleen negatieve waarden of nulwaarden bevat.","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения."}},Object_Disclaimer_RequireNumericDimension:{id:"Object.Disclaimer.RequireNumericDimension",locale:{"en-US":"This visualization requires a numeric diemnsion."}},"properties.boxplot.calculationMode.tukey.elements.boxEnd":{id:"properties.boxplot.calculationMode.tukey.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.tukey.elements.boxMiddle":{id:"properties.boxplot.calculationMode.tukey.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Drittes Quartil","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.tukey.elements.boxStart":{id:"properties.boxplot.calculationMode.tukey.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.tukey.elements.firstWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.firstWhisker",locale:{"en-US":"Box start - {0} IQR","zh-TW":"方塊開始 - {0} IQR","zh-CN":"框开始 - {0} IQR","tr-TR":"Kutu başlangıcı - {0} IQR","sv-SE":"Rutans start - {0} IQR","it-IT":"Inizio scatola - {0} IQR","es-ES":"Inicio de caja - {0} IQR","de-DE":"Box-Beginn - {0} IQR","pl-PL":"Początek wykresu pudełkowego - {0} IQR","nl-NL":"Begin box - {0} IQR","ko-KR":"상자 시작 - {0} IQR","pt-BR":"Início da caixa - {0} IQR","fr-FR":"Début de la boîte - {0} IQR","ja-JP":"ボックス開始 - {0} IQR","ru-RU":"Начало поля - {0} IQR"}},"properties.boxplot.calculationMode.tukey.elements.lastWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.lastWhisker",locale:{"en-US":"Box end + {0} IQR","zh-TW":"方塊結束 + {0} IQR","zh-CN":"框结束 + {0} IQR","tr-TR":"Kutu bitişi + {0} IQR","sv-SE":"Rutans slut + {0} IQR","it-IT":"Fine scatola + {0} IQR","es-ES":"Fin de caja + {0} IQR","de-DE":"Box-Ende + {0} IQR","pl-PL":"Koniec wykresu pudełkowego - {0} IQR","nl-NL":"Einde box + {0} IQR","ko-KR":"상자 끝 + {0} IQR","pt-BR":"Fim da caixa + {0} IQR","fr-FR":"Fin de la boîte + {0} IQR","ja-JP":"ボックス終了 + {0} IQR","ru-RU":"Конец поля + {0} IQR"}},"properties.boxplot.calculationMode.stdDev.elements.boxEnd":{id:"properties.boxplot.calculationMode.stdDev.elements.boxEnd",locale:{"en-US":"Box middle + 1 standard deviation","zh-TW":"方塊中間 + 1 個標準差","zh-CN":"框中部 + 1 个标准偏差","tr-TR":"Kutu ortası + 1 standart sapma","sv-SE":"Rutans mitt + 1 standardavvikelse","it-IT":"Centro scatola + 1 deviazione standard","es-ES":"Mitad de la caja + 1 desviación estándar","de-DE":"Box-Mitte +1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego + 1 odch. stand","nl-NL":"Midden box + 1 standaardafwijking","ko-KR":"상자 중간 + 1개 표준 편차","pt-BR":"Meio da caixa + 1 desvio padrão","fr-FR":"Milieu de la boîte + 1 écart type","ja-JP":"ボックス中間 + 1 標準偏差","ru-RU":"Середина поля + 1 стандартное отклонение"}},"properties.boxplot.calculationMode.stdDev.elements.boxMiddle":{id:"properties.boxplot.calculationMode.stdDev.elements.boxMiddle",locale:{"en-US":"Average","zh-TW":"平均值","zh-CN":"平均值","tr-TR":"Ortalama","sv-SE":"Medel","it-IT":"Media","es-ES":"Media","de-DE":"Durchschnitt","pl-PL":"Średnia","nl-NL":"Gemiddelde","ko-KR":"평균","pt-BR":"Média","fr-FR":"Moyenne","ja-JP":"平均値","ru-RU":"Среднее"}},"properties.boxplot.calculationMode.stdDev.elements.boxStart":{id:"properties.boxplot.calculationMode.stdDev.elements.boxStart",locale:{"en-US":"Box middle - 1 standard deviation","zh-TW":"方塊中間 - 1 個標準差","zh-CN":"框中部 - 1 个标准偏差","tr-TR":"Kutu ortası - 1 standart sapma","sv-SE":"Rutans mitt - 1 standardavvikelse","it-IT":"Centro scatola - 1 deviazione standard","es-ES":"Mitad de la caja - {1} desviación estándar","de-DE":"Box-Mitte -1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego - 1 odch. stand","nl-NL":"Midden box - 1 standaardafwijking","ko-KR":"상자 중간 - 1개 표준 편차","pt-BR":"Середина поля - 1 стандартное отклонение","fr-FR":"Milieu de la boîte - 1 écart type","ja-JP":"ボックス中間 - 1 標準偏差","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.stdDev.elements.firstWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.firstWhisker",locale:{"en-US":"Box middle - {0} standard deviations","zh-TW":"方塊中間 - {0} 個標準差","zh-CN":"框中部 - {0} 个标准偏差","tr-TR":"Kutu ortası - {0} standart sapma","sv-SE":"Rutans mitt - {0} standardavvikelser","it-IT":"Centro scatola - {0} deviazioni standard","es-ES":"Mitad de la caja - {0} desviaciones estándar","de-DE":"Box-Mitte -{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego - {0} odch. stand","nl-NL":"Midden box - {0} standaardafwijkingen","ko-KR":"상자 중간 - {0}개 표준 편차","pt-BR":"Meio da caixa - {0} desvios padrão","fr-FR":"Milieu de la boîte - {0} écarts types","ja-JP":"ボックス中間 - {0} 標準偏差","ru-RU":"Середина поля - {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.stdDev.elements.lastWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.lastWhisker",locale:{"en-US":"Box middle + {0} standard deviations","zh-TW":"方塊中間 + {0} 個標準差","zh-CN":"框中部 + {0} 个标准偏差","tr-TR":"Kutu ortası + {0} standart sapma","sv-SE":"Rutans mitt + {0} standardavvikelser","it-IT":"Centro scatola + {0} deviazioni standard","es-ES":"Mitad de la caja + {0} desviaciones estándar","de-DE":"Box-Mitte +{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego + {0} odch. stand","nl-NL":"Midden box + {0} standaardafwijkingen","ko-KR":"상자 중간 + {0}개 표준 편차","pt-BR":"Meio da caixa + {0} desvios padrão","fr-FR":"Milieu de la boîte + {0} écarts types","ja-JP":"ボックス中間 + {0} 標準偏差","ru-RU":"Середина поля + {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.fractiles.elements.boxEnd":{id:"properties.boxplot.calculationMode.fractiles.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile<","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.boxMiddle":{id:"properties.boxplot.calculationMode.fractiles.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Median","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.fractiles.elements.boxStart":{id:"properties.boxplot.calculationMode.fractiles.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth",locale:{"en-US":"5th percentile","zh-TW":"第 5 個百分位數","zh-CN":"第 5 个百分位","tr-TR":"5. yüzdebirlik","sv-SE":"5:e percentilen","it-IT":"5° percentile","es-ES":"5º percentil","de-DE":"5. Perzentil","pl-PL":"5. percentyl","nl-NL":"5e percentiel","ko-KR":"5번째 백분위수","pt-BR":"5º percentil","fr-FR":"5e centile","ja-JP":"5 番目のパーセンタイル","ru-RU":"5-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first",locale:{"en-US":"1st percentile","zh-TW":"第 1 個百分位數","zh-CN":"第 1 个百分位","tr-TR":"1. yüzdebirlik","sv-SE":"1:e percentilen","it-IT":"1° percentile","es-ES":"1er percentil","de-DE":"1. Perzentil","pl-PL":"1. percentyl","nl-NL":"1e percentiel","ko-KR":"1번째 백분위수","pt-BR":"1º percentil","fr-FR":"1er centile","ja-JP":"1 番目のパーセンタイル","ru-RU":"1-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min",locale:{"en-US":"Minimum","zh-TW":"最小","zh-CN":"最小值","tr-TR":"En az","sv-SE":"Min","it-IT":"Minimo","es-ES":"Mínimo","de-DE":"Minimum","pl-PL":"Minimum","nl-NL":"Minimum","ko-KR":"최소","pt-BR":"Mínimo","fr-FR":"Minimale","ja-JP":"最小値","ru-RU":"Минимум"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth",locale:{"en-US":"10th percentile","zh-TW":"第 10 個百分位數","zh-CN":"第 10 个百分位","tr-TR":"10. yüzdebirlik","sv-SE":"10:e percentilen","it-IT":"10° percentile","es-ES":"10º percentil","de-DE":"10. Perzentil","pl-PL":"10. percentyl","nl-NL":"10e percentiel","ko-KR":"10번째 백분위수","pt-BR":"10º percentil","fr-FR":"10e centile","ja-JP":"10 番目のパーセンタイル","ru-RU":"10-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max",locale:{"en-US":"Maximum","zh-TW":"最大","zh-CN":"最大值","tr-TR":"En fazla","sv-SE":"Max","it-IT":"Massimo","es-ES":"Máximo","de-DE":"Maximum","pl-PL":"Maksimum","nl-NL":"Maximum","ko-KR":"최대","pt-BR":"Máximo","fr-FR":"Maximale","ja-JP":"最大値","ru-RU":"Максимум"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth",locale:{"en-US":"90th percentile","zh-TW":"第 90 個百分位數","zh-CN":"第 90 个百分位","tr-TR":"90. yüzdebirlik","sv-SE":"90:e percentilen","it-IT":"90° percentile","es-ES":"90º percentil","de-DE":"90. Perzentil","pl-PL":"90. percentyl","nl-NL":"90e percentiel","ko-KR":"90번째 백분위수","pt-BR":"90º percentil","fr-FR":"90e centile","ja-JP":"90 番目の百分位数","ru-RU":"90-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth",locale:{"en-US":"95th percentile","zh-TW":"第 95 個百分位數","zh-CN":"第 95 个百分位","tr-TR":"95. yüzdebirlik","sv-SE":"95:e percentilen","it-IT":"95° percentile","es-ES":"95º percentil","de-DE":"95. Perzentil","pl-PL":"95. percentyl","nl-NL":"95e percentiel","ko-KR":"95번째 백분위수","pt-BR":"95º percentil","fr-FR":"95e centile","ja-JP":"95 番目の百分位数","ru-RU":"95-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth",locale:{"en-US":"99th percentile","zh-TW":"第 99 個百分位數","zh-CN":"第 99 个百分位","tr-TR":"99. yüzdebirlik","sv-SE":"99:e percentilen","it-IT":"99° percentile","es-ES":"99º percentil","de-DE":"99. Perzentil","pl-PL":"99. percentyl","nl-NL":"99e percentiel","ko-KR":"99번째 백분위수","pt-BR":"99º percentil","fr-FR":"99e centile","ja-JP":"99 番目の百分位数","ru-RU":"99-й процентиль"}}};var c={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},u=/([astvzqmhlc])([^astvzqmhlc]*)/gi,h=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;var d=function(e){var t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(u,(function(e,n,r){var i=n.toLowerCase(),o=function(e){var t=e.match(h);return t?t.map(Number):[]}(r),s=n;if("m"===i&&o.length>2&&(t.push([s].concat(o.splice(0,2))),i="l",s="m"===s?"l":"L"),o.length<c[i])return"";for(t.push([s].concat(o.splice(0,c[i])));o.length>=c[i]&&o.length&&c[i];)t.push([s].concat(o.splice(0,c[i])));return""})),t};function f(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var m=d;function y(e,t){var n=e.x*Math.cos(t)-e.y*Math.sin(t),r=e.y*Math.cos(t)+e.x*Math.sin(t);e.x=n,e.y=r}function b(e,t,n){e.x+=t,e.y+=n}function v(e,t){e.x*=t,e.y*=t}var x=function(e){if(void 0!==e&&e.CanvasRenderingContext2D&&(!e.Path2D||!function(e){var t=e.document.createElement("canvas").getContext("2d"),n=new e.Path2D("M0 0 L1 1");return t.strokeStyle="red",t.lineWidth=1,t.stroke(n),255===t.getImageData(0,0,1,1).data[0]}(e))){var t=function(){function e(t){var n;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.segments=[],t&&t instanceof e)?(n=this.segments).push.apply(n,p(t.segments)):t&&(this.segments=m(t))}return f(e,[{key:"addPath",value:function(t){var n;t&&t instanceof e&&(n=this.segments).push.apply(n,p(t.segments))}},{key:"moveTo",value:function(e,t){this.segments.push(["M",e,t])}},{key:"lineTo",value:function(e,t){this.segments.push(["L",e,t])}},{key:"arc",value:function(e,t,n,r,i,o){this.segments.push(["AC",e,t,n,r,i,!!o])}},{key:"arcTo",value:function(e,t,n,r,i){this.segments.push(["AT",e,t,n,r,i])}},{key:"ellipse",value:function(e,t,n,r,i,o,s,a){this.segments.push(["E",e,t,n,r,i,o,s,!!a])}},{key:"closePath",value:function(){this.segments.push(["Z"])}},{key:"bezierCurveTo",value:function(e,t,n,r,i,o){this.segments.push(["C",e,t,n,r,i,o])}},{key:"quadraticCurveTo",value:function(e,t,n,r){this.segments.push(["Q",e,t,n,r])}},{key:"rect",value:function(e,t,n,r){this.segments.push(["R",e,t,n,r])}}]),e}(),n=e.CanvasRenderingContext2D.prototype.fill,r=e.CanvasRenderingContext2D.prototype.stroke;e.CanvasRenderingContext2D.prototype.fill=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i="nonzero";0===t.length||1===t.length&&"string"==typeof t[0]?n.apply(this,t):(2===arguments.length&&(i=t[1]),o(this,t[0].segments),n.call(this,i))},e.CanvasRenderingContext2D.prototype.stroke=function(e){e?(o(this,e.segments),r.call(this)):r.call(this)};var i=e.CanvasRenderingContext2D.prototype.isPointInPath;e.CanvasRenderingContext2D.prototype.isPointInPath=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if("Path2D"===t[0].constructor.name){var r=t[1],s=t[2],a=t[3]||"nonzero";return o(this,t[0].segments),i.apply(this,[r,s,a])}return i.apply(this,t)},e.Path2D=t}function o(e,t){var n,r,i,o,s,a,l,c,u,h,d,f,p,g,m,x,w,k,M,_,S,q,D,C,E,A,T={x:0,y:0},N={x:0,y:0};e.beginPath();for(var R=0;R<t.length;++R){var O=t[R];switch("S"!==(_=O[0])&&"s"!==_&&"C"!==_&&"c"!==_&&(q=null,D=null),"T"!==_&&"t"!==_&&"Q"!==_&&"q"!==_&&(C=null,E=null),_){case"m":case"M":"m"===_?(d+=O[1],p+=O[2]):(d=O[1],p=O[2]),"M"!==_&&T||(T={x:d,y:p}),e.moveTo(d,p);break;case"l":d+=O[1],p+=O[2],e.lineTo(d,p);break;case"L":d=O[1],p=O[2],e.lineTo(d,p);break;case"H":d=O[1],e.lineTo(d,p);break;case"h":d+=O[1],e.lineTo(d,p);break;case"V":p=O[1],e.lineTo(d,p);break;case"v":p+=O[1],e.lineTo(d,p);break;case"a":case"A":"a"===_?(d+=O[6],p+=O[7]):(d=O[6],p=O[7]),x=O[1],w=O[2],l=O[3]*Math.PI/180,i=!!O[4],o=!!O[5],s={x:d,y:p},y(a={x:(N.x-s.x)/2,y:(N.y-s.y)/2},-l),(c=a.x*a.x/(x*x)+a.y*a.y/(w*w))>1&&(x*=c=Math.sqrt(c),w*=c),u=x*x*w*w,h=x*x*a.y*a.y+w*w*a.x*a.x,v(S={x:x*a.y/w,y:-w*a.x/x},o!==i?Math.sqrt((u-h)/h)||0:-Math.sqrt((u-h)/h)||0),r=Math.atan2((a.y-S.y)/w,(a.x-S.x)/x),n=Math.atan2(-(a.y+S.y)/w,-(a.x+S.x)/x),y(S,l),b(S,(s.x+N.x)/2,(s.y+N.y)/2),e.save(),e.translate(S.x,S.y),e.rotate(l),e.scale(x,w),e.arc(0,0,1,r,n,!o),e.restore();break;case"C":q=O[3],D=O[4],d=O[5],p=O[6],e.bezierCurveTo(O[1],O[2],q,D,d,p);break;case"c":e.bezierCurveTo(O[1]+d,O[2]+p,O[3]+d,O[4]+p,O[5]+d,O[6]+p),q=O[3]+d,D=O[4]+p,d+=O[5],p+=O[6];break;case"S":null!==q&&null!==D||(q=d,D=p),e.bezierCurveTo(2*d-q,2*p-D,O[1],O[2],O[3],O[4]),q=O[1],D=O[2],d=O[3],p=O[4];break;case"s":null!==q&&null!==D||(q=d,D=p),e.bezierCurveTo(2*d-q,2*p-D,O[1]+d,O[2]+p,O[3]+d,O[4]+p),q=O[1]+d,D=O[2]+p,d+=O[3],p+=O[4];break;case"Q":C=O[1],E=O[2],d=O[3],p=O[4],e.quadraticCurveTo(C,E,d,p);break;case"q":C=O[1]+d,E=O[2]+p,d+=O[3],p+=O[4],e.quadraticCurveTo(C,E,d,p);break;case"T":null!==C&&null!==E||(C=d,E=p),C=2*d-C,E=2*p-E,d=O[1],p=O[2],e.quadraticCurveTo(C,E,d,p);break;case"t":null!==C&&null!==E||(C=d,E=p),C=2*d-C,E=2*p-E,d+=O[1],p+=O[2],e.quadraticCurveTo(C,E,d,p);break;case"z":case"Z":d=T.x,p=T.y,T=void 0,e.closePath();break;case"AC":d=O[1],p=O[2],m=O[3],r=O[4],n=O[5],A=O[6],e.arc(d,p,m,r,n,A);break;case"AT":f=O[1],g=O[2],d=O[3],p=O[4],m=O[5],e.arcTo(f,g,d,p,m);break;case"E":d=O[1],p=O[2],x=O[3],w=O[4],l=O[5],r=O[6],n=O[7],A=O[8],e.save(),e.translate(d,p),e.rotate(l),e.scale(x,w),e.arc(0,0,1,r,n,A),e.restore();break;case"R":d=O[1],p=O[2],k=O[3],M=O[4],T={x:d,y:p},e.rect(d,p,k,M)}N.x=d,N.y=p}}},w=d,k=x;"undefined"!=typeof window&&k(window);var M={path2dPolyfill:k,parsePath:w},_=Object.prototype.hasOwnProperty,S=Object.prototype.toString,q=Object.defineProperty,D=Object.getOwnPropertyDescriptor,C=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===S.call(e)},E=function(e){if(!e||"[object Object]"!==S.call(e))return!1;var t,n=_.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&_.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||_.call(e,t)},A=function(e,t){q&&"__proto__"===t.name?q(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},T=function(e,t){if("__proto__"===t){if(!_.call(e,t))return;if(D)return D(e,t).value}return e[t]},N=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=T(a,n),a!==(i=T(t,n))&&(u&&i&&(E(i)||(o=C(i)))?(o?(o=!1,s=r&&C(r)?r:[]):s=r&&E(r)?r:{},A(a,{name:n,newValue:e(u,s,i)})):void 0!==i&&A(a,{name:n,newValue:i}));return a},R="2.2.4";function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function P(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e){return!!e.changedTouches}function j(e){return"number"==typeof e&&!isNaN(e)}function z(e){return"number"!=typeof e||isNaN(e)}function F(e){const t=e.length;let n=NaN,r=NaN,i=NaN,o=NaN;for(let s=0;s<t;s++)n=isNaN(n)?e[s].x:Math.min(n,e[s].x),r=isNaN(r)?e[s].x:Math.max(r,e[s].x),i=isNaN(i)?e[s].y:Math.min(i,e[s].y),o=isNaN(o)?e[s].y:Math.max(o,e[s].y);return[n,i,r,o]}function H(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function B(e){return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}]}function V(e){const[t,n,r,i]=F(e);return{x:t,y:n,width:r-t,height:i-n}}function $(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function W(e){const{x:t,y:n,width:r,height:i,x1:o,x2:s,y1:a,y2:l,cx:c,cy:u,r:h,vertices:d}=e||{};return j(c)&&j(u)&&j(h)?"circle":j(o)&&j(s)&&j(a)&&j(l)?"line":j(t)&&j(n)&&j(r)&&j(i)?"rect":j(t)&&j(n)?"point":Array.isArray(d)?d.every((e=>Array.isArray(e)))?"geopolygon":"polygon":null}function U(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}var Y=Math.PI,K=2*Y,X=1e-6,G=K-X;function J(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Z(){return new J}function Q(e){return function(){return e}}J.prototype=Z.prototype={constructor:J,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var o=this._x1,s=this._y1,a=n-e,l=r-t,c=o-e,u=s-t,h=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>X)if(Math.abs(u*a-l*c)>X&&i){var d=n-o,f=r-s,p=a*a+l*l,g=d*d+f*f,m=Math.sqrt(p),y=Math.sqrt(h),b=i*Math.tan((Y-Math.acos((p+h-g)/(2*m*y)))/2),v=b/y,x=b/m;Math.abs(v-1)>X&&(this._+="L"+(e+v*c)+","+(t+v*u)),this._+="A"+i+","+i+",0,0,"+ +(u*d>c*f)+","+(this._x1=e+x*a)+","+(this._y1=t+x*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,r,i,o){e=+e,t=+t,o=!!o;var s=(n=+n)*Math.cos(r),a=n*Math.sin(r),l=e+s,c=t+a,u=1^o,h=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>X||Math.abs(this._y1-c)>X)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%K+K),h>G?this._+="A"+n+","+n+",0,1,"+u+","+(e-s)+","+(t-a)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>X&&(this._+="A"+n+","+n+",0,"+ +(h>=Y)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var ee=Math.abs,te=Math.atan2,ne=Math.cos,re=Math.max,ie=Math.min,oe=Math.sin,se=Math.sqrt,ae=1e-12,le=Math.PI,ce=le/2,ue=2*le;function he(e){return e>=1?ce:e<=-1?-ce:Math.asin(e)}function de(e){return e.innerRadius}function fe(e){return e.outerRadius}function pe(e){return e.startAngle}function ge(e){return e.endAngle}function me(e){return e&&e.padAngle}function ye(e,t,n,r,i,o,s){var a=e-n,l=t-r,c=(s?o:-o)/se(a*a+l*l),u=c*l,h=-c*a,d=e+u,f=t+h,p=n+u,g=r+h,m=(d+p)/2,y=(f+g)/2,b=p-d,v=g-f,x=b*b+v*v,w=i-o,k=d*g-p*f,M=(v<0?-1:1)*se(re(0,w*w*x-k*k)),_=(k*v-b*M)/x,S=(-k*b-v*M)/x,q=(k*v+b*M)/x,D=(-k*b+v*M)/x,C=_-m,E=S-y,A=q-m,T=D-y;return C*C+E*E>A*A+T*T&&(_=q,S=D),{cx:_,cy:S,x01:-u,y01:-h,x11:_*(i/w-1),y11:S*(i/w-1)}}function be(){var e=de,t=fe,n=Q(0),r=null,i=pe,o=ge,s=me,a=null;function l(){var l,c,u=+e.apply(this,arguments),h=+t.apply(this,arguments),d=i.apply(this,arguments)-ce,f=o.apply(this,arguments)-ce,p=ee(f-d),g=f>d;if(a||(a=l=Z()),h<u&&(c=h,h=u,u=c),h>ae)if(p>ue-ae)a.moveTo(h*ne(d),h*oe(d)),a.arc(0,0,h,d,f,!g),u>ae&&(a.moveTo(u*ne(f),u*oe(f)),a.arc(0,0,u,f,d,g));else{var m,y,b=d,v=f,x=d,w=f,k=p,M=p,_=s.apply(this,arguments)/2,S=_>ae&&(r?+r.apply(this,arguments):se(u*u+h*h)),q=ie(ee(h-u)/2,+n.apply(this,arguments)),D=q,C=q;if(S>ae){var E=he(S/u*oe(_)),A=he(S/h*oe(_));(k-=2*E)>ae?(x+=E*=g?1:-1,w-=E):(k=0,x=w=(d+f)/2),(M-=2*A)>ae?(b+=A*=g?1:-1,v-=A):(M=0,b=v=(d+f)/2)}var T=h*ne(b),N=h*oe(b),R=u*ne(w),O=u*oe(w);if(q>ae){var I,P=h*ne(v),L=h*oe(v),j=u*ne(x),z=u*oe(x);if(p<le&&(I=function(e,t,n,r,i,o,s,a){var l=n-e,c=r-t,u=s-i,h=a-o,d=h*l-u*c;if(!(d*d<ae))return[e+(d=(u*(t-o)-h*(e-i))/d)*l,t+d*c]}(T,N,j,z,P,L,R,O))){var F=T-I[0],H=N-I[1],B=P-I[0],V=L-I[1],$=1/oe(function(e){return e>1?0:e<-1?le:Math.acos(e)}((F*B+H*V)/(se(F*F+H*H)*se(B*B+V*V)))/2),W=se(I[0]*I[0]+I[1]*I[1]);D=ie(q,(u-W)/($-1)),C=ie(q,(h-W)/($+1))}}M>ae?C>ae?(m=ye(j,z,T,N,h,C,g),y=ye(P,L,R,O,h,C,g),a.moveTo(m.cx+m.x01,m.cy+m.y01),C<q?a.arc(m.cx,m.cy,C,te(m.y01,m.x01),te(y.y01,y.x01),!g):(a.arc(m.cx,m.cy,C,te(m.y01,m.x01),te(m.y11,m.x11),!g),a.arc(0,0,h,te(m.cy+m.y11,m.cx+m.x11),te(y.cy+y.y11,y.cx+y.x11),!g),a.arc(y.cx,y.cy,C,te(y.y11,y.x11),te(y.y01,y.x01),!g))):(a.moveTo(T,N),a.arc(0,0,h,b,v,!g)):a.moveTo(T,N),u>ae&&k>ae?D>ae?(m=ye(R,O,P,L,u,-D,g),y=ye(T,N,j,z,u,-D,g),a.lineTo(m.cx+m.x01,m.cy+m.y01),D<q?a.arc(m.cx,m.cy,D,te(m.y01,m.x01),te(y.y01,y.x01),!g):(a.arc(m.cx,m.cy,D,te(m.y01,m.x01),te(m.y11,m.x11),!g),a.arc(0,0,u,te(m.cy+m.y11,m.cx+m.x11),te(y.cy+y.y11,y.cx+y.x11),g),a.arc(y.cx,y.cy,D,te(y.y11,y.x11),te(y.y01,y.x01),!g))):a.arc(0,0,u,w,x,g):a.lineTo(R,O)}else a.moveTo(0,0);if(a.closePath(),l)return a=null,l+""||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-le/2;return[ne(r)*n,oe(r)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Q(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Q(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:Q(+e),l):n},l.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:Q(+e),l):r},l.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:Q(+e),l):i},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:Q(+e),l):o},l.padAngle=function(e){return arguments.length?(s="function"==typeof e?e:Q(+e),l):s},l.context=function(e){return arguments.length?(a=null==e?null:e,l):a},l}function ve(e){this._context=e}function xe(e){return new ve(e)}function we(e){return e[0]}function ke(e){return e[1]}function Me(){var e=we,t=null,n=Q(0),r=ke,i=Q(!0),o=null,s=xe,a=null;function l(l){var c,u,h,d,f,p=l.length,g=!1,m=new Array(p),y=new Array(p);for(null==o&&(a=s(f=Z())),c=0;c<=p;++c){if(!(c<p&&i(d=l[c],c,l))===g)if(g=!g)u=c,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),h=c-1;h>=u;--h)a.point(m[h],y[h]);a.lineEnd(),a.areaEnd()}g&&(m[c]=+e(d,c,l),y[c]=+n(d,c,l),a.point(t?+t(d,c,l):m[c],r?+r(d,c,l):y[c]))}if(f)return a=null,f+""||null}function c(){return function(){var e=we,t=ke,n=Q(!0),r=null,i=xe,o=null;function s(s){var a,l,c,u=s.length,h=!1;for(null==r&&(o=i(c=Z())),a=0;a<=u;++a)!(a<u&&n(l=s[a],a,s))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(l,a,s),+t(l,a,s));if(c)return o=null,c+""||null}return s.x=function(t){return arguments.length?(e="function"==typeof t?t:Q(+t),s):e},s.y=function(e){return arguments.length?(t="function"==typeof e?e:Q(+e),s):t},s.defined=function(e){return arguments.length?(n="function"==typeof e?e:Q(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),s):i},s.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),s):r},s}().defined(i).curve(s).context(o)}return l.x=function(n){return arguments.length?(e="function"==typeof n?n:Q(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:Q(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:Q(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:Q(+e),r=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:Q(+e),l):n},l.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:Q(+e),l):r},l.lineX0=l.lineY0=function(){return c().x(e).y(n)},l.lineY1=function(){return c().x(e).y(r)},l.lineX1=function(){return c().x(t).y(n)},l.defined=function(e){return arguments.length?(i="function"==typeof e?e:Q(!!e),l):i},l.curve=function(e){return arguments.length?(s=e,null!=o&&(a=s(o)),l):s},l.context=function(e){return arguments.length?(null==e?o=a=null:a=s(o=e),l):o},l}function _e(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Se(e){return e}ve.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var qe=Array.prototype.slice;function De(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Ce(e){this._context=e}function Ee(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Ae(e,t){this._context=e,this._k=(1-t)/6}Ce.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:De(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:De(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Ae.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Ee(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Ee(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Te=function e(t){function n(e){return new Ae(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Ne(e,t){this._context=e,this._alpha=t}Ne.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var r=e._x1,i=e._y1,o=e._x2,s=e._y2;if(e._l01_a>ae){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>ae){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,s=(s*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,s,e._x2,e._y2)}(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Re=function e(t){function n(e){return t?new Ne(e,t):new Ae(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Oe(e){return e<0?-1:1}function Ie(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(Oe(o)+Oe(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function Pe(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Le(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,a=(o-r)/3;e._context.bezierCurveTo(r+a,i+a*t,o-a,s-a*n,o,s)}function je(e){this._context=e}function ze(e){this._context=new Fe(e)}function Fe(e){this._context=e}function He(e){this._context=e}function Be(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),s=new Array(r);for(i[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,s[t]-=n*s[t-1];for(i[r-1]=s[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function Ve(e,t){this._context=e,this._t=t}function $e(e,t){if((i=e.length)>1)for(var n,r,i,o=1,s=e[t[0]],a=s.length;o<i;++o)for(r=s,s=e[t[o]],n=0;n<a;++n)s[n][1]+=s[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function We(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Ue(e,t){return e[t]}function Ye(e){for(var t,n=-1,r=0,i=e.length,o=-1/0;++n<i;)(t=+e[n][1])>o&&(o=t,r=n);return r}function Ke(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function Xe(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",r=arguments.length>2?arguments[2]:void 0;const i={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};function s(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in i)&&(i[e]=t,!0)}function a(e){return i[e]||o.get(e)}function l(e,i){if(void 0!==i)return s(e,i);const o=a(e);return r&&void 0===o&&r.warn("".concat(e," does not exist in ").concat(n," registry")),o||a(t)}return t=o.default(),l.add=s,l.get=a,l.has=function(e){return!!i[e]||o.has(e)},l.remove=function(e){const t=i[e];return delete i[e],t},l.getKeys=function(){return Object.keys(i)},l.getValues=function(){return Object.keys(i).map((e=>i[e]))},l.default=function(e){return void 0!==e&&(t=e),t},l.register=s,l}function Ge(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Je(e){return(e=Ge(Math.abs(e)))?e[1]:NaN}je.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Le(this,this._t0,Pe(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Le(this,Pe(this,n=Ie(this,e,t)),n);break;default:Le(this,this._t0,n=Ie(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(ze.prototype=Object.create(je.prototype)).point=function(e,t){je.prototype.point.call(this,t,e)},Fe.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},He.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=Be(e),i=Be(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[s],t[s]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},Ve.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var Ze,Qe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function et(e){if(!(t=Qe.exec(e)))throw new Error("invalid format: "+e);var t;return new tt({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function tt(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function nt(e,t){var n=Ge(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}et.prototype=tt.prototype,tt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var rt={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>nt(100*e,t),r:nt,s:function(e,t){var n=Ge(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(Ze=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Ge(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function it(e){return e}var ot,st,at,lt=Array.prototype.map,ct=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ut(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?it:(t=lt.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],s=0,a=t[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(e.substring(i-=a,i+a)),!((l+=a+1)>r));)a=t[s=(s+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",s=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?it:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(lt.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e){var t=(e=et(e)).fill,n=e.align,h=e.sign,d=e.symbol,f=e.zero,p=e.width,g=e.comma,m=e.precision,y=e.trim,b=e.type;"n"===b?(g=!0,b="g"):rt[b]||(void 0===m&&(m=12),y=!0,b="g"),(f||"0"===t&&"="===n)&&(f=!0,t="0",n="=");var v="$"===d?i:"#"===d&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",x="$"===d?o:/[%p]/.test(b)?l:"",w=rt[b],k=/[defgprs%]/.test(b);function M(e){var i,o,l,d=v,M=x;if("c"===b)M=w(e)+M,e="";else{var _=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),m),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),_&&0==+e&&"+"!==h&&(_=!1),d=(_?"("===h?h:c:"-"===h||"("===h?"":h)+d,M=("s"===b?ct[8+Ze/3]:"")+M+(_&&"("===h?")":""),k)for(i=-1,o=e.length;++i<o;)if(48>(l=e.charCodeAt(i))||l>57){M=(46===l?s+e.slice(i+1):e.slice(i))+M,e=e.slice(0,i);break}}g&&!f&&(e=r(e,1/0));var S=d.length+e.length+M.length,q=S<p?new Array(p-S+1).join(t):"";switch(g&&f&&(e=r(q+e,q.length?p-M.length:1/0),q=""),n){case"<":e=d+e+M+q;break;case"=":e=d+q+e+M;break;case"^":e=q.slice(0,S=q.length>>1)+d+e+M+q.slice(S);break;default:e=q+d+e+M}return a(e)}return m=void 0===m?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),M.toString=function(){return e+""},M}return{format:h,formatPrefix:function(e,t){var n=h(((e=et(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(Je(t)/3))),i=Math.pow(10,-r),o=ct[8+r/3];return function(e){return n(i*e)+o}}}}!function(e){ot=ut(e),st=ot.format,at=ot.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const ht=new Date,dt=new Date;function ft(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;let a;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=n=>ft((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})),n&&(i.count=(t,r)=>(ht.setTime(+t),dt.setTime(+r),e(ht),e(dt),Math.floor(n(ht,dt))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e==0:t=>i.count(0,t)%e==0):i:null)),i}const pt=6e4,gt=864e5,mt=6048e5,yt=ft((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pt)/gt),(e=>e.getDate()-1));yt.range;const bt=ft((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/gt),(e=>e.getUTCDate()-1));bt.range;const vt=ft((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/gt),(e=>Math.floor(e/gt)));function xt(e){return ft((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pt)/mt))}vt.range;const wt=xt(0),kt=xt(1),Mt=xt(2),_t=xt(3),St=xt(4),qt=xt(5),Dt=xt(6);function Ct(e){return ft((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/mt))}wt.range,kt.range,Mt.range,_t.range,St.range,qt.range,Dt.range;const Et=Ct(0),At=Ct(1),Tt=Ct(2),Nt=Ct(3),Rt=Ct(4),Ot=Ct(5),It=Ct(6);Et.range,At.range,Tt.range,Nt.range,Rt.range,Ot.range,It.range;const Pt=ft((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));Pt.every=e=>isFinite(e=Math.floor(e))&&e>0?ft((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,Pt.range;const Lt=ft((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));function jt(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function zt(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ft(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<0?i=t+1:o=t}while(i<o)}return i}return 2!==e.length?(t=jt,n=(t,n)=>jt(e(t),n),r=(t,n)=>e(t)-n):(t=e===jt||e===zt?e:Ht,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const s=i(e,t,n,o-1);return s>n&&r(e[s-1],t)>-r(e[s],t)?s-1:s},right:function(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<=0?i=t+1:o=t}while(i<o)}return i}}}function Ht(){return 0}Lt.every=e=>isFinite(e=Math.floor(e))&&e>0?ft((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,Lt.range;const Bt=Ft(jt).right;Ft((function(e){return null===e?NaN:+e})).center;var Vt=Bt;class $t extends Map{constructor(e,t=Ut){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(Wt(this,e))}has(e){return super.has(Wt(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const r=t(n);e.has(r)&&(n=e.get(r),e.delete(r));return n}(this,e))}}function Wt({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Ut(e){return null!==e&&"object"==typeof e?e.valueOf():e}const Yt=Math.sqrt(50),Kt=Math.sqrt(10),Xt=Math.sqrt(2);function Gt(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=Yt?10:o>=Kt?5:o>=Xt?2:1;let a,l,c;return i<0?(c=Math.pow(10,-i)/s,a=Math.round(e*c),l=Math.round(t*c),a/c<e&&++a,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*s,a=Math.round(e/c),l=Math.round(t/c),a*c<e&&++a,l*c>t&&--l),l<a&&.5<=n&&n<2?Gt(e,t,2*n):[a,l,c]}function Jt(e,t,n){return Gt(e=+e,t=+t,n=+n)[2]}function Zt(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Qt(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function en(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function tn(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,s=e.shortDays,a=e.months,l=e.shortMonths,c=cn(i),u=un(i),h=cn(o),d=un(o),f=cn(s),p=un(s),g=cn(a),m=un(a),y=cn(l),b=un(l),v={a:function(e){return s[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return a[e.getMonth()]},c:null,d:Tn,e:Tn,f:Pn,g:Yn,G:Xn,H:Nn,I:Rn,j:On,L:In,m:Ln,M:jn,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:br,s:vr,S:zn,u:Fn,U:Hn,V:Vn,w:$n,W:Wn,x:null,X:null,y:Un,Y:Kn,Z:Gn,"%":yr},x={a:function(e){return s[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return a[e.getUTCMonth()]},c:null,d:Jn,e:Jn,f:nr,g:fr,G:gr,H:Zn,I:Qn,j:er,L:tr,m:rr,M:ir,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:br,s:vr,S:or,u:sr,U:ar,V:cr,w:ur,W:hr,x:null,X:null,y:dr,Y:pr,Z:mr,"%":yr},w={a:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=b.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=g.exec(t.slice(n));return r?(e.m=m.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return _(e,t,n,r)},d:wn,e:wn,f:Dn,g:yn,G:mn,H:Mn,I:Mn,j:kn,L:qn,m:xn,M:_n,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:vn,Q:En,s:An,S:Sn,u:dn,U:fn,V:pn,w:hn,W:gn,x:function(e,t,r){return _(e,n,t,r)},X:function(e,t,n){return _(e,r,t,n)},y:yn,Y:mn,Z:bn,"%":Cn};function k(e,t){return function(n){var r,i,o,s=[],a=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++a<c;)37===e.charCodeAt(a)&&(s.push(e.slice(l,a)),null!=(i=nn[r=e.charAt(++a)])?r=e.charAt(++a):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),s.push(r),l=a+1);return s.push(e.slice(l,a)),s.join("")}}function M(e,t){return function(n){var r,i,o=en(1900,void 0,1);if(_(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Qt(en(o.y,0,1))).getUTCDay(),r=i>4||0===i?At.ceil(r):At(r),r=bt.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=Zt(en(o.y,0,1))).getDay(),r=i>4||0===i?kt.ceil(r):kt(r),r=yt.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Qt(en(o.y,0,1)).getUTCDay():Zt(en(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Qt(o)):Zt(o)}}function _(e,t,n,r){for(var i,o,s=0,a=t.length,l=n.length;s<a;){if(r>=l)return-1;if(37===(i=t.charCodeAt(s++))){if(i=t.charAt(s++),!(o=w[i in nn?t.charAt(s++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return v.x=k(n,v),v.X=k(r,v),v.c=k(t,v),x.x=k(n,x),x.X=k(r,x),x.c=k(t,x),{format:function(e){var t=k(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=M(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=k(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=M(e+="",!0);return t.toString=function(){return e},t}}}var nn={"-":"",_:" ",0:"0"},rn=/^\s*\d+/,on=/^%/,sn=/[\\^$*+?|[\]().{}]/g;function an(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function ln(e){return e.replace(sn,"\\$&")}function cn(e){return new RegExp("^(?:"+e.map(ln).join("|")+")","i")}function un(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function hn(e,t,n){var r=rn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function dn(e,t,n){var r=rn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function fn(e,t,n){var r=rn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function pn(e,t,n){var r=rn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function gn(e,t,n){var r=rn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function mn(e,t,n){var r=rn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function yn(e,t,n){var r=rn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function bn(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function vn(e,t,n){var r=rn.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function xn(e,t,n){var r=rn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function wn(e,t,n){var r=rn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function kn(e,t,n){var r=rn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Mn(e,t,n){var r=rn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function _n(e,t,n){var r=rn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Sn(e,t,n){var r=rn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function qn(e,t,n){var r=rn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Dn(e,t,n){var r=rn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Cn(e,t,n){var r=on.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function En(e,t,n){var r=rn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function An(e,t,n){var r=rn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Tn(e,t){return an(e.getDate(),t,2)}function Nn(e,t){return an(e.getHours(),t,2)}function Rn(e,t){return an(e.getHours()%12||12,t,2)}function On(e,t){return an(1+yt.count(Pt(e),e),t,3)}function In(e,t){return an(e.getMilliseconds(),t,3)}function Pn(e,t){return In(e,t)+"000"}function Ln(e,t){return an(e.getMonth()+1,t,2)}function jn(e,t){return an(e.getMinutes(),t,2)}function zn(e,t){return an(e.getSeconds(),t,2)}function Fn(e){var t=e.getDay();return 0===t?7:t}function Hn(e,t){return an(wt.count(Pt(e)-1,e),t,2)}function Bn(e){var t=e.getDay();return t>=4||0===t?St(e):St.ceil(e)}function Vn(e,t){return e=Bn(e),an(St.count(Pt(e),e)+(4===Pt(e).getDay()),t,2)}function $n(e){return e.getDay()}function Wn(e,t){return an(kt.count(Pt(e)-1,e),t,2)}function Un(e,t){return an(e.getFullYear()%100,t,2)}function Yn(e,t){return an((e=Bn(e)).getFullYear()%100,t,2)}function Kn(e,t){return an(e.getFullYear()%1e4,t,4)}function Xn(e,t){var n=e.getDay();return an((e=n>=4||0===n?St(e):St.ceil(e)).getFullYear()%1e4,t,4)}function Gn(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+an(t/60|0,"0",2)+an(t%60,"0",2)}function Jn(e,t){return an(e.getUTCDate(),t,2)}function Zn(e,t){return an(e.getUTCHours(),t,2)}function Qn(e,t){return an(e.getUTCHours()%12||12,t,2)}function er(e,t){return an(1+bt.count(Lt(e),e),t,3)}function tr(e,t){return an(e.getUTCMilliseconds(),t,3)}function nr(e,t){return tr(e,t)+"000"}function rr(e,t){return an(e.getUTCMonth()+1,t,2)}function ir(e,t){return an(e.getUTCMinutes(),t,2)}function or(e,t){return an(e.getUTCSeconds(),t,2)}function sr(e){var t=e.getUTCDay();return 0===t?7:t}function ar(e,t){return an(Et.count(Lt(e)-1,e),t,2)}function lr(e){var t=e.getUTCDay();return t>=4||0===t?Rt(e):Rt.ceil(e)}function cr(e,t){return e=lr(e),an(Rt.count(Lt(e),e)+(4===Lt(e).getUTCDay()),t,2)}function ur(e){return e.getUTCDay()}function hr(e,t){return an(At.count(Lt(e)-1,e),t,2)}function dr(e,t){return an(e.getUTCFullYear()%100,t,2)}function fr(e,t){return an((e=lr(e)).getUTCFullYear()%100,t,2)}function pr(e,t){return an(e.getUTCFullYear()%1e4,t,4)}function gr(e,t){var n=e.getUTCDay();return an((e=n>=4||0===n?Rt(e):Rt.ceil(e)).getUTCFullYear()%1e4,t,4)}function mr(){return"+0000"}function yr(){return"%"}function br(e){return+e}function vr(e){return Math.floor(+e/1e3)}const xr=Xe();xr("d3-number",(function(e,t,n){let r,i;function o(e){return i(e)}function s(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return r=ut(t),i=r.format(e),this},s(),o.format=function(e,i,o,a){return(o||a)&&(t=o,n=a,s()),r.format(e)(i)},o.pattern=function(t){return t&&(e=t,i=r.format(t)),e},o})),xr("d3-time",(function(e){let t=tn({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),n=t.format(e);function r(e){return n(e)}return r.format=function(e,n){return t.format(e)(n)},r.locale=function(){return t=tn(...arguments),n=t.format(e),this},r.parse=function(e,n){return t.parse(e)(n)},r.parsePattern=function(e){return t.parse(e)},r}));const wr={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return xr(t.type||"d3-number")(t.format||"")})(e)};function kr(e){let{id:t=wr.id,key:n=wr.key,min:r=wr.min,max:i=wr.max,type:o=wr.type,tags:s=wr.tags,title:a=wr.title,values:l=wr.values,value:c=wr.value,label:u=wr.label,formatter:h=wr.formatter}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{id:()=>t(e),key:()=>n(e),raw:()=>e,tags:()=>s(e),type:()=>o(e),min:()=>r(e),max:()=>i(e),title:()=>a(e),items:()=>l(e),formatter:()=>h(e),value:c,label:u}}const Mr=e=>e.filter((e=>"number"==typeof e&&!isNaN(e))),_r=e=>e.reduce(((e,t)=>e+t),0),Sr={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=Mr(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=Mr(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=Mr(e);return t.length?t.reduce(((e,t)=>e+t),0):NaN},avg:e=>{const t=Mr(e),n=t.length;return n?_r(t)/n:NaN}};function qr(e,t,n,r){const i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach((s=>{const a=n[s],l=i[s]={};-1!==["number","string","boolean"].indexOf(typeof a)?(l.type="primitive",l.value=a):"function"==typeof a?(l.type="function",l.value=a,l.label=a,l.field=o):"object"==typeof a&&(a.fields?l.fields=a.fields.map((n=>qr(e,t,{main:n},r).main)):void 0!==a.field?(l.type="field",l.field=t.field(a.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof a.filter&&(l.filter=a.filter),void 0!==a.value&&(l.value=a.value),void 0!==a.label&&(l.label=a.label),"function"==typeof a.reduce?l.reduce=a.reduce:a.reduce?l.reduce=Sr[a.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?Sr[l.field.reduce]:l.field.reduce),"function"==typeof a.reduceLabel?l.reduceLabel=a.reduceLabel:a.reduceLabel?l.reduceLabel=Sr[a.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?Sr[l.field.reduceLabel]:l.field.reduceLabel))})),i}function Dr(e,t){const{main:n}=qr(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{});return{props:qr(e,t,e.props||{},n),main:n}}function Cr(e,t,n,r){const i=Array(e.length),o=Array(e.length);let s;for(let t=0;t<e.length;t++)s=r?e[t][r]:e[t],i[t]=s.value,o[t]=s.label;const a=t.reduce,l=t.reduceLabel,c=a?a(i):i,u={value:c,label:l?l(o,c):n?n(c):String(c)};return r&&e[0][r].source?(u.source=e[0][r].source,u):!r&&e[0].source?(u.source=e[0].source,u):u}function Er(e,t){let{main:n,propsArr:r,props:i}=t,o=[];const s=n.field.formatter(),a={};return r.forEach((e=>{a[e]=i[e].field?i[e].field.formatter():e=>e})),o.push(...e.map((e=>{const t=Cr(e.items,n,s);return r.forEach((n=>{t[n]=Cr(e.items,i[n],a[n],n)})),t}))),o}function Ar(e){let{cfg:t,itemData:n,obj:r,target:i,tracker:o,trackType:s}=e;const a="function"===s?t.trackBy(n):n[t.trackBy];let l=o[a];l||(l=o[a]={items:[],id:a},i.push(l)),l.items.push(r)}function Tr(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let r=0;r<n;r++)t<e[r]&&(t=e[r]);return t}function Nr(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let r=0;r<n;r++)t>e[r]&&(t=e[r]);return t}const Rr={diverging:function(e,t){if((a=e.length)>0)for(var n,r,i,o,s,a,l=0,c=e[t[0]].length;l<c;++l)for(o=s=0,n=0;n<a;++n)(i=(r=e[t[n]][l])[1]-r[0])>=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=s,r[0]=s+=i):r[0]=o},none:$e,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],o=i.length;r<o;++r){for(var s=0,a=0;s<n;++s)a+=e[s][r][1]||0;i[r][1]+=i[r][0]=-a/2}$e(e,t)}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,s=e[0].length;o<s;++o){for(i=n=0;n<r;++n)i+=e[n][o][1]||0;if(i)for(n=0;n<r;++n)e[n][o][1]/=i}$e(e,t)}},wiggle:function(e,t){if((i=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,o=0,s=1;s<r;++s){for(var a=0,l=0,c=0;a<i;++a){for(var u=e[t[a]],h=u[s][1]||0,d=(h-(u[s-1][1]||0))/2,f=0;f<a;++f){var p=e[t[f]];d+=(p[s][1]||0)-(p[s-1][1]||0)}l+=h,c+=d*h}n[s-1][1]+=n[s-1][0]=o,l&&(o-=c/l)}n[s-1][1]+=n[s-1][0]=o,$e(e,t)}}},Or={ascending:function(e){var t=e.map(Ke);return We(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,r=e.length,i=e.map(Ke),o=function(e){var t=e.map(Ye);return We(e).sort((function(e,n){return t[e]-t[n]}))}(e),s=0,a=0,l=[],c=[];for(t=0;t<r;++t)n=o[t],s<a?(s+=i[n],l.push(n)):(a+=i[n],c.push(n));return c.reverse().concat(l)},none:We,reverse:function(e){return We(e).reverse()}};function Ir(e,t,n){const r={},i=t.stackKey,o=t.value,s=t.startProp||"start",a=t.endProp||"end",l=t.offset||"none",c=t.order||"none",u=t.valueRef||"";let h=0,d={};for(let t=0;t<e.items.length;t++){let n=e.items[t],o=u?n[u]:null;if(o&&o.source){let e="".concat(o.source.key||"","/").concat(o.source.field);d[e]||(d[e]=o.source)}let s=i(n);r[s]=r[s]||{items:[]},r[s].items.push(n),h=Math.max(h,r[s].items.length)}const f=Array.apply(null,{length:h}).map(Number.call,Number),p=Object.keys(r).map((e=>r[e].items)),g=function(){var e=Q([]),t=We,n=$e,r=Ue;function i(i){var o,s,a=e.apply(this,arguments),l=i.length,c=a.length,u=new Array(c);for(o=0;o<c;++o){for(var h,d=a[o],f=u[o]=new Array(l),p=0;p<l;++p)f[p]=h=[0,+r(i[p],d,p,i)],h.data=i[p];f.key=d}for(o=0,s=t(u);o<c;++o)u[s[o]].index=o;return n(u,s),u}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:Q(qe.call(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:Q(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?We:"function"==typeof e?e:Q(qe.call(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?$e:e,i):n},i}().keys(f).value(((e,t)=>e[t]?o(e[t]):0)).order(Or[c]).offset(Rr[l]);let m=g(p),y=[];for(let e=0;e<m.length;e++){let t=m[e];for(let e=0;e<t.length;e++){let n=t[e],r=t[e].data[t.key];r&&(r[s]={value:n[0]},r[a]={value:n[1]},y.push(n[0],n[1]))}}let b=Object.keys(d).map((e=>{let t=n(d[e].key);return t?t.field(d[e].field):null})).filter((e=>!!e));const v=kr({title:b.map((e=>e.title())).join(", "),min:Nr(y),max:Tr(y),type:"measure",formatter:b[0]?b[0].formatter:void 0});e.fields.push(v)}function Pr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).logger;if(Array.isArray(e))n.items=e.map((e=>({value:e,label:String(e)})));else if(e){if("collection"in e)n=I({},t.collection(e.collection));else{const i=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),s=e.label||(e=>e);if(e.groupBy||e.mapTo)r.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=i.hierarchy?i.hierarchy(e.hierarchy):null,n.fields=i.fields();else if(e.items)n.items=e.items.map((e=>({value:o(e),label:String(s(e))})));else if(e.extract){const r=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];r.forEach((e=>{const r=e.source?t.dataset(e.source):i;r&&(n.items=[...n.items,...r.extract(e)],void 0!==e.field&&o.push(r.field(e.field)))})),o.length&&(n.fields=o),e.amend&&Array.isArray(e.amend)&&(n.items=[...n.items,...e.amend])}else if(void 0!==e.field&&i){const t=i.field(e.field);t&&(n.fields||(n.fields=[]),n.fields.push(t),"value"in e||(o=t.value||(e=>e),s=t.label||(e=>e),n.value=o),n.items=t.items().map((t=>({value:o(t),label:String(s(t)),source:{field:e.field}}))))}else e.fields&&e.fields.forEach((e=>{const r="object"==typeof e&&e.source?t.dataset(e.source):i;if(!r)return;let o;o="object"==typeof e&&void 0!==e.field?r.field(e.field):r.field(e),o&&(n.fields||(n.fields=[]),n.fields.push(o))}));n.items&&e.map&&(n.items=n.items.map(e.map))}e&&e.stack&&Ir(n,e.stack,t.dataset)}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&n.items&&(n.items=n.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&n.items&&(n.items=n.items.sort(e.sort)),n}function Lr(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Pr;if(e.data){const r=i(e.data,t,n);if(r&&r.fields&&r.fields[0])return r.fields[0].formatter()}if(r=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(r)){return n.formatter.get(r)(e.format||"")}throw new Error("Formatter of type '".concat(r,"' was not found"))}function jr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const zr=Symbol("implicit");function Fr(){var e=new $t,t=[],n=[],r=zr;function i(i){let o=e.get(i);if(void 0===o){if(r!==zr)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new $t;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return Fr(t,n).unknown(r)},jr.apply(i,arguments),i}function Hr(){var e,t,n=Fr().unknown(void 0),r=n.domain,i=n.range,o=0,s=1,a=!1,l=0,c=0,u=.5;function h(){var n=r().length,h=s<o,d=h?s:o,f=h?o:s;e=(f-d)/Math.max(1,n-l+2*c),a&&(e=Math.floor(e)),d+=(f-d-e*(n-l))*u,t=e*(1-l),a&&(d=Math.round(d),t=Math.round(t));var p=function(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r<i;)o[r]=e+r*n;return o}(n).map((function(t){return d+e*t}));return i(h?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),h()):r()},n.range=function(e){return arguments.length?([o,s]=e,o=+o,s=+s,h()):[o,s]},n.rangeRound=function(e){return[o,s]=e,o=+o,s=+s,a=!0,h()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(a=!!e,h()):a},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),h()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),h()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,h()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),h()):u},n.copy=function(){return Hr(r(),[o,s]).round(a).paddingInner(l).paddingOuter(c).align(u)},jr.apply(h(),arguments)}function Br(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Vr(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function $r(){}var Wr=.7,Ur=1/Wr,Yr="\\s*([+-]?\\d+)\\s*",Kr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Gr=/^#([0-9a-f]{3,8})$/,Jr=new RegExp(`^rgb\\(${Yr},${Yr},${Yr}\\)$`),Zr=new RegExp(`^rgb\\(${Xr},${Xr},${Xr}\\)$`),Qr=new RegExp(`^rgba\\(${Yr},${Yr},${Yr},${Kr}\\)$`),ei=new RegExp(`^rgba\\(${Xr},${Xr},${Xr},${Kr}\\)$`),ti=new RegExp(`^hsl\\(${Kr},${Xr},${Xr}\\)$`),ni=new RegExp(`^hsla\\(${Kr},${Xr},${Xr},${Kr}\\)$`),ri={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function ii(){return this.rgb().formatHex()}function oi(){return this.rgb().formatRgb()}function si(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Gr.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?ai(t):3===n?new ui(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?li(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?li(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Jr.exec(e))?new ui(t[1],t[2],t[3],1):(t=Zr.exec(e))?new ui(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Qr.exec(e))?li(t[1],t[2],t[3],t[4]):(t=ei.exec(e))?li(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ti.exec(e))?mi(t[1],t[2]/100,t[3]/100,1):(t=ni.exec(e))?mi(t[1],t[2]/100,t[3]/100,t[4]):ri.hasOwnProperty(e)?ai(ri[e]):"transparent"===e?new ui(NaN,NaN,NaN,0):null}function ai(e){return new ui(e>>16&255,e>>8&255,255&e,1)}function li(e,t,n,r){return r<=0&&(e=t=n=NaN),new ui(e,t,n,r)}function ci(e,t,n,r){return 1===arguments.length?function(e){return e instanceof $r||(e=si(e)),e?new ui((e=e.rgb()).r,e.g,e.b,e.opacity):new ui}(e):new ui(e,t,n,null==r?1:r)}function ui(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function hi(){return`#${gi(this.r)}${gi(this.g)}${gi(this.b)}`}function di(){const e=fi(this.opacity);return`${1===e?"rgb(":"rgba("}${pi(this.r)}, ${pi(this.g)}, ${pi(this.b)}${1===e?")":`, ${e})`}`}function fi(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function pi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function gi(e){return((e=pi(e))<16?"0":"")+e.toString(16)}function mi(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new bi(e,t,n,r)}function yi(e){if(e instanceof bi)return new bi(e.h,e.s,e.l,e.opacity);if(e instanceof $r||(e=si(e)),!e)return new bi;if(e instanceof bi)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new bi(s,a,l,e.opacity)}function bi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function vi(e){return(e=(e||0)%360)<0?e+360:e}function xi(e){return Math.max(0,Math.min(1,e||0))}function wi(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Br($r,si,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ii,formatHex:ii,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return yi(this).formatHsl()},formatRgb:oi,toString:oi}),Br(ui,ci,Vr($r,{brighter(e){return e=null==e?Ur:Math.pow(Ur,e),new ui(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Wr:Math.pow(Wr,e),new ui(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ui(pi(this.r),pi(this.g),pi(this.b),fi(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:hi,formatHex:hi,formatHex8:function(){return`#${gi(this.r)}${gi(this.g)}${gi(this.b)}${gi(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:di,toString:di})),Br(bi,(function(e,t,n,r){return 1===arguments.length?yi(e):new bi(e,t,n,null==r?1:r)}),Vr($r,{brighter(e){return e=null==e?Ur:Math.pow(Ur,e),new bi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Wr:Math.pow(Wr,e),new bi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ui(wi(e>=240?e-240:e+120,i,r),wi(e,i,r),wi(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new bi(vi(this.h),xi(this.s),xi(this.l),fi(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=fi(this.opacity);return`${1===e?"hsl(":"hsla("}${vi(this.h)}, ${100*xi(this.s)}%, ${100*xi(this.l)}%${1===e?")":`, ${e})`}`}}));var ki=e=>()=>e;function Mi(e){return 1==(e=+e)?_i:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):ki(isNaN(t)?n:t)}}function _i(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):ki(isNaN(e)?t:e)}var Si=function e(t){var n=Mi(t);function r(e,t){var r=n((e=ci(e)).r,(t=ci(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=_i(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1);function qi(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function Di(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),s=new Array(r);for(n=0;n<i;++n)o[n]=Oi(e[n],t[n]);for(;n<r;++n)s[n]=t[n];return function(e){for(n=0;n<i;++n)s[n]=o[n](e);return s}}function Ci(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ei(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Ai(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Oi(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var Ti=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ni=new RegExp(Ti.source,"g");function Ri(e,t){var n,r,i,o=Ti.lastIndex=Ni.lastIndex=0,s=-1,a=[],l=[];for(e+="",t+="";(n=Ti.exec(e))&&(r=Ni.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),a[s]?a[s]+=i:a[++s]=i),(n=n[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:Ei(n,r)})),o=Ni.lastIndex;return o<t.length&&(i=t.slice(o),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)a[(n=l[r]).i]=n.x(e);return a.join("")})}function Oi(e,t){var n,r=typeof t;return null==t||"boolean"===r?ki(t):("number"===r?Ei:"string"===r?(n=si(t))?(t=n,Si):Ri:t instanceof si?Si:t instanceof Date?Ci:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?qi:Array.isArray(t)?Di:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Ai:Ei)(e,t)}function Ii(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Pi(e){return+e}var Li=[0,1];function ji(e){return e}function zi(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Fi(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=zi(i,r),o=n(s,o)):(r=zi(r,i),o=n(o,s)),function(e){return o(r(e))}}function Hi(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=zi(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(t){var n=Vt(e,t,1,r)-1;return o[n](i[n](t))}}function Bi(){var e,t,n,r,i,o,s=Li,a=Li,l=Oi,c=ji;function u(){var e=Math.min(s.length,a.length);return c!==ji&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(s[0],s[e-1])),r=e>2?Hi:Fi,i=o=null,h}function h(t){return null==t||isNaN(t=+t)?n:(i||(i=r(s.map(e),a,l)))(e(c(t)))}return h.invert=function(n){return c(t((o||(o=r(a,s.map(e),Ei)))(n)))},h.domain=function(e){return arguments.length?(s=Array.from(e,Pi),u()):s.slice()},h.range=function(e){return arguments.length?(a=Array.from(e),u()):a.slice()},h.rangeRound=function(e){return a=Array.from(e),l=Ii,u()},h.clamp=function(e){return arguments.length?(c=!!e||ji,u()):c!==ji},h.interpolate=function(e){return arguments.length?(l=e,u()):l},h.unknown=function(e){return arguments.length?(n=e,h):n},function(n,r){return e=n,t=r,u()}}function Vi(e,t,n,r){var i,o=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?Jt(t,e,n):Jt(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=et(null==r?",f":r)).type){case"s":var s=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Je(t)/3)))-Je(Math.abs(e)))}(o,s))||(r.precision=i),at(r,s);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Je(t)-Je(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-Je(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return st(r)}function $i(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)==(t=+t))return[e];const r=t<e,[i,o,s]=r?Gt(t,e,n):Gt(e,t,n);if(!(o>=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let e=0;e<a;++e)l[e]=(o-e)/-s;else for(let e=0;e<a;++e)l[e]=(o-e)*s;else if(s<0)for(let e=0;e<a;++e)l[e]=(i+e)/-s;else for(let e=0;e<a;++e)l[e]=(i+e)*s;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return Vi(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),s=0,a=o.length-1,l=o[s],c=o[a],u=10;for(c<l&&(i=l,l=c,c=i,i=s,s=a,a=i);u-- >0;){if((i=Jt(l,c,n))===r)return o[s]=l,o[a]=c,t(o);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return e},e}function Wi(){var e=Bi()(ji,ji);return e.copy=function(){return t=e,Wi().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},jr.apply(e,arguments),$i(e)}function Ui(){var e,t=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[Vt(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=Array.from(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Array.from(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return Ui().domain(t).range(n).unknown(e)},jr.apply(i,arguments)}function Yi(e){return void 0===e?e=>e:t=>e(t)}function Ki(e){return Math.max(0,Math.min(1,e))}function Xi(e){return"object"==typeof e}function Gi(e,t,n){const r=Math.abs(t-n)/(e+1),i=[];for(let o=1;o<=e;o++){const e=o*r;i.push(t<n?t+e:t-e)}return i}function Ji(e,t,n){if(1===e.length)return e;const r=e.concat([]);for(let i=0;i<e.length;i++){let o=e[i],s=e[i+1];0===i&&o!==n.start()?(r.push(...Gi(t,o,s)),o-=s-o,s=e[i],r.push(...Gi(t,o,s))):i===e.length-1&&s!==n.end()?(s=o+(o-e[i-1]),r.push(...Gi(t,o,s))):r.push(...Gi(t,o,s))}return r.filter((e=>e>=n.min()&&e<=n.max()))}function Zi(e){let{distance:t,scale:n,minorCount:r=0,unitDivider:i=100,formatter:o}=e;const s=z(i)||z(t)?2:Math.max(t/i,2),a=Math.min(1e3,Math.round(s));let l=n.ticks(a);l.length<=1&&(l=n.ticks(a+1));const c=r>0?Ji(l,r,n):l;c.sort(((e,t)=>e-t));const u=c.map(Yi(o));return c.map(((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:u[t],value:e,isMinor:-1===l.indexOf(e)}}))}function Qi(e){let{distance:t,scale:n,minorCount:r=0,unitDivider:i=100,formatter:o}=e;const s=z(i)||z(t)?2:Math.max(t/i,2),a=Math.min(1e3,Math.round(s)),l=a>10?10:a;n.nice(l);const c=n.ticks(a),u=r>0?Ji(c,r,n):c;u.sort(((e,t)=>e-t));const h=u.map(Yi(o));return u.map(((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:h[t],value:e,isMinor:-1===c.indexOf(e)}}))}function eo(e){let t,{settings:n,scale:r,distance:i,formatter:o=e=>e}=e;const s=n.minorTicks&&!z(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter((e=>"object"==typeof e?!z(e.value):!z(e)));t=function(e){let{values:t,scale:n,formatter:r=e=>e}=e;return t.sort(((e,t)=>(Xi(e)?e.value:e)-(Xi(t)?t.value:t))).filter(((e,t,r)=>{const i=Xi(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t})).map((e=>{const t=Xi(e),i=t?e.value:e,o=n(i);return{position:o,value:i,label:t&&void 0!==e.label?e.label:r(i),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?Ki(n(e.start)):o,end:t&&!isNaN(e.end)?Ki(n(e.end)):o}}))}({values:e,scale:r.copy(),formatter:o})}else if(z(n.ticks.count)){t=(n.ticks.tight?Qi:Zi)({distance:i,minorCount:s,unitDivider:n.ticks.distance,scale:r,formatter:o}),n.ticks.forceBounds&&function(e,t,n){const r=e.map((e=>e.position)),i=t.range();-1===r.indexOf(i[0])?e.splice(0,0,{position:i[0],start:i[0],end:i[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);const o=e[e.length-1];-1===r.indexOf(i[1])?e.push({position:i[1],start:i[1],end:i[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,r,o)}else{t=function(e){let{count:t,minorCount:n,scale:r,formatter:i}=e;return r.ticks((t-1)*n+t).map(((e,t)=>{const o=r(e);return{position:o,start:o,end:o,label:i(e),isMinor:t%(n+1)!=0,value:e}}))}({count:Math.min(1e3,n.ticks.count),minorCount:s,scale:r.copy(),formatter:o})}return t}function to(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={};return Object.keys(t).forEach((i=>{const o=typeof e[i];r[i]="function"===o?e[i](n):"undefined"===o?t[i]:e[i]})),r}const no={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},ro={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},io={count:NaN};function oo(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function so(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Wi(),i={instance:null,invert:!1},o={data:t,resources:n},s=to(e,no,o);let a;function l(e){return z(e)?NaN:r(e)}s.ticks=to(e.ticks,ro,o),s.minorTicks=to(e.minorTicks,io,o),l.data=()=>t,l.invert=function(e){return r.invert(e)},l.rangeRound=function(e){return r.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return r.clamp(e),l},l.cachedTicks=function(){return a},l.clearTicksCache=function(){return a=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=N(!0,{},s,e.settings),e.scale=l,a=eo(e),a):(a=r.ticks(e),a)},l.nice=function(e){return r.nice(e),l},l.tickFormat=function(e,t){return r.tickFormat(e,t)},l.interpolate=function(e){return r.interpolate(e),l},l.domain=function(e){return arguments.length?(r.domain(e),i.instance&&i.instance.domain([l.start(),l.end()]),l):r.domain()},l.range=function(e){return arguments.length?(r.range(e),l):r.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(e){let t=(l.start()-l.end())/e,n=[l.end()],r=[],i=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,s=l(e+i);n.push(o,o),r.push(s,s)}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){const i=so(e,t,n);return i.domain(l.domain()),i.range(l.range()),i.clamp(r.clamp()),i},l.norm=function(e){return oo(i,l),i.instance(e)},l.normInvert=function(e){return oo(i,l),i.instance.invert(e)};const{mini:c,maxi:u}=function(e,t){const n=+e.min,r=+e.max;let i=0,o=1;if(t&&t[0]){const n=t.map((e=>e.min())).filter((e=>!isNaN(e))),r=t.map((e=>e.max())).filter((e=>!isNaN(e)));if(i=n.length?Math.min(...n):Number.NaN,o=r.length?Math.max(...r):Number.NaN,isNaN(i)||isNaN(o))i=-1,o=1;else if(i===o&&0===i)i=-1,o=1;else if(i===o&&i)i-=Math.abs(.1*i),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){const t=o-i;i-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter((e=>!isNaN(e)));i=Math.min(...t,i),o=Math.max(...t,o)}}return{mini:isNaN(n)?i:n,maxi:isNaN(r)?o:r}}(s,t?t.fields:[]);return l.domain([c,u]),l.range(s.invert?[1,0]:[0,1]),i.invert=s.invert,l}const ao={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function lo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:t,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},r=to(e,ao,n),i=t.items||[],o={},s=[],a=[];function l(e,n){e.data=()=>t,e.datum=e=>i[o[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>a,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,function(e){let{scale:t}=e;const n=t.domain(),r=t.data().items,i=t.labels?t.labels():n,o=t.bandwidth();return n.map(((e,n)=>{const s=t(e);return{position:s+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:s,end:s+o}}))}(t,n.trackBy)}}const c=Hr();l(c,e),c.pxScale=function(t){const n=r.maxPxStep;if(isNaN(n))return c;const i=c.domain().length,o=Math.max(1,i-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;const s=c.copy();s.type=c.type,l(s,e);const a=o*n/t,u=(1-a)*c.align();return s.range(r.invert?[a+u,u]:[u,a+u]),s};const u="function"==typeof e.value?e.value:e=>e.datum.value,h="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<i.length;e++){const t=N({datum:i[e]},n),r=u(t,e);-1===s.indexOf(r)&&(s.push(r),a.push(h(t,e)),o[r]=e)}return c.domain(s),c.range(r.invert?r.range.slice().reverse():r.range),c.padding(isNaN(r.padding)?0:r.padding),isNaN(r.paddingInner)||c.paddingInner(r.paddingInner),isNaN(r.paddingOuter)||c.paddingOuter(r.paddingOuter),c.align(isNaN(r.align)?.5:r.align),c}const co={depth:0};function uo(e,t,n){return e.ancestors().map((e=>t(N({datum:e.data},n)))).reverse().slice(1).toString()}const ho=e=>e.min(),fo=e=>e.max();function po(e,t){const n=e&&!isNaN(e.min),r=e&&!isNaN(e.max);let i=n?+e.min:0,o=r?+e.max:1;if(t&&t.length){if(!n){const e=t.map(ho).filter(j);i=e.length?Math.min(...e):i}if(!r){const e=t.map(fo).filter(j);o=e.length?Math.max(...e):o}}return[i,o]}const go={domain:[],range:[],invert:!1,min:NaN,max:NaN};function mo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=so(e,t,n).clamp(!0).interpolate(Si),i=to(e,go,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,s=Array.isArray(i.range)&&i.range.length,a=r;N(!0,a,r);const[l,c]=po(i,t?t.fields:[]),u=o?i.domain.length:-1,h=n.theme?n.theme.palette("sequential",u>0?u:2):[],d=s?i.range:h;return a.range(i.invert?d.slice().reverse():d.slice()),a.domain(o?i.domain:function(e,t,n){const r=e.length;if(2===r)return[t,n];const i=[],o=(n-t)/(r-1);i.push(t);for(let e=1;e<r-1;e++)i.push(t+o*e);return i.push(n),i}(a.range(),l,c)),a}const yo={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function bo(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const vo={domain:[],range:[]};const xo={domain:[],range:[],unknown:void 0},wo={domain:[],range:[],override:!1};const ko=Xe();function Mo(e,t,n){let r=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),r={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((e=>{r.extract.push({field:e})})));const i=Pr(r,t,n);let o,s=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map((e=>"dimension"===e.type()?"band":"linear"));return-1!==t.indexOf("linear")?"linear":"band"}(e.fields):"linear"}(i);return"color"===s&&(s=i.fields&&i.fields[0]&&"dimension"===i.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(s)&&(o=n.scale.get(s),o=o(e,i,{theme:n.theme,logger:n.logger}),o.type=s),o}ko("linear",so),ko("band",lo),ko("h-band",(function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={data:n,resources:r},o=to(t,ao,i);o.ticks=to(t.ticks,co,i),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let s=lo(o);const{values:a,labels:l,items:c,ticks:u}=function(e,t,n){const r=t.ticks.depth,i=t.value,o=t.label,s=[],a=[],l={},c=[];let u=0;if(!e)return{values:s,labels:a,items:l,ticks:c};e.eachAfter((e=>{if(e.depth>0){const t=uo(e,i,n),h=e.leaves()||[e],d=i(N({datum:e.data},n)),f=o(N({datum:e.data},n)),p=Array.isArray(e.children),g={key:t,count:h.length,value:d,label:f,leftEdge:uo(h[0],i,n),rightEdge:uo(h[Math.max(h.length-1,0)],i,n),node:e};p?(s.push("SPACER_".concat(u,"_SPACER")),u++):(s.push(t),a.push(f)),(r<=0&&!p||e.depth===r)&&c.push(g),l[t]=g}}));const h=e.height-1;return h>0&&s.splice(-h),{values:s,labels:a,items:l,ticks:c}}(n.root,o,i),h=function(e){const t=String(e),n=c[t];return s(n?o.invert?n.rightEdge:n.leftEdge:t)};N(!0,h,s),h.bandwidth=function(e){const t=c[String(e)],n=s.bandwidth();if(t&&!t.isLeaf){const e=h(t.leftEdge),r=h(t.rightEdge);return Math.abs(e-r)+n}return n},h.step=function(e){const t=c[String(e)],n=t?t.count:1;let r=s.step();return r*=n,r},h.data=()=>n,h.datum=e=>{const t=c[String(e)];return t?t.node.data:null},h.copy=()=>e(t,n,r),h.labels=()=>l,h.ticks=()=>u.map((e=>{const t=h(e.key),n=h.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}));const d=s.pxScale;return h.pxScale=function(e){return s=d(e),h},h.domain(a),h})),ko("sequential-color",mo),ko("threshold-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Ui(),i=to(e,yo,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,s=Array.isArray(i.range)&&i.range.length;function a(e){return z(e)?NaN:r(e)}Object.keys(r).forEach((e=>a[e]=r[e]));const l=t.fields,[c,u]=po(i,l),h=o?i.domain.length:-1,d=n.theme?n.theme.palette("sequential",h>0?h:2):[];let f=s?i.range:d,p=[];return p=o?i.domain:i.nice?function(e,t,n){const r=2===e.length?10:Math.max(1,e.length),i=Wi().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;const o=Math.max(0,e.length-1);for(;i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}(f,c,u):[c+(u-c)/2],f.length>p.length+1?p=function(e,t,n){const r=e.length;if(2===r)return[t+(n-t)/2];const i=[],o=(n-t)/r;for(let e=1;e<r;e++)i.push(t+o*e);return i}(f,c,u):f.length<p.length+1&&(f=function(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;const i=mo().domain([n,r]).range(t);return[n,...bo(e),r].map((e=>i(e)))}(p,f,c,u)),a.data=()=>t,a.range(i.invert?f.slice().reverse():f),a.domain(p),a})),ko("categorical-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Fr(),i={data:t,resources:n},o=to(e,vo,i),s="function"==typeof e.value?e.value:e=>e.datum.value,a="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},u=[],h=[];for(let e=0;e<l.length;e++){const t=N({datum:l[e]},i),n=s(t,e);-1===u.indexOf(n)&&(u.push(n),h.push(a(t,e)),c[n]=e)}return r.data=()=>t,r.labels=()=>h,r.label=e=>h[u.indexOf(e)],r.datum=e=>l[c[e]],r.range(o.range),Array.isArray(o.domain)&&o.domain.length?r.domain(o.domain):r.domain(u),r}(e,t,n),i=n.theme,o=to(e,xo,{data:t,resources:n});let s;if(o.explicit=to(e.explicit,wo,{data:t,resources:n}),s=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():i?i.palette("categorical",r.domain().length).slice():[],o.unknown)r.unknown(o.unknown);else if(i&&i.palette("unknown")){let e=i.palette("unknown");r.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=r.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],i=Math.floor(e.length/s.length);for(let e=1;e<i+1;e*=2)s=s.concat(s);if(o.explicit.override)for(let r=0;r<t.length;r++){const i=e.indexOf(t[r]);i>-1&&(s[i]=n[r])}else{const r=t.map(((t,r)=>[e.indexOf(t),t,n[r]])).sort(((e,t)=>e[0]-t[0]));r.forEach((t=>{const n=e.indexOf(t[1]);-1!==n&&s.splice(n,0,t[2])}))}s.length=e.length}return r.range(s),r}));var _o={};function So(){So.init.call(this)}_o.isObject=function(e){return"object"==typeof e&&null!==e},_o.isNumber=function(e){return"number"==typeof e},_o.isUndefined=function(e){return void 0===e},_o.isFunction=function(e){return"function"==typeof e};var qo=So;So.EventEmitter=So,So.prototype._events=void 0,So.prototype._maxListeners=void 0,So.defaultMaxListeners=10,So.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},So.prototype.setMaxListeners=function(e){if(!_o.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},So.prototype.emit=function(e){var t,n,r,i,o,s;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],_o.isUndefined(n))return!1;if(_o.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(_o.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(s=n.slice()).length,o=0;o<r;o++)s[o].apply(this,i)}return!0},So.prototype.addListener=function(e,t){var n;if(!_o.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,_o.isFunction(t.listener)?t.listener:t),this._events[e]?_o.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,_o.isObject(this._events[e])&&!this._events[e].warned)&&((n=_o.isUndefined(this._maxListeners)?So.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,_o.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),_o.isFunction(console.trace)&&console.trace()));return this},So.prototype.on=So.prototype.addListener,So.prototype.once=function(e,t){if(!_o.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},So.prototype.removeListener=function(e,t){var n,r,i,o;if(!_o.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||_o.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(_o.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},So.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],_o.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},So.prototype.listeners=function(e){return this._events&&this._events[e]?_o.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},So.listenerCount=function(e,t){return e._events&&e._events[t]?_o.isFunction(e._events[t])?1:e._events[t].length:0};var Do={mixin:e=>(Object.keys(qo.prototype).forEach((t=>{e[t]=qo.prototype[t]})),qo.init(e),e)};function Co(){let e=0,t=0,n=0,r=0;n=n||e;const i={move(e){this.moveTo(n+e)},moveTo(o){const s=Math.max(e,Math.min(t-r,o));n!==s&&(n=s,i.emit("update"))},update(o){let s=!1;({min:e=e,max:t=t}=o),void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,s=!0);const a=Math.max(e,Math.min(t-r,n));n!==a&&(n=a,s=!0),s&&i.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:r})};return Do.mixin(i),i}function Eo(e,t){const n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||Co();return o.update({min:n,max:r,viewSize:i}),o}function Ao(e,t){return e<=t}function To(e,t){return e<t}function No(e,t,n){let r=0;for(;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function Ro(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=[];function i(){}return i.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{includeMax:r=!0,includeMin:i=!0}=n;e=r?Ao:To,t=i?Ao:To},i.add=e=>{let{min:t,max:n}=e;const i=No(r,t),o=No(r,n,!0),s=[i,o-i];i%2==0&&s.push(t),o%2==0&&s.push(n);const a=r.join(",");r.splice(...s);return a!==r.join(",")},i.remove=e=>{let{min:t,max:n}=e;const i=No(r,t),o=No(r,n,!0),s=[i,o-i];i%2==1&&s.push(t),o%2==1&&s.push(n);const a=r.join(",");r.splice(...s);return a!==r.join(",")},i.set=e=>{const t=r.join(",");r=[],Array.isArray(e)?e.forEach(i.add):i.add(e);return t!==r.join(",")},i.clear=()=>{const e=r.length>0;return r=[],e},i.containsValue=n=>function(e,t,n,r){const i=e.length;for(let o=1;o<i;o+=2)if(n(e[o-1],t)&&r(t,e[o]))return!0;return!1}(r,n,t,e),i.containsRange=e=>{let{min:t,max:n}=e;const i=No(r,t,!0),o=No(r,n);return i===o&&o%2==1},i.toggle=e=>i.containsRange(e)?i.remove(e):i.add(e),i.ranges=()=>{const e=[];for(let t=1;t<r.length;t+=2)e.push({min:r[t-1],max:r[t]});return e},i.configure(n),i}function Oo(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const Io={key:void 0,includeMin:!0,includeMax:!0};function Po(e){let{items:t,collection:n,vc:r}=e;const i={},o=[];let s,a;for(let e=0,o=t.length;e<o;e++){s=t[e].key,n[s]||(n[s]=r()),a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[s].add(a[e])&&(i[s]=i[s]||[],i[s].push(a[e]))}const l=Object.keys(i);for(let e=0,t=l.length;e<t;e++)s=l[e],o.push({id:s,values:i[s]});return o}function Lo(e){let{items:t,collection:n}=e;const r={},i=[];let o,s;for(let e=0,i=t.length;e<i;e++)if(o=t[e].key,n[o]){s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[o].remove(s[e])&&(r[o]=r[o]||[],r[o].push(s[e]))}const a=Object.keys(r);for(let e=0,t=a.length;e<t;e++)o=a[e],i.push({id:o,values:r[o]});return i}function jo(e){const t={};let n,r;for(let i=0,o=e.length;i<o;i++){n=e[i].key,r=e[i].values||[e[i].value],t[n]||(t[n]=[]);for(let e=0;e<r.length;e++){-1===t[n].indexOf(r[e])&&t[n].push(r[e])}}return t}function zo(e){let{key:t,collection:n,obj:r,fn:i,value:o}=e;n[t]||(n[t]=i()),r[t]=r[t]||[],r[t].push(o),n[t].add(o)}function Fo(e,t){const n=[],r=Object.keys(e);let i,o;const s=e=>-1===t[i].indexOf(e);for(let a=0,l=r.length;a<l;a++)i=r[a],t[i]?(o=e[i].filter(s),o.length&&n.push({id:i,values:o})):n.push({id:i,values:e[i]});return n}function Ho(e,t,n){const r=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,r=Array(n);for(let i=0;i<n;i++)r[i]=e[i].key in t?N({},e[i],{key:t[e[i].key]}):e[i];return r}(t,n);return e&&e.length?e.reduce(((e,t)=>t(e)),r):r}function Bo(e){return e.replace(/(-[a-z])/g,(e=>e.toUpperCase().replace("-","")))}function Vo(e){return e.replace(/([A-Z])/g,(e=>"-".concat(e.toLowerCase())))}function $o(e,t,n){let{ranges:r,interceptors:i,rc:o,aliases:s,rangeConfig:a}=n;const l=Ho(i["".concat(t,"Ranges")],e,s);let c=!1;return l.forEach((e=>{const n=e.key;if(r[n]||(r[n]=o(a.sources[n]||a.default)),"set"===t)c=r[n][t](e.ranges||e.range)||c;else{const i=e.ranges||[e.range];for(let e=0;e<i.length;e++)c=r[n][t](i[e])||c}})),c}function Wo(){let{vc:e=Oo,rc:t=Ro}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1,r={},i={},o={},s={sources:{},default:N({},Io)};const a={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},l=()=>{const e={values:{},ranges:{}};return Object.keys(i).forEach((t=>{e.values[t]=i[t].values()})),Object.keys(r).forEach((t=>{e.ranges[t]=r[t].ranges()})),e},c={ls:[],clear(){this.ls.forEach((e=>e.clear()))},start(){this.ls.forEach((e=>e.start()))},end(){this.ls.forEach((e=>e.end()))},update(){const e=l();this.ls.forEach((t=>t._state(e)))},updateValues(){const e=l();this.ls.forEach((t=>t._state({values:e.values})))},updateRanges(){const e=l();this.ls.forEach((t=>t._state({ranges:e.ranges})))}},u={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(s={sources:{},default:N({},Io)},e.ranges.forEach((e=>{const t={};Object.keys(Io).filter((e=>"key"!==e)).forEach((n=>{t[n]=void 0!==e[n]?e[n]:Io[n]})),void 0!==e.key?s.sources[e.key]=t:s.default=t})),Object.keys(r).forEach((e=>r[e].configure(s.sources[e]||s.default))),u.emit("update",[],[]))},link:e=>{if(u===e)throw new Error("Can't link to self");c.ls.push(e),e._state(l())},_state:e=>{if(!e)return l();if(e.values){const t=[];Object.keys(e.values).forEach((n=>{i[n]&&e.values[n].join(";")===i[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(i).forEach((n=>{e.values[n]||t.push({key:n,values:[]})})),t.length&&u.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach((n=>{r[n]&&e.ranges[n].join(";")===r[n].toString()||t.push({key:n,ranges:e.ranges[n]})})),Object.keys(r).forEach((n=>{e.ranges[n]||t.push({key:n,ranges:[]})})),t.length&&u.setRanges(t)}},start:function(){if(!n){n=!0;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];u.emit("start",...t),c.start()}},end:function(){if(n){n=!1,r={},i={};for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];u.emit("end",...t),c.end()}},isActive:()=>n,clear:()=>{const e=u.brushes().filter((e=>"value"===e.type&&e.brush.values().length)).map((e=>({id:e.id,values:e.brush.values()}))),t=Object.keys(r).length>0||e.length;r={},i={},t&&(u.emit("update",[],e),c.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(r).map((e=>({type:"range",id:e,brush:r[e]})))),e=e.concat(Object.keys(i).map((e=>({type:"value",id:e,brush:i[e]})))),e},addValue:(e,t)=>{u.addValues([{key:e,value:t}])},addValues:t=>{const r=Ho(a.addValues,t,o),s=Po({vc:e,collection:i,items:r});u.emit("add-values",r),s.length&&(n||(n=!0,u.emit("start")),u.emit("update",s,[]),c.updateValues())}};return u.setValues=t=>{const r=Ho(a.setValues,t,o),s=function(e){let{items:t,vCollection:n,vc:r}=e;const i={},o=jo(t);let s,a=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)s=u[e],c[s]=n[s].values().slice(),delete n[s];const h=e=>{n[s]&&n[s].contains(e)||zo({key:s,value:e,collection:n,obj:i,fn:r})},d=Object.keys(o);for(let e=0,t=d.length;e<t;e++)s=d[e],o[s].forEach(h);return l=Fo(c,i),a=Fo(i,c),[a,l]}({items:r,vCollection:i,vc:e});u.emit("set-values",r),(s[0].length>0||s[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",s[0],s[1]),c.updateValues())},u.removeValue=(e,t)=>{u.removeValues([{key:e,value:t}])},u.removeValues=e=>{const t=Ho(a.removeValues,e,o),n=Lo({collection:i,items:t});u.emit("remove-values",t),n.length&&(u.emit("update",[],n),c.updateValues())},u.addAndRemoveValues=(t,r)=>{const s=Ho(a.addValues,t,o),l=Ho(a.removeValues,r,o),h=Po({vc:e,collection:i,items:s}),d=Lo({collection:i,items:l});u.emit("add-values",s),u.emit("remove-values",l),(h.length||d.length)&&(n||(n=!0,u.emit("start")),u.emit("update",h,d),c.updateValues())},u.toggleValue=(e,t)=>{u.toggleValues([{key:e,value:t}])},u.toggleValues=t=>{const r=Ho(a.toggleValues,t,o),s=function(e){let{items:t,values:n,vc:r}=e;const i={},o={},s=[],a=[],l=jo(t);let c,u,h;const d=Object.keys(l);for(let e=0,t=d.length;e<t;e++){c=d[e],h=l[c];for(let e=0,t=h.length;e<t;e++)u=h[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):zo({key:c,value:u,collection:n,obj:i,fn:r})}const f=Object.keys(i);for(let e=0,t=f.length;e<t;e++)c=f[e],s.push({id:c,values:i[c]});const p=Object.keys(o);for(let e=0,t=p.length;e<t;e++)c=p[e],a.push({id:c,values:o[c]});return[s,a]}({items:r,values:i,vc:e});u.emit("toggle-values",r),(s[0].length>0||s[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",s[0],s[1]),c.updateValues())},u.containsValue=(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].contains(t)},u.addRange=(e,t)=>{u.addRanges([{key:e,range:t}])},u.addRanges=e=>{$o(e,"add",{ranges:r,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.removeRange=(e,t)=>{u.removeRanges([{key:e,range:t}])},u.removeRanges=e=>{$o(e,"remove",{ranges:r,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.setRange=(e,t)=>{u.setRanges([{key:e,range:t}])},u.setRanges=e=>{$o(e,"set",{ranges:r,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.toggleRange=(e,t)=>{u.toggleRanges([{key:e,range:t}])},u.toggleRanges=e=>{$o(e,"toggle",{ranges:r,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.containsRangeValue=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].containsValue(t)},u.containsRange=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].containsRange(t)},u.containsMappedData=(e,t,n)=>{let s=[];const a=Object.keys(e);let l,c,u,h;for(let t=0,n=a.length;t<n;t++){if(l=a[t],"value"===l)c=e,s[t]={key:"",i:t,bool:!1};else{if("source"===l)continue;c=e[l],s[t]={key:l,i:t,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in o&&(u=o[u]),h=c.value,r[u]?s[t].bool=Array.isArray(h)?r[u].containsRange({min:h[0],max:h[1]}):r[u].containsValue(h):i[u]&&i[u].contains(h)&&(s[t].bool=!0))}return t?(s=s.filter((e=>-1!==t.indexOf(e.key))),"and"===n?!!s.length&&!s.some((e=>!1===e.bool)):"xor"===n?!!s.length&&s.some((e=>e.bool))&&s.some((e=>!1===e.bool)):s.some((e=>e.bool))):s.some((e=>e.bool))},u.intercept=(e,t)=>{const n=Bo(e);a[n]&&a[n].push(t)},u.removeInterceptor=(e,t)=>{const n=Bo(e);if(!a[n])return;const r=a[n].indexOf(t);-1!==r&&a[n].splice(r,1)},u.removeAllInterceptors=e=>{const t=[];if(e){const n=Bo(e);a[n]&&a[n].length&&t.push({name:e,handlers:a[n]})}else Object.keys(a).forEach((e=>{a[e].length&&t.push({name:Vo(e),handlers:a[e]})}));t.forEach((e=>{e.handlers.slice().forEach((t=>u.removeInterceptor(e.name,t)))}))},u.addKeyAlias=(e,t)=>{o[e]=t},u.removeKeyAlias=e=>{delete o[e]},Do.mixin(u),u}function Uo(e){return e*e*e}function Yo(e){return--e*e*e+1}function Ko(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}Xe();const Xo=["stroke","fill","color","backgroundColor","thumbColor"];function Go(e,t){const n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n);let s;for(s=0;s<r;++s)i[s]=Jo(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(e){for(s=0;s<r;++s)o[s]=i[s](e);return o}}function Jo(e,t,n){const r=typeof t;let i;return null==t||"boolean"===r?function(e){return()=>e}(t):("number"===r?Ei:"string"===r?(i=si(t))&&Xo.includes(n)?(t=i,Si):Ri:t instanceof si?Si:t instanceof Date?Ci:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?qi:Array.isArray(t)?Go:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Zo:Ei)(e,t)}function Zo(e,t){const n={},r={};let i;for(i in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)i in e?n[i]=Jo(e[i],t[i],i):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}function Qo(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const es={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},ts=/^\$/;function ns(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function rs(e,t,n){const r=e[t];r&&r.scale&&r.scale.pxScale?r.scale=r.scale.pxScale(n):r&&r.pxScale&&(e[t]=r.pxScale(n))}function is(e,t){return e.pxScale?e.pxScale(t):e}const os={normalizeSettings:function(e,t,n){const r=N({},e),i=N({},t);return Object.keys(r).forEach((e=>{i[e]={};const o=r[e],s=typeof o;if("function"==typeof o)i[e].fn=o;else if(ns(o)){let n=t[e];"string"==typeof n&&ts.test(n)&&(n=es[n]);const r=typeof n;i[e]="undefined"===r||r===s?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(i[e].fn=o.fn),void 0!==o.scale&&(i[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(i[e].ref=o.ref))})),Object.keys(t).forEach((e=>{if(e in r)return;const n=t[e];"string"===typeof n&&ts.test(n)?i[e]=es[n]:i[e]=n})),i},resolveForItem:function(e,t,n){const r={},i=Object.keys(t),o=i.length,s=e.datum,a=e.datum;for(let l=0;l<o;l++){const o=i[l],c=t[o],u="object"==typeof a&&void 0!==c,h=u&&"string"==typeof c.ref,d=u&&o in a,f=h?a[c.ref]:d?a[o]:s;ns(c)?r[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),r[o]=c.fn.call(null,e,n)):u&&c.scale&&f?(r[o]=c.scale(f.value),c.scale.bandwidth&&(r[o]+=c.scale.bandwidth()/2)):h&&f?r[o]=f.value:c.fn?r[o]=c.fn.call(null,e,n):r[o]=c}return r},updateScaleSize:rs};function ss(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((e,t)=>Array.isArray(t.children)?(e.push(...ss(t.children)),e):(e.push(t),e)),[])}function as(e,t){let{context:n,data:r,style:i,filter:o,mode:s}=t;const a=e.chart.brush(n),l=r,c=i.active||{},u=i.inactive||{},h=[];Object.keys(c).forEach((e=>{h.push(e)})),Object.keys(u).forEach((e=>{-1===h.indexOf(e)&&h.push(e)}));const d=[];let f=!1;const p=()=>{let t=ss(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},g=()=>{const e=p(),t=e.length;let n,r=!1;const i="function"==typeof l?l({brush:a}):l;for(let r=0;r<t;r++){if(n=e[r].data,!n)continue;e[r].__style||(e[r].__style={},h.forEach((t=>{e[r].__style[t]=e[r][t]})));const t=a.containsMappedData(n,i,s),o=d.indexOf(e[r]);let l=!1;t&&-1===o?(d.push(e[r]),l=!0):t||-1===o||(d.splice(o,1),l=!0),e[r].needToUpdate=l||f,e[r].isActive=t}for(let i=0;i<t;i++)if(n=e[i].data,n){if(e[i].needToUpdate){const t=N({},e[i],e[i].__style),n=e[i].isActive;h.forEach((r=>{e[i][r]=n&&r in c?"function"==typeof c[r]?c[r].call(null,t,d):c[r]:!n&&r in u?"function"==typeof u[r]?u[r].call(null,t,d):u[r]:e[i].__style[r]})),r=!0}delete e[i].needToUpdate}return f=!1,r},m=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,r=p(),i=r.length;for(let e=0;e<i;e++)r[e].data&&(r[e].__style=r[e].__style||{},h.forEach((t=>{r[e].__style[t]=r[e][t],t in u&&(r[e][t]="function"==typeof u[t]?u[t].call(null,r[e]):u[t])})));f=!0,d.length=0,n||e.renderer.render(e.nodes)},y=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,r=p(),i=r.length;for(let e=0;e<i;e++)r[e].__style&&(Object.keys(r[e].__style).forEach((t=>{r[e][t]=r[e].__style[t]})),r[e].__style=void 0);d.length=0,n||e.renderer.render(e.nodes)},b=()=>{if(g()){const t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return a.on("start",m),a.on("end",y),a.on("update",b),{isActive:()=>a.isActive(),update:()=>{d.length=0,f=!0,g()},cleanUp:function(){a.removeListener("start",m),a.removeListener("end",y),a.removeListener("update",b)}}}function ls(e){let{nodes:t,action:n,chart:r,trigger:i}=e;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let{dataPoints:t,action:n,chart:r,trigger:i}=e;if(!i)return;const o=i.data||[""];let s={items:[],actionFn:"toggleRanges"},a={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(s.actionFn="".concat(n,"Ranges"),a.actionFn="".concat(n,"Values"));for(let e=0;e<t.length;e++){const n=t[e];n&&o.forEach((e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},s.items.push(e)):(e.value=t.value,a.items.push(e))}}))}i.contexts.forEach((e=>{s.items.length?r.brush(e)[s.actionFn](s.items):r.brush(e)[a.actionFn](a.items)}))}({dataPoints:o,action:n,chart:r,trigger:i})}function cs(e){let{collisions:t,t:n,config:r,action:i}=e,o=[],s=!1;t.length>0&&(o=t,s=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const a=o.map((e=>e.node));return ls({nodes:a,action:i,chart:r.chart,data:r.data,trigger:n}),s}function us(e,t,n){const r=n.element().getBoundingClientRect();let i=L(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,r):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,r);return null===i||i.x<0||i.y<0||i.x>r.width||i.y>r.height?[]:(t.touchRadius>0&&L(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!L(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function hs(e,t,n){return e?"function"==typeof e?e(t):e:n}const ds={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function fs(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?"M".concat(r.x," ").concat(r.y):"L".concat(r.x," ").concat(r.y),n+=" "}return t&&(n+="Z"),n}function ps(e,t,n,r){const i=n/2,o=e-r/2,s=t-r/2,a=e-i,l=t-i;return[{x:o,y:s},{x:o,y:l},{x:o+r,y:l},{x:o+r,y:s},{x:a+n,y:s},{x:a+n,y:s+r},{x:o+r,y:s+r},{x:o+r,y:l+n},{x:o,y:l+n},{x:o,y:s+r},{x:a,y:s+r},{x:a,y:s}]}function gs(e){return-e/180*Math.PI}function ms(e){return function(e){let t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),r=n*Math.cos(e),i=n*Math.sin(e);return{x1:r<0?1:0,y1:i<0?1:0,x2:r>=0?r:r+1,y2:i>=0?i:i+1}}(gs(e))}function ys(e,t){return{x:e.x+t.x,y:e.y+t.y}}function bs(e,t){return{x:e.x-t.x,y:e.y-t.y}}function vs(e,t){return{x:e.x*t,y:e.y*t}}function xs(e,t){return e.x-t.x}function ws(e,t){return e.y-t.y}function ks(e,t){return xs(e,t)**2+ws(e,t)**2}function Ms(e,t){return Math.sqrt(ks(e,t))}function _s(e,t){return e.x*t.x+e.y*t.y}function Ss(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const r=Math.cos(t),i=Math.sin(t),o=bs(e,n);return ys({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}const qs={up:0,down:180,left:90,right:-90};function Ds(e){let{x:t,y:n,size:r}=e;const i=r/2;return{type:"rect",x:t-i,y:n-i,width:r,height:r}}const Cs=Xe();Cs.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),Cs.add("diamond",(function(e){const t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:fs([{x:n,y:r+t/2},{x:n+t/2,y:r},{x:n+t,y:r+t/2},{x:n+t/2,y:r+t},{x:n,y:r+t/2}])}})),Cs.add("saltire",(function(e){const t=gs(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n);let o=e.size;const s=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*s;const a={x:e.x,y:e.y},l=ps(e.x,e.y,o,i).map((e=>Ss(e,t,a)));return{type:"path",fill:"black",d:fs(l)}})),Cs.add("square",(function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),Cs.add("triangle",(function(e){const t=e.size,n={x:e.x,y:e.y},r=qs[e.direction]||0,i=t/2,o=e.x-i,s=e.y-i;let a=[{x:o,y:s+t},{x:o+i,y:s},{x:o+t,y:s+t},{x:o,y:s+t}];const l=gs(r);return a=a.map((e=>Ss(e,l,n))),{type:"path",fill:"black",d:fs(a)}})),Cs.add("line",(function(e){const t="vertical"===e.direction,n=e.size/2,r=e.x,i=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:r-(t?0:n),y1:i-(t?n:0),x2:r+(t?0:n),y2:i+(t?n:0),collider:Ds(e)}})),Cs.add("star",(function(e){const t=e.size,n=[],r=t/2,i=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,s=isNaN(e.startAngle)?90:e.startAngle,a=360/i;for(let t=1;t<=i;t++){const i=a*t+s,l=gs(i),c=gs(i+a/2),u=Math.sin(l),h=Math.cos(l),d=Math.sin(c),f=Math.cos(c);n.push({x:e.x+h*r,y:e.y+u*r}),n.push({x:e.x+f*o,y:e.y+d*o})}return{type:"path",fill:"black",d:fs(n)}})),Cs.add("n-polygon",(function(e){const t=[],n=e.size/2,r=Math.max(isNaN(e.sides)?6:e.sides,3),i=360/r,o=isNaN(e.startAngle)?0:e.startAngle;for(let s=1;s<=r;s++){const r=gs(i*s+o),a=Math.sin(r),l=Math.cos(r);t.push({x:e.x+l*n,y:e.y+a*n})}return{type:"path",fill:"black",d:fs(t)}})),Cs.add("cross",(function(e){const t=e.x,n=e.y,r=e.size/2,i=isNaN(e.width)?r/2:e.width,o=Math.min(i,r);return{type:"path",fill:"black",d:fs(ps(t,n,e.size,o))}})),Cs.add("bar",(function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,r=e.size/2,i=r/2/2;let o=[{x:t.x-r,y:t.y+i},{x:t.x-r,y:t.y-i},{x:t.x+r,y:t.y-i},{x:t.x+r,y:t.y+i}];if(n){const e=gs(90);o=o.map((n=>Ss(n,e,t)))}const s=V(o);return s.type="rect",s.fill="black",s})),Cs.add("rect",(function(e){const{x:t,y:n,size:r}=e,i=void 0===e.width?r:e.width,o=void 0===e.height?r:e.height;return{type:"rect",fill:"black",x:t-i/2,y:n-o/2,width:i,height:o}}));const Es=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Cs;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((n=>{void 0!==ds[n]&&"transform"!==n&&(e[n]=t[n])}))}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function As(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{dock:n="center",displayOrder:r=0,prioOrder:i=0,preferredSize:o=0,minimumLayoutMode:s,show:a=!0}=e;n=n||"center";return{computePreferredSize(e){let{inner:n,outer:r,children:i}=e;return"function"==typeof o?o({inner:n,outer:r,children:i,dock:this.dock()},t):o},dock(e){return void 0!==e?(n=e,this):"function"==typeof n?n(t):n},displayOrder(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},prioOrder(e){return void 0!==e?(i=e,this):"function"==typeof i?i(t):i},minimumLayoutMode(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s},show(e){return void 0!==e?(a=e,this):"function"==typeof a?a(t):a}}}function Ts(e,t,n){const{require:r=[]}=t,i=t.mediator||{},{settings:o,formatter:s,scale:a,data:l,renderer:c,chart:u,dockConfig:h,mediator:d,instance:f,rect:p,style:g,registries:m,resolver:y,update:b,_DO_NOT_USE_getInfo:v,symbol:x,isVisible:w}=n;e.emit=()=>{},w&&(e.isVisible=w),Object.defineProperty(e,"settings",{get:o}),Object.defineProperty(e,"data",{get:l}),Object.defineProperty(e,"formatter",{get:s}),Object.defineProperty(e,"scale",{get:a}),Object.defineProperty(e,"mediator",{get:d}),Object.defineProperty(e,"style",{get:g}),Object.defineProperty(e,"registries",{get:m}),p&&Object.defineProperty(e,"rect",{get:p}),v&&(e._DO_NOT_USE_getInfo=v),Object.keys(t).forEach((n=>{var r;r=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some((e=>e===r))||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),r.forEach((t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:u}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:h}):"instance"===t?Object.defineProperty(e,"instance",{get:f}):"update"===t&&b?Object.defineProperty(e,"update",{get:b}):"resolver"===t?Object.defineProperty(e,"resolver",{get:y}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:x})})),Object.keys(i).forEach((t=>{e.mediator.on(t,i[t].bind(e))}))}function Ns(e,t,n){const r=t=>e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0,i={};return i.displayOrder=r("displayOrder"),i.dock=r("dock"),i.prioOrder=r("prioOrder"),i.minimumLayoutMode=r("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==i.displayOrder?i.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==i.prioOrder?i.prioOrder:e.layout.prioOrder,e.layout.dock=i.dock||e.layout.dock,e.layout.minimumLayoutMode=i.minimumLayoutMode||e.layout.minimumLayoutMode,i.show=e.show,i.preferredSize=t,i}function Rs(e,t,n){Object.keys(n.on||{}).forEach((r=>{e.eventListeners=e.eventListeners||[];const i=n.on[r].bind(e);e.eventListeners.push({event:r,listener:i}),t.on(r,i)})),e.emit=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.emit(e,...r)}}function Os(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{defaultSettings:n={},_DO_NOT_USE_getInfo:r=()=>({})}=e,{chart:i,container:o,mediator:s,registries:a,theme:l,renderer:c}=t,u=Do.mixin({});let h,d,f,p,g,m=t.settings||{},y=N(!0,{},n,m),b=[],v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:os,n={};return{resolve:function(r){let{data:i,settings:o,defaults:s={},scaled:a}=r;const l=n.norm=t.normalizeSettings(o,s,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};a&&Object.keys(a).forEach((e=>{l[e]&&t.updateScaleSize(l,e,a[e])}));const u=[];if(!i||!Array.isArray(i.items)){const e={data:i,resources:c};let r=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:r}}{let e;for(let r=0,o=i.items.length;r<o;r++){e={datum:i.items[r],data:i,resources:c};let o=t.resolveForItem(e,n.norm,r);o.data=i.items[r],u.push(o)}}return{settings:n.norm,items:u}}}}({chart:i}),x=!1;const w={nodes:[],chart:i,config:y.brush||{},renderer:null},k={tap:[],over:[]},M=[],_={},S=N({},m);function q(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const i=void 0!==e[t],o=void 0!==m[t];let s;for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return i&&("function"==typeof e[t]?s=e[t].call(_,...l):r&&(s=e[t])),o&&("function"==typeof m[t]?s=m[t].call(S,...l):r&&(s=m[t])),i||o||(s=n.call(_,...l)),s}}const D=q("preferredSize",(()=>0),!0),C=q("resize",(e=>{let{inner:t}=e;return t})),E=q("created"),A=q("beforeMount"),T=q("mounted"),R=q("beforeUnmount"),O=q("beforeUpdate"),P=q("updated"),L=q("beforeRender"),j=q("beforeDestroy"),z=q("destroyed"),F=e.render,H=()=>{y.brush&&(y.brush.consume||[]).forEach((e=>{e.context&&e.style&&M.push(as(w,e))}))},B=()=>{y.brush&&(y.brush.trigger||[]).forEach((e=>{"over"===e.on?k.over.push(e):k.tap.push(e)}))};Object.defineProperty(w,"data",{get:()=>b});const V=y.renderer||e.renderer,$=V?c||a.renderer(V)():c||a.renderer()();"function"==typeof $.settings&&$.settings(y.rendererSettings),w.renderer=$;const W={resources:i.logger?{logger:i.logger()}:{}};let U=As(Ns(y,D,i.logger()),W);const Y=e=>{e.key=y.key,e.element=$.element()},K=()=>{};K.dockConfig=()=>U,K.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(m=e.settings,y=N(!0,{},n,e.settings),U=As(Ns(y,D,i.logger()),W),w.config=y.brush||{}),y.scale&&(h=i.scale(y.scale)),y.data){const{rendererSettings:e}=y,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=Pr(y.data,{dataset:i.dataset,collection:i.dataCollection},{logger:i.logger()},i.dataCollection);t?t.isFirst?(b=n,b.items&&(b.items=[...n.items])):b.items&&(b.items=[...b.items,...n.items||[]]):b=n}else b=h?h.data():[];"string"==typeof y.formatter||"object"==typeof y.formatter?d=i.formatter(y.formatter):h&&h.data().fields&&(d=h.data().fields[0].formatter()),g=l.style(y.style||{})},K.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=C({inner:e,outer:t});p=n?$.size(n):$.size(e),S.rect=N(!0,{computedPhysical:p.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),p=N(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},p)},K.getRect=()=>S.rect;const X=()=>{const e=$.renderArgs?$.renderArgs.slice(0):[],{rendererSettings:t}=y;let n=b;const r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return b.items&&r&&(n=I(I({},b),{},{items:b.items.slice(r.start,r.end)})),e.push({data:n}),e};let G,J,Z;function Q(e){const{rendererSettings:t}=y,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?w.nodes=[...e||[]]:w.nodes&&(w.nodes=[...w.nodes,...e||[]]):w.nodes=e}K.beforeMount=A,K.beforeRender=()=>{L({size:p})},K.render=()=>{const e=F.call(_,...X());Q(e),$.render(e),G=e,J=S.rect.computed},K.hide=()=>{K.unmount(),$.size({x:0,y:0,width:0,height:0}),$.clear()},K.beforeUpdate=()=>{O({settings:y,data:b})},K.update=()=>{Z&&Z.stop();const{rendererSettings:e,brush:t,animations:n}=y;if("function"==typeof(null==e?void 0:e.transform)&&e.transform())return $.render(),void(G=null);const r=F.call(_,...X());Q(r),M.forEach((e=>e.cleanUp())),M.length=0,k.tap=[],k.over=[],t&&(H(),B()),M.forEach((e=>{e.isActive()&&e.update()})),G&&n&&("function"==typeof n.enabled?n.enabled():n.enabled)?(n.compensateForLayoutChanges&&n.compensateForLayoutChanges({currentNodes:G,currentRect:S.rect.computed,previousRect:J}),Z=function(e,t,n,r){let i,{old:o,current:s}=e,{renderer:a}=t,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},h={nodes:[],ips:[]},d=[],f=null;const p=n.trackBy||Qo,g={start(){let e={};if(o.forEach(((t,n)=>{let r=p(t,n);e[r]=t})),s.forEach(((t,n)=>{let r=p(t,n);if(e[r]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter((e=>!e.dummy)),r=t.points.filter((e=>!e.dummy)),i=r.map((e=>e.data.major.value)),o=n.filter((e=>i.includes(e.data.major.value))).map((e=>e.data.major.value)),s=n.filter((e=>o.includes(e.data.major.value))),a=r.filter((e=>o.includes(e.data.major.value)));return{old:s,current:a}}(e[r],t);h.ips.push(Zo(N({},e[r],{points:n.old}),N({},t,{points:n.current}))),l.push(N({},e[r],{commonPoints:n.old}))}else h.ips.push(Zo(e[r],t)),l.push(e[r]);h.nodes.push(t),e[r]=!1}else c.nodes.push(t),c.ips.push(Zo(N({},t,{r:.001,opacity:0}),t))})),Object.keys(e).forEach((t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(Zo(e[t],N({},e[t],{r:1e-4,opacity:0}))))})),d.push({name:"exiting",easing:Uo,duration:200,tweens:u.ips,nodes:[...l]}),d.push({name:"updating",easing:Ko,duration:400,tweens:h.ips,nodes:[]}),d.push({name:"entering",easing:Yo,duration:200,tweens:c.ips,nodes:[...h.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,i=e?l.filter(e).length:l.length,{isInit:o,shouldBeRemoved:s}=r.getValue("animations.updatingStageMeta");!1===o?(r.setValue("animations.updatingStageMeta.shouldBeRemoved",0===i),r.setValue("animations.updatingStageMeta.isInit",!0)):r.setValue("animations.updatingStageMeta.shouldBeRemoved",s&&0===i)}d.length&&(f=a.getScene(s),d[0].started=Date.now(),"undefined"!=typeof window&&(i=window.requestAnimationFrame(g.tick)))},tick(){let e=d[0];e||g.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,n=[],o=e.tweens.map((n=>n(e.easing(Math.min(1,t)))));if(n.push(...o),n.push(...e.nodes),a.render(n),t>=1){d.shift();const{isInit:e,shouldBeRemoved:t}=r.getValue("animations.updatingStageMeta");d.length?"updating"===d[0].name&&t&&d.shift():(!0===e&&r.setValue("animations.updatingStageMeta.isInit",!1),g.stop())}i&&(i=window.requestAnimationFrame(g.tick))},stop(){i&&(window.cancelAnimationFrame(i),i=!1)},inProgress:()=>!!i,get targetScene(){return f}};return g}({old:G,current:r},{renderer:$},n,i.storage),Z.start()):$.render(r),G=r,J=S.rect.computed,$.setKey&&"string"==typeof m.key&&$.setKey(m.key)},K.updated=P,K.destroy=()=>{K.unmount(),j(f),$.destroy(),z(),f=null};const ee=e=>{w.nodes=e,M.forEach((e=>{e.isActive()&&e.update()})),$.render(e)};return Ts(_,e,{settings:()=>y,data:()=>b,scale:()=>h,formatter:()=>d,renderer:()=>$,chart:()=>i,dockConfig:()=>U,mediator:()=>s,instance:()=>S,rect:()=>S.rect,style:()=>g,update:()=>ee,registries:()=>a,resolver:()=>v,symbol:()=>Es(a.symbol)}),Ts(S,m,{settings:()=>y,data:()=>b,scale:()=>h,formatter:()=>d,renderer:()=>$,chart:()=>i,dockConfig:()=>U,mediator:()=>s,style:()=>g,_DO_NOT_USE_getInfo:r.bind(_),isVisible:()=>x}),K.getBrushedShapes=function(e,t,n){const r=[];if(y.brush&&y.brush.consume){const o=i.brush(e),s=$.findShapes("*");y.brush.consume.filter((t=>t.context===e)).forEach((e=>{for(let i=0;i<s.length;i++){const a=s[i];a.data&&o.containsMappedData(a.data,n||e.data,t)&&(Y(a),r.push(a),s.splice(i,1),i--)}}))}return r},K.findShapes=e=>{var t;const n=(null!==(t=Z)&&void 0!==t&&t.inProgress()?Z.targetScene:$).findShapes(e);for(let e=0,t=n.length;e<t;e++)Y(n[e]);return n},K.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=$.itemsAt(e);let r;r=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map((e=>e.node));for(let e=0,t=r.length;e<t;e++)Y(r[e]);return r},K.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];ls({nodes:e,action:t.action||"toggle",trigger:t,chart:i,data:w.data})},K.mount=()=>{f=$.element&&$.element()?f:$.appendTo(o),$.setKey&&"string"==typeof m.key&&$.setKey(m.key),y.brush&&(H(),B()),Rs(S,u,m),Rs(_,u,e),x=!0},K.mounted=()=>T(f),K.unmount=()=>{[S,_].forEach((e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach((e=>{let{event:n,listener:r}=e;t.removeListener(n,r)})),e.eventListeners.length=0),e.emit=()=>{}}(e,u)})),k.tap=[],k.over=[],M.forEach((e=>{e.cleanUp()})),M.length=0,R(),x=!1},K.onBrushTap=e=>{k.tap.forEach((t=>{(function(e){let{e:t,t:n,config:r}=e;return cs({collisions:us(t,n,r.renderer),t:n,config:r,action:hs(n.action,t,"toggle")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&i.toggleBrushing(!0)}))},K.onBrushOver=e=>{k.over.forEach((t=>{(function(e){let{e:t,t:n,config:r}=e;return cs({collisions:us(t,n,r.renderer),t:n,config:r,action:hs(n.action,t,"set")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&i.toggleBrushing(!0)}))},K.def=_,K.ctx=S,K.renderer=()=>$,K.set({settings:m}),E(),K}function Is(e){const t=N(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const r=t.split(".");let i=e;for(let e=0;e<r.length;++e){const t=r[e];if(void 0===i[t])return n;i=i[t]}return i}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const r=t.split("."),i=r[r.length-1];let o=e;for(let e=0;e<r.length-1;++e){const t=r[e];void 0===o[t]&&(o[t]=Number.isNaN(+r[e+1])?{}:[]),o=o[t]}void 0!==n?o[i]=n:delete o[i]}(t,e,n)};return n}function Ps(e,t,n){const r=ys(function(e,t){const n=_s(e,t)/_s(t,t)||1;return{x:t.x*n,y:t.y*n}}(bs(n,e),bs(t,e)),e);return r}function Ls(e,t,n){return Ms(e,n)+Ms(t,n)-Ms(e,t)<1e-12}function js(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function zs(e){return e.x1===e.x2&&e.y1===e.y2}function Fs(e){return e.width<=0||e.height<=0}function Hs(e){return e.r<=0}function Bs(e){return e.edges.length<=2}function Vs(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=Gs(e,$(t.edges[r])),!0===n)return!0;return!1}function $s(e,t){let n=!1;const{numPolygons:r,polygons:i}=t;for(let t=0;t<r;t++){if(n=oa(e,i[t]),!0===n)return!0}return!1}function Ws(e,t){if(Hs(e))return!1;return ks({x:e.cx,y:e.cy},t)<=e.r**2}function Us(e,t){if(Fs(t)||Hs(e))return!1;const n=t.width/2,r=t.height/2,i=t.x+n,o=t.y+r,s=e.r,a=e.cx,l=e.cy,c=Math.abs(a-i),u=Math.abs(l-o);if(c>n+s||u>r+s)return!1;if(c<=n||u<=r)return!0;return(c-n)**2+(u-r)**2<=s**2}function Ys(e,t){if(Hs(e)||zs(t))return!1;const[n,r]=H(t);if(Ws(e,n)||Ws(e,r))return!0;const i={x:e.cx,y:e.cy},o=Ps(n,r,i);return ks(o,i)<=e.r**2&&Ls(n,r,o)}function Ks(e,t){if(Bs(t)||Hs(e))return!1;if(Xs(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let r=0;r<n;r++){if(Ys(e,$(t.edges[r])))return!0}return!1}function Xs(e,t){if(Bs(e)||!ea(e.boundingRect(),t))return!1;const{x:n,y:r}=t,i=e.vertices;let o,s,a,l,c;for(o=!1,l=-1,s=i.length,a=s-1;++l<s;a=l){if(i[l].x===n&&i[l].y===r)return!0;if(i[l].y===i[a].y&&i[l].y===r&&(n-i[l].x)*(n-i[a].x)<=0)return!0;if(i[l].y<r&&r<=i[a].y||i[a].y<r&&r<=i[l].y){if(c=(i[a].x-i[l].x)*(r-i[l].y)/(i[a].y-i[l].y)+i[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function Gs(e,t){if(Bs(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(na(t,$(e.edges[n])))return!0}const[n,r]=H(t);return Xs(e,n)||Xs(e,r)}function Js(e,t){if(Bs(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(ta(t,$(e.edges[n])))return!0}const[n,r,i,o]=B(t);return Xs(e,n)||Xs(e,r)||Xs(e,i)||Xs(e,o)}function Zs(e,t){return!Fs(e)&&!Fs(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function Qs(e,t){if(Fs(e)||Fs(t))return!1;return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}].every((t=>ea(e,t)))}function ea(e,t){return!Fs(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function ta(e,t){if(zs(t)||Fs(e))return!1;const[n,r]=H(t);if(ea(e,n)||ea(e,r))return!0;const i=B(e);let o=i.length;for(let e=0;e<o;e++){if(na($([i[e],i[3!==e?e+1:0]]),t))return!0}return!1}function na(e,t){const[n,r]=H(e),[i,o]=H(t),s=xs(r,n),a=ws(r,n),l=xs(o,i),c=ws(o,i),u=xs(n,i),h=ws(n,i);let d=c*s-l*a;const f=l*h-c*u,p=s*h-a*u;let g,m;if(0===s&&0===a)return!1;if(0===l&&0===c)return!1;if(0===d){if(0===f&&0===p){if(0===s){if(0===a)return n.x===r.x&&n.y===r.y;g=ws(i,n)/a,m=ws(o,n)/a}else g=(i.x-n.x)/s,m=(o.x-n.x)/s;return!(g<0&&m<0||g>1&&m>1)}return!1}const y=f/d;return d=p/d,y>=0&&y<=1&&d>=0&&d<=1}function ra(e,t){if(zs(e))return!1;const[n,r]=H(e);return Ls(n,r,t)}function ia(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Zs(n,r)&&(Qs(n,r)?Vs(e,t):Vs(t,e))}function oa(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Zs(n,r)&&(Qs(r,n)?function(e,t){let n=!1;const{numPolygons:r,polygons:i}=e;for(let e=0;e<r;e++)if(n=ia(t,i[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=la(e,$(t.edges[r])),!0===n)return!0;return!1}(e,t))}function sa(e,t){if(Hs(e))return!1;if(aa(t,{x:e.cx,y:e.cy}))return!0;const{numPolygons:n,polygons:r}=t;for(let t=0;t<n;t++){const n=r[t],i=n.edges.length;for(let t=0;t<i;t++){if(Ys(e,$(n.edges[t])))return!0}}return!1}function aa(e,t){if(!ea(e.boundingRect(),t))return!1;const{x:n,y:r}=t,i=e.numPolygons;let o,s,a,l,c,u,h=!1;for(s=0;s<i;s++)for(o=e.vertices[s],c=-1,a=o.length,l=a-1;++c<a;l=c){if(o[c].x===n&&o[c].y===r)return!0;if(o[c].y===o[l].y&&o[c].y===r&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<r&&r<=o[l].y||o[l].y<r&&r<=o[c].y){if(u=(o[l].x-o[c].x)*(r-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(h=!h)}}return h}function la(e,t){const[n,r]=H(t);if(aa(e,n)||aa(e,r))return!0;const{numPolygons:i,polygons:o}=e;for(let e=0;e<i;e++){const n=o[e];for(let e=0,r=n.edges.length;e<r;e++){if(na(t,$(n.edges[e])))return!0}}return!1}function ca(e,t){const[n,r,i,o]=B(t);if(aa(e,n)||aa(e,r)||aa(e,i)||aa(e,o))return!0;const{numPolygons:s,polygons:a}=e;for(let e=0;e<s;e++){const n=a[e];for(let e=0,r=n.edges.length;e<r;e++){if(ta(t,$(n.edges[e])))return!0}}return!1}const ua=/^\$/,ha="@extend";function da(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function fa(e,t,n){if("string"==typeof e){let r=t[e];return-1!==n.indexOf(e)&&da(e),ua.test(r)?(n.push(e),fa(r,t,n)):r}let r=e;const i=N(!0,{},t,e),o={};if(e[ha]){const o=e[ha];-1!==n.indexOf(o)&&da(o);let s=n.slice();s.push(o),r=N(!0,{},fa(i[o],t,s),e)}return Object.keys(r).forEach((e=>{let t=n.slice();if(e===ha||ua.test(e))return;o[e]=r[e];let s=o[e];ua.test(s)&&s in i?(-1!==n.indexOf(s)&&da(s),t.push(s),s=i[s],"object"==typeof s||ua.test(s)&&s in i?o[e]=fa(s,i,t):o[e]=s):"object"==typeof s&&(o[e]=fa(s,i,t))})),o}function pa(e,t){return fa(e,t,[])}function ga(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const r=e=>{e.forEach((e=>{const n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map((e=>e?e.length:0))}}))},i={palette:(e,n)=>((e,n)=>{const r=t[e];if(!r)return[];const i=r.sizes;for(let e=0;e<i.length;e++)if(n<=i[e])return r.colors[e];return r.colors[i.length-1]})(e,n),setPalettes:r,style:e=>pa(e,n),setStyle:t=>{n=N({},e,t)}};return r(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),i}function ma(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function ya(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return N(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function ba(e,t,n,r,i){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:r,margin:isNaN(i)?0:i}}function va(e,t,n){if(void 0===e.cachedSize){const r=e.config.dock();let i,o=e.comp.preferredSize({inner:t,outer:n,dock:r});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},i="top"===r||"bottom"===r?o.height:"right"===r||"left"===r?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(i),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function xa(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function wa(e,t){const n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function ka(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const r=e.width-(t.x+t.width);r<n.right&&(t.width-=n.right-r),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const i=e.height-(t.y+t.height);i<n.bottom&&(t.height-=n.bottom-i)}function Ma(e,t,n,r,i){const o=N({},t),s=N({},n);xa(o,r),wa(s,r),ka(e,o,s);const a=function(e,t,n){const r=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),i=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=r&&t.height>=i}(e,o,i);return!!a&&(xa(t,r),wa(n,r),!0)}function _a(e){return{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y}}function Sa(e){return V([].concat(...e.map(B)))}function qa(e){let{visible:t,layoutRect:n,reducedRect:r,containerRect:i,translation:o}=e;const s=ba(r.x,r.y,r.width,r.height),a=ba(r.x,r.y,r.width,r.height),l={},c=t.slice(),u=c.slice().sort(((e,t)=>e.config.displayOrder()-t.config.displayOrder()));return t.sort(((e,t)=>{if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n})).forEach((e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=s.width,t.x=n.x,c.x=s.x,t.y=c.y=s.y-e.cachedSize,s.y-=e.cachedSize,s.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=s.x,t.y=c.y=s.y+s.height,t.width=n.width,c.width=s.width,t.height=c.height=e.cachedSize,s.height+=e.cachedSize;break;case"left":t.x=c.x=a.x-e.cachedSize,t.y=n.y,c.y=a.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=a.height,a.x-=e.cachedSize,a.width+=e.cachedSize;break;case"right":t.x=c.x=a.x+a.width,t.y=n.y,c.y=a.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=a.height,a.width+=e.cachedSize;break;case"center":t.x=c.x=r.x,t.y=c.y=r.y,t.width=c.width=r.width,t.height=c.height=r.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map((e=>l[e])).filter((e=>!!e));n.length>0&&(t=Sa(n.map((e=>e.outerRect))),c=Sa(n.map((e=>e.r))))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,r){const i={x:r.width/n.width,y:r.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=i.x<i.y,t=Math.min(i.x,i.y);i.x=t,i.y=t;const s=e?"height":"width",a=(r[s]-n[s]*i.x)*n.align;o.left=e?0:a,o.top=e?a:0}e.scaleRatio=i,e.margin=o,t.scaleRatio=i,t.margin=o,n.scaleRatio=i,n.margin=o}(c,t,n,i),c.edgeBleed=e.edgeBleed,c.computed=_a(c),t.edgeBleed=e.edgeBleed,t.computed=_a(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0})),u}function Da(e,t,n){const r=e.layoutModes||{},i=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof i?o=r[i.width]&&r[i.height]&&n.width>=r[i.width].width&&n.height>=r[i.height].height:o&&void 0!==i&&(o=r[i]&&n.width>=r[i].width&&n.height>=r[i].height),o}function Ca(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function Ea(e){let t=ya(e);const n={};return n.layout=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const{logicalContainerRect:r,containerRect:i}=function(e,t){const n={x:0,y:0,width:0,height:0},r={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(r.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,r.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,r.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),r.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(r.width=n.width,r.height=n.height,r.preserveAspectRatio=!1),ma(r),ma(n),{logicalContainerRect:r,containerRect:n}}(e,t),[o,s]=function(e,t,n){const r=[],i=[];for(let o=0;o<e.length;++o){const s=e[o];Ca(s);let a=s.dockConfig;const l=s.key,c=a.dock(),u=/@/.test(c)?c.split(",").map((e=>e.replace(/^\s*@/,""))):[];Da(t,a,n)?r.push({comp:s,key:l,config:a,referencedDocks:u}):i.push({comp:s,key:l,config:a,referencedDocks:u})}return[r,i]}(n,t,r),a=function(e){let{layoutRect:t,visible:n,hidden:r,settings:i}=e;const o=ba(t.x,t.y,t.width,t.height),s={left:0,right:0,top:0,bottom:0},a=n.slice();a.sort(((e,t)=>e.config.prioOrder()-t.config.prioOrder()));for(let e=0;e<a.length;++e){const n=a[e];va(n,o,t),Ma(t,o,s,n,i)||(r.push(a.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let r=e[n];if(r.referencedDocks.length){const i=r.referencedDocks.every((e=>t.some((t=>t.key===e))));i&&t.push(e.splice(n,1)[0])}}}(n,r);const l=n.filter((e=>-1!==a.indexOf(e)));return n.length=0,n.push(...l),ka(t,o,s),o}({layoutRect:r,visible:o,hidden:s,settings:t}),l=qa({visible:o,layoutRect:r,reducedRect:a,containerRect:i,translation:{x:e.x,y:e.y}});return s.forEach((e=>{e.comp.visible=!1;const t=ba();e.comp.resize(t,t)})),{visible:o.map((e=>e.comp)),hidden:s.map((e=>e.comp)),ordered:l.map((e=>e.comp))}},n.settings=function(e){t=ya(e)},n}const Aa=(e,t)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.hasKey&&r.key===t)return e[n]}return null},Ta=e=>null==e?void 0:e.map((e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(I(I({},n),{},{children:Ta(e.children)}))}})),Na=(e,t)=>({visible:[],hidden:t,ordered:[]}),Ra=e=>(t,n)=>{var r;const i=n.map(((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize(I(I({},t),{},{children:Ta(e.children)}))}})),o=e=>n[e.index],{visible:s=i,hidden:a=[],ordered:l=s}=null!==(r=e(t,i))&&void 0!==r?r:{};return{visible:s.map(o),hidden:a.map(o),ordered:l.map(o)}},Oa=e=>"function"==typeof e?Ra(e):(e=>{const t=Ea(e);return Ra(((e,n)=>t.layout(e,n)))})(e);function Ia(e,t,n){const r=t.left-n.left,i=t.top-n.top,o=W(e),s=N(!0,{},e);switch(o){case"circle":s.cx+=r,s.cy+=i;break;case"polygon":for(let e=0,t=s.vertices.length;e<t;e++){const t=s.vertices[e];t.x+=r,t.y+=i}break;case"geopolygon":for(let e=0;e<s.vertices.length;e++){const t=s.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n.x+=r,n.y+=i}}break;case"line":s.x1+=r,s.y1+=i,s.x2+=r,s.y2+=i;break;case"point":case"rect":s.x+=r,s.y+=i}return s}function Pa(e,t){const n=[];let r=0;t.forEach((e=>{n.push(r),r++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(r+=t.length)})),t.forEach(((t,r)=>((e,t,n)=>{const r=t.instance.renderer().element();if(isNaN(n)||!r||!e||!e.children)return;const i=e.children[Math.max(0,n)];if(r===i)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==i?(e.insertBefore(r,i),o&&o.forEach((t=>{e.insertBefore(t,r)}))):(o&&o.forEach((t=>{e.appendChild(t,r)})),e.appendChild(r))})(e,t,n[r])))}function La(e,t){let{element:n,data:r=[],settings:i={},on:o={}}=e;const s=t.registries,a=t.logger,l=ga(t.style,t.palettes),c=[],u=N({},e),h=function(){const e={};return Do.mixin(e),e}();let d=[],f=null,p=null,g=null,m=[],y=()=>{},b=()=>{};const v={};let x=!1;const w=function(e){let{createComponent:t}=e;const n={};let r=[],i=[];const o=e=>{const n=t(e);return n&&(r.push(n),e.components&&(n.children=e.components.map((e=>o(e))).filter((e=>!!e)))),n},s=e=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)},a=(e,t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n],i=t.find((e=>r.hasKey&&r.key===e.key));i?r.children&&i.components&&a(r.children,i.components):(e.splice(n,1),s(r),r.children&&a(r.children,[]),r.instance.destroy())}},l=e=>{let{compList:t,data:n,excludeFromUpdate:r,formatters:i,scales:s,settingsList:a}=e;return a.map((e=>{const a=Aa(t,e.key);return r.indexOf(e.key)>-1?(delete a.updateWith,a):a?(e.rendererSettings&&"function"==typeof a.instance.renderer().settings&&a.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(a.applyTransform=!0,a):(a.updateWith={formatters:i,scales:s,data:n,settings:e},e.components&&(a.children=l({compList:a.children||[],data:n,excludeFromUpdate:r,formatters:i,scales:s,settingsList:e.components})),a)):o(e)})).filter((e=>!!e))},c=e=>{let{components:t,hidden:n,layoutFn:r,ordered:i,rect:o,visible:s}=e;const{visible:a,hidden:l,ordered:u}=r(o,t);s.push(...a),n.push(...l),i.push(...u),a.forEach((e=>{if(e.children){var t,r;const o=Oa(null!==(t=null===(r=e.settings)||void 0===r?void 0:r.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:i,rect:e.instance.getRect(),visible:s})}})),l.forEach((e=>{e.children&&c({components:e.children,hidden:n,layoutFn:Na,ordered:i,rect:null,visible:s})}))};return n.destroy=()=>{r.forEach((e=>e.instance.destroy())),r=[],i=[]},n.findComponentByKey=e=>Aa(r,e),n.forEach=e=>{r.forEach(e)},n.layout=e=>{let{layoutSettings:t,rect:n}=e;const r=[],o=[],s=[],a=Oa(t);return c({components:i,hidden:o,layoutFn:a,ordered:s,rect:n,visible:r}),{visible:r,hidden:o,ordered:s}},n.set=e=>{let{components:t}=e;i=t.map((e=>o(e))).filter((e=>!!e))},n.update=e=>{let{components:t,data:n,excludeFromUpdate:r,formatters:o,scales:s}=e;a(i,t),i=l({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:s,settingsList:t})},n}({createComponent:e=>{if(!s.component.has(e.type))return a.warn("Unknown component: ".concat(e.type)),!1;return{instance:Os(s.component(e.type),{settings:e,chart:u,mediator:h,registries:s,theme:l,container:n}),settings:N(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function k(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const r="function"==typeof e[t];let i;for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=r?e[t].call(u,...s):n.call(u,...s),i}}const M=()=>{let e;i.dockLayout?(a.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=i.dockLayout):e=i.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const{width:t,height:n}=e.getBoundingClientRect();return{x:0,y:0,width:t,height:n}}return{x:0,y:0,width:0,height:0}}(n);return w.layout({layoutSettings:e,rect:t})},_=k("created"),S=k("beforeMount"),q=k("mounted"),D=k("beforeUpdate"),C=k("updated"),E=k("beforeRender"),A=k("beforeDestroy"),T=k("destroyed"),R=function(e,t){let{partialData:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{formatters:r={},scales:i={},scroll:o={}}=t;y=function(e,t){let{types:n,logger:r}=t;const i={},o=[];return Array.isArray(e)?o.push(...e):(r.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach(((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(r.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let s=o({key:n,data:e.data,config:e.config});i[n]=s}})),e=>e?i[e]:i[Object.keys(i)[0]]}(e,{logger:a,types:s.data}),n||Object.keys(v).forEach((e=>v[e].clear())),t.palettes&&l.setPalettes(t.palettes),t.style&&l.setStyle(t.style),b=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Pr;const i={};return(e||[]).forEach((e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");i[e.key]=()=>r(e.data,t,n)})),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in i))throw new Error("Unknown data collection: ".concat(t));"function"==typeof i[t]&&(i[t]=i[t]());let r=i[t];if(n&&n.fields&&n.fields.filter){let e=r.fields.filter(n.fields.filter);r.fields.length!==e.length&&(r=N(r,{fields:e}))}return r}}(t.collections,{dataset:y},{logger:a});const c={theme:l,logger:a};f=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Mo;const i={};return{get(o){let s;return"string"==typeof o&&e[o]?s=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(s=o.scale),s?(i[s]=i[s]||r(e[s],t,n),i[s]):r(o,t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(i,{dataset:y,collection:b},I(I({},c),{},{scale:s.scale})),p=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Lr;const i={};return{get(o){let s;return"string"==typeof o&&e[o]?s=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?s=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(s=o.type),s?(i[s]=i[s]||r(e[s],t,n),i[s]):r(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(r,{dataset:y,collection:b},I(I({},c),{},{formatter:s.formatter})),g=function(e,t){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Eo(e[r],t?t[r]:null));return n}(o,g)};function O(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},r=e.filter((e=>!!e.key)).map((e=>e.key));m.forEach((e=>{e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()})),m=e.map((e=>{const r=e.key&&t[e.key]?t[e.key]:s.interaction(e.type)(u,h,n);return r.set(e),r}))}const P=e=>{const t=n.getBoundingClientRect(),r="clientX"in e?e.clientX:e.x,i="clientY"in e?e.clientY:e.y,o={x:r-t.left,y:i-t.top},s=[];return d.forEach((e=>{const t=e.instance.getRect();ea(t.computedPhysical?t.computedPhysical:{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y},o)&&s.push(e)})),s},j=()=>{if(c.length||!n)return;Object.keys(o).forEach((e=>{const t=o[e].bind(u);n.addEventListener(e,t),c.push({key:e,listener:t})}));const e={},t=t=>{t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=P(e)},r=t=>{const n=e.comps||P(t);if(!n.every((e=>e.instance.def.disableTriggers))&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=L(e),r=n?e.changedTouches[0]:e,i=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(r.clientX-t.x),s=isNaN(t.y)?0:Math.abs(r.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&s<=12&&i<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),x){x=!1;break}}},i=[];var s;i.push({key:"mousedown",listener:t}),i.push({key:"mouseup",listener:r}),("ontouchstart"in(s=n)&&"ontouchend"in s||navigator.maxTouchPoints>1)&&(i.push({key:"touchstart",listener:t}),i.push({key:"touchend",listener:r})),i.push({key:"mousemove",listener:e=>{const t=P(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),x){x=!1;break}}}}),i.forEach((e=>{n.addEventListener(e.key,e.listener),c.push(e)}))},z=()=>{c.forEach((e=>{let{key:t,listener:r}=e;return n.removeEventListener(t,r)})),c.length=0},F=()=>{n.innerHTML="",(()=>{const{components:e=[]}=i;E(),R(r,i),w.set({components:e});const{visible:t,hidden:o,ordered:s}=M();d=t,o.forEach((e=>{e.instance.hide(),e.visible=!1})),t.forEach((e=>e.instance.beforeMount())),t.forEach((e=>e.instance.mount())),t.forEach((e=>e.instance.beforeRender())),t.forEach((e=>e.instance.render())),t.forEach((e=>e.instance.mounted())),t.forEach((e=>{e.visible=!0})),Pa(n,s)})(),j(),O(i.interactions)};return u.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{excludeFromUpdate:t=[]}=e;e.data&&(r=e.data),e.settings&&(i=e.settings,O(e.settings.interactions)),D(),R(r,i);const{formatters:n,scales:o,components:s=[]}=i;w.update({components:s,data:r,excludeFromUpdate:t,formatters:n,scales:o}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()})),M()},u.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{partialData:t,excludeFromUpdate:o=[]}=e;let s;e.data&&(r=e.data),e.settings&&(i=e.settings,O(e.settings.interactions)),D(),R(r,i,{partialData:t});const{formatters:a,scales:l,components:c=[]}=i;w.update({components:c,data:r,excludeFromUpdate:o,formatters:a,scales:l}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()}));const u=[],h=[];let f;if(t)w.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible&&u.push(e)})),f=u;else{const{visible:e,hidden:t,ordered:n}=M();d=e,f=e,s=n,e.forEach((e=>{e.updateWith&&e.visible?u.push(e):h.push(e)})),t.forEach((e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}h.forEach((e=>e.instance.beforeMount())),h.forEach((e=>e.instance.mount())),f.forEach((e=>e.instance.beforeRender())),f.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),t||Pa(n,s),h.forEach((e=>e.instance.mounted())),u.forEach((e=>e.instance.updated())),d.forEach((e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1})),C()},u.destroy=()=>{A(),w.destroy(),z(),O(),delete u.update,delete u.destroy,T()},u.getAffectedShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=[];return d.filter((e=>null==r||e.key===r)).forEach((r=>{const o=r.instance.getBrushedShapes(e,t,n);i=[...i,...o]})),i},u.findShapes=e=>{let t=[];return d.forEach((n=>{const r=n.instance.findShapes(e);t=[...t,...r]})),t},u.componentsFromPoint=e=>P(e).map((e=>e.instance.ctx)),u.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[];const i=n.getBoundingClientRect();let o=d;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map((e=>e.key));o=d.filter((t=>-1!==e.indexOf(t.key))).map((n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]})))}for(let n=o.length-1;n>=0;n--){const s=o[n],a=Ia(e,i,s.instance.renderer().element().getBoundingClientRect()),l=s.instance.shapesAt(a,s.opts),c=l.length>0&&"stop"===t.propagation;if(r=[...r,...l],r.length>0&&c)return r}return r},u.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const r=t.components[n].key;d.filter((e=>r===e.key)).forEach((r=>{let i=e.filter((e=>e.key===r.key));r.instance.brushFromShapes(i,t.components[n])}))}},u.scroll=function(){return function(e,t){return t[e]||(t[e]=Co()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",g)},u.dataset=e=>y(e),u.dataCollection=e=>b(e),u.scales=function(){return f.all()},u.formatters=function(){return p.all()},u.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return v[e]||(v[e]=Wo()),v[e]},u.scale=function(e){return f.get(e)},u.formatter=function(e){return p.get(e)},u.toggleBrushing=function(e){x=void 0!==e?e:!x},u.component=e=>{const t=w.findComponentByKey(e);return null==t?void 0:t.instance.ctx},u.logger=()=>a,u.theme=()=>l,u.storage=Is({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(u,"interactions",{get:()=>({instances:m,on(){j(),m.forEach((e=>e.on()))},off(){z(),m.forEach((e=>e.off()))}})}),_(),n&&(S(),F(),q(n),u.element=n),u}const ja=e=>{let t=Xe(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var za=Xe();function Fa(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}const Ha=e=>e.filter((e=>"number"==typeof e&&!isNaN(e)));const Ba=e=>{let{key:t,data:n,cache:r,config:i}=e;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let{data:t,config:n}=e;const r=t.split("\n"),i=r[0],o=r[1];let s=",";if(n&&n.parse&&n.parse.delimiter)s=n.parse.delimiter;else if(i){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(i&&o){if(n.test(i)&&n.test(o)&&i.split(n).length===o.split(n).length){s=n;break}}else n.test(i)&&(s=n)}}return r.map((e=>e.split(s)))})({data:n,config:i})),Array.isArray(o)&&function(e){let t,{source:n,data:r,cache:i,config:o}=e,s=r;const a=o&&o.parse;Array.isArray(r[0])?a&&!1===a.headers?t=r[0].map(((e,t)=>t)):(t=r[0],s=r.slice(1)):t=Object.keys(r[0]);const l=!!a&&"function"==typeof a.row&&a.row;let c,u=t;u=a&&"function"==typeof a.fields?a.fields(u.slice()):t.map((e=>({key:e,title:e}))),Array.isArray(r[0])?c=u.map((()=>[])):(c={},u.forEach((e=>{c[e.key]=[]})));for(let e=0;e<s.length;e++){const t=l?l(s[e],e,u):s[e];if(t)if(Array.isArray(t))for(let e=0;e<u.length;e++)c[e].push(t[e]);else for(let e=0;e<u.length;e++)c[u[e].key].push(t[u[e].key])}const h=Array.isArray(c)?e=>c[e]:e=>c[u[e].key];for(let e=0;e<u.length;e++){const t=h(e),r=Ha(t),o=r.length>0,s=o?"measure":"dimension",a=o?Math.min(...r):NaN,l=o?Math.max(...r):NaN;i.fields.push(kr(N({source:n,key:e,title:u[e].title,values:t,min:a,max:l,type:s},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:r,source:t,config:i})};function Va(){let{key:e,data:t,config:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[]},i={key:()=>e,raw:()=>t,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}(e,{cache:r,matrix:t}),fields:()=>r.fields.slice(),extract:e=>function(e,t){const n=Array.isArray(e)?e:[e];let r=[];return n.forEach((e=>{if(void 0!==e.field){const n=t.field(e.field),i=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const{props:o,main:s}=Dr(e,t),a=Object.keys(o),l=!!e.trackBy,c=typeof e.trackBy,u={},h=[],d=n.items(),f=[];for(let t=0;t<d.length;t++){const n=d[t];if(s.filter&&!s.filter(n))continue;const r=Fa(s,n,{key:i});a.forEach((e=>{const s=o[e];let a=s.field?s.field.items()[t]:n;r[e]=Fa(s,a,{key:i})})),l&&Ar({cfg:e,itemData:n,obj:r,target:h,tracker:u,trackType:c}),f.push(r)}r=l?[...r,...Er(h,{main:s,propsArr:a,props:o})]:[...r,...f]}})),r}(e,i),hierarchy:()=>null};return Ba({key:e,data:t,config:n,cache:r}),i}Va.util={normalizeConfig:Dr,collect:Er,track:Ar};const $a=Xe();$a.default("matrix"),$a("matrix",Va),$a("default",Va);const Wa=Xe();function Ua(e,t,n){return Math.max(e,Math.min(t,n))}function Ya(e){let{item:t,value:n,boxCenter:r,rendWidth:i,rendHeight:o,flipXY:s,symbol:a}=e,l="x",c="y",u=i,h=o,d=n<.5?90:-90;return s&&(l="y",c="x",u=o,h=i,d=n<.5?180:0),a(N({},t.oob,{[l]:r*u,[c]:Math.max(t.oob.size/2,Math.min(n*h,h-t.oob.size/2)),startAngle:d}))}function Ka(e){let{item:t,boxWidth:n,boxPadding:r,rendWidth:i,rendHeight:o,flipXY:s}=e,a="x",l="y",c="width",u="height",h=i,d=o;s&&(a="y",l="x",c="height",u="width",h=o,d=i);const{actualDiff:f,actualLow:p}=function(e){let{start:t,end:n,minPx:r=.1,maxPx:i=1}=e;const o=Math.max(t,n),s=Math.min(t,n),a=Ua(-.1,1.2,o),l=Ua(-.1,1.2,s),c=a*i-l*i,u=Math.max(r,c),h=(u-c)/2;return{actualDiff:u,startModifier:h,actualLow:l*i-h}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:d});return N({},t.box,{type:"rect",[a]:(r+t.major)*h,[l]:p,[u]:f,[c]:n*h,data:t.data||{},collider:{type:null}})}function Xa(e){let{item:t,from:n,to:r,boxCenter:i,rendWidth:o,rendHeight:s,flipXY:a}=e,l="x1",c="y1",u="x2",h="y2",d=o,f=s;return a&&(l="y1",c="x1",u="y2",h="x2",d=s,f=o),N({},t.line,{type:"line",[h]:Math.floor(n*f),[l]:i*d,[c]:Math.floor(r*f),[u]:i*d,data:t.data||{},collider:{type:null}})}function Ga(e){let{item:t,key:n,position:r,width:i,boxCenter:o,rendWidth:s,rendHeight:a,flipXY:l}=e,c="x1",u="y1",h="x2",d="y2",f=s,p=a;l&&(c="y1",u="x1",h="y2",d="x2",f=a,p=s);const g=i/2;return N({type:"line"},t[n],{[u]:Math.floor(r*p),[c]:(o-g)*f,[d]:Math.floor(r*p),[h]:(o+g)*f,r:g*f,cx:o*f,cy:r*p,width:i*f,data:t.data||{},collider:{type:null}})}function Ja(e,t,n){const{width:r,maxWidthPx:i,minWidthPx:o}=t.box,s=e>=0?1:-1;let a=Math.min(s*e*r,isNaN(i)?n:i/n);return a=isNaN(o)?a:Math.max(o/n,a),a*s}Wa("native",(function(e,t,n){let r,i,o={chart:e,mediator:t,element:n},s=[],a=!0;function l(){"function"==typeof r.enable&&(r.enable=r.enable.bind(o)()),r.enable&&Object.keys(r.events).forEach((e=>{const t=r.events[e].bind(o);n.addEventListener(e,t),s.push({key:e,listener:t})}))}function c(){s.forEach((e=>{let{key:t,listener:r}=e;n.removeEventListener(t,r)})),s=[]}return{get key(){return i},set(e){!function(e){i=e.key,r=e,r.events=r.events||[],void 0===r.enable&&(r.enable=!0)}(e),c(),a&&l()},off(){a=!1,c()},on(){a=!0,0===s.length&&l()},destroy(){c(),o=null,r=null}}}));const Za={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},Qa=Object.keys(Za),el={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let{data:t}=e;const{width:n,height:r}=this.rect,i="horizontal"===this.settings.settings.orientation,{style:o,resolver:s,symbol:a}=this,l=Qa.filter((e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show)),c={};l.forEach((e=>c[e]=Za[e]));const u=function(e){let{keys:t,data:n,defaultSettings:r,style:i,settings:o,width:s,height:a,resolver:l}=e;const c=N(!0,{},r||{},i||{}),u={major:"horizontal"===o.orientation?a:s,minor:"horizontal"===o.orientation?s:a},h=o.major;let d;d="object"==typeof h&&"object"==typeof h.ref&&void 0!==h.ref.start&&void 0!==h.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:N(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof h&&void 0!==h.binStart&&void 0!==h.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:N(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const f=o.minor||{},p={};["start","end","min","max","med"].forEach((e=>{(f[e]||n.items&&n.items.length&&n.items[0][e])&&(p[e]={scale:f.scale,ref:e})}));let g,m={major:d,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:N(!0,{},p,f)})};for(let e=0,r=t.length;e<r;e++)o[g]&&!1===o[g].show||(g=t[e],m[g]=l.resolve({data:n,defaults:c[g],settings:o[g],scaled:u}));return m}({keys:l,data:t,defaultSettings:c,style:o,settings:this.settings.settings,width:n,height:r,resolver:s}),{settings:h,items:d}=u,f=function(e){let{width:t,height:n,flipXY:r,resolved:i,keys:o,symbol:s}=e;const a=[],l=i.major.items;if(!l.length)return a;const c=t,u=n,h=r?n:t,d=i.major.settings,f=["start","end","min","max","med"].filter((e=>void 0!==i.minor.settings[e])),p=f.length,g=o.filter((e=>"oob"!==e));let m,y,b,v,x,w,k,M,_;const S=o?o.length:0,q=g?g.length:0,D={box:function(){b.box&&j(b.start)&&j(b.end)&&m.push(Ka({item:b,boxWidth:v,boxPadding:x,rendWidth:c,rendHeight:u,flipXY:r}))},line:function(){j(b.min)&&j(b.start)&&m.push(Xa({item:b,from:b.min,to:b.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),j(b.max)&&j(b.end)&&m.push(Xa({item:b,from:b.max,to:b.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},median:function(){b.median&&j(b.med)&&m.push(Ga({item:b,key:"median",position:b.med,width:v,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},whisker:function(){if(b.whisker){const e=v*b.whisker.width;j(b.min)&&m.push(Ga({item:b,key:"whisker",position:b.min,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),j(b.max)&&m.push(Ga({item:b,key:"whisker",position:b.max,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))}}};function C(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let r=0;r<p;r++)e=b[f[r]],j(e)&&(t<e&&(t=e),n>e&&(n=e));k=t<0&&t!==-Number.MAX_VALUE,M=n>1&&n!==Number.MAX_VALUE,_=k||M}for(let e=0,t=l.length;e<t;e++){m=[],y=null;const t=l[e],n=t.data;let f=null,p=null;void 0!==d.binStart?(f=t.binStart,p=t.binEnd,y=d.binStart.scale):(y=d.major.scale,f=y?t.major:0);let E=0;y?y.bandwidth?(E=y.bandwidth(),f-=E/2):E=p-f:E=1,b=N({},{major:f,majorEnd:p},i.minor.items[e]);for(let t=0;t<S;t++)b[o[t]]=i[o[t]].items[e];if(v=Ja(E,b,h),x=(E-v)/2,w=x+b.major+v/2,C(),_)b.oob&&(k?m.push(Ya({item:b,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:s})):M&&m.push(Ya({item:b,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:s})));else for(let e=0;e<q;e++)b[g[e]]&&!1===b[g[e]].show||D[g[e]]();const A={type:"container",data:n,collider:{type:"bounds"},children:m};a.push(A)}return a}({items:d,settings:h,width:n,height:r,flipXY:i,resolved:u,keys:l,symbol:a});return f}};const tl={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},nl=/px$/,rl={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},il={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function ol(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function sl(e,t,n,r){let{width:i,height:o}=t;return e.filter((e=>!1!==e.show&&!isNaN(e.x+e.y))).map((e=>{let t=e,s=nl.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);z(s)&&(t=tl,s=n.min+t.size*(n.max-n.min));const[a,l]=function(e){let t=rl.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),c=I(I({},l),{},{type:a,label:e.label,x:e.x*i,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,s)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity});t===e.errorShape&&(c.width=t.width);const u=r(c);return u.data=e.data,u}))}const al={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let{data:t}=e;const n=this.resolver.resolve({data:t,defaults:N({},rl,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),{width:r,height:i}=this.rect,o=N({},il,this.settings.settings.sizeLimits),s=n.items,a=function(e,t,n,r,i){const o=ol(e?e.scale:void 0,n),s=ol(t?t.scale:void 0,r);let a=Math.min(o.value*i[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],s.value*i[s.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*i[o.isBandwidth?"minRelDiscrete":"minRelExtent"],s.value*i[s.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(a)),maxGlobal:i.maxPx,minGlobal:i.minPx}}(n.settings.x,n.settings.y,r,i,o);return sl(s,this.rect,a,this.settings.shapeFn||this.symbol)}};Math.PI;const ll={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function cl(e,t,n,r){let{x:i,y:o,width:s,height:a}=t;const l=be(),c={x:i+s/2,y:o+a/2},u=Math.min(s,a)/2,h=Math.min(s,a)/2,d=h/100;return e.map(((e,t)=>{const i=n[t];i.type="path";const o=h*i.outerRadius,s=u*i.innerRadius,a=d*i.cornerRadius;l.innerRadius(s),l.outerRadius(o),l.cornerRadius(a),i.arcDatum=e;const f=l.centroid(e),p=i.offset?function(e,t,n,r){let[i,o]=e;const s=Math.sqrt(i*i+o*o);i/=s,o/=s;const a=n-r;return{x:i*t*a,y:o*t*a}}(f,i.offset,o,s):{x:0,y:0};return i.transform="translate(".concat(p.x,", ").concat(p.y,") translate(").concat(c.x,", ").concat(c.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:s,outerRadius:o,cornerRadius:a,offset:{x:c.x+p.x,y:c.y+p.y}}},i}))}function ul(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const hl={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let{data:t}=e;const n=[],r=[],i=this.settings.settings,{items:o}=this.resolver.resolve({data:t,defaults:N({},ll,this.style.slice),settings:i.slice});let s=0;for(let e=0,t=o.length;e<t;e++){const t=ul(i,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),r.push(o[e]),s+=t)}const a=function(){var e=Se,t=_e,n=null,r=Q(0),i=Q(ue),o=Q(0);function s(s){var a,l,c,u,h,d=s.length,f=0,p=new Array(d),g=new Array(d),m=+r.apply(this,arguments),y=Math.min(ue,Math.max(-ue,i.apply(this,arguments)-m)),b=Math.min(Math.abs(y)/d,o.apply(this,arguments)),v=b*(y<0?-1:1);for(a=0;a<d;++a)(h=g[p[a]=a]=+e(s[a],a,s))>0&&(f+=h);for(null!=t?p.sort((function(e,n){return t(g[e],g[n])})):null!=n&&p.sort((function(e,t){return n(s[e],s[t])})),a=0,c=f?(y-d*v)/f:0;a<d;++a,m=u)l=p[a],u=m+((h=g[l])>0?h*c:0)+v,g[l]={data:s[l],index:a,value:h,startAngle:m,endAngle:u,padAngle:b};return g}return s.value=function(t){return arguments.length?(e="function"==typeof t?t:Q(+t),s):e},s.sortValues=function(e){return arguments.length?(t=e,n=null,s):t},s.sort=function(e){return arguments.length?(n=e,t=null,s):n},s.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:Q(+e),s):r},s.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:Q(+e),s):i},s.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:Q(+e),s):o},s}().sortValues(null);a.startAngle(i.startAngle),a.endAngle(i.endAngle),a.padAngle(i.padAngle);return cl(a(n),N({},this.rect,{x:0,y:0}),r,s)}};const dl=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],r=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((e=>{const n=Math.round(t[e.key]),i=t[e.key]-n;t[e.key]=n,r&&"append"===e.type&&(i>0?t[e.key]+=.5:t[e.key]-=.5)}))}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach((t=>{const n=e[t];n.items=[],n.append.forEach((e=>{n.items.push({key:e,type:"append"})})),n.round.forEach((e=>{n.items.push({key:e,type:"round"})}))})),t.multiple=e=>e.forEach((e=>t(e))),t}();class fl{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const r=e.substring(0,1);if("x"===r||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===r||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,r=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let r=n?this.height:this.width,i=n?this.width:this.height;e=e.fn({width:r,height:i,flipXY:n});const o=Object.keys(e);for(let r=0,i=o.length;r<i;r++){let i=o[r];t[fl.evaluateKey(i,n)]=e[i]}}else{const r=Object.keys(e);for(let i=0,o=r.length;i<o;i++){let o=r[i];const s=fl.evaluateKey(o,n),a=this.transposeCoordinate(s,e[o],n);t[s]=a}}return r&&dl(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function pl(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new fl(...t)}function gl(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const ml={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=pl(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,rs(this,"x",this.rect.width),rs(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=N({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=N({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=gl(this.x,this.rect.width),this.lines.y=gl(this.y,this.rect.height),this.lines.y=this.lines.y.map((e=>N(e,{flipXY:!0})));let e=e=>{let{dir:t,isMinor:n}=e,r=this.lines[t].filter((e=>!!e.isMinor===n)),i=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:i,data:{items:r,dir:t}}).items.forEach((e=>{let n=e.data;var r,i;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(r=n.value)&&void 0!==r?r:null===(i=n.data)||void 0===i?void 0:i.value,dir:t})}))};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function yl(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===r||"right"===r){let i="right"===r;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}let i="bottom"===r;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function bl(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===r||"right"===r){let i="right"===r;return"\n M ".concat(e+=i?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}let i="bottom"===r;return t+=i?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function vl(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function xl(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function wl(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function kl(e,t){const n=e.min();if(n===e.max()){const r=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return r?2:-1;if(t>n)return r?-1:2}return e(t)}const Ml={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:()=>30,beforeRender(){this.blueprint=pl(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){let e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(wl).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=kl(t,e.value);return N(e,{scale:t,position:n})}return N(e,{position:e.value})})),this.lines.y=this.lines.y.filter(wl).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=kl(t,e.value);return N(e,{scale:t,position:n,flipXY:!0})}return N(e,{position:e.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(xl(e)),!1))),this.lines.y=this.lines.y.filter((e=>!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(xl(e)),!1)));let n=[];return[...this.lines.x,...this.lines.y].forEach((t=>{(!0===t.show||void 0===t.show)&&function(e){let{chart:t,blueprint:n,renderer:r,p:i,settings:o,items:s}=e,a=!0,l=!1,c=!1,u=!1,h=!1,d=N(!0,{},o.style.line,i.line||{});if(l=n.processItem({type:"line",x1:i.position,y1:0,x2:i.position,y2:1,stroke:d.stroke||"black",strokeWidth:d.strokeWidth||1,strokeDasharray:d.strokeDasharray,flipXY:i.flipXY||!1,value:i.valueInfo?i.valueInfo.id:i.value}),i.label){const e=N(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},o.style.label||{},{fill:d.stroke},i.label);let l,f={width:0,height:0},p="";if("string"==typeof i.formatter)l=t.formatter(i.formatter);else if("object"==typeof i.formatter)l=t.formatter(i.formatter);else if(void 0!==i.scale&&i.scale.data){const e=i.scale.data()&&i.scale.data().fields;l=e&&e[0]?e[0].formatter():null}!1!==i.label.showValue&&(l?p=" (".concat(l(i.value),")"):i.scale&&(p=" (".concat(i.value,")"))),p&&(f=r.measureText({text:p,fontFamily:e.fontFamily,fontSize:e.fontSize}));let g=r.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),m={width:g.width+f.width,height:Math.max(g.height,f.height)},y=e.padding,b=vl(i.flipXY?e.vAlign:e.align),v=vl(i.flipXY?e.align:e.vAlign),x=Math.min(1+m.width+2*y,e.maxWidth*n.width,e.maxWidthPx),w=m.height+2*y,k=i.flipXY?w:x,M=i.flipXY?x:w;if(c=n.processItem({fn:t=>{let{width:r,height:o}=t,s=i.position*r-(i.flipXY?w:x)*(1-b);return s=i.flipXY?s:Math.max(s,0),{type:"rect",x:s,y:Math.max(Math.abs(v*o-M*v),0),width:i.flipXY?k:Math.min(k,n.width-s),height:M,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:i.flipXY||!1}),c.x<-1||c.x+c.width>n.width+1||c.y<-1||c.y+c.height>n.height+1)c=void 0;else{u={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:c.x+y,y:c.y+c.height/2+m.height/3,maxWidth:c.width-2*y-f.width,anchor:"start"},p&&(h={type:"text",text:p||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:u.x+3+(c.width-(f.width+2*y)),y:u.y});for(let e=0,t=s.length;e<t;e++){let t=s[e];"rect"===t.type?Zs(c,t)&&(a=!1):"line"===t.type&&i.flipXY===t.flipXY&&ta(c,t)&&(a=!1)}}}s.push(l),a&&c&&u&&(s.push(c,u),h&&s.push(h))}({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:t,settings:e,items:n})})),e.style.oob.show&&function(e){let{blueprint:t,oob:n,settings:r,items:i}=e;const o=Object.keys(n);let s=r.style.oob||{};for(let e=0,r=o.length;e<r;e++){const r=o[e],a=n[r];if(a.length>0){let e=r.charAt(1),n="y"===r.charAt(0),o=s.padding.x+s.width,l=s.padding.y+s.width,c="bottom";c=n?"1"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let{width:r,height:i}=t,u=e*r+("1"===e?-o:o),h=n?l:i-l;return"arc"===s.type?{type:"path",d:yl(n?h:u,n?u:h,s.width,c),x:u,y:h,stroke:s.stroke,fill:s.fill,strokeWidth:s.strokeWidth||0}:{type:"circle",cx:u,cy:h,r:s.width,stroke:s.stroke,fill:s.fill,strokeWidth:s.strokeWidth||0,opacity:s.opacity,data:a}},flipXY:n}),h=u.cx||u.x,d=u.cy||u.y,f={type:"text",text:a.length||"",x:h-.4*s.width,y:d+.4*s.width,fontFamily:s.text.fontFamily,fontSize:"".concat(1.3*s.width,"px"),stroke:s.text.stroke,fill:s.text.fill,strokeWidth:s.text.strokeWidth||0,opacity:s.text.opacity},p={type:"path",d:bl(h,d,s.width,c),x:h,y:d,stroke:s.triangle.stroke,fill:s.triangle.fill,strokeWidth:s.triangle.strokeWidth||0,opacity:s.triangle.opacity};i.push(u,f,p)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function _l(e){const t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){N(e,t.style)}(t,e),t}function Sl(e){return"string"==typeof e||"number"==typeof e?e:"-"}function ql(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){const r=n.angle*(Math.PI/180),i=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,s="end"===t.anchor&&r<0,a="start"===t.anchor&&r>=0,l=t.boundingRect.y+(a||s?t.boundingRect.height:0),c=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map((e=>Ss(e,r,{x:t.x,y:t.y}))),u={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},h={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},d=r>=0?[u,h]:[h,u];c.push(...d),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const r=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:r,y:0,width:r<0?n.stepSize+r:n.stepSize,height:n.innerRect.height}}else{const r=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:r,width:n.innerRect.width,height:r<0?n.stepSize+r:n.stepSize}}const r=t.collider;r.x=Math.max(r.x,0),r.y=Math.max(r.y,0);const i=r.x+r.width-(n.outerRect.x+n.outerRect.width);r.width=i>0?r.width-i:r.width;const o=r.y+r.height-(n.outerRect.y+n.outerRect.height);r.height=o>0?r.height-o:r.height}(e,t,n)}function Dl(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let r=0;if(e.tilted)r=e.stepSize*n;else{const i=t?e.textRect.height:e.textRect.width;r=Math.max(0,e.stepSize-i)*n}return r}function Cl(e,t){var n,r;const i={type:"text",text:Sl(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(r=e.data)||void 0===r?void 0:r.value};return"top"===t.align||"bottom"===t.align?(i.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+Dl(t,!1),i.y="top"===t.align?t.innerRect.height:0,i.anchor=t.stepSize?"start":"middle",i.x+=isNaN(t.style.offset)?0:+t.style.offset):(i.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+Dl(t,!0),i.x="left"===t.align?t.innerRect.width:0,i.anchor="left"===t.align?"end":"start",i.baseline=t.stepSize?"text-before-edge":"central",i.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(i,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,r=t.outerRect.width,i=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-i,s=e.x+i;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):s>r&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,r=t.outerRect.height,i=t.maxHeight/2,o=e.y-i,s=e.y+i;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):s>r&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(i,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(i,t),function(e,t){if(t.tilted){const n=-t.angle,r=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(r)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(r)/2):e.x-=t.maxHeight*Math.sin(r)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const i=Math.cos(r)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+i>n&&(e.maxWidth=(n-e.x-10)/Math.cos(r))}else{const n=t.paddingEnd;e.x-i<n&&(e.maxWidth=(e.x-n-10)/Math.cos(r))}}}(i,t),function(e,t){e.boundingRect=t.textBounds(e)}(i,t),ql(e,i,t),i}function El(e,t){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){N(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){const n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function Al(e){return!e.isMinor&&e.position>=0&&e.position<=1}function Tl(e){let{rect:t,state:n,majorTicks:r,measure:i,horizontal:o}=e;return o?function(e){let{majorTicks:t,measureText:n,rect:r,state:i}=e;const o="layered"===i.labels.activeMode?2:1,s=r.width,a=t.map((e=>e.label)).map((e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":""))).map(n).map((e=>e.width));for(let e=0;e<t.length;++e){const n=t[e];if(o*s*Math.abs(n.start-n.end)<a[e])return!0}return!1}({majorTicks:r,measureText:i,rect:t,state:n}):function(e){let{majorTicks:t,measureText:n,rect:r}=e;const i=r.height,o=n("M").height;return!(t.length<2)&&i*Math.abs(t[0].position-t[1].position)<o}({majorTicks:r,measureText:i,rect:t,state:n})}function Nl(e){let{value:t,maxValue:n,minValue:r,range:i,modifier:o}=e;return isNaN(i)||isNaN(o)||(t=i*o),t>n&&(t=n),t<r&&(t=r),t}function Rl(e){let{isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:s,state:a}=e,l=0;const c={left:0,top:0,right:0,bottom:0},{maxLengthPx:u,minLengthPx:h}=s.labels;if(s.labels.show){const e=s.align,d="top"===e||"bottom"===e,f=d?n.inner.width:n.inner.height,p=o.ticks({settings:s,distance:f,formatter:r}).filter(Al),g=e=>{const t=i({text:e,fontSize:s.labels.fontSize,fontFamily:s.labels.fontFamily});return t.width=Nl({value:t.width,maxValue:u,minValue:h}),t};if(t&&d&&"auto"===s.labels.mode&&(!function(e){let{majorTicks:t,measure:n,rect:r,state:i,settings:o}=e;const s=o.labels.maxGlyphCount,a="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=r.width;let h=0,d=0;if(isNaN(s))for(let e=0;e<t.length;e++){const r=t[e],i=r.label,o=n(i).width*(i.length>1?l:1);if(d=a*u*Math.abs(r.start-r.end),o+c>d)return!0}else if(d=a*u*t.reduce(((e,t)=>Math.min(Math.abs(t.start-t.end),e)),1/0),h=n("M").width*l*s,h+c>d)return!0;return!1}({majorTicks:p,measure:g,rect:n.inner,state:a,settings:s})?a.labels.activeMode="horizontal":a.labels.activeMode="tilted"),!s.labels.filterOverlapping&&"tilted"!==a.labels.activeMode&&Tl({rect:n.inner,state:a,majorTicks:p,measure:g,horizontal:d})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let m,y;if("tilted"===a.labels.activeMode){const e=Math.abs(s.labels.tiltAngle)*(Math.PI/180);m=t=>Nl({value:t.width,maxValue:u,minValue:h})*Math.sin(e)+t.height*Math.cos(e)}else m=d?e=>e.height:e=>Nl({value:e.width,maxValue:u,minValue:h});if(d&&"tilted"!==a.labels.activeMode)y=["M"];else if(isNaN(s.labels.maxGlyphCount))y=p.map((e=>e.label));else{let e="";for(let t=0;t<s.labels.maxGlyphCount;t++)e+="M";y=[e]}const b=y.map(g),v=b.map(m),x=Math.max(...v,0);if(l+=x,l+=s.labels.margin,"layered"===a.labels.activeMode&&(l*=2),"tilted"===a.labels.activeMode){const e="bottom"===s.align==s.labels.tiltAngle>=0,t=Math.abs(s.labels.tiltAngle)*(Math.PI/180),r=(x-g("M").height*Math.cos(t))/Math.sin(t),i=e=>Math.min(r,e.width)*Math.cos(t)+e.height,o=(t,r)=>{const i=p[r]?p[r].position:0;return e?t-i*n.inner.width:t-(1-i)*n.inner.width},a=Math.min(s.labels.maxEdgeBleed,Math.max(...b.map(i).map(o),0))+s.paddingEnd;if(c[e?"left":"right"]=a,!s.labels.filterOverlapping&&function(e){let{majorTicks:t,measureText:n,rect:r,bleedSize:i,angle:o}=e;if(t.length<2)return!1;if(0===o)return!0;const s=Math.abs(o),a=1/(Math.min(r.outer.width-i,r.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(s*(Math.PI/180))/a}({majorTicks:p,measureText:g,rect:n,bleedSize:a,angle:s.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const Ol=(e,t,n)=>e.width*Math.abs(t.position-n.position);function Il(e){let{layered:t,major:n,innerRect:r,outerRect:i,tick:o,index:s}=e;const a=t?2:1,l=n[s-a],c=n[s+a],u=l?Ol(r,o,l)/2-2:1/0,h=c?Ol(r,o,c)/2-2:1/0;return n.length<2?r.width:l?c?2*Math.min(u,h):(e=>{let{innerRect:t,outerRect:n,tick:r,prevWidth:i}=e;const o=t.x-n.x,s=n.width-t.width-o,a=t.width-t.width*r.position+s,l=2*Math.min(i,a),c=1===r.position?t.width/2-2:0;return Math.max(i,l,c)})({innerRect:r,outerRect:i,tick:o,prevWidth:u}):(e=>{let{innerRect:t,outerRect:n,tick:r,nextWidth:i}=e;const o=t.x-n.x,s=t.width*r.position+o,a=2*Math.min(i,s),l=0===r.position?t.width/2-2:0;return Math.max(i,a,l)})({innerRect:r,outerRect:i,tick:o,nextWidth:h})}function Pl(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function Ll(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=Pl(e)+e.labels.margin,t}function jl(e,t){return e.map((e=>El(e,t)))}function zl(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function Fl(e){let{textMetrics:t,settings:n,innerRect:r,scale:i,tilted:o,layered:s,tick:a}=e;const l=t.height,c=zl(i,a),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=r.width-Ll(n)-n.paddingEnd;else if(s)u.width=c*r.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(r.height-Ll(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*r.width;return u.width=Nl({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function Hl(e){let{textMetrics:t,settings:n,innerRect:r,outerRect:i,tilted:o,layered:s,tick:a,index:l,major:c}=e;const u=t.height,h={width:0,height:u};if("left"===n.align||"right"===n.align)h.width=r.width-Ll(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);h.width=(r.height-Ll(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else h.width=Il({layered:s,major:c,innerRect:r,outerRect:i,tick:a,index:l});return h.width=Nl({value:h.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),h}function Bl(e){let t;function n(){return t=Hl,n}function r(){return t=Fl,r}function i(e){let{settings:n,scale:r,innerRect:i,outerRect:o,measureText:s,ticks:a,state:l,textBounds:c}=e;const u=[],h=function(e){return e.filter((e=>!e.isMinor))}(a),d=function(e){return e.filter((e=>e.isMinor))}(a),f={innerRect:i,align:n.align,outerRect:o},p="tilted"===l.labels.activeMode,g="layered"===l.labels.activeMode;let m;if(n.line.show&&(f.style=n.line,f.padding=n.paddingStart,u.push(_l(f))),n.ticks.show&&(f.style=n.ticks,f.tickSize=n.ticks.tickSize,f.padding=Pl(n),m=jl(h,f)),n.labels.show){const e=Ll(n);f.style=n.labels,f.padding=e,f.tilted=p,f.layered=g,f.angle=n.labels.tiltAngle,f.paddingEnd=n.paddingEnd,f.textBounds=c;const l=(e,l)=>{f.textRect=function(e){let{style:t,measureText:n,tick:r}=e;return n({text:r.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:s,style:f.style});const c=t({textMetrics:f.textRect,settings:n,innerRect:i,outerRect:o,scale:r,tilted:p,layered:g,tick:e,major:h,index:l});f.maxWidth=c.width,f.maxHeight=c.height,f.stepSize=function(e){let{innerRect:t,scale:n,settings:r,tick:i}=e;return("top"===r.align||"bottom"===r.align?t.width:t.height)*zl(n,i)}({innerRect:i,scale:r,ticks:a,settings:n,tick:e})};let d=[];d=!g||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map(((e,r)=>{n(e,r);const i=Cl(e,t);return i.data=e.data,i}))}(h,f,l):function(e,t,n,r){const i=t.padding,o=Ll(n);return e.map(((e,s)=>{r(e,s);const a=o+t.maxHeight+n.labels.margin;t.layer=s%2,t.padding=s%2==0?i:a;const l=Cl(e,t);return l.data=e.data,l}))}(h,f,n,l),n.labels.filterOverlapping&&function(e,t,n){let r=(t,n)=>Zs(U(1,e[t].boundingRect),U(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);r=(n,r)=>{const i=1/Math.abs(e[n].x-e[r].x),o=Math.sin(t*(Math.PI/180))/i;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let i=n+1;i<=Math.min(n+5,n+(e.length-1));i++)e[n]&&e[i]&&r(n,i)&&(i===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(i,1),t&&t.splice(i,1)),i--,n--)}(d,m,f),u.push(...d)}return n.minorTicks&&n.minorTicks.show&&d.length>0&&(f.style=n.minorTicks,f.tickSize=n.minorTicks.tickSize,f.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...jl(d,f))),m&&u.push(...m),u}return n.build=i,r.build=i,e?r():n()}const Vl={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},$l={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const Wl={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){let{state:t,style:n,settings:r}=e;const i=N(!0,{},t.isDiscrete?Vl:$l,n),o=N(!0,{},i,r.settings),s=r.layout.dock||t.defaultDock;o.dock=s,o.align=function(e,t){const n=["top","bottom"],r=["left","right"];return-1!==n.indexOf(e)&&-1===r.indexOf(t)||-1!==r.indexOf(e)&&-1===n.indexOf(t)?e:t}(r.settings.align,s),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const{paddingStart:a,paddingEnd:l}=o;return o.paddingStart="function"==typeof a?a.call(null):a,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=Bl(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(e,t,n){const r=t.labels.mode;return n&&e.isHorizontal?"auto"===r?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?r:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const{formatter:t,state:n,scale:r}=this,i=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=is(r,i);const o=function(e){let{isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:s,state:a}=e,l=0;const{size:c,edgeBleed:u,isToLarge:h}=Rl({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:s,state:a});if(l+=c,h)return{size:l};if(s.ticks.show&&(l+=s.ticks.margin,l+=s.ticks.tickSize),s.minorTicks&&s.minorTicks.show){const e=s.minorTicks.margin+s.minorTicks.tickSize;e>l&&(l=e)}if(s.line.show){const e=s.line.strokeWidth/2;l+=e,u[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(s.align)]=Math.ceil(e)}return l+=s.paddingStart,l+=s.paddingEnd,{size:l,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{settings:t}=e;this.setState(t)},resize(e){const{inner:t,outer:n}=e,r=N({},t,function(e){let{align:t,inner:n}=e;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),i=n||r;return N(this.state.innerRect,r),N(this.state.outerRect,i),n},beforeRender(){const{scale:e,formatter:t}=this,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=is(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((e=>e.position>=0&&e.position<=1))},render(){const{state:e}=this,t=[];return t.push(...this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:e})),dl.multiple(t),t}};const Ul={render:()=>[]};function Yl(e,t,n){let r="";if("function"==typeof e)r=e();else if("string"==typeof e)r=e;else if(n){const e=(n.data().fields||[]).map((e=>e.title()));r=e.join(t)}return r}function Kl(e,t){let n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}const Xl={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created(){this.definitionSettings=this.settings.settings;const e=this.settings.text,t=this.definitionSettings.join;this.title=Yl(e,t,this.scale)},preferredSize(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render(){const{title:e,definitionSettings:t,rect:n}=this,r=[];return r.push(function(e){let{title:t,definitionSettings:n,dock:r,rect:i,measureText:o,style:s}=e;const a={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:Kl(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};N(a,s.text);const l=o(a);if("top"===r||"bottom"===r){let e=i.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=i.width-(n.paddingRight||0)),a.x=e,a.y="top"===r?i.height-n.paddingStart:n.paddingStart+l.height,a.dy="top"===r?-l.height/6:-l.height/3,a.maxWidth=.8*i.width}else{let e=i.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=i.height-n.paddingStart),a.y=e,a.x="left"===r?i.width-n.paddingStart:n.paddingStart,a.dx="left"===r?-l.height/3:l.height/3;const t="left"===r?270:90;a.transform="rotate(".concat(t,", ").concat(a.x+a.dx,", ").concat(a.y+a.dy,")"),a.maxWidth=.8*i.height}return isNaN(n.maxLengthPx)||(a.maxWidth=Math.min(a.maxWidth,n.maxLengthPx)),a}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),r},beforeUpdate(e){e.settings&&(N(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=Yl(t,n,this.scale)}};function Gl(e,t){const n=e.settings.layout.dock,r=e.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",s=e.rect[o],a=e.chart.scroll(e.settings.scroll);let l;{let e=t[i?"x":"y"];r&&(e=s-e);const n=a.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/s*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:e=>{let t=e[i?"x":"y"];if(r&&(t=s-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=a.getState(),o=(t-l.startOffset)/s*(n.max-n.min),c=l.startScroll+o;a.moveTo(c)},end:e=>{let t=e[i?"x":"y"];r&&(t=s-t);const n=a.getState();if(l.swipe){const e=(t-l.startOffset)/s*(n.max-n.min),r=l.startScroll+e;a.moveTo(r)}else{const e=t/s*(n.max-n.min)+n.min-n.viewSize/2;a.moveTo(e)}}}}function Jl(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const Zl={require:["chart","renderer"],on:{panStart(e){const t=Jl(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=Gl(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=Jl(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=Jl(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=Jl(e,this.renderer);Gl(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,r="top"===t||"bottom"===t,i=r?"width":"height",o=this.rect[i],s=this.chart.scroll(this.settings.scroll).getState();let a=o*(s.start-s.min)/(s.max-s.min);const l=o*s.viewSize/(s.max-s.min);return n&&(a=o-a-l),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:{position:"absolute",[r?"left":"top"]:"".concat(a,"px"),[r?"top":"left"]:"25%",[r?"height":"width"]:"50%",[i]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function Ql(e){let{h:t,isVertical:n,value:r,pos:i,align:o,borderHit:s,state:a,idx:l}=e;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let h=0,d="100%",f="100%";return a.targetRect&&"start"===a.settings.bubbles.align?(d="".concat(a.targetRect.x+a.targetRect.width,"px"),f="".concat(a.targetRect.y+a.targetRect.height,"px")):a.targetRect&&"end"===a.settings.bubbles.align&&(h=n?a.targetRect.x:a.targetRect.y,d="".concat(a.rect.width-h,"px"),f="".concat(a.rect.height-h,"px")),c||(i-=s),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(e){e.srcElement.children[0].style.backgroundColor=a.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":r,"data-key":[a.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?h:i,"px"),top:"".concat(n?i:h,"px"),height:n?"".concat(s,"px"):f,width:n?d:"".concat(s,"px"),pointerEvents:"auto"}},[t("div",{style:N({backgroundColor:a.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function ec(e){let{h:t,isVertical:n,label:r,otherValue:i,rangeIdx:o,idx:s,pos:a,align:l,state:c,value:u}=e;const h="end"!==l,d="outside"===c.settings.bubbles.placement;let f,p="none";n?(f=h?"left":"right",d&&(p=h?"translate(-100%, 0px)":"translate(100%, 0px)")):(f=h?"top":"bottom",d&&(p=h?"translate(0px, -100%)":"translate(0px, 100%)"));let g=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===s;const m={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const b=g?t("input",{type:"text",value:u,style:I(I({},m),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,t,i)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,s].join("-"),"data-other-value":i,"data-idx":o,"data-bidx":s,style:m},[r]);return t("div",{style:{position:"absolute",[f]:"0",[n?"top":"left"]:"".concat(a,"px"),transform:p}},[b])}function tc(e){let{h:t,isVertical:n,top:r,height:i,color:o,on:s,opacity:a}=e;return t("div",N({style:{backgroundColor:o,opacity:a,position:"absolute",left:n?0:"".concat(r,"px"),top:n?"".concat(r,"px"):0,height:n?"".concat(i,"px"):"100%",width:n?"100%":"".concat(i,"px"),pointerEvents:"auto"}},s),[])}function nc(e){let{borderHit:t,els:n,isVertical:r,state:i,vStart:o,vEnd:s,idx:a}=e,l=0;i.targetRect&&(l=r?i.targetRect.y:i.targetRect.x);const c=!!i.scale,u=c?i.scale.norm(o)*i.size:o,h=c?i.scale.norm(s)*i.size:s,d=Math.abs(u-h),f=Math.min(u,h)+l,p=f+d;if(i.targetRect){const e=i.targetFillRect||i.targetRect,t=r?e.height:e.width,a=c?i.scale.norm(o)*t:o,l=c?i.scale.norm(s)*t:s,u=Math.abs(a-l),h=Math.min(a,l),d={h:i.h,isVertical:r,top:h,height:u,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(d.on={onmouseover(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[tc(d)]))}const g=u<h?o:s,m=u<h?s:o,[y,b]=c?i.scale.domain():[Math.min(o,s),Math.max(o,s)],v=g+1e-5>=y&&g-1e-5<=b,x=m-1e-5<=b&&m+1e-5>=y;v&&n.push(Ql({h:i.h,isVertical:r,borderHit:t,value:g,pos:f,align:"start",state:i,idx:a})),x&&n.push(Ql({h:i.h,isVertical:r,borderHit:t,value:m,pos:p,align:"end",state:i,idx:a}));const w=i.settings.bubbles;if(w&&w.show){const e={fontSize:w.fontSize,fontFamily:w.fontFamily,color:w.fill},t=[o,s];v&&n.push(ec({h:i.h,isVertical:r,align:w.align,style:e,rangeIdx:a,idx:0,otherValue:m,value:g,label:"".concat(i.format(g,t)),pos:f,state:i})),x&&n.push(ec({h:i.h,isVertical:r,align:w.align,style:e,rangeIdx:a,idx:1,otherValue:g,value:m,label:"".concat(i.format(m,t)),pos:p,state:i}))}}function rc(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let r=e.current-e.start;return r=r<0?Math.max(r,n):Math.min(r,t),r}function ic(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach(((r,i)=>{e.active&&i===e.active.idx||nc({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(r.min,r.max),vEnd:Math.max(r.min,r.max),idx:i})})),e.active){let r=e.start,i=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)r=Math.min(e.active.start,e.active.end),i=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)r=Math.min(e.start,e.current),i=Math.max(e.start,e.current);else{const t=rc(e);r=e.active.start+t,i=e.active.end+t}nc({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function oc(e){return{min:e.scale.min(),max:e.scale.max()}}function sc(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function ac(e,t,n){let r,i,o=e.ranges,s=-1;for(r=0;r<o.length;r++){if(o[r].min<=t&&t<=o[r].max){s=r,n.min=r?o[r-1].max:n.min,n.max=r+1<o.length?o[r+1].min:n.max;break}if(t<o[r].min){n.max=o[r].min,n.min=r?o[r-1].max:n.min;break}}-1===s&&o.length&&r>=o.length&&(n.min=o[o.length-1].max),-1!==s&&(i={idx:s,start:o[s].min,end:o[s].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=i}function lc(e){e.renderer.render(ic(e))}function cc(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map((e=>e.id())),i=t.brushes().filter((e=>"range"===e.type&&-1!==r.indexOf(e.id)))[0];return i?i.brush.ranges():[]}function uc(e,t){let n,r=1/0;const i=t.domain(),o=t.bandwidth()/2;for(let s=0;s<i.length;++s){const a=Math.abs(e-o-t(i[s]));a<r&&(r=a,n=i[s])}return n}function hc(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function dc(e){return V(e.reduce(((e,t)=>(e.push(...B(t.bounds)),e)),[]))}const fc={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=cc(this.state,this.state.brushInstance),this.state.active=null,lc(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),r=this.state.rect[0===this.state.direction?"height":"width"];let i=is(this.chart.scale(t.scale),r);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,r=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((t=>e.chart.component(t))).filter((e=>!!e&&!!e.rect)),i=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(i.length>0){const r=dc(i);if(t.size=r[0===e.state.direction?"height":"width"],t.scale=is(e.chart.scale(n.scale),t.size),t.targetRect=r,o.length>0){const e=dc(o);t.targetFillRect=e}}else if(r&&r.length>0){const n=r.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.rect.computedInner.height)})),{x0:r[0].rect.computedInner.x,y0:r[0].rect.computedInner.y,x1:r[0].rect.computedInner.x+r[0].rect.computedInner.width,y1:r[0].rect.computedInner.y+r[0].rect.computedInner.height});t.targetRect={x:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(this);if(i=o.scale?o.scale:i,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?r:o.size,this.state.settings=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,r){let i=e.ranges.map((e=>({min:e.min,max:e.max})));const o=e.scale.min(),s=e.scale.max();i[t]={min:Math.max(o,Math.min(n,r)),max:Math.min(s,Math.max(n,r))},e.ranges[t]=I({},i[t]);const a=e.scale.data();a&&a.fields&&a.fields.forEach((t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)}))}(this.state,e,t,n),this.emit("bubbleEnd"),lc(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,lc(this.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,data:n,scale:i,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(i,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=i;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=so(),this.state.scale.data=i.data,this.state.format||(this.state.format=(e,t)=>hc(i.range(),t)?function(e,t){const n=t.ticks(),r=t.domain().indexOf(uc(e,t));return-1!==r?n[r].label:"-"}(e,i):"-"),this.state.fauxBrushInstance=Wo(),this.state.findValues=e=>function(e,t){const n=t.domain(),r=t.range(),i=[];return e.forEach((e=>{if(!hc(r,[e.min,e.max]))return;const o=n.indexOf(uc(e.min,t)),s=n.indexOf(uc(e.max,t));i.push.apply(i,n.slice(Math.min(o,s),Math.max(o,s)+1))})),i}(e,i);return this.state.ranges=cc(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[ic(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(e){!function(e){let{state:t,e:n,renderer:r,ranges:i,targetSize:o}=e;if(t.started)return;t.edit=null;const s=n.center.x-n.deltaX,a=n.center.y-n.deltaY;let l=document.elementFromPoint(s,a);r.element().contains(l)||(l=null);const c={started:!0};t.offset=N({},r.element().getBoundingClientRect());const u=s-t.offset.left,h=a-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=i(t,t.fauxBrushInstance||t.brushInstance);const d=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(f/t.size),c.start=t.scale.normInvert(d/t.size);let p=t.ranges;const g=oc(t);let m,y,b=-1;if(l&&l.hasAttribute("data-idx"))b=parseInt(l.getAttribute("data-idx"),10),g.min=b>0?p[b-1].max:g.min,g.max=b+1<p.length?p[b+1].min:g.max;else{for(m=0;m<p.length;m++){if(p[m].min<=c.start&&c.start<=p[m].max){b=m,g.min=m?p[m-1].max:g.min,g.max=m+1<p.length?p[m+1].min:g.max;break}if(c.start<p[m].min){g.max=p[m].min,g.min=m?p[m-1].max:g.min;break}}-1===b&&p.length&&m>=p.length&&(g.min=p[p.length-1].max)}if(-1!==b||t.multi||(c.ranges=[],g.min=t.scale.min(),g.max=t.scale.max()),-1!==b)if(y={idx:b,start:p[b].min,end:p[b].max,limitLow:g.min,limitHigh:g.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(d-e)<=o?(c.start=y.end,y.mode="modify"):Math.abs(d-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:g.min,limitHigh:g.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!ea(t.targetRect,{x:u,y:h})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:cc,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=oc(e);ac(e,e.current,n)}(this.state,cc),lc(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,r=e.scale.normInvert(n);e.current=Math.max(Math.min(r,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){let t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=rc(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});const n=e.scale.data();n&&n.fields&&n.fields.forEach((n=>{if(e.fauxBrushInstance){let r=cc(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),s=o.filter((e=>-1===i.indexOf(e))),a=i.filter((e=>-1===o.indexOf(e))),l=s.map((e=>({key:n.id(),value:e}))),c=a.map((e=>({key:n.id(),value:e})));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),lc(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(e){if(!this.state.editable)return;const t=e.srcEvent||e,n=t.target,r={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(r.rangeIdx)||JSON.stringify(r)===JSON.stringify(this.state.edit))return;this.state.edit=r,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const i=n.parentNode;lc(this.state);const o=i.querySelector("input");o.focus(),o.select()}};function pc(e){e.renderer.render(ic(e))}function gc(e){return e.rc.ranges()}function mc(e,t){const n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}const yc={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?0:1,r=this.state.rect[0===n?"height":"width"],i=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map((e=>this.chart.component(e))).filter((e=>!!e&&!!e.rect)),s=o[0]?o.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.rect.height)})),{x0:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=s?{x:s.x0-this.rect.x,y:s.y0-this.rect.y,width:s.x1-s.x0,height:s.y1-s.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=t,this.state.offset=i,this.state.rc=Ro(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.size=r,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(e,t){return function(e,t,n){const r=Math.min(...n),i=Math.max(...n),o={x:e.direction?r+e.rect.x:e.rect.x,y:e.direction?e.rect.y:r+e.rect.y,width:e.direction?i-r:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:i-r},s=e.chart.shapesAt(o,e.settings.brush);if(0===s.length)return"-";const a=s.reduce(((n,i)=>{const o=n.bounds,s=i.bounds;return t===r?o[e.cssCoord.coord]<=s[e.cssCoord.coord]?n:i:o[e.cssCoord.coord]+o[e.cssCoord.area]>=s[e.cssCoord.coord]+s[e.cssCoord.area]?n:i})),l=e.settings.brush.components.reduce(((e,t)=>e.key===a.key?e:t));return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(a.data):Array.isArray(l.data)&&l.data.length?a.data[l.data[0]].label:a.data&&a.data.label?a.data.label:"-"}(this,e,t)},[]},start(e){!function(e){let{state:t,e:n,renderer:r,ranges:i,targetSize:o}=e;if(t.started)return;const s=n.center.x-n.deltaX,a=n.center.y-n.deltaY;let l=document.elementFromPoint(s,a);r.element().contains(l)||(l=null);const c={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);const u=s-t.offset.left,h=a-t.offset.top,d=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let p=f,g=d;c.start=d,c.current=f;let m=t.ranges;const y=sc(t);let b,v,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),y.min=x>0?m[x-1].max:y.min,y.max=x+1<m.length?m[x+1].min:y.max;else{for(b=0;b<m.length;b++){if(m[b].min<=g&&g<=m[b].max){x=b,y.min=b?m[b-1].max:y.min,y.max=b+1<m.length?m[b+1].min:y.max;break}if(g<m[b].min){y.max=m[b].min,y.min=b?m[b-1].max:y.min;break}}-1===x&&m.length&&b>=m.length&&(y.min=m[m.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(v={idx:x,start:m[x].min,end:m[x].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),v.mode="modify";else{let e=v.start,t=v.end;Math.abs(d-e)<=o?(c.start=v.end,v.mode="modify"):Math.abs(d-t)<=o&&(c.start=v.start,v.mode="modify")}else v={idx:-1,start:g,end:p,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=v,"modify"!==v.mode&&t.targetRect&&!ea(t.targetRect,{x:u,y:h})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:gc,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=sc(e);ac(e,e.current,n)}(this.state,gc),pc(this.state))},move(e){this.state.started&&(!function(e,t){const n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){const t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=rc(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);let n=[];t.forEach((t=>{n=[...n,...mc(e,t)]})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),pc(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function bc(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],r=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map((e=>e.id())),i=t.brushes().filter((e=>"range"===e.type&&-1!==r.indexOf(e.id)))[0];return i?i.brush.ranges():[]}(e).map((i=>{const o=e.scale(i.min)*n,s=e.scale(i.max)*n,a=Math.min(o,s),l=Math.abs(o-s);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:a,width:t?r:l,y:t?a:0,height:t?l:r}}))}function vc(e,t,n,r){function i(){!function(e){e.renderer.render(bc(e))}(e)}function o(){!function(e){e.renderer.render(bc(e))}(e)}function s(){!function(e){e.renderer.render(bc(e))}(e)}e.brush=t,t&&(t.on("start",i),t.on("update",o),t.on("end",s),e.start=i,e.update=o,e.end=s,e.brush=t,e.scale=n,e.renderer=r)}function xc(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}const wc={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",r="horizontal"===n?this.rect.width:this.rect.height,i=is(this.chart.scale(e.scale),r);return xc(this.state),vc(this.state,t,i,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,bc(this.state)},beforeDestroy(){xc(this.state)}};function kc(e,t){const n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function Mc(e,t,n){return ks(e,t.points[0])<n.settings.snapIndicator.threshold**2}function _c(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function Sc(e){let{state:t,start:n=null,end:r=null}=e;null!==n&&(t.snapIndicator.x1=n.x,t.snapIndicator.y1=n.y),null!==r&&(t.snapIndicator.x2=r.x,t.snapIndicator.y2=r.y)}function qc(e,t){e.snapIndicator.visible=t}const Dc={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=this.settings.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"})));const n=kc(this.state.rendererBounds,e);_c(this.state,n),Sc({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=kc(this.state.rendererBounds,e);Mc(t,this.state,this.settings)?qc(this.state,!0):qc(this.state,!1),_c(this.state,t),Sc({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter((e=>e.visible));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const n=e.points[e.points.length-2],r=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=r.x+e.componentDelta.x,e.lineBrushShape.y2=r.y+e.componentDelta.y;const i=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(i,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;qc(this.state,!1);Mc(kc(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,r=e.componentDelta.y,i=e.points.map((e=>({x:e.x+n,y:e.y+r}))),o=t.shapesAt({vertices:i},{components:e.brushConfig});t.brushFromShapes(o,{components:e.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([])},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render(){}};function Cc(e,t,n,r,i){let o,s=0,a=t.length-1;for(;s<a;){let l=Math.floor((s+a)/2);o=i(t[l]),o[n]+o[r]<e[n]?s=l+1:a=l}return s}function Ec(e){let{orientation:t,targetNodes:n,labels:r,container:i}=e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Cc;const s=[],a="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const{textBounds:h,node:d}=r[t];if(h[a]<i[a]||h[a]+h[l]>i[a]+i[l])return!1;for(let e=o(h,s,a,l,c);e<s.length;e++)if(Zs(h,s[e].textBounds))return!1;const f=o(h,n,a,l,u),p=h[a]+h[l];for(let e=f;e<n.length;e++){const t=n[e].node;if(p<t.localBounds[a])break;if(Zs(h,t.localBounds)&&d!==t)return!1}return s.push(r[t]),!0}}const Ac=4;function Tc(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Nc(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function Rc(e){return I(I({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function Oc(e,t,n){return n?e.width>=t.height:e.width>=t.width}function Ic(e,t,n){return n?e.height>=t.width:e.height>=t.height}function Pc(e,t,n,r,i){let o,s;return"v"===e?(o=r||i||Oc(t,n,!0),s=Ic(t,n,!r)):(o=Oc(t,n),s=i||Ic(t,n,!1)),o&&s}function Lc(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function jc(e,t,n){const r={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(!n.overflow&&!function(e,t,n){return Oc(e,t,n.rotate)&&Ic(e,t,n.rotate)}(e,i,n))return!1;const o=.5*i.height;return n.rotate?(r.x=Lc(e.x,e.width,i.height,n.align)+o,r.y=Lc(e.y,e.height,i.width,n.justify),r.transform="rotate(-90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,")")):(r.x=Lc(e.x,e.width,i.width,n.align),r.y=Lc(e.y,e.height,i.height,n.justify)+o),r}function zc(e){let{bar:t,view:n,direction:r,position:i,padding:o=Ac}=e;const s={};if(N(s,t),i&&"inside"!==i)if("up"===r||"down"===r){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===i&&"up"===r||"opposite"===i&&"down"===r?(s.y=0,s.height=e):("outside"===i&&"down"===r||"opposite"===i&&"up"===r)&&(s.y=o,s.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===i&&"left"===r||"opposite"===i&&"right"===r?(s.x=0,s.width=e):("outside"===i&&"right"===r||"opposite"===i&&"left"===r)&&(s.x=o,s.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),r=Math.max(0,Math.min(e.y+e.height,t.height)),i=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=i,e.width=o-i,e.y=n,e.height=r-n}(s,n),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{top:n=Ac,bottom:r=Ac,left:i=Ac,right:o=Ac}=t;e.x+=i,e.width-=i+o,e.y+=n,e.height-=n+r}(s,o),s}function Fc(e){let t,n,r,i,o,{direction:s,fitsHorizontally:a,measured:l,node:c,orientation:u,placementSettings:h,rect:d}=e,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zc;const p=[],g="h"===u?"width":"height";for(o=0;o<h.length;o++)if(r=h[o],i=f({bar:c.localBounds,view:d,direction:s,position:r.position,padding:r.padding}),p.push(i),t=!o||i[g]>t[g]?i:t,Pc(u,i,l,a,r.overflow)){n=i;break}return n||(n=t,o=p.indexOf(n)),r=h[o],{bounds:n,placement:r}}function Hc(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{top:o=Ac,bottom:s=Ac,left:a=Ac,right:l=Ac}=i,c=e.x+e.dx,u=e.y+e.dy,h=n?Math.min(t.width,r.height):Math.min(t.height,r.width),d=n?Math.min(t.height,r.height):Math.min(t.width,r.width),f=.5*t.height,p=1e-9;return{x:(n?c-f:c)-a-p,y:(n?u:u-f)-o-p,width:d+(a+l)-p,height:h+(o+s)-p}}function Bc(e){let{chart:t,targetNodes:n,rect:r,fitsHorizontally:i,collectiveOrientation:o}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fc,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:jc,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ec;const c=[],u={container:r,targetNodes:n,labels:[],orientation:o};let h,d,f,p,g,m,y,b,v,x,w,k,M,_;for(let e=0,l=n.length;e<l;e++){m=null,d=n[e],f=d.node,M=Tc(f,t),v=d.direction,_="left"===v||"right"===v?"h":"v";for(let t=0;t<d.texts.length;t++){if(p=d.texts[t],!Nc(p))continue;x=d.labelSettings[t],b=d.measurements[t],k=x.placements;const n=s({direction:v,fitsHorizontally:i,lblStngs:x,measured:b,node:f,orientation:_,placements:k,placementSettings:d.placementSettings[t],rect:r});if(m=n.bounds,w=n.placement,m&&w){g=w.justify;const t="function"==typeof x.linkData?x.linkData(M,e):void 0,n="function"==typeof w.overflow?w.overflow(M,e):w.overflow;"up"===v&&(g=1-g),"opposite"===w.position&&(g=1-g),"left"===v&&(g=1-g);const r=!("h"===o||i);if(h=a(m,p,{justify:"h"===_?w.align:g,align:"h"===_?g:w.align,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:b,rotate:r,overflow:!!n}),h){const n=Hc(h,b,r,m,w.padding);y="function"==typeof w.fill?w.fill(I(I({},M),{},{textBounds:n}),e):w.fill,h.fill=y,void 0!==t&&(h.data=t),"object"==typeof w.background&&(h.backgroundColor="function"==typeof w.background.fill?w.background.fill(I(I({},M),{},{textBounds:n}),e):w.background.fill,void 0!==h.backgroundColor&&(h.backgroundBounds=Hc(h,b,r,m,w.background.padding))),c.push(h),u.labels.push({node:f,textBounds:n})}}}}const S=c.filter(l(u));return[...S.filter((e=>void 0!==e.backgroundBounds)).map(Rc),...S]}function Vc(e){const t=2*Math.PI;return(e%t+t)%t}function $c(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function Wc(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function Uc(e,t,n){let{x:r,y:i}=t;if(r*r+i*i>e*e)return null;let o=Math.sin(n),s=Math.cos(n),a=r*s-i*o,l=e*e-a*a;if(l<0)return null;let c=Math.sqrt(l);return{x:a*s+o*c,y:-a*o+s*c}}function Yc(e){let t,n,{radius:r,size:i,angle:o}=e,{width:s,height:a}=i,l={x:s/2,y:a/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=Uc(r,l,o),!t)return null;t.y*=-1,n={x:-s,y:0};break;case 1:if(t=Uc(r,l,Math.PI-o),!t)return null;n={x:-s,y:-a};break;case 2:if(t=Uc(r,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-a};break;case 3:if(t=Uc(r,l,2*Math.PI-o),!t)return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:s,height:a}}function Kc(e){let{slice:t,measured:n,padding:r}=e,{start:i,end:o,innerRadius:s,outerRadius:a}=t,l=a-s-2*r,c=o-i;if(c<Math.PI){let e=(n.height/2+r)/Math.tan(c/2);e>s&&(l=a-e-2*r)}if(l<0||l<n.minReqWidth)return null;const u=Vc((i+o)/2);let h=a-r,d={x:Math.sin(u)*h,y:-Math.cos(u)*h,width:l,height:n.height};return u<Math.PI?(d.angle=u-Math.PI/2,d.anchor="end"):(d.angle=u+Math.PI/2,d.anchor="start"),d}function Xc(e){let{context:t,node:n,bounds:r}=e;let{start:i,end:o}=n.desc.slice;const s=Vc((i+o)/2);switch(Math.floor(s/(Math.PI/2))){case 0:t.q1maxY=r.y-2,void 0===t.q2minY&&(t.q2minY=r.y+r.height+2);break;case 1:t.q2minY=r.y+r.height+2;break;case 2:t.q3minY=r.y+r.height+2;break;case 3:t.q4maxY=r.y-2,void 0===t.q3minY&&(t.q3minY=r.y+r.height+2)}}function Gc(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Jc(e,t,n){const r={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){let t=e.angle*(360/(2*Math.PI));r.transform="rotate(".concat(t,", ").concat(r.x,", ").concat(r.y,")")}return r}function Zc(e){let t,n,{slice:r,direction:i,position:o,padding:s,measured:a,view:l,context:c,store:u}=e,{start:h,end:d,innerRadius:f,offset:p}=r;switch(o){case"into":t="rotate"===i?Kc({slice:r,measured:a,padding:s}):function(e){let{slice:t,padding:n,measured:r}=e,{start:i,end:o,innerRadius:s,outerRadius:a}=t;const l=Vc((i+o)/2);let c=Yc({radius:a,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",ta(c,{x1:0,y1:0,x2:Math.sin(i)*a,y2:-Math.cos(i)*a})||ta(c,{x1:0,y1:0,x2:Math.sin(o)*a,y2:-Math.cos(o)*a})||Us({cx:0,cy:0,r:s},c)?null:($c(c,n),c)):null}({slice:r,measured:a,padding:s});break;case"inside":n={start:h,end:d,innerRadius:0,outerRadius:f},t="rotate"===i?Kc({slice:n,measured:a,padding:s}):function(e){let{slice:t,padding:n,measured:r,store:i}=e;const{start:o,end:s,outerRadius:a}=t,l=Vc((o+s)/2);let c=Yc({radius:a,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",$c(c,n),i.insideLabelBounds.some((e=>Zs(e,c)))?null:(i.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:a,padding:s,store:u});break;case"outside":t="rotate"===i?function(e){let{slice:t,measured:n,padding:r,view:i}=e,{start:o,end:s,outerRadius:a,offset:l}=t,c=a+r,u=s-o;if(u<Math.PI&&(n.height/2+r)/Math.tan(u/2)>c)return null;const h=Vc((o+s)/2);let d=Math.sin(h)*c,f=-Math.cos(h)*c,p=n.width+1,g=h%Math.PI;if(g>Math.PI/2&&(g=Math.PI-g),Math.cos(g)>.001){let e=f<0?i.y:i.y+i.height,t=Math.abs(e-l.y)/Math.cos(g)-Math.tan(g)*(n.height/2)-2*r-a;t<p&&(p=t)}if(Math.sin(g)>.001){let e=d<0?i.x:i.x+i.width,t=Math.abs(e-l.x)/Math.sin(g)-n.height/2/Math.tan(g)-2*r-a;t<p&&(p=t)}if(p<=0||p<n.minReqWidth)return null;let m={x:d,y:f,width:p,height:n.height};return h<Math.PI?(m.angle=h-Math.PI/2,m.anchor="start"):(m.angle=h+Math.PI/2,m.anchor="end"),m}({slice:r,measured:a,padding:s,view:l}):function(e){let{slice:t,measured:n,padding:r,view:i,context:o}=e,{start:s,end:a,outerRadius:l,offset:c}=t;const u=Vc((s+a)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),i))return null;let h=l+r+n.height/2,d=Math.sin(u)*h,f=-Math.cos(u)*h,p=n.width+1;if(u<Math.PI){let e=Math.abs(i.x+i.width-(d+c.x));e<p&&(p=e)}else{let e=Math.abs(i.x-(d+c.x));e<p&&(p=e)}if(p<n.minReqWidth)return null;let g={x:d,y:f,width:p,height:n.height};return u<Math.PI?g.anchor="start":g.anchor="end",g}({slice:r,measured:a,padding:s,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=p.x,t.y+=p.y,"outside"===o&&"rotate"!==i&&function(e,t,n){const{start:r,end:i,offset:o,outerRadius:s}=n,a=Vc((r+i)/2);switch(Math.floor(a/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=s+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),r=n-e.y;if(e.y=n,r>1){let t=s+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),r=n-e.y;if(e.y=n,r>1){let t=s+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=s+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}}}(t,c,r)),t}function Qc(e){let{context:t,direction:n,measured:r,node:i,placementSettings:o,rect:s,store:a}=e,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zc;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:i.desc.slice,view:s,direction:n,position:c.position,measured:r,padding:c.padding,store:a});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function eu(e,t,n){const r=t.fontFamily,i="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:r,fontSize:i});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:r,fontSize:i}).width),o}const tu=/\n+|\r+|\r\n/,nu=/\s/,ru=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function iu(e){return"string"==typeof e?-1!==e.search(tu):-1!==String(e).search(tu)}function ou(e){return-1!==e.search(nu)}function su(e){return-1!==e.search(ru)}function au(e,t,n){return Math.max(t,Math.min(n,e))}function lu(){let{string:e,separator:t="",reverse:n=!1,measureText:r=e=>({width:e.length,height:1}),mandatoryBreakIdentifiers:i=[iu],noBreakAllowedIdentifiers:o=[],suppressIdentifier:s=[ou,iu,e=>""===e],hyphenationIdentifiers:a=[su]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=String(e).split(t);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(l);const c=l.length,u=n?e=>e>=0:e=>e<c;let h=n?c:-1;function d(e){const t=au(e,0,c-1),n=l[t],u=r(n),h=function(e,t,n,r,i){return r.some((r=>r(e,t,n)))?1:i.some((r=>r(e,t,n)))?0:2}(n,t,l,i,o);return{index:t,value:n,breakOpportunity:h,suppress:s.some((e=>e(n,t,l))),hyphenation:a.some((e=>e(n,t,l))),width:u.width,height:u.height,done:!1}}return{next:function(e){return isNaN(e)?n?h--:h++:h=au(e,0,c-1),u(h)?d(h):{done:!0}},peek:d,length:c}}const cu="…",uu=/^\s*\d+(\.\d+)?px\s*$/i;function hu(e){return"string"===typeof e&&uu.test(e)}function du(e){const t=e["font-size"]||e.fontSize;return hu(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function fu(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const r=du(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function pu(e,t){return{lines:[],line:"",width:0,maxLines:fu(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function gu(e){e.lines.push(e.line),e.line="",e.width=0}function mu(e,t){e.line+=t.value,e.width+=t.width}function yu(e,t,n){if(t.width>e.maxWidth)return t;const r=t.index;for(let i=1;i<5;i++){const o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(r-i),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function bu(e,t,n){const r=lu({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=r.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?yu(e,t,r):t,gu(e),mu(e,t)):mu(e,t)}}function vu(e,t){const n=lu({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),r=pu(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){gu(r),i=!1;break}1===e.breakOpportunity?gu(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?r.width+=e.width:(e=r.hyphens.enabled?yu(r,e,n):e,gu(r),mu(r,e)):mu(r,e)}return{lines:r.lines,reduced:i}}function xu(e,t){const n=lu({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=pu(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){gu(r),i=!1;break}1===e.breakOpportunity?gu(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?gu(r):e.width>r.maxWidth?bu(r,e,t):(gu(r),mu(r,e)):mu(r,e)}return{lines:r.lines,reduced:i}}function wu(e){return{"break-all":vu,"break-word":xu}[e.wordBreak]}function ku(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const r=wu(n);if(!r)return;const i=e(n);if(i.width>n.maxWidth||iu(n.text)){const o=(du(n)-i.height)/2,s=r(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,r){const i={type:"container",children:[]};void 0!==t.id&&(i.id=t.id);let o=0;return e.lines.forEach(((s,a)=>{const l=N({},t);l.text=s,l._lineBreak=!0,o+=n,e.reduced&&a===e.lines.length-1?l.text+=cu:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=r,o+=n,i.children.push(l)})),i}(s,n,o,i.height)}}}}function Mu(e,t){let{text:n,"font-size":r,"font-family":i,maxWidth:o}=e;if(n="string"==typeof n?n:"".concat(n),void 0===o)return n;let s=t({text:n,fontSize:r,fontFamily:i}).width;if(s<=o)return n;let a=0,l=n.length-1;for(;a<=l;){let e=Math.floor((a+l)/2);s=t({text:n.substr(0,e)+cu,fontSize:r,fontFamily:i}).width,s<=o?a=e+1:l=e-1}return n.substr(0,l)+cu}function _u(e){const t=e.baseline||e["dominant-baseline"];let n=0;const r=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*r;break;case"text-before-edge":n=.85*r;break;case"middle":n=.25*r;break;case"central":n=.35*r;break;case"mathemetical":n=r/2;break;case"text-after-edge":case"ideographic":n=.2*-r;break;default:n=0}return n}const Su={},qu={},Du={fontSize:void 0,fontFamily:void 0};let Cu;function Eu(e,t,n){const r=e+t+n;return"number"!=typeof qu[r]&&(Cu=Cu||document.createElement("canvas").getContext("2d"),function(e,t){Du.fontSize===e&&Du.fontFamily===t||(Cu.font=e+" "+t,Du.fontSize=e,Du.fontFamily=t)}(t,n),qu[r]=Cu.measureText(e).width),qu[r]}function Au(e){return"number"!=typeof Su[e]&&(Su[e]=function(e){if(hu(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),Su[e]}function Tu(e){let{text:t,fontSize:n,fontFamily:r}=e;return{width:Eu(t,n,r),height:Au(n)}}function Nu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tu;const n=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,i=t({text:e.text,fontFamily:r,fontSize:n}),o=Math.min(e.maxWidth||i.width,i.width),s=e.x||0,a=e.y||0,l=e.dx||0,c={x:0,y:a+((e.dy||0)+_u(e))-.75*i.height,width:o,height:i.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?s+l-o/2:"end"===u?s+l-o:s+l,c}function Ru(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tu;const n=wu(e),r=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:i,fontSize:r});if(n&&(o.width>e.maxWidth||iu(e.text))){const o=n(e,(e=>t({text:e,fontFamily:i,fontSize:r}))),s=N({},e);let a=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let s=o.lines[e];s+=e===n-1&&o.reduced?cu:"";const c=t({text:s,fontSize:r,fontFamily:i}).width;c>=a&&(a=c,l=s)}s.text=l;const c=Nu(s,t);return c.height=du(e)*o.lines.length,c}return Nu(e,t)}function Ou(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Iu(e,t,n){const r={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-i.width);return r.x=e.x+n.align*o,r.y=e.y+i.height/1.2,r}function Pu(e){let{cx:t,cy:n,r:r}=e;return{type:"circle",bounds:{cx:t,cy:n,r:r}}}function Lu(e){return e.desc&&e.desc.slice?function(e){let{start:t,end:n,innerRadius:r,outerRadius:i,offset:o}=e;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let s=0!==r?r:i;return Pu({cx:o.x,cy:o.y,r:s})}(e.desc.slice):"circle"===e.type?Pu(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var ju={bar:function(e){let{settings:t,chart:n,nodes:r,rect:i,renderer:o,style:s}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Bc;const l=N({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},s.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map((e=>N({},l,t,e))),u=t.labels.map((e=>e.placements.map((n=>N({},l,t,e,n))))),{fitsHorizontally:h,hasHorizontalDirection:d,targetNodes:f}=function(e){let{nodes:t,rect:n,chart:r,labelSettings:i,placementSettings:o,settings:s,renderer:a}=e;const l={},c=[];let u,h,d,f,p,g,m,y=!0,b=!1;for(let e=0;e<t.length;e++){if(h=t[e],f=h.localBounds,!Zs(f,n))continue;let v=Tc(h,r);u={node:h,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<i.length;t++)g=i[t],d="function"==typeof g.label?g.label(v,e):void 0,Nc(d)&&(m="function"==typeof s.direction?s.direction(v,e):s.direction||"up",b=b||"left"===m||"right"===m,l.fontFamily=g.fontFamily,l.fontSize="".concat(g.fontSize,"px"),l.text=d,p=a.measureText(l),u.measurements.push(p),u.texts.push(d),u.labelSettings.push(g),u.placementSettings.push(o[t]),u.direction=m,y=y&&p.width<=f.width-2*Ac);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:b}}({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:c,placementSettings:u}),p=function(e){let{orientation:t="auto",defaultOrientation:n="h"}=e;switch(t.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return n}}({orientation:t.orientation,defaultOrientation:d?"h":"v"}),g="h"===p?"y":"x",m="h"===p?"height":"width";return f.sort(((e,t)=>e.node.localBounds[g]+e.node.localBounds[m]-(t.node.localBounds[g]+t.node.localBounds[m]))),a({chart:n,targetNodes:f,stngs:t,rect:i,fitsHorizontally:h,collectiveOrientation:p})},slice:function(e){let{settings:t,chart:n,nodes:r,rect:i,renderer:o,style:s}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qc,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Jc;const c=N({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},s.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map((e=>N({},c,t,e))),h=t.labels.map((e=>e.placements.map((n=>N({},c,t,e,n))))),d=[],f={insideLabelBounds:[]};r=function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.length;++o){const{start:s,end:a}=e[o].desc.slice,l=Vc((s+a)/2);switch(Math.floor(l/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:r.push(e[o]);break;case 3:i.push(e[o])}}const o=(e,t)=>Vc((e.desc.slice.start+e.desc.slice.end)/2)-Vc((t.desc.slice.start+t.desc.slice.end)/2),s=(e,t)=>o(t,e);return t.sort(s),n.sort(o),r.sort(s),i.sort(o),t.concat(n,i,r)}(r);const p={};for(let e=0,t=r.length;e<t;e++){const t=r[e],s=Gc(t,n);for(let n=0;n<u.length;n++){const r=u[n],c="function"==typeof r.label?r.label(s,e):"";if(!c)continue;const g="function"==typeof r.direction?r.direction(s,e):r.direction||"horizontal",m="function"==typeof r.linkData?r.linkData(s,e):void 0,y=eu(c,r,o),b=a({context:p,direction:g,lblStngs:r,measured:y,node:t,placementSettings:h[n],rect:i,store:f}),v=b.bounds,x=b.placement;if(v&&x){if("outside"===x.position&&"rotate"!==g){Xc({context:p,node:t,bounds:v});if(!js(Wc(v),i))continue}const n="function"==typeof x.fill?x.fill(s,e):x.fill,o=l(v,c,{fill:n,fontSize:r.fontSize,fontFamily:r.fontFamily,textMetrics:y});o&&(void 0!==m&&(o.data=m),d.push(o),v.line&&(v.line.stroke=n,d.push(v.line)))}}}return d},rows:function(e){let{settings:t,chart:n,nodes:r,renderer:i,style:o}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Iu;const a=N({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);a.fontSize=parseInt(a.fontSize,10);const l=N({},a,t),c=t.labels.map((e=>N({},l,e))),u={},h=[];for(let e=0,t=r.length;e<t;e++){let t=r[e],o=Ou(t,n),{type:a,bounds:d}=Lu(t);if(!d)continue;let f,p=0,g=[],m=[],y="circle"===a?2*d.r*.9:d.height;for(p+=l.padding,f=0;f<c.length;f++){let t=c[f],n="function"==typeof t.label?t.label(o,e):"";u.fontFamily=t.fontFamily,u.fontSize="".concat(t.fontSize,"px"),u.text=n;let r=i.measureText(u);if(p+=r.height+t.padding,p>y)break;m.push(n),g.push(r)}const b=f,v=Math.max(0,y-p);let x;for(x="circle"===a?d.cy-.9*d.r:d.y,x+=l.justify*v+l.padding,f=0;f<b;f++){let t,n=c[f];if("circle"===a){let e=Math.max(Math.abs(x-d.cy),Math.abs(x+g[f].height-d.cy)),n=Math.sqrt(d.r*d.r-e*e);t={x:d.cx-n+l.padding,y:x,width:2*n-2*l.padding,height:g[f].height}}else t={x:d.x+l.padding,y:x,width:d.width-2*l.padding,height:g[f].height};x+=g[f].height+l.padding;let r="function"==typeof n.fill?n.fill(o,e):n.fill;const u="function"==typeof n.linkData?n.linkData(o,e):void 0;let p=s(t,m[f],{fill:r,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:g[f]});if(p){if(p.text&&p.text!==cu){const e=Mu(p,i.measureText);if(cu===e)continue;p.ellipsed=e}void 0!==u&&(p.data=u),h.push(p)}}}return h}};const zu={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach((e=>{e.strategy&&ju[e.strategy.type]&&e.component&&t.push(...function(e,t){let{chart:n,source:r,rect:i,renderer:o,style:s}=e;if(!n.component(r.component))return[];const a=n.findShapes(r.selector).filter((e=>e.key===r.component));return t({chart:n,settings:r.strategy.settings,nodes:a,rect:{x:0,y:0,width:i.width,height:i.height},renderer:o,style:s})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},ju[e.strategy.type]))})),t}};const Fu={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,justify:.5,align:.5,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25},navigation:{button:{class:void 0,content:void 0,tabIndex:void 0},disabled:!1}};function Hu(e){let{x:t=0,y:n,item:r,globalMetrics:i,createSymbol:o,direction:s="ltr"}=e,a=r.label.displayObject,l=r.label.bounds,c=r.symbol.meta;const u="rtl"===s;let h={x:u?t+i.maxLabelBounds.width:t+i.maxSymbolSize+i.spacing,y:n,width:i.maxLabelBounds.width,height:Math.max(i.maxSymbolSize,i.maxLabelBounds.height)},d=function(e,t,n){const r=Math.max(0,e.width-t),i=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*r,y:e.y+t/2+n.justify*i}}({x:u?t+i.maxLabelBounds.width+i.spacing:t,y:n,width:i.maxSymbolSize,height:h.height},c.size,{align:void 0===c.align?.5:c.align,justify:void 0===c.justify?.5:c.justify});const f=o(N({},c,d));return delete f.collider,a.anchor=u?"end":"start",function(e,t,n){const r=n.textMetrics;if(e.height<r.height)return!1;const i=Math.max(0,e.width-r.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-r.height);t.x=e.x+n.align*i,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(h,a,{textMetrics:l,fontSize:parseInt(a.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:r.label.displayObject.data,children:[f,a],collider:{type:"rect",x:t,y:n,width:i.maxItemBounds.width,height:i.maxItemBounds.height}},metrics:h}}function Bu(e,t){const n=e.items.length,r=Math.ceil(n/t),i="horizontal"===e.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*r+(r-1)*e.layout.margin[o]}function Vu(e,t){let n,r,i,o,{onScroll:s=()=>{}}=t,a=null,l=0;const c={itemize:t=>{n=function(e,t){let n,r,{resolved:i,dock:o}=e,s=[],a=i.items.items,l=i.symbols.items,c=i.labels.items,u=0,h=0,d=0;for(let e=0;e<a.length;e++){if(!1===a[e].show)continue;const i=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=N({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:i,title:i}),r={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},s.push(r),u=Math.max(l[e].size,u),h=Math.max(r.label.bounds.width,h),d=Math.max(r.label.bounds.height,d)}return{items:s,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,d),width:u+8+h},maxLabelBounds:{width:h,height:d}},layout:{margin:{vertical:void 0!==i.layout.item.vertical?i.layout.item.vertical:4,horizontal:void 0!==i.layout.item.horizontal?i.layout.item.horizontal:4},mode:i.layout.item.mode,size:i.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:i.layout.item.direction,scrollOffset:i.layout.item.scrollOffset}}}(t,e.renderer),a=isNaN(n.layout.scrollOffset)?a:n.layout.scrollOffset},getItemsToRender:t=>{i=t.viewRect,l=c.getContentOverflow(i);const s=c.extent();a=Math.max(0,Math.min(a,l)),o=N({},i);const u="horizontal"===c.orientation()?"x":"y";return o[u]-=a,o["x"===u?"width":"height"]=s,function(e,t,n){let{viewRect:r}=e,{itemized:i,create:o=Hu,parallels:s,createSymbol:a}=n;const l=i.layout.direction,c=i.globalMetrics,u=i.items,h="horizontal"===i.layout.orientation;let d=0;const f=[],p=c.maxItemBounds.height,g=c.maxItemBounds.width,m=i.layout.margin.vertical+p,y=i.layout.margin.horizontal+g;let b=t.x,v=t.y,x=r.x-t.x;for(let e=0;e<u.length;e++){let n=o({y:v,x:"rtl"===l?r.x+x+r.width-g-(b-t.x):b,item:u[e],globalMetrics:c,direction:l,createSymbol:a});if((h&&b>=r.x-g||!h&&v>=r.y-p)&&f.push(n.item),d++,d>=s?(d=0,h?(b+=y,v=t.y):(v+=m,b=t.x)):h?v+=m:b+=y,!h&&v>r.y+r.height)break;if(h&&b>r.x+r.width)break}return f}(t,o,{itemized:n,parallels:r,createSymbol:e.symbol})},parallelize:(e,t)=>(r=function(e,t,n){const r=n.items.length,i="horizontal"===n.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical",s=n.globalMetrics.maxItemBounds[i]*r+(r-1)*n.layout.margin[o];let a=Math.ceil(s/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",r="width"===e?"horizontal":"vertical",i=n.layout.margin[r]||4,o=Math.floor((t+i)/(i+n.globalMetrics.maxItemBounds[e]));a=Math.min(a,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(a,l))}(e,t,n),r),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return Bu(n,r)>i[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,Bu(n,r)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:()=>"horizontal"===c.orientation()?i.x+i.width<o.x+o.width:i.y+i.height<o.y+o.height,hasPrev:()=>"horizontal"===c.orientation()?o.x<i.x:o.y<i.y,next:()=>{c.scroll(-c.getNextSize())},prev:()=>{c.scroll(c.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(l,a-e));t!==a&&(a=t,s())},offset:()=>a,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>Bu(n,r),spread:()=>function(e,t){const n=t,r="horizontal"===e.layout.orientation?"height":"width",i="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*n+(n-1)*e.layout.margin[i]}(n,r)};return c}function $u(e){return Object.keys(e).filter((t=>e[t])).join(" ")}const Wu={up:"▲",right:"▶",down:"▼",left:"◀"};function Uu(e,t){let{size:n,isActive:r,direction:i,nav:o,attrs:s}=t,a={},l="";const c=s;o&&o.button&&("function"==typeof o.button.class?a=o.button.class({direction:i}):o.button.class&&(a=o.button.class),"function"==typeof o.button.content&&(l=o.button.content(e,{direction:i})),void 0!==o.button.tabIndex&&(c.tabindex=o.button.tabIndex));const u={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(a).length||(u.border="0",u.background="none"),(!r||o&&o.disabled)&&(c.disabled="disabled"),e("button",N({class:$u(a),style:u},c),[l||e("span",{style:{pointerEvents:"none"}},[Wu[i]])])}function Yu(e){let t;const n={itemize:e=>{t=function(e){let{dock:t,navigation:n}=e;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:n}}(e)},render:r=>function(e,t,n,r){let{rect:i,itemRenderer:o}=t;if(!e||!e.renderArgs)return;e.size(i);const s=e.renderArgs[0],a="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const h=a?["right","left"]:["down","up"];l&&a&&h.reverse();const d=[s("div",{style:{position:"relative",display:"flex","flex-direction":a?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!a?"rtl":"ltr"},[Uu(s,{size:32,isActive:c,direction:h[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),Uu(s,{size:32,isActive:u,direction:h[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(d)}(n.renderer,r,t,e),extent:()=>32,spread:()=>64};return n}function Ku(e){let t;const n={itemize:n=>{t=function(e,t){let{resolved:n}=e;if(!1===n.title.item.show)return null;const r=N({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(r.anchor&&"start"!==r.anchor?"end"===r.anchor&&(r.anchor="start"):r.anchor="end"),void 0===n.title.settings.text){const e=t.scale.data().fields;r.text=e&&e[0]?e[0].title():""}return{displayObject:r,bounds:t.renderer.textBounds(r)}}(n,e)},render:e=>{!function(e,t,n){let{rect:r}=e;if(!t)return;const i=[];if(t.size(r),n){const e={start:0,end:r.width,middle:r.width/2};i.push(N({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(i)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function Xu(e,t,n,r){let i,o,s,{itemRenderer:a,navigationRenderer:l,titleRenderer:c,isPreliminary:u=!1}=r,h=0;const d={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:d.x,y:d.y,width:d.width,height:c.spread()},"horizontal"===n){i={x:d.x,y:d.y,width:c.extent(),height:c.spread()};const e=d.width-i.width-(i.width?t.spacing:0),n=d.height;a.parallelize(e,u?void 0:n);const r=a.extent()>e?l.extent():0,f=a.spread(),p=r?l.spread():0;o={x:i.x+i.width+(i.width?t.spacing:0),y:d.y+Math.max(0,(p-f)/2),width:d.width-r-i.width-(r?t.spacing:0)-(i.width?t.spacing:0),height:n},s={x:o.x+o.width+(r?t.spacing:0),y:d.y,width:r,height:d.height},i.y=o.y;"rtl"===a.direction()&&(s.x=d.x,o.x=s.x+s.width+(s.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),h=Math.max(i.height,p,a.spread())}else{const e=d.height-i.height-(i.height?t.spacing:0),n=d.width;a.parallelize(e,u?void 0:n);const r=a.extent()>e?l.extent():0;s={x:d.x,y:d.y+d.height-r,width:d.width,height:r},o={x:d.x,y:i.y+i.height+(i.height?t.spacing:0),width:d.width,height:d.height-i.height-(i.height?t.spacing:0)-s.height-(s.height?t.spacing:0)},h=Math.max(c.extent(),r?l.spread():0,a.spread())}return o=N({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),s.x+=e.x,s.y+=e.y,i.x+=e.x,i.y+=e.y,{title:N({},e,i),content:N({},e,o),navigation:N({},e,s),orientation:n,preferredSize:h}}function Gu(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const r=e.settings.layout.dock;if("threshold-color"===e.scale.type){const i=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):i&&(o=i.formatter());for(let e=0;e<t.length-1;e++){const r={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};i&&(r.source={field:i.id()}),n.items.push(r)}"vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")&&n.items.reverse()}else{const r=e.scale.labels?e.scale.labels():null;n.items=t.map(((t,n)=>{const i=e.scale.datum?N({},e.scale.datum(t)):{value:t};return i.value=t,e.scale.label?i.label=e.scale.label(t):r&&(i.label=r[n]),i}))}const i=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:N(!0,{},Fu.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:Fu.layout,settings:e.settings.settings.layout}),s=e.resolver.resolve({data:n,defaults:N(!0,{},Fu.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),a=N(!0,{},(e.settings.settings.item||{}).shape);void 0===a.fill&&e.settings.scale&&(a.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:N(!0,{},Fu.item.shape,e.style.item.shape),settings:a}),c=e.resolver.resolve({data:n,defaults:N(!0,{},{show:Fu.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function u(e,n){let r=e.data.value,i=t[n+1];e.data.value=[r,i]}"threshold-color"===e.scale.type&&("vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")?(c.items.reverse().forEach(u),c.items.reverse()):c.items.forEach(u));return{title:i,labels:s,symbols:l,items:c,layout:o}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function Ju(e){const{rect:t,settings:n,state:r,itemRenderer:i,navigationRenderer:o,titleRenderer:s}=e,a=n.layout.dock,l="top"===a||"bottom"===a?"horizontal":"vertical",c=Xu(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:s});e.renderer.size(c.content);let u=i.getItemsToRender({viewRect:N({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:i}),s.render({rect:c.title}),e.state.views={layout:c},u}const Zu={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(e){if(!this.state.interaction.started)return;const t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t},panend(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=Ju(this);this.update(e)},this.itemRenderer=Vu(this,{onScroll:this.onScroll}),this.navigationRenderer=Yu(this),this.titleRenderer=Ku(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),Gu(this)},preferredSize(e){return function(e,t){let n=0;const r=e.settings.layout.dock||"center",i="top"===r||"bottom"===r?"horizontal":"vertical",o=e.state.display,s=Xu(t.inner,o,i,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=s.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){Gu(this)},render(){return Ju(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function Qu(e,t){let n=0;const r=e.state.isVertical?"justify":"align",i=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",s=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[s](),n*=Math.min(1,Math.max(e.stgns[r],0)),t[i]+=n}function eh(e,t,n){const r=n[e];return"object"==typeof r?-1!==r.valid.indexOf(t)?t:r.default:n.default}function th(e){return eh(e.layout.dock,e.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function nh(e,t){const n={x:0,y:0,width:0,height:0},r=e.stgns.padding;return n.x=r.left,n.y=r.top,n.width=t.width-r.left-r.right,n.height=t.height-r.top-r.bottom,n}function rh(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,r=e.chart.scale(e.stgns.fill),i=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let r=n,i=e.stgns.tick.label;!i&&e.formatter?i=e.formatter:!i&&t.data().fields&&(i=t.data().fields[0].formatter()),"function"==typeof i&&(r=n.map(i).map(String));const o=n.map(((n,i)=>{const o=r[i];return{value:n,label:o,pos:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}}));return o}(e,i),s=eh((a=e.settings).layout.dock,a.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"});var a;if(void 0===n.text){const e=i.data().fields;n.text=e&&e[0]?e[0].title():""}const l=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),c=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),u={isVertical:t,nodes:[],title:{anchor:th(e.settings),textMetrics:l,textBounds:c,requiredWidth:()=>{if(!n.show)return 0;let e=c.width,r=n.maxLengthPx;return t||(e+=n.padding,r+=n.padding),Math.min(e,r,u.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=c.height;return t&&(e+=n.padding),Math.min(e,u.rect.height)}},ticks:{values:o,anchor:s,length:Math.min(Math.max(...o.map((e=>e.textMetrics.width))),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===s?Math.max(...u.ticks.values.map((e=>e.textMetrics.height)))+e.stgns.tick.padding:0,height:Math.max(...o.map((e=>e.textMetrics.height)))},legend:{fillScale:r,majorScale:i,length:()=>{const n=t?"height":"width",r=t?"requiredHeight":"requiredWidth",i=Math.min(u.rect[n],u.rect[n]*e.stgns.length)-u.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return u}const ih={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize(e){const t=this.state;t.rect=nh(this,e.inner);let n=this.stgns.size;const r=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=r;const i=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce(((e,t)=>e+t.textMetrics.height),0);if(e>this.state.legend.length())return i;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return i;n+=Math.max(...t.ticks.values.map((e=>e.textMetrics.height)))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+r,n):Math.max(n,t.title.requiredWidth()+r)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=rh(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=rh(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=nh(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,r="left"===t.ticks.anchor,i="top"===t.ticks.anchor;let o=t.rect.x,s=t.rect.y,a="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,s+=t.title.textMetrics.height,s+=i?t.rect.height-t.title.textBounds.height:0,a="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,s+=t.title.textMetrics.height,s+=i?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=r?t.rect.width:0,s+=t.title.textMetrics.height,a=r?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(s,t.rect.y+t.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:a,title:n.title.text};return Qu(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale;return t.domain().map((e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))}))).sort(((e,t)=>e.offset-t.offset))}(this),n=function(e,t){const n=e.state,r=e.stgns,i=n.rect;let o=i.x,s=i.y,a=n.isVertical?r.size:n.legend.length(),l=n.isVertical?n.legend.length():r.size;"left"===n.ticks.anchor?o+=n.rect.width-r.size:"top"===n.ticks.anchor&&(s+=n.rect.height-r.size),"top"===n.title.anchor?s+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:s,width:a,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return Qu(e,c),c}(this,t),r=function(e,t){const n=e.state,r=e.stgns;let i="start";const o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},s=n.ticks.values.map((s=>{let a=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*s.pos,u=0===s.pos?"text-before-edge":"text-after-edge"):a=t.x+t.width*s.pos,"right"===n.ticks.anchor?(a=t.x+r.size+r.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(a=t.x-r.tick.padding,i="end"):"top"===n.ticks.anchor?(l=t.y-r.tick.padding,c-=.25*s.textMetrics.height,i=0===s.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,c=.8*s.textMetrics.height,i=0===s.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:a,y:l,dx:0,dy:c,text:s.label,fontSize:r.tick.fontSize,fontFamily:r.tick.fontFamily,fill:r.tick.fill,maxWidth:n.isVertical?r.tick.maxLengthPx:Math.min(r.tick.maxLengthPx,n.legend.length()/2),anchor:i,textBoundsFn:e.renderer.textBounds,title:s.label,baseline:u}}));return{type:"container",id:"legend-seq-ticks",children:[...s,o]}}(this,n),i={id:"legend-seq-target",type:"container",children:[n,r]};this.state.nodes.push(i)},render(){return this.state.nodes}};const oh={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},connect:!1,orientation:"horizontal",layers:{curve:"linear",show:!0,sort:void 0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function sh(e,t){let{generatorType:n,item:r,data:i,major:o,minor:s,layerObj:a,stngs:l}=t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,generatorType:n,major:o,minor:s,layerObj:a,stngs:l,opacity:r.opacity,stroke:r.stroke,strokeWidth:r.strokeWidth,strokeLinejoin:r.strokeLinejoin,fill:c||r.fill,data:i};return r.strokeDasharray&&(u.strokeDasharray=r.strokeDasharray),u}function ah(e){const{metaLayers:t,coordinates:n,layers:r,lines:i,areas:o}=function(e){let{data:t,stngs:n,rect:r,resolver:i,style:o,domain:s}=e;const{width:a,height:l}=r,c=i.resolve({data:t,defaults:oh.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:a,minor:"vertical"===n.orientation?a:l}}),u=!n.connect&&s.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),h={};let d=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=h[n]?h[n].items[h[n].items.length-1]:null,r=e?s.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&s.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==r&&h[n].items.push({dummy:!0})}h[n]=h[n]||{order:d++,id:n,items:[],dataItems:[],consumableData:{}},h[n].dataItems.push(t.data),h[n].items.push(t)}const f=Object.keys(h).map((e=>(h[e].consumableData=I({points:h[e].dataItems},h[e].dataItems[0]),h[e]))),p={items:f.map((e=>e.consumableData))},g=n.layers||{};return{coordinates:c,metaLayers:f,layers:i.resolve({data:p,defaults:{curve:oh.layers.curve,show:oh.layers.show},settings:{curve:g.curve,show:g.show}}),lines:i.resolve({data:p,defaults:N({},oh.layers.line,o.line),settings:g.line}),areas:i.resolve({data:p,defaults:N({},oh.layers.area,o.area),settings:g.area})}}(e),s=[];return t.forEach(((t,a)=>{const l=r.items[a];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let h,d;for(let r=0;r<t.items.length;r++){if(h=t.items[r],d=h.data,!h.dummy){if(isNaN(h.major))continue;e.missingMinor0&&(h.minor0=n.settings.minor.scale?n.settings.minor.scale(d.minor0?d.minor0.value:0):0),isNaN(h.minor)||c.push(h.minor),l.data.push(h.data)}u.push(h)}const f=c.sort(((e,t)=>e-t))[Math.floor((c.length-1)/2)];s.push({layerObj:l,lineObj:i.items[a],areaObj:o.items[a],median:f,points:u,consumableData:t.consumableData})})),s}const lh={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let{data:t}=e;const{width:n,height:r}=this.rect;this.stngs=this.settings.settings||{};const i=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,o=ah({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:i,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){const e=o.map((e=>({id:e.layerObj.id,data:e.layerObj.data}))).sort(this.stngs.layers.sort).map((e=>e.id));o.sort(((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id)))}else o.sort(((e,t)=>e.median-t.median));return function(e,t){let{width:n,height:r,missingMinor0:i,stngs:o}=t;const s=[],a=o.layers||{};return e.forEach((e=>{const{lineObj:t,layerObj:l,areaObj:c,points:u}=e;let h={size:r,p:"y"},d={size:n,p:"x"};if("vertical"===o.orientation){const e=N(!0,{},d);d=N(!0,{},h),h=N(!0,{},e)}a.area&&!1!==c.show&&s.push(sh(u,{data:e.consumableData,item:c,generatorType:"area",major:d,minor:h,layerObj:l,stngs:o})),t&&!1!==t.show&&(s.push(sh(u,{data:e.consumableData,item:t,generatorType:"line".concat(h.p.toUpperCase(),"1"),major:d,minor:h,layerObj:l,stngs:o},"none")),!i&&a.area&&!1!==c.show&&!1!==t.showMinor0&&s.push(sh(u,{data:e.consumableData,item:t,generatorType:"line".concat(h.p.toUpperCase(),"0"),major:d,minor:h,layerObj:l,stngs:o},"none")))})),s}(o,{width:n,height:r,missingMinor0:i,stngs:this.stngs})}};function ch(e,t){let n,r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,r=t.center.y):(n=t.clientX,r=t.clientY);const o=n-e.state.boundingRect.left,s=r-e.state.boundingRect.top;return{x:i?Math.max(0,Math.min(o,e.rect.width)):o,y:i?Math.max(0,Math.min(s,e.rect.height)):s}}function uh(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function hh(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-r}}const dh={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=ch(this,e,!1);ea({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=this.settings.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"}))),this.state.start=ch(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=ch(this,e),function(e){if(e.state.active){const t=uh(e,e.state.start),n=uh(e,e.state.end),r=e.chart.shapesAt(hh(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([N({type:"rect"},hh(t.state.start,t.state.end),t.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{Array.isArray(e.contexts)&&e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function fh(e,t,n){let{renderer:r,style:i,props:o,h:s}=n;const a=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,r){return r.content({h:e,style:n,data:t})}(s,e,i,o),c=s("div",{dir:o.direction,class:$u(N({"pic-tooltip":!0},a.tooltip)),style:N({position:"relative",display:"inline-block"},t.computedTooltipStyle)},s("div",{style:i.content,class:$u(N({"pic-tooltip-content":!0},a.content))},l),s("div",{class:$u(N({"pic-tooltip-arrow":!0},a.arrow)),style:N({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(c),r.element().children[0]}function ph(e){let{defaultDuration:t,defaultDelay:n}=e,r=null,i=null,o=!1;const s=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach((t=>t(e)))},e.on=(e,n)=>{Array.isArray(e)?e.forEach((e=>t[e].push(n))):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach((e=>{t[e].length=0}))},e}(),a=function(){},l=()=>{r=null,i=null,o=!1,s.set("fulfilled")};return a.invoke=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;r&&(clearTimeout(r),s.set("debounced")),s.set("pending"),r=setTimeout((()=>{e(),o=!0,r=null,s.set("active")}),c),a>0&&(i&&clearTimeout(i),i=setTimeout(l,a+Math.max(c,0)))},a.clear=()=>{o?s.set("cancelled"):r&&(clearTimeout(r),s.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},a.on=(e,t)=>{s.on(e,t)},a.destroy=()=>{a.clear(),s.destroy()},a}function gh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)")}}function mh(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n}}}function yh(e){return{left:{left:"100%",top:"calc(50% - ".concat(e,"px)"),borderWidth:"".concat(e,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% - ".concat(e,"px)"),borderWidth:"".concat(e,"px")},top:{left:"calc(50% - ".concat(e,"px)"),top:"100%",borderWidth:"".concat(e,"px")},bottom:{left:"calc(50% - ".concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(e,"px")}}}function bh(e,t,n,r,i,o){const s=t+o.x,a=n+o.y,l=i;return!(s<0||a<0)&&!(s+r>e.width||a+l>e.height)}function vh(e){let{area:t,vx:n,vy:r,width:i,height:o,offset:s}=e;const a=n+s.x,l=r+s.y,c=i,u=o;let h=a<0?-a:0,d=l<0?-l:0;return h+=a+c>t.width?-(a+c-t.width):0,d+=l+u>t.height?-(l+u-t.height):0,{x:h,y:d}}function xh(e){let{options:t,pointer:n,width:r,height:i,dockOrder:o,x:s,y:a}=e;const{targetBounds:l}=n,c=gh(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(s,"px"),top:"".concat(a,"px"),transform:u},computedArrowStyle:yh(t.offset)[t.dock],dock:t.dock};const h={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},d=mh(r,i,t.offset),f=[],p="target"===t.area?s:l.left+s,g="target"===t.area?a:l.top+a;for(let e=0;e<o.length;e+=1){const n=o[e],l=vh({area:h,vx:p,vy:g,width:r,height:i,offset:d[n]}),u={left:"".concat(s,"px"),top:"".concat(a,"px"),transform:c[n]},m=yh(t.offset)[n];0!==l.x&&(u.width="".concat(r-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(s+l.x,"px"),m.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:m,dock:n,rect:{width:r,height:i}};if(0===l.x&&0===l.y)return y;y.offset=l,f.push(y)}return f.sort(((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x))),f[0]}function wh(e,t,n){const r=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!r)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const i=r.rect;return N({scaleRatio:i.scaleRatio},i.computedInner)}const kh={bounds:function(e){let{resources:t,nodes:n,pointer:r,width:i,height:o,options:s}=e;const{targetBounds:a}=r,{x:l,y:c,width:u,height:h}=t.getNodeBoundsRelativeToTarget(n[0]),d={left:{x:l,y:c+h/2},right:{x:l+u,y:c+h/2},top:{x:l+u/2,y:c},bottom:{x:l+u/2,y:c+h}},f=gh(s.offset),p=f[s.dock];if(p)return{computedTooltipStyle:{left:"".concat(d[s.dock].x,"px"),top:"".concat(d[s.dock].y,"px"),transform:p},computedArrowStyle:yh(s.offset)[s.dock],dock:s.dock};const g={width:"target"===s.area?a.width:window.innerWidth,height:"target"===s.area?a.height:window.innerHeight},m=mh(i,o,s.offset),y=["top","left","right","bottom"];for(let e=0;e<y.length;e+=1){const t=y[e];if(bh(g,"target"===s.area?d[t].x:a.left+d[t].x,"target"===s.area?d[t].y:a.top+d[t].y,i,o,m[t]))return{computedTooltipStyle:{left:"".concat(d[t].x,"px"),top:"".concat(d[t].y,"px"),transform:f[t]},computedArrowStyle:yh(s.offset)[t],dock:t}}return{computedTooltipStyle:{left:"".concat(d.top.x,"px"),top:"".concat(d.top.y,"px"),transform:f.top},computedArrowStyle:yh(s.offset).top,dock:"top"}},pointer:function(e){let{options:t,pointer:n,width:r,height:i}=e;const{x:o,y:s}=n;return xh({x:o,y:s,pointer:n,width:r,height:i,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let{options:t,pointer:n,width:r,height:i,nodes:o,resources:s}=e;const a=o[0],{dx:l,dy:c}=n,u=s.getComponentBoundsFromNode(a),h=l+u.x+u.width/2,d=c+u.y+u.height/2,{start:f,end:p,outerRadius:g}=a.desc.slice,m=(f+p)/2-Math.PI/2,y=2*Math.PI,b=(m%y+y)%y;let v=["top","left","right","bottom"];return"auto"===t.dock&&(v=b<=Math.PI/4||b>=7*Math.PI/4?["right","top","bottom","left"]:b<=3*Math.PI/4?["bottom","left","right","top"]:b<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),xh({x:h+g*u.scaleRatio.x*Math.cos(b),y:d+g*u.scaleRatio.y*Math.sin(b),pointer:n,width:r,height:i,options:t,dockOrder:v})}};function Mh(e,t){let{width:n,height:r}=e,{chart:i,state:o,props:s}=t;const a={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:e=>wh(e,o.pointer,i),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const r=wh(e,t,n),i=e.bounds;return{x:r.x+t.dx+i.x,y:r.y+t.dy+i.y,width:i.width,height:i.height}}(e,o.pointer,i)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:r},l=typeof s.placement;if("object"===l&&"function"==typeof s.placement.fn)return s.placement.fn(a);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=N(c,s.placement(a))),"object"===l&&kh[s.placement.type]?c=N(c,s.placement):"string"===l&&kh[s.placement]&&(c=N(c,{type:s.placement})),a.options=c;const u=kh[c.type](a);let{x:h,y:d,width:f,height:p}=a.resources.getComponentBoundsFromNode(a.nodes[0]);return h+=a.pointer.dx,f+=h,d+=a.pointer.dy,p+=d,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,h,parseFloat(u.computedTooltipStyle.left)),f),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,d,parseFloat(u.computedTooltipStyle.top)),p),"px"),u}let _h;function Sh(){_h=null}const qh={duration:8e3,delay:500,filter:e=>e.filter((e=>e.data&&void 0!==e.data.value)),extract:e=>e.node.data.value,content:e=>{let{h:t,data:n}=e;return n.map((e=>t("div",{},e)))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every(((e,n)=>t[n]&&JSON.stringify(e.data)===JSON.stringify(t[n].data))),placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0};const Dh={require:["chart","renderer"],defaultSettings:{settings:qh,style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide(){this.hide()},show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,{nodes:n,duration:r,delay:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let{chart:n,state:r}=t,i=0,o=0;e.center?(i+=e.center.x,o+=e.center.y):(i+=e.clientX,o+=e.clientY);const s=n.element.getBoundingClientRect(),a=r.targetElement.getBoundingClientRect(),l=i,c=o,u=s.left-a.left,h=s.top-a.top,d=i-s.left,f=o-s.top;return i-=a.left,o-=a.top,{x:i,y:o,dx:u,dy:h,cx:d,cy:f,clientX:l,clientY:c,targetBounds:a,chartBounds:s}}(e,this),t=Array.isArray(n)?this.props.filter(n):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke((()=>this.invokeRenderer(this.state.activeNodes)),r,i)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=ph({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",(()=>{!function(e){_h&&_h!==e&&_h()}(t),_h=t,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(()=>{const e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,N({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,N({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),_h===t&&(_h=null),this.state.tooltipElm=void 0})),this.dispatcher.on("active",(()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}))},created(){this.init(this.settings)},beforeUpdate(e){let{settings:t}=e;this.dispatcher&&(this.dispatcher.destroy(),Sh()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),Sh()},appendTo(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;const{width:e,height:t}=this.state.targetElement.getBoundingClientRect();this.renderer.destroy(),this.renderer.size({width:e,height:t}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let{chart:n,scale:r,props:i,h:o}=t;const s={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},a=[];return e.forEach((e=>{if("function"==typeof i.extract){const t=N({node:e},s);a.push(i.extract(t))}})),a}(e,this),n=Mh(fh(t,{style:{left:"0px",top:"0px",visibility:"hidden"}},this).getBoundingClientRect(),this);this.state.tooltipElm=fh(t,n,this)}};const Ch={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes(this.props.selector).filter((e=>e.key===this.props.target)),t=e.filter((e=>e.collider)).map((e=>e.collider));t.forEach((e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}},Eh=2*Math.PI;function Ah(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function Th(e,t,n,r,i){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*r+e**3*i}function Nh(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||function(e,t,n,r){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+r.x-(n.x+n.x))+Math.abs(t.y+r.y-(n.y+n.y))}(e,t,n,r)<=10)return i[i.length-1]!==e&&i.push(e),i.push(r),i;const s=Ah(e,t),a=Ah(t,n),l=Ah(n,r),c={x:Th(.5,e.x,t.x,n.x,r.x),y:Th(.5,e.y,t.y,n.y,r.y)},u=Ah(s,a),h=Ah(a,l);return Nh(e,s,u,c,i,o-1),Nh(c,h,l,r,i,o-1),i}function Rh(e,t,n){const{cp1:r,cp2:i}=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return Nh(e,r,i,n)}function Oh(e,t,n){const r=[],i=!!e[4],o=!!e[5],s=e[3];let a,l,c,u,h=e[6],d=e[7],f=e[1],p=e[2];if("a"===e[0]&&(h+=t,d+=n),t===d&&n===d)return r;if(!f||!p)return r.push({x:h,y:d}),r;({cx:a,cy:l,rx:f,ry:p,sweepAngle:c,startAngle:u}=function(e,t,n,r,i,o,s,a,l){let c,u,h,d,f,p;const g=gs(n%360),m=Math.cos(g),y=Math.sin(g),b=(a-o)/2,v=(l-s)/2,x=m*b+y*v,w=m*v-y*b;p=x**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,p>1&&(p=Math.sqrt(p),e*=p,t*=p);const k=e*w,M=t*x,_=k**2+M**2,S=(e*t)**2-_;let q=Math.sqrt(Math.max(S/_,0));r===i&&(q=-q);const D=q*(k/t),C=q*(-M/e);d=m*D-y*C+(a+o)/2,f=y*D+m*C+(l+s)/2;const E=(x-D)/e,A=(w-C)/t,T=(-x-D)/e,N=(-w-C)/t;return c=Math.atan2(A,E),c+=c<0?Eh:0,u=Math.atan2(N,T),u+=u<0?Eh:0,h=u-c,!i&&c<u?h-=Eh:i&&u<c&&(h+=Eh),h%=Eh,{startAngle:c,sweepAngle:h,cx:d,cy:f,rx:e,ry:t}}(f,p,s,i,o,h,d,t,n));const g=Math.abs(c*Math.sqrt((f**2+p**2)/2)),m=Math.ceil(g/10),y=c/m;for(let e=1;e<=m;e++){const t=(u+y*e)%Eh,n=Math.cos(t),i=Math.sin(t);r.push({x:a+n*f+-i*n,y:l+i*p+n*i})}return r}function Ih(e){const t=M.parsePath(e),n=[],r=[];let i=0,o=0,s=null,a=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],h=u[0];switch("S"!==h&&"s"!==h&&"C"!==h&&"c"!==h&&(s=null,a=null),"T"!==h&&"t"!==h&&"Q"!==h&&"q"!==h&&(l=null,c=null),h){case"m":r.length&&n.push(r.splice(0));case"l":i+=u[1],o+=u[2],r.push({x:i,y:o});break;case"M":r.length&&n.push(r.splice(0));case"L":i=u[1],o=u[2],r.push({x:i,y:o});break;case"H":i=u[1],r.push({x:i,y:o});break;case"h":i+=u[1],r.push({x:i,y:o});break;case"V":o=u[1],r.push({x:i,y:o});break;case"v":o+=u[1],r.push({x:i,y:o});break;case"a":r.push(...Oh(u,i,o)),i+=u[6],o+=u[7];break;case"A":r.push(...Oh(u,i,o)),i=u[6],o=u[7];break;case"c":r.push(...Nh({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o},{x:u[5]+i,y:u[6]+o})),s=u[3]+i,a=u[4]+o,i+=u[5],o+=u[6];break;case"C":r.push(...Nh({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),s=u[3],a=u[4],i=u[5],o=u[6];break;case"s":null!==s&&null!==s||(s=i,a=o),r.push(...Nh({x:i,y:o},{x:2*i-s,y:2*o-a},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),s=u[1]+i,a=u[2]+o,i+=u[3],o+=u[4];break;case"S":null!==s&&null!==s||(s=i,a=o),r.push(...Nh({x:i,y:o},{x:2*i-s,y:2*o-a},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),s=u[1],a=u[2],i=u[3],o=u[4];break;case"Q":r.push(...Rh({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],i=u[3],o=u[4];break;case"q":r.push(...Rh({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),l=u[1]+i,c=u[2]+o,i+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...Rh({x:i,y:o},{x:l,y:c},{x:u[1],y:u[2]})),i=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...Rh({x:i,y:o},{x:l,y:c},{x:u[1]+i,y:u[2]+o})),i+=u[1],o+=u[2];break;case"z":case"Z":r.length&&r.push({x:r[0].x,y:r[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];Math.abs(n.x-r.x)<1e-12&&Math.abs(n.y-r.y)<1e-12&&(e.splice(t,1),t--)}}(r),n.push(r.splice(0)),n}const Ph={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter((e=>e.key===this.props.target)),t=[];e.forEach((e=>{Ih(e.attrs.d).forEach((e=>{e.forEach((e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var Lh=[function(e){e.component("box",el),e.component("box-marker",el)},function(e){e.component("point",al),e.component("point-marker",al)},function(e){e.component("pie",hl)},function(e){e.component("grid-line",ml)},function(e){e.component("ref-line",Ml)},function(e){e.component("axis",Wl)},function(e){e.component("container",Ul)},function(e){e.component("text",Xl)},function(e){e.component("scrollbar",Zl)},function(e){e.component("brush-range",fc),e.component("brush-area-dir",yc)},function(e){e.component("range",wc)},function(e){e.component("brush-lasso",Dc)},function(e){e.component("labels",zu)},function(e){e.component("legend-cat",Zu)},function(e){e.component("legend-seq",ih)},function(e){e.component("line",lh)},function(e){e.component("brush-area",dh)},function(e){e.component("tooltip",Dh)},function(e){e.component("debug-collider",Ch)},function(e){e.component("debug-path-to-points",Ph)}];let jh=class{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let e=[];const t=this.children.length;let n,r;for(n=0;n<t;n++)r=this.children[n],e.push(r),r.children.length&&(e=[...e,...r.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map((e=>e.toJSON()))}}};class zh{constructor(){let{x:e=0,y:t=0,width:n=0,height:r=0,minWidth:i=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x:e,y:t,width:n,height:r,minWidth:i,minHeight:o})}set(){let{x:e=0,y:t=0,width:n=0,height:r=0,minWidth:i=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="rect",n>=0?(this.x=e,this.width=Math.max(n,i)):(this.x=e+Math.min(n,-i),this.width=-Math.min(n,-i)),r>=0?(this.y=t,this.height=Math.max(r,o)):(this.y=t+Math.min(r,-o),this.height=-Math.min(r,-o))}containsPoint(e){return ea(this,e)}intersectsLine(e){return ta(this,$(e))}intersectsRect(e){return Zs(this,V(e))}intersectsCircle(e){return Us(e,this)}intersectsPolygon(e){return Js(e,this)}intersectsGeoPolygon(e){return ca(e,this)}points(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}class Fh{constructor(){let{cx:e=0,cy:t=0,r:n=0,minRadius:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({cx:e,cy:t,r:n,minRadius:r})}set(){let{cx:e=0,cy:t=0,r:n=0,minRadius:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="circle",this.cx=e,this.cy=t,this.r=Math.max(n,r),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return Ws(this,e)}intersectsLine(e){return Ys(this,$(e))}intersectsRect(e){return Us(this,V(e))}intersectsCircle(e){return n=e,!Hs(t=this)&&!Hs(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return Ks(this,e)}intersectsGeoPolygon(e){return sa(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class Hh{constructor(){let{x1:e=0,y1:t=0,x2:n=0,y2:r=0,tolerance:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x1:e,y1:t,x2:n,y2:r,tolerance:i})}set(){let{x1:e=0,y1:t=0,x2:n=0,y2:r=0,tolerance:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="line",this.x1=e,this.y1=t,this.x2=n,this.y2=r,this.tolerance=Math.max(0,Math.round(i)),this.vectors=this.points(),this.zeroSize=e===n&&t===r}containsPoint(e){if(this.tolerance>0){return Ys({cx:e.x,cy:e.y,r:this.tolerance},this)}return ra(this,e)}intersectsLine(e){return na(this,$(e))}intersectsRect(e){return ta(V(e),this)}intersectsCircle(e){return Ys(e,this)}intersectsPolygon(e){return Gs(e,this)}intersectsGeoPolygon(e){return la(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class Bh{constructor(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polygon",this.vertices=e.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return Xs(this,e)}intersectsCircle(e){return Ks(e,this)}intersectsLine(e){return Gs(this,$(e))}intersectsRect(e){return Js(this,V(e))}intersectsPolygon(e){return ia(this,e)}intersectsGeoPolygon(e){return oa(e,this)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function Vh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Bh(...t)}function $h(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function Wh(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}class Uh{constructor(){let{vertices:e=[[]]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="geopolygon",this.vertices=e.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)Wh(this.vertices[e]),this.vertices[e].length>2&&$h(this.vertices[e]),this.polygons[e]=Vh({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return aa(this,e)}intersectsCircle(e){return sa(e,this)}intersectsLine(e){return la(this,$(e))}intersectsRect(e){return ca(this,V(e))}intersectsPolygon(e){return oa(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Zs(n,r)&&(Qs(r,n)?$s(t,e):$s(e,t))}(this,e)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function Yh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Uh(...t)}class Kh{constructor(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({points:e})}set(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polyline",this.segments=[],this._points=e.slice(),this._points.length>1)for(let e=0,r=this._points.length-1;e<r;e++)t=this._points[e],n=this._points[e+1],(t.x!==n.x||t.y!==n.y)&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y});var t,n}containsPoint(e){return this.segments.some((t=>ra(t,e)))}intersectsCircle(e){return this.segments.some((t=>Ys(e,t)))}intersectsLine(e){const t=$(e);return this.segments.some((e=>na(e,t)))}intersectsRect(e){const t=V(e);return this.segments.some((e=>ta(t,e)))}intersectsPolygon(e){return this.segments.some((t=>Gs(e,t)))}intersectsGeoPolygon(e){return this.segments.some((t=>la(e,t)))}points(){return this._points}}const Xh=Xe();function Gh(e,t){return Xh.get(e)(t)}Xh.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new zh(...t)})),Xh.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Fh(...t)})),Xh.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Hh(...t)})),Xh.add("polygon",Vh),Xh.add("geopolygon",Yh),Xh.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Kh(...t)}));class Jh{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach((e=>{const t=Gh(e.type,e);t&&this.geometries.push(t)}))}containsPoint(e){return this.geometries.some((t=>t.containsPoint(e)))}intersectsLine(e){return this.geometries.some((t=>t.intersectsLine(e)))}intersectsRect(e){return this.geometries.some((t=>t.intersectsRect(e)))}intersectsCircle(e){return this.geometries.some((t=>t.intersectsCircle(e)))}intersectsPolygon(e){return this.geometries.some((t=>t.intersectsPolygon(e)))}intersectsGeoPolygon(e){return this.geometries.some((t=>t.intersectsGeoPolygon(e)))}}class Zh{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new Zh).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,r,i;if(e instanceof Zh&&(e=e._elements),Array.isArray(e)){for(r=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(i=0;i<3;i++)r[t][n]+=this._elements[t][i]*e[i][n];this._elements=r}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,r,i,o){return this.multiply([[e,n,i],[t,r,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],r=this._elements[1][0],i=this._elements[1][1],o=this._elements[1][2],s=this._elements[2][0],a=this._elements[2][1],l=this._elements[2][2],c=0;return c=e*i*l+t*o*s+n*r*a-n*i*s-t*r*l-e*o*a,c}invert(){let e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],r=this._elements[0][2],i=this._elements[1][0],o=this._elements[1][1],s=this._elements[1][2],a=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-s*l,r*l-n*c,n*s-r*o],[s*a-i*c,t*c-r*a,r*i-t*s],[i*l-o*a,a*n-t*l,t*o-n*i]],this.multiply(1/e),this}transpose(){const e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map((e=>e.join("\t"))).join("\n"))}isIdentity(){const e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}transformPoint(e){let t,n,r=[e.x,e.y,1],i=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=r[n]*i[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,r,i,o,s=this._elements,a=[];for(i=0;i<e.length;i++){for(t=[e[i].x,e[i].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)o[n]+=t[r]*s[n][r];a.push({x:o[0],y:o[1]})}return a}get elements(){const e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}const Qh=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function ed(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const r=t.args[1],i=t.args[2];e.translate(r,i),e.rotate(n),e.translate(-r,-i)}else 1===t.args.length&&e.rotate(n)}function td(e,t){const n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function nd(e,t){const n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function rd(e,t){t.args.length>=6&&e.transform(...t.args)}function id(e,t){const n=function(e){let t,n=[];for(;null!==(t=Qh.exec(e));){const e=t[2].trim(),r=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:r.filter((e=>e.trim().length>0)).map((e=>Number(e)))})}return n}(e);let r;for(let e=0,i=n.length;e<i;e++)r=n[e],"rotate"===r.cmd?ed(t,r):"scale"===r.cmd?td(t,r):"matrix"===r.cmd?rd(t,r):"translate"===r.cmd&&nd(t,r)}const od={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},sd={type:(e,t)=>t.filter((t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()})),attr:(e,t,n,r)=>r.filter((r=>{const i=r.attrs[e];if(!t)return void 0!==i;if(void 0===i)return!1;switch(t){case"=":return n===String(i);case"!=":return n!==String(i);default:return!1}})),universal:e=>e,tag:(e,t)=>t.filter((t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))};function ad(e,t){if(!t||!t.length||!e||"function"!=typeof sd[e.type])return[];switch(e.type){case"type":case"tag":return sd[e.type](e.value,t);case"attr":return sd[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return sd[e.type](t);default:return[]}}var ld={find:function(e,t){const n=[],r=[];let i,o;if(t.isBranch){let s;i=function(e){const t=[];let n,r,i,o;return e.split(/\s*,\s*/).forEach((e=>{e=e.trim(),n=[];const s=t=>{i=e.match(od[t]),i&&(o=!0,e=e.slice(i[0].length),r={type:t,value:i[0]},"attr"===t&&(i=i[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),r.attribute=i[1],r.operator=i[2],r.attributeValue=i[3]),n.push(r))};for(;e&&(o=!1,i=e.match(/^\s*([>+~]|\s)\s*/),i&&(o=!0,n.push({type:" ",value:i[0]}),e=e.slice(i[0].length)),Object.keys(od).forEach(s),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););})),t}(e),o=t.descendants;for(let e=0,t=i.length;e<t;e++){s=i[e];const t=[];let n=o.slice(),a=!1;s.reverse().forEach((e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(a=!1);n=ad(e,n),a=!0})),a&&t.push(n);const l=t[0].filter((e=>{let n,r=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(r);r&&n<0;)r=r.parent,n=t[e].indexOf(r);if(n<0)return!1}return!0}));r.push(l)}for(let e=0,t=r.length;e<t;e++)for(let t=0,i=r[e].length;t<i;t++)n.indexOf(r[e][t])<0&&n.push(r[e][t])}return n||[]}};function cd(e,t,n){const r=e.type;let i=e.points();n&&(i=i.every((e=>Array.isArray(e)))?i.map((e=>n.transformPoints(e))):n.transformPoints(i)),function(e,t){for(let n=0,r=e.length;n<r;n++)e[n].x/=t,e[n].y/=t}(i,t);let o=null;if("rect"===r||"bounds"===r)o=V(i),o.type=r;else if("circle"===r)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(i,e.r),o.type=r;else if("line"===r)o=$(i),o.type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:fs(i,"polygon"===r)}}else if("geopolygon"===r){let e="";for(let t=0;t<i.length;t++)e+=fs(i[t],!0);o={type:"path",d:e}}return o}class ud{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{x:n,y:r,width:i,height:o}=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n,y:r,width:i,height:o}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((e=>cd(e,t,n)))}:cd(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map((e=>new ud(e))),this._parent=()=>e.parent?new ud(e.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,r=this._getElementBoundingRect();let i=r.left,o=r.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const{left:t=0,top:n=0}=e.getBoundingClientRect();i-=t,o-=n}return n.x+=i,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function hd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ud(...t)}class dd{constructor(e){this._node=hd(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function fd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new dd(...t)}function pd(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=fd(n);const e=n.parent;e&&"stage"!==e.type&&pd(e,t.parent)}}function gd(e,t,n){if(null===e.colliderType)return null;const r=function(e,t){let n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{const r={x:t.cx,y:t.cy};({x:n.cx,y:n.cy}=e.inverseModelViewMatrix.transformPoint(r)),n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((e=>Array.isArray(e)))?Yh(n):Vh(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let r=e.descendants.length-1;r>=0;r--){const i=e.descendants[r];if(null!==i.collider&&i.collider[t](n)){const e=fd(i);return pd(i,e),e}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){const t=fd(e);return pd(e,t),t}return null}(e,t,r)}function md(e,t,n,r){const i=e.length;for(let o=0;o<i;o++){const i=e[o],s=gd(i,t,r);s&&n.push(s),!i.children||s||i.collider||md(i.children,t,n,r)}}function yd(e,t,n){const r=e.length;for(let i=0;i<r;i++){const r=e[i];if(null!==gd(r,t,n))return!0;if(r.children&&!r.collider)return yd(r.children,t,n)}return!1}function bd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(W(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=B(e).map((e=>vs(e,t))),["intersectsRect",n];case"line":return n=H(e).map((e=>vs(e,t))),["intersectsLine",n];case"point":return n=vs(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map((e=>vs(e,t))),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map((e=>e.map((e=>vs(e,t))))),["intersectsGeoPolygon",n];default:return[]}}function vd(e,t){const[n,r]=bd(t,e.dpi),i=[];return n&&(md([e],n,i,r),function(e,t){for(let n=0,r=t.length;n<r;n++)t[n].input=e}(t,i)),i}function xd(e,t){const[n,r]=bd(t,e.dpi);return yd([e],n,r)}class wd extends jh{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const{data:t,desc:n,tag:r,strokeReference:i,fillReference:o}=e;var s,a;s=this.attrs,a=e,Object.keys(ds).forEach((e=>{const t=a[e];void 0!==t&&(s[ds[e]]=t)})),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=N(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return ld.find(e,this).map((e=>hd(e)))}getItemsFrom(e){return vd(this,e)}containsPoint(e){return xd(this,e)}intersectsLine(e){return xd(this,e)}intersectsRect(e){return xd(this,e)}intersectsCircle(e){return xd(this,e)}intersectsPolygon(e){return xd(this,e)}intersectsGeoPolygon(e){return xd(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Zh;void 0!==this.attrs.transform&&id(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Zh;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),r=e.attrs,i=Object.keys(r);if(n.length!==i.length)return!1;for(let e=0;e<n.length;e++){const i=n[e];if(!Object.hasOwnProperty.call(r,i))return!1;if(t[i]!==r[i])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(e){this._mvm=e,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(e){this._node=e}get node(){return this._node}set collider(e){const t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Jh(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=Gh("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=Gh(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class kd extends jh{addChild(e){if(!(e&&e instanceof jh))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const Md=kd.prototype;class _d extends wd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const{collider:t}=e,n=N({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},[r,,i]=e.bounds(t),{x:o,y:s}=r,{x:a,y:l}=i,c=isNaN(n.width)?a:Math.max(a,n.width+n.x),u=isNaN(n.height)?l:Math.max(l,n.height+n.y);n.x=isNaN(n.x)?o:Math.min(o,n.x),n.y=isNaN(n.y)?s:Math.min(s,n.y),n.width=c-n.x,n.height=u-n.y,this.__boundingRect[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=N({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}addChild(e){const t=Md.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=N({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=Md.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=N({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;if(Md.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=N(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(Md.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=N(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function Sd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new _d(...t)}class qd extends _d{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const Dd=kd.prototype,Cd=["x1","x2","y1","y2","id","offset","style"];class Ed extends wd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=Cd.length;r!==i;r++)n=Cd[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return Dd.addChild.call(this,e)}addChildren(e){return Dd.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return Dd.removeChild.call(this,e),this}removeChildren(e){return Dd.removeChildren.call(this,e),this}}function Ad(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ed(...t)}const Td=kd.prototype,Nd=["patternUnits","x","y","width","height","id"];class Rd extends wd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=Nd.length;r!==i;r++)n=Nd[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return Td.addChild.call(this,e)}addChildren(e){return Td.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return Td.removeChild.call(this,e),this}removeChildren(e){return Td.removeChildren.call(this,e),this}}class Od extends wd{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:r=0,height:i=0,rx:o=0,ry:s=0,collider:a}=e,l=N({type:"rect",x:t,y:n,width:r,height:i},a);super.set(e),r>=0?(this.attrs.x=t,this.attrs.width=r):(this.attrs.x=t+r,this.attrs.width=-r),i>=0?(this.attrs.y=n,this.attrs.height=i):(this.attrs.y=n+i,this.attrs.height=-i),o>0&&(this.attrs.rx=o),s>0&&(this.attrs.ry=s),this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=B(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[r,i,o,s]=F(n);return this.__boundingRect[e]={x:r,y:i,width:o-r,height:s-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}class Id extends wd{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cx:t=0,cy:n=0,r:r=0,collider:i}=e,o=N({type:"circle",cx:t,cy:n,r:r},i);super.set(e),this.attrs.cx=t,this.attrs.cy=n,this.attrs.r=r,this.collider=o,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const{cx:t,cy:n,r:r,r:i}=this.attrs,o=t-r,s=n-i;let a=2*r,l=2*i,c=[{x:o,y:s},{x:o+a,y:s},{x:o+a,y:s+l},{x:o,y:s+l}];if(e&&this.modelViewMatrix){c=this.modelViewMatrix.transformPoints(c);const[t,n,r,i]=F(c);a=r-t,l=i-n,this.__bounds[e]=[{x:t,y:n},{x:t+a,y:n},{x:t+a,y:n+l},{x:t,y:n+l}]}else this.__bounds[e]=c;return this.__bounds[e]}}class Pd extends wd{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x1:t=0,y1:n=0,x2:r=0,y2:i=0,collider:o}=e;super.set(e),this.attrs.x1=t,this.attrs.y1=n,this.attrs.x2=r,this.attrs.y2=i;const s={type:"line",x1:t,y1:n,x2:r,y2:i};this.collider=N(s,o),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=H(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const[n,r,i,o]=F(t),s=n!==i||r!==o;return this.__boundingRect[e]={x:n,y:r,width:s?Math.max(1,i-n):0,height:s?Math.max(1,o-r):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const Ld=Math.PI/2;function jd(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function zd(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const Fd={step:function(e){return new Ve(e,.5)},stepAfter:function(e){return new Ve(e,1)},stepBefore:function(e){return new Ve(e,0)},linear:xe,basis:function(e){return new Ce(e)},cardinal:Te.tension(0),catmullRom:Re,monotonex:function(e){return new je(e)},monotoney:function(e){return new ze(e)},natural:function(e){return new He(e)}};function Hd(e){if(e.length<2)return!1;const t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}class Bd extends wd{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=be();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const{major:t,minor:n,layerObj:r,points:i,stngs:o,generatorType:s}=e,a=Me(),l=o.coordinates?o.coordinates.defined:null;a[t.p]((e=>e.major*t.size))["".concat(n.p,"1")]((e=>e.minor*n.size))["".concat(n.p,"0")]((e=>e.minor0*n.size)).curve(Fd["monotone"===r.curve?"monotone".concat(t.p):r.curve]),l?a.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined)):a.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)));const c=o.connect?i.filter(a.defined()):i,u=("area"===s?a:a[s]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=Ih(this.attrs.d),this.segments.length>1&&this.segments.every((e=>Hd(e))))return void(this.collider=N({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach((t=>{if(t.length<=1);else if(Hd(t))this.collider=N({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=[],i=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const s=e[n-1],a=e[n],l=e[n+1],c=jd(a,s),u=jd(a,l),h=(c+u)/2,d=h+Math.PI,f=Math.max(h,d),p=Math.min(h,d),g=c>u;if(1===n){const e=jd(s,a);r.push(zd(s,e-Ld,t)),i.unshift(zd(s,e+Ld,t))}const m=g?f:p,y=g?p:f;if(r.push(zd(a,m,t)),i.unshift(zd(a,y,t)),n===o-1){const e=jd(l,a);r.push(zd(l,e+Ld,t)),i.unshift(zd(l,e-Ld,t))}}return{type:"polygon",vertices:[...r,...i]}}(t,n,e.collider)}else this.collider=N({type:"polyline",points:t},e.collider)}))}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:Ih(this.attrs.d),this.points=function(e){const t=[];let n,r=e.length;for(let i=0;i<r;i++){n=e[i];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,[n,r,i,o]=F(t);return this.__boundingRect[e]={x:n||0,y:r||0,width:i-n||0,height:o-r||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}function Vd(e){let{data:t,_boundingRect:n,_textBoundsFn:r}=e;return null!=t&&(n||r)}class $d extends wd{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,dx:r=0,dy:i=0,textBoundsFn:o,text:s,title:a,collider:l,boundingRect:c,ellipsed:u}=e;super.set(e),this.attrs.x=t,this.attrs.y=n,this.attrs.dx=r,this.attrs.dy=i,this.attrs.text=s,void 0!==a&&(this.attrs.title=String(a)),"object"==typeof c?this._textBoundsFn=()=>c:"function"==typeof o&&(this._textBoundsFn=o),"string"==typeof u&&(this.ellipsed=u),this.collider=N({type:Vd(this)?"bounds":null},l),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=B(e),r=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n,[i,o,s,a]=F(r);return this.__boundingRect[t]={x:i,y:o,width:s-i,height:a-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const Wd=Xe();function Ud(e,t){return Wd.get(e)(t)}Wd.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Od(...t)})),Wd.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Id(...t)})),Wd.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new $d(...t)})),Wd.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Pd(...t)})),Wd.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Bd(...t)})),Wd.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new qd(...t)})),Wd.add("container",Sd),Wd.add("defs",Sd),Wd.add("linearGradient",Ad),Wd.add("radialGradient",Ad),Wd.add("stop",Ad),Wd.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Rd(...t)}));const Yd=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.length-1]}return n.save=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=n(),o={};let s="";for(let t=0;t<e.length;t++)s=e[t],void 0!==i[s]&&(o[s]=i[s]);return N(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function Kd(e,t){if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)t[n](e)}function Xd(e,t,n){e.node=n[t],e.index=t}function Gd(e,t,n,r){let i=!1;const o={siblings:e,node:null,index:0};for(let s=0,a=e.length;s<a;s++){if(Xd(o,s,e),Kd(o,r.create),i="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,i)continue;o.node=Yd.save(o.node);const a=Ud(o.node.type,o.node);a&&(o.node.transform&&(n.save(),id(o.node.transform,n)),n.isIdentity()||(a.modelViewMatrix=n.clone()),t.addChild(a),o.node.children&&Gd(o.node.children,a,n,r),o.node.transform&&n.restore()),Yd.restore()}}function Jd(e){let{items:t,stage:n,dpi:r,on:i={}}=e;return n||(n=Ud("stage",r)),Gd(t,n,new Zh,i),n}function Zd(e,t,n){const{orientation:r,degree:i,stops:o=[]}=n;let s=null;if("radial"===r){const n=t.boundingRect();s=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else{const r=ms(i);["x1","x2","y1","y2"].forEach((e=>{e in n&&(r[e]=n[e])}));const o=t.boundingRect();s=e.createLinearGradient(o.x+r.x1*o.width,o.y+r.y1*o.height,o.x+r.x2*o.width,o.y+r.y2*o.height)}for(let e=0,t=o.length;e<t;e++){let t=o[e];s.addColorStop(t.offset,t.color)}return s}function Qd(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function ef(){let{x:e,y:t,width:n,height:r,scaleRatio:i,margin:o,edgeBleed:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const a={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return a.x=isNaN(e)?a.x:e,a.y=isNaN(t)?a.y:t,a.width=isNaN(n)?a.width:n,a.height=isNaN(r)?a.height:r,void 0!==i&&(a.scaleRatio.x=isNaN(i.x)?a.scaleRatio.x:i.x,a.scaleRatio.y=isNaN(i.y)?a.scaleRatio.y:i.y),void 0!==o&&(a.margin.left=isNaN(o.left)?0:o.left,a.margin.top=isNaN(o.top)?0:o.top),"object"==typeof s&&["left","right","top","bottom"].forEach((e=>{!isNaN(s[e])&&s[e]>0&&(a.edgeBleed[e]=s[e],a.edgeBleed.bool=!0)})),a.computedPhysical={x:Math.round(a.margin.left+(a.x-a.edgeBleed.left)*a.scaleRatio.x),y:Math.round(a.margin.top+(a.y-a.edgeBleed.top)*a.scaleRatio.y),width:Math.round((a.width+a.edgeBleed.left+a.edgeBleed.right)*a.scaleRatio.x),height:Math.round((a.height+a.edgeBleed.top+a.edgeBleed.bottom)*a.scaleRatio.y)},a}function tf(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:Tu,textBounds:Ru,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function nf(e){return t=>{let{node:n}=t;"text"===n.type&&function(e){return null!=e}(n.data)&&!n.textBoundsFn&&(n.textBoundsFn=e.textBounds)}}const rf=200,of=200;class sf{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,{rect:n,dpiRatio:r,canvasBufferSize:i}=e;t=i?"function"==typeof i?i(n):i:{width:n.computedPhysical.width+2*rf,height:n.computedPhysical.height+2*of},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*r),this.bufferCanvas.height=Math.round(t.height*r)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const af=Xe();function lf(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function cf(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function uf(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function hf(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Object.keys(r);for(let i=0,o=n.length;i<o;i++){let o=n[i];const s=o[0],a=o[1],l=o[2];if(s in t.attrs&&!(a in r)&&e[a]!==t.attrs[s]){const n=l?l(t.attrs[s]):t.attrs[s];"function"==typeof e[a]?e[a](n):e[a]=n}}for(let t=0,n=i.length;t<n;t++){const n=i[t];e[n]=r[n]}}function df(e,t,n,r){for(let i=0,o=e.length;i<o;i++){let o=e[i],s={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?s.fillStyle=Zd(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(s.fillStyle=r.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?s.strokeStyle=Zd(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(s.strokeStyle=r.patterns.create(o.attrs.stroke))),hf(t,o,n,s),o.modelViewMatrix&&uf(o.modelViewMatrix.elements,t),af.has(o.type)&&af.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&df(o.children,t,n,r),t.restore()}}function ff(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jd;const r={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let i,o=!1,s=ef();const a=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",lf]];let l;const c=tf();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(r).forEach((t=>{void 0!==e[t]&&(r[t]=e[t])})),r),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof r.transform||t||(t=new sf(e)),n.appendChild(e),e),c.getScene=r=>{const i=cf(t&&t.getContext()||e.getContext("2d")),o=s.scaleRatio.x,a=s.scaleRatio.y,l={type:"container",children:r,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*i*o,", ").concat(s.edgeBleed.top*i*a,")"):""};return 1===i&&1===o&&1===a||(l.transform+="scale(".concat(i*o,", ").concat(i*a,")")),n({items:[l],dpi:i,on:{create:[ku(c.measureText),nf(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let r={};return{create(e){const i=e.key;return i?(r[i]=r[i]||Qd(e,t,n),r[i]):Qd(e,t,n)},clear(){r={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),h=cf(u),d=t&&r.transform();if(d)return e.width=e.width,function(e){let{el:t,dpiRatio:n,transform:r}=e;if("object"==typeof r){const e=[r.horizontalScaling,r.horizontalSkewing,r.verticalSkewing,r.verticalScaling,r.horizontalMoving*n,r.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:h,transform:d}),t.apply(),!0;o&&(e.style.left="".concat(s.computedPhysical.x,"px"),e.style.top="".concat(s.computedPhysical.y,"px"),e.style.width="".concat(s.computedPhysical.width,"px"),e.style.height="".concat(s.computedPhysical.height,"px"),e.width=Math.round(s.computedPhysical.width*h),e.height=Math.round(s.computedPhysical.height*h),t&&t.updateSize({rect:s,dpiRatio:h,canvasBufferSize:r.canvasBufferSize}));const f=c.getScene(n),p=!i||!f.equals(i);l.clear();const g=o||p,m="function"==typeof r.progressive&&r.progressive();return g&&(m&&!m.isFirst||c.clear(),df(f.children,u,a,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,m&&!m.isFirst&&f.children.unshift(...i.children),i=f,g},c.itemsAt=e=>i?i.getItemsFrom(e):[],c.findShapes=e=>i?i.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),i=null,c),c.size=e=>{if(e){const t=ef(e);JSON.stringify(s)!==JSON.stringify(t)&&(o=!0,s=t)}return s},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),i=null},c}function pf(e,t){af.add(e,t)}function gf(e,t){return Math.max(0,Math.min(e,t))}const mf=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),yf=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),bf=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function vf(e){return mf.test(e)}function xf(e){return yf.test(e)||bf.test(e)}function wf(e){let t,n,r=e?e.length:0;for(t=0;t<r;t++){if(n=e[t],vf(n))return"ltr";if(xf(n))return"rtl"}return"ltr"}const kf={start:"end",end:"start",center:"center",middle:"middle"};function Mf(e,t){return"rtl"===t?kf[e]:e}function _f(e,t){const n=[];let r;const i=[],o=[],s=[];let a,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),a=e.map(c),l=t.map(c);for(let e=0,r=t.length;e<r;e++){-1===a.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?i.push(e[t]):s.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=_f([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=_f(s[e].children||[],o[e].content.children||[]),o[e].object=s[e].object,o[e].children=o[e].diff.items;return r=o.concat(n),n.isTree=!0,i.isTree=!0,o.isTree=!0,s.isTree=!0,r.isTree=!0,{added:n,updatedNew:o,updatedOld:s,removed:i,items:r}}function Sf(e,t,n){for(let r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function qf(e,t){for(let n=0,r=e.length;n<r;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function Df(e,t,n,r){let i;for(let o=0,s=e.length;o<s;o++)i=e[o],null!==i.object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(Sf(i.diff.added,i.object,t),qf(i.diff.removed,r),Df(i.diff.items,t,n,r)))}function Cf(e,t,n,r,i,o){const s=_f(e,t);return Sf(s.added,n,r),qf(s.removed,o),Df(s.items,r,i,o),s.items}pf("rect",(function(e,t){let{g:n,doFill:r,doStroke:i}=t;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,r,i,o,s){o=gf(r/2,o>0?o:s),s=gf(i/2,s>0?s:o),e.moveTo(t,n+s),e.lineTo(t,n+i-s),e.quadraticCurveTo(t,n+i,t+o,n+i),e.lineTo(t+r-o,n+i),e.quadraticCurveTo(t+r,n+i,t+r,n+i-s),e.lineTo(t+r,n+s),e.quadraticCurveTo(t+r,n,t+r-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+s)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),r&&n.fill(),i&&n.stroke()})),pf("circle",(function(e,t){let{g:n,doFill:r,doStroke:i}=t;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),r&&n.fill(),i&&n.stroke()})),pf("line",(function(e,t){let{g:n,doStroke:r}=t;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),r&&n.stroke()})),pf("path",(function(e,t){let{g:n,doStroke:r,doFill:i}=t;const o=new Path2D(e.d);i&&n.fill(o),r&&n.stroke(o)})),pf("text",(function(e,t){let{g:n,ellipsed:r,doStroke:i}=t;const o=r||Mu(e,Tu);e["font-weight"]?n.font="".concat(e["font-weight"]," ").concat(e["font-size"]," ").concat(e["font-family"]):n.font="".concat(e["font-size"]," ").concat(e["font-family"]);const s=wf(e.text);n.canvas.dir!==s&&(n.canvas.dir=s);const a=Mf("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);a&&n.textAlign!==a&&(n.textAlign=a);const l=_u(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),i&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}));const Ef="http://www.w3.org/2000/svg",Af=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(Ef,"container"===e?"g":e);return t.appendChild(n),n},Tf=e=>{e.parentNode&&e.parentNode.removeChild(e)},Nf=(e,t)=>{if((e=>{switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}})(t)){for(const n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||Mu(t.attrs,Tu);const n=wf(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",Mf(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(Ef,"title");n.textContent=t.attrs.title,e.appendChild(n)}else e.setAttribute(n,t.attrs[n]);else{const r=+e.getAttribute(n)||0;let i=0;i="dominant-baseline"===n?_u(t.attrs):t.attrs[n],e.setAttribute("dy",i+r)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class Rf{constructor(e,t,n,r){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=r}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function Of(){return new Rf(Cf,Af,Nf,Tf)}function If(e){let t,n,r,i=0;if(0===(e=JSON.stringify(e)).length)return i;for(t=0,r=e.length;t<r;t++)n=e.charCodeAt(t),i=(i<<5)-i+n,i&=i;return i}function Pf(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ef,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Jd;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Of)();let r,i,o,s=!1,a=ef();const l={transform:void 0},c=tf(),u={type:"defs",children:[]},h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:If,n={},r=Date.now();const i={onCreate(i){let o={};i.node&&"object"==typeof i.node.fill&&"pattern"===i.node.fill.type&&i.node.fill.shapes&&(o.fill=i.node.fill),i.node&&"object"==typeof i.node.stroke&&"pattern"===i.node.stroke.type&&i.node.stroke.shapes&&(o.stroke=i.node.stroke),Object.keys(o).forEach((s=>{let a="";const l=o[s],c=t(l),u="picasso-pattern-".concat(r,"-").concat(c);if("undefined"!=typeof window&&(a=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach((e=>{t.children.push(e)})),e.push(t),n[c]=!0}i.node["".concat(s,"Reference")]="url('".concat(a,"#").concat(u,"')")}))},clear(){n={}}};return i}(u.children),d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:If,n={},r=Date.now();const i={getOrCreateGradient(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=t(i[o]),l="picasso-gradient-".concat(r,"-").concat(a);if(!n[a]){let{orientation:t,degree:r,stops:s=[]}=i[o],c={};void 0===r&&(r=90),"radial"===t?c.type="radialGradient":(c=ms(r),["x1","x2","y1","y2"].forEach((e=>{e in i[o]&&(c[e]=i[o][e])})),c.type="linearGradient"),c.id=l,c.children=s.map((e=>{let{offset:t,color:n,opacity:r}=e;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==r?r:1)}})),e.push(c),n[a]=l}return"url('".concat(s,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=i.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=i.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return i}(u.children);return c.element=()=>r,c.root=()=>i,c.settings=e=>(e&&Object.keys(l).forEach((t=>{void 0!==e[t]&&(l[t]=e[t])})),l),c.appendTo=t=>(r||(r=t.ownerDocument.createElementNS(e,"svg"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none",r.setAttribute("xmlns",e),i=t.ownerDocument.createElementNS(e,"g"),i.style.pointerEvents="auto",r.appendChild(i)),t.appendChild(r),r),c.getScene=e=>{const n=a.scaleRatio.x,r=a.scaleRatio.y,i={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*n,", ").concat(a.edgeBleed.top*r,")"):""};return 1===n&&1===r||(i.transform+="scale(".concat(n,", ").concat(r,")")),t({items:[i],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},d.onCreate,h.onCreate,ku(c.measureText),nf(c)]}})},c.render=e=>{if(!r)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const{a:e,b:n,c:r,d:o,e:s,f:a}=t;return i.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(r,", ").concat(o,", ").concat(s,", ").concat(a,")"),!0}i.style.transform="",s&&(r.style.left="".concat(a.computedPhysical.x,"px"),r.style.top="".concat(a.computedPhysical.y,"px"),r.setAttribute("width",a.computedPhysical.width),r.setAttribute("height",a.computedPhysical.height)),d.clear(),h.clear(),u.children.length=0;const f=c.getScene(e),p=!o||!f.equals(o),g=s||p;return g&&(c.clear(),n.render(f.children,i)),s=!1,o=f,g},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!i)return c;o=null;const e=i.cloneNode(!1);return r.replaceChild(e,i),i=e,c},c.destroy=()=>{r&&r.parentNode&&r.parentNode.removeChild(r),r=null,i=null},c.size=e=>{if(e){const t=ef(e);JSON.stringify(a)!==JSON.stringify(t)&&(s=!0,a=t)}return a},c}var Lf,jf,zf,Ff,Hf,Bf,Vf,$f={},Wf=[],Uf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Yf(e,t){for(var n in t)e[n]=t[n];return e}function Kf(e){var t=e.parentNode;t&&t.removeChild(e)}function Xf(e,t,n){var r,i,o,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?Lf.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Gf(e,s,r,i,null)}function Gf(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++zf:i};return null==i&&null!=jf.vnode&&jf.vnode(o),o}function Jf(e){return e.children}function Zf(e,t){this.props=e,this.context=t}function Qf(e,t){if(null==t)return e.__?Qf(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Qf(e):null}function ep(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return ep(e)}}function tp(e){(!e.__d&&(e.__d=!0)&&Ff.push(e)&&!np.__r++||Hf!==jf.debounceRendering)&&((Hf=jf.debounceRendering)||Bf)(np)}function np(){var e,t,n,r,i,o,s,a;for(Ff.sort(Vf);e=Ff.shift();)e.__d&&(t=Ff.length,r=void 0,i=void 0,s=(o=(n=e).__v).__e,(a=n.__P)&&(r=[],(i=Yf({},o)).__v=o.__v+1,hp(a,o,i,n.__n,void 0!==a.ownerSVGElement,null!=o.__h?[s]:null,r,null==s?Qf(o):s,o.__h),dp(r,o),o.__e!=s&&ep(o)),Ff.length>t&&Ff.sort(Vf));np.__r=0}function rp(e,t,n,r,i,o,s,a,l,c){var u,h,d,f,p,g,m,y=r&&r.__k||Wf,b=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(f=n.__k[u]=null==(f=t[u])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?Gf(null,f,null,null,f):Array.isArray(f)?Gf(Jf,{children:f},null,null,null):f.__b>0?Gf(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=n,f.__b=n.__b+1,null===(d=y[u])||d&&f.key==d.key&&f.type===d.type)y[u]=void 0;else for(h=0;h<b;h++){if((d=y[h])&&f.key==d.key&&f.type===d.type){y[h]=void 0;break}d=null}hp(e,f,d=d||$f,i,o,s,a,l,c),p=f.__e,(h=f.ref)&&d.ref!=h&&(m||(m=[]),d.ref&&m.push(d.ref,null,f),m.push(h,f.__c||p,f)),null!=p?(null==g&&(g=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=l=ip(f,l,e):l=op(e,f,d,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=e&&(l=Qf(d))}for(n.__e=g,u=b;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=sp(r).nextSibling),gp(y[u],y[u]));if(m)for(u=0;u<m.length;u++)pp(m[u],m[++u],m[++u])}function ip(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?ip(r,t,n):op(n,r,r,i,r.__e,t));return t}function op(e,t,n,r,i,o){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<r.length;l+=1)if(a==i)break e;e.insertBefore(i,o),s=o}return void 0!==s?s:i.nextSibling}function sp(e){var t,n,r;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=sp(n)))return r;return null}function ap(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Uf.test(t)?n:n+"px"}function lp(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||ap(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||ap(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?up:cp,o):e.removeEventListener(t,o?up:cp,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function cp(e){return this.l[e.type+!1](jf.event?jf.event(e):e)}function up(e){return this.l[e.type+!0](jf.event?jf.event(e):e)}function hp(e,t,n,r,i,o,s,a,l){var c,u,h,d,f,p,g,m,y,b,v,x,w,k,M,_=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(c=jf.__b)&&c(t);try{e:if("function"==typeof _){if(m=t.props,y=(c=_.contextType)&&r[c.__c],b=c?y?y.props.value:c.__:r,n.__c?g=(u=t.__c=n.__c).__=u.__E:("prototype"in _&&_.prototype.render?t.__c=u=new _(m,b):(t.__c=u=new Zf(m,b),u.constructor=_,u.render=mp),y&&y.sub(u),u.props=m,u.state||(u.state={}),u.context=b,u.__n=r,h=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=_.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=Yf({},u.__s)),Yf(u.__s,_.getDerivedStateFromProps(m,u.__s))),d=u.props,f=u.state,u.__v=t,h)null==_.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==_.getDerivedStateFromProps&&m!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(m,b),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(m,u.__s,b)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=m,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),v=0;v<u._sb.length;v++)u.__h.push(u._sb[v]);u._sb=[],u.__h.length&&s.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(m,u.__s,b),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(d,f,p)}))}if(u.context=b,u.props=m,u.__P=e,x=jf.__r,w=0,"prototype"in _&&_.prototype.render){for(u.state=u.__s,u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),k=0;k<u._sb.length;k++)u.__h.push(u._sb[k]);u._sb=[]}else do{u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(r=Yf(Yf({},r),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(p=u.getSnapshotBeforeUpdate(d,f)),M=null!=c&&c.type===Jf&&null==c.key?c.props.children:c,rp(e,Array.isArray(M)?M:[M],t,n,r,i,o,s,a,l),u.base=t.__e,t.__h=null,u.__h.length&&s.push(u),g&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=fp(n.__e,t,n,r,i,o,s,l);(c=jf.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),jf.__e(e,t,n)}}function dp(e,t){jf.__c&&jf.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){jf.__e(e,t.__v)}}))}function fp(e,t,n,r,i,o,s,a){var l,c,u,h=n.props,d=t.props,f=t.type,p=0;if("svg"===f&&(i=!0),null!=o)for(;p<o.length;p++)if((l=o[p])&&"setAttribute"in l==!!f&&(f?l.localName===f:3===l.nodeType)){e=l,o[p]=null;break}if(null==e){if(null===f)return document.createTextNode(d);e=i?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,d.is&&d),o=null,a=!1}if(null===f)h===d||a&&e.data===d||(e.data=d);else{if(o=o&&Lf.call(e.childNodes),c=(h=n.props||$f).dangerouslySetInnerHTML,u=d.dangerouslySetInnerHTML,!a){if(null!=o)for(h={},p=0;p<e.attributes.length;p++)h[e.attributes[p].name]=e.attributes[p].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||lp(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||lp(e,o,t[o],n[o],r)}(e,d,h,i,a),u)t.__k=[];else if(p=t.props.children,rp(e,Array.isArray(p)?p:[p],t,n,r,i&&"foreignObject"!==f,o,s,o?o[0]:n.__k&&Qf(n,0),a),null!=o)for(p=o.length;p--;)null!=o[p]&&Kf(o[p]);a||("value"in d&&void 0!==(p=d.value)&&(p!==e.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&lp(e,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==e.checked&&lp(e,"checked",p,h.checked,!1))}return e}function pp(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){jf.__e(e,n)}}function gp(e,t,n){var r,i;if(jf.unmount&&jf.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||pp(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){jf.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&gp(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||Kf(e.__e),e.__=e.__e=e.__d=void 0}function mp(e,t,n){return this.constructor(e,n)}function yp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createElement:t=document.createElement.bind(document)}=e;let n,r,i=ef();const o={transform:void 0},s=tf();return s.element=()=>n,s.root=()=>n,s.settings=e=>(e&&Object.keys(o).forEach((t=>{void 0!==e[t]&&(o[t]=e[t])})),o),s.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),s.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const{a:e,b:r,c:i,d:o,e:s,f:a}=t;return n.style.transform="matrix(".concat(e,", ").concat(r,", ").concat(i,", ").concat(o,", ").concat(s,", ").concat(a,")"),!0}let s;return n.style.transform="",n.style.left="".concat(i.computedPhysical.x,"px"),n.style.top="".concat(i.computedPhysical.y,"px"),n.style.width="".concat(i.computedPhysical.width,"px"),n.style.height="".concat(i.computedPhysical.height,"px"),s=Array.isArray(e)?Xf("div",null,e):e,r=function(e,t,n){var r,i,o;jf.__&&jf.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],hp(t,e=(!r&&n||t).__k=Xf(Jf,null,[e]),i||$f,$f,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?Lf.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),dp(o,e)}(s,n,r),!0},s.renderArgs=[Xf],s.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;r=null}return s},s.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,r=null},s.size=e=>(e&&(i=ef(e)),i),s}Lf=Wf.slice,jf={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},zf=0,Zf.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Yf({},this.state),"function"==typeof e&&(e=e(Yf({},n),this.props)),e&&Yf(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),tp(this))},Zf.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),tp(this))},Zf.prototype.render=Jf,Ff=[],Bf="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Vf=function(e,t){return e.__v.__b-t.__v.__b},np.__r=0;var bp=[function(e){e.renderer("svg",Pf)},function(e){e.renderer("canvas",ff)},function(e){e.renderer("dom",yp)}];const vp={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const xp=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(){let{level:e=vp.OFF,pipe:t=console}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e;const r={[vp.OFF]:()=>{},[vp.ERROR]:function(){return t.error(...arguments)},[vp.WARN]:function(){return t.warn(...arguments)},[vp.INFO]:function(){return t.info(...arguments)},[vp.DEBUG]:function(){return t.log(...arguments)}},i=function(e){if(e&&!(n<e)){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];(r[e]||r[vp.DEBUG])(...i)}};return{log:i,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(vp.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(vp.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(vp.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(vp.DEBUG,...t)},level:e=>("number"==typeof e&&(n=e),n),LOG_LEVEL:vp}}(t.logger),i={component:Xe(n.component,"component",r),data:Xe(n.data,"data",r),formatter:Xe(n.formatter,"formatter",r),interaction:Xe(n.interaction,"interaction",r),renderer:ja(n.renderer),scale:Xe(n.scale,"scale",r),symbol:Xe(n.symbol,"symbol",r),logger:r};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:N({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},i)}return t.renderer&&t.renderer.prio&&i.renderer.default(t.renderer.prio[0]),o.use=function(e){return function(e){e(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i)},o.chart=e=>La(e,{registries:i,logger:r,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(i).forEach((e=>{o[e]=i[e]})),o.version=R,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:za,data:$a,formatter:xr,interaction:Wa,renderer:ja(),scale:ko,symbol:Cs});function wp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wp(Object(n),!0).forEach((function(t){Mp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Mp(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Lh.forEach(xp.use),bp.forEach(xp.use),[].forEach(xp.use);var _p=Object.prototype.hasOwnProperty,Sp=Object.prototype.toString,qp=Object.defineProperty,Dp=Object.getOwnPropertyDescriptor,Cp=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Sp.call(e)},Ep=function(e){if(!e||"[object Object]"!==Sp.call(e))return!1;var t,n=_p.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&_p.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||_p.call(e,t)},Ap=function(e,t){qp&&"__proto__"===t.name?qp(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Tp=function(e,t){if("__proto__"===t){if(!_p.call(e,t))return;if(Dp)return Dp(e,t).value}return e[t]},Np=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=Tp(a,n),a!==(i=Tp(t,n))&&(u&&i&&(Ep(i)||(o=Cp(i)))?(o?(o=!1,s=r&&Cp(r)?r:[]):s=r&&Ep(r)?r:{},Ap(a,{name:n,newValue:e(u,s,i)})):void 0!==i&&Ap(a,{name:n,newValue:i}));return a};function Rp(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=i.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),a=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(r)&&r.some(((e,t)=>e!==t))){const e=r.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function Op(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function Ip(e){let{cache:t,f:n,mainCell:r,p:i,prop:o,page:s,rowIdx:a,row:l,sourceKey:c,target:u,targetProp:h,columnOrder:d}=e,f=r;if(i.field&&i.field!==n){const e=Rp(i.field,s,{cache:t},d);if(-1===e)return;f=Np({qRow:a},e(l))}u[h]=Op(i,f,{key:c})}function Pp(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const s=t.raw(),a=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),h=Object.keys(c),d=!!i[e].trackBy,f=typeof i[e].trackBy,p={},g=[],m=[];for(let t=0;t<s.qDataPages.length;t++){const o=Rp(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let y=0;y<s.qDataPages[t].qMatrix.length;y++){const b=s.qDataPages[t].qArea.qTop+y,v=Np({qRow:b},o(s.qDataPages[t].qMatrix[y])),x=Op(u,v,{key:a});if(!(u.filter&&!u.filter(v))){for(let e=0;e<h.length;e++){const r=c[h[e]];let i=r.fields||[r];r.fields&&(x[h[e]]=[]);for(let o=0;o<i.length;o++)Ip({cache:n,f:l,mainCell:v,p:i[o],prop:h[e],props:c,page:s.qDataPages[t],rowIdx:b,row:s.qDataPages[t].qMatrix[y],sourceKey:a,target:r.fields?x[h[e]]:x,targetProp:r.fields?o:h[e],columnOrder:s.qColumnOrder});if(r.fields){const t=x[h[e]].map((e=>e.value)),n=x[h[e]].map((e=>e.label));x[h[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[h[e]].value)}}}d&&r.track({cfg:i[e],itemData:v,obj:x,target:g,tracker:p,trackType:f}),m.push(x)}}}const y=d?r.collect(g,{main:u,propsArr:h,props:c}):m;o=[...o,...y]}return o}function Lp(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function jp(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Fp)):void 0===t&&(t=zp);for(var n,r,i,o,s,a=new Vp(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new Vp(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(Bp)}function zp(e){return e.children}function Fp(e){return Array.isArray(e)?e[1]:null}function Hp(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Bp(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Vp(e){this.data=e,this.depth=this.height=0,this.parent=null}function $p(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}Vp.prototype=jp.prototype={constructor:Vp,count:function(){return this.eachAfter(Lp)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;e=n.pop(),t=r.pop();for(;e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return jp(this).eachBefore(Hp)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var Wp={depth:-1},Up={},Yp={};function Kp(e){return e.id}function Xp(e){return e.parentId}function Gp(){var e,t=Kp,n=Xp;function r(r){var i,o,s,a,l,c,u,h,d=Array.from(r),f=t,p=n,g=new Map;if(null!=e){const t=d.map(((t,n)=>function(e){e=`${e}`;let t=e.length;Zp(e,t-1)&&!Zp(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,r)))),n=t.map(Jp),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(Jp(e)),d.push(Yp));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,i=d.length;s<i;++s)o=d[s],c=d[s]=new Vp(o),null!=(u=f(o,s,r))&&(u+="")&&(h=c.id=u,g.set(h,g.has(h)?Up:c)),null!=(u=p(o,s,r))&&(u+="")&&(c.parent=u);for(s=0;s<i;++s)if(u=(c=d[s]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===Up)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===Yp&&1===a.children.length;)a=a.children[0],--i;for(let e=d.length-1;e>=0&&(c=d[e]).data===Yp;--e)c.data=null}if(a.parent=Wp,a.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(Bp),a.parent=null,i>0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=$p(e),r):t},r.parentId=function(e){return arguments.length?(n=$p(e),r):n},r.path=function(t){return arguments.length?(e=$p(t),r):e},r}function Jp(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Zp(e,t););return e.slice(0,t)}function Zp(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function Qp(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=Qp(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=Qp(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function eg(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...eg(e[i].children,t-1,n)]);return r}function tg(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>eg(e.children,r-1,n)}return!1}const ng=/^qDimensionInfo(?:\/(\d+))?/,rg=/^\/?qMeasureInfo\/(\d+)/,ig=/\/qAttrExprInfo\/(\d+)/,og=/\/qAttrDimInfo\/(\d+)/;function sg(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function ag(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,h=r;const d=n.qEffectiveInterColumnSortOrder,f=sg(n);return ng.test(h)&&(i=!0,o=+ng.exec(h)[1],h=r.replace(ng,"")),rg.test(h)&&("K"===n.qMode?c=+rg.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+rg.exec(h)[1],u=0):u=+rg.exec(h)[1],h=h.replace(rg,"")),h&&(og.exec(h)?a=+og.exec(h)[1]:ig.exec(h)&&(s=+ig.exec(h)[1])),l=i?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function lg(e,t){let n,r,i=tg(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function cg(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function ug(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,g,m,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,r)),"function"==typeof h.label&&(f=e=>h.label(e,r)),h.accessor?(g=h.accessor(r),Array.isArray(g)?(m=g.map(h.valueAccessor),h.attrAccessor&&(m=m.map(h.attrAccessor)),d&&(p=m.map(d),d=null),f&&(y=m.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(g)):h.valueAccessor(g),y=p)):(p=i,y=i)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,r):c,label:"function"==typeof a.label?a.label(u,r):u})}}const hg=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Qp(r,e);return o&&o[0]?(t.tree=jp(o[0],n.children||(e=>e[i])),t.tree):null};const dg=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields?a.fields:[a];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==s){const e=lg(o,ag(t.field,{cube:r,cache:i}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function fg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),s="S"===i.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}(e),r=e.fields(),i=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),s={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var a;const t=n[i[e]],o="".concat(r,"__").concat(null!==(a=t.qElemNumber)&&void 0!==a?a:t.qElemNo);s[o]||(s[o]=kp({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];s[r].qValues.push(t)}}const l=Object.keys(s).map((e=>s[e]));return Gp().id((e=>e.__id)).parentId((e=>e.__parent))(l)}(t):hg(i,n,e);if(!s)return null;const a=s.height,l=[];for(let o=0;o<=a;o++){let s=null;if(o>0)if("S"===i.qMode){let e=sg(i)[o-1];s=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),s=n.fields[e]}const{props:a,main:c}=r.normalizeConfig(kp(kp({},e),{},{field:s?s.key():void 0}),t),u=Object.keys(a);l[o]={propsArr:u,props:a,main:c};const h=s?ag(s,{cube:i,cache:n}):{fieldDepth:0};dg({propsArr:u,props:a,cube:i,cache:n,itemDepthObject:h,f:s})}const c=s.copy().descendants(),u=s.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,r=l[u[e].depth].main,i=c[e],s=i.data,a=cg(r,s,{key:o});ug({propsArr:t,props:n,item:i,itemData:s,ret:a,sourceKey:o,isTree:!0}),u[e].data=a}return s}function pg(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<i.length;s++)if(void 0!==i[s].field){const a=t.raw(),l=t.key();if(!hg(a,n,e))continue;const c="object"==typeof i[s].field?i[s].field:t.field(i[s].field),{props:u,main:h}=r.normalizeConfig(i[s],t),d=Object.keys(u),f=ag(c,{cube:a,cache:n}),{nodeFn:p,attrFn:g,valueFn:m}=lg({fieldDepth:0},f);dg({propsArr:d,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!i[s].trackBy,b=typeof i[s].trackBy,v={},x=[],w=p(n.tree),k=[];for(let e=0;e<w.length;e++){const t=w[e],n=g?g(m(t)):m(t);if(h.filter&&!h.filter(n))continue;const o=cg(h,n,{key:l});ug({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[s],itemData:n,obj:o,target:x,tracker:v,trackType:b}),k.push(o)}const M=y?r.collect(x,{main:h,propsArr:d,props:u}):k;o=[...o,...M]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var gg=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){
17
+ */var s=(r||(r=1,function(e){!function(t,n){e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}}("undefined"!=typeof window?window:o,(function(e,t){var n=[],r=Object.getPrototypeOf,i=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},s=n.push,a=n.indexOf,l={},c=l.toString,u=l.hasOwnProperty,d=u.toString,h=d.call(Object),f={},p=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},g=function(e){return null!=e&&e===e.window},m=e.document,y={type:!0,src:!0,nonce:!0,noModule:!0};function v(e,t,n){var r,i,o=(n=n||m).createElement("script");if(o.text=e,t)for(r in y)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function b(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var x="3.7.1",w=/HTML$/i,M=function(e,t){return new M.fn.init(e,t)};function k(e){var t=!!e&&"length"in e&&e.length,n=b(e);return!p(e)&&!g(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function _(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}M.fn=M.prototype={jquery:x,constructor:M,length:0,toArray:function(){return i.call(this)},get:function(e){return null==e?i.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=M.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return M.each(this,e)},map:function(e){return this.pushStack(M.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(M.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(M.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},M.extend=M.fn.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},a=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[a]||{},a++),"object"==typeof s||p(s)||(s={}),a===l&&(s=this,a--);a<l;a++)if(null!=(e=arguments[a]))for(t in e)r=e[t],"__proto__"!==t&&s!==r&&(c&&r&&(M.isPlainObject(r)||(i=Array.isArray(r)))?(n=s[t],o=i&&!Array.isArray(n)?[]:i||M.isPlainObject(n)?n:{},i=!1,s[t]=M.extend(c,o,r)):void 0!==r&&(s[t]=r));return s},M.extend({expando:"jQuery"+(x+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e)||(t=r(e))&&("function"!=typeof(n=u.call(t,"constructor")&&t.constructor)||d.call(n)!==h))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){v(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(k(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)for(;t=e[r++];)n+=M.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(k(Object(e))?M.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:a.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!w.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,s=!n;i<o;i++)!t(e[i],i)!==s&&r.push(e[i]);return r},map:function(e,t,n){var r,i,s=0,a=[];if(k(e))for(r=e.length;s<r;s++)null!=(i=t(e[s],s,n))&&a.push(i);else for(s in e)null!=(i=t(e[s],s,n))&&a.push(i);return o(a)},guid:1,support:f}),"function"==typeof Symbol&&(M.fn[Symbol.iterator]=n[Symbol.iterator]),M.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){l["[object "+t+"]"]=t.toLowerCase()}));var S=n.pop,q=n.sort,D=n.splice,E="[\\x20\\t\\r\\n\\f]",C=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g");M.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var A=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function T(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}M.escapeSelector=function(e){return(e+"").replace(A,T)};var N=m,R=s;!function(){var t,r,o,s,l,c,d,h,p,g,m=R,y=M.expando,v=0,b=0,x=ee(),w=ee(),k=ee(),A=ee(),T=function(e,t){return e===t&&(l=!0),0},O="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",I="(?:\\\\[\\da-fA-F]{1,6}"+E+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",P="\\["+E+"*("+I+")(?:"+E+"*([*^$|!~]?=)"+E+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+E+"*\\]",L=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",j=new RegExp(E+"+","g"),z=new RegExp("^"+E+"*,"+E+"*"),F=new RegExp("^"+E+"*([>+~]|"+E+")"+E+"*"),H=new RegExp(E+"|>"),B=new RegExp(L),V=new RegExp("^"+I+"$"),$={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+L),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),bool:new RegExp("^(?:"+O+")$","i"),needsContext:new RegExp("^"+E+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,U=/^h\d$/i,Y=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,X=new RegExp("\\\\[\\da-fA-F]{1,6}"+E+"?|\\\\([^\\r\\n\\f])","g"),G=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},J=function(){le()},Z=he((function(e){return!0===e.disabled&&_(e,"fieldset")}),{dir:"parentNode",next:"legend"});try{m.apply(n=i.call(N.childNodes),N.childNodes),n[N.childNodes.length].nodeType}catch(e){m={apply:function(e,t){R.apply(e,i.call(t))},call:function(e){R.apply(e,i.call(arguments,1))}}}function Q(e,t,n,r){var i,o,s,a,l,u,d,g=t&&t.ownerDocument,v=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==v&&9!==v&&11!==v)return n;if(!r&&(le(t),t=t||c,h)){if(11!==v&&(l=Y.exec(e)))if(i=l[1]){if(9===v){if(!(s=t.getElementById(i)))return n;if(s.id===i)return m.call(n,s),n}else if(g&&(s=g.getElementById(i))&&Q.contains(t,s)&&s.id===i)return m.call(n,s),n}else{if(l[2])return m.apply(n,t.getElementsByTagName(e)),n;if((i=l[3])&&t.getElementsByClassName)return m.apply(n,t.getElementsByClassName(i)),n}if(!(A[e+" "]||p&&p.test(e))){if(d=e,g=t,1===v&&(H.test(e)||F.test(e))){for((g=K.test(e)&&ae(t.parentNode)||t)==t&&f.scope||((a=t.getAttribute("id"))?a=M.escapeSelector(a):t.setAttribute("id",a=y)),o=(u=ue(e)).length;o--;)u[o]=(a?"#"+a:":scope")+" "+de(u[o]);d=u.join(",")}try{return m.apply(n,g.querySelectorAll(d)),n}catch(t){A(e,!0)}finally{a===y&&t.removeAttribute("id")}}}return ve(e.replace(C,"$1"),t,n,r)}function ee(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function te(e){return e[y]=!0,e}function ne(e){var t=c.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function re(e){return function(t){return _(t,"input")&&t.type===e}}function ie(e){return function(t){return(_(t,"input")||_(t,"button"))&&t.type===e}}function oe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Z(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function se(e){return te((function(t){return t=+t,te((function(n,r){for(var i,o=e([],n.length,t),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))}))}))}function ae(e){return e&&void 0!==e.getElementsByTagName&&e}function le(e){var t,n=e?e.ownerDocument||e:N;return n!=c&&9===n.nodeType&&n.documentElement?(d=(c=n).documentElement,h=!M.isXMLDoc(c),g=d.matches||d.webkitMatchesSelector||d.msMatchesSelector,d.msMatchesSelector&&N!=c&&(t=c.defaultView)&&t.top!==t&&t.addEventListener("unload",J),f.getById=ne((function(e){return d.appendChild(e).id=M.expando,!c.getElementsByName||!c.getElementsByName(M.expando).length})),f.disconnectedMatch=ne((function(e){return g.call(e,"*")})),f.scope=ne((function(){return c.querySelectorAll(":scope")})),f.cssHas=ne((function(){try{return c.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}})),f.getById?(r.filter.ID=function(e){var t=e.replace(X,G);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&h){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(X,G);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&h){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},r.find.CLASS=function(e,t){if(void 0!==t.getElementsByClassName&&h)return t.getElementsByClassName(e)},p=[],ne((function(e){var t;d.appendChild(e).innerHTML="<a id='"+y+"' href='' disabled='disabled'></a><select id='"+y+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||p.push("\\["+E+"*(?:value|"+O+")"),e.querySelectorAll("[id~="+y+"-]").length||p.push("~="),e.querySelectorAll("a#"+y+"+*").length||p.push(".#.+[+~]"),e.querySelectorAll(":checked").length||p.push(":checked"),(t=c.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),d.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&p.push(":enabled",":disabled"),(t=c.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||p.push("\\["+E+"*name"+E+"*="+E+"*(?:''|\"\")")})),f.cssHas||p.push(":has"),p=p.length&&new RegExp(p.join("|")),T=function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!f.sortDetached&&t.compareDocumentPosition(e)===n?e===c||e.ownerDocument==N&&Q.contains(N,e)?-1:t===c||t.ownerDocument==N&&Q.contains(N,t)?1:s?a.call(s,e)-a.call(s,t):0:4&n?-1:1)},c):c}for(t in Q.matches=function(e,t){return Q(e,null,null,t)},Q.matchesSelector=function(e,t){if(le(e),h&&!A[t+" "]&&(!p||!p.test(t)))try{var n=g.call(e,t);if(n||f.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return Q(t,c,null,[e]).length>0},Q.contains=function(e,t){return(e.ownerDocument||e)!=c&&le(e),M.contains(e,t)},Q.attr=function(e,t){(e.ownerDocument||e)!=c&&le(e);var n=r.attrHandle[t.toLowerCase()],i=n&&u.call(r.attrHandle,t.toLowerCase())?n(e,t,!h):void 0;return void 0!==i?i:e.getAttribute(t)},Q.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},M.uniqueSort=function(e){var t,n=[],r=0,o=0;if(l=!f.sortStable,s=!f.sortStable&&i.call(e,0),q.call(e,T),l){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)D.call(e,n[r],1)}return s=null,e},M.fn.uniqueSort=function(){return this.pushStack(M.uniqueSort(i.apply(this)))},r=M.expr={cacheLength:50,createPseudo:te,match:$,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(X,G),e[3]=(e[3]||e[4]||e[5]||"").replace(X,G),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||Q.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&Q.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return $.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&B.test(n)&&(t=ue(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(X,G).toLowerCase();return"*"===e?function(){return!0}:function(e){return _(e,t)}},CLASS:function(e){var t=x[e+" "];return t||(t=new RegExp("(^|"+E+")"+e+"("+E+"|$)"))&&x(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=Q.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(j," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,h,f,p=o!==s?"nextSibling":"previousSibling",g=t.parentNode,m=a&&t.nodeName.toLowerCase(),b=!l&&!a,x=!1;if(g){if(o){for(;p;){for(d=t;d=d[p];)if(a?_(d,m):1===d.nodeType)return!1;f=p="only"===e&&!f&&"nextSibling"}return!0}if(f=[s?g.firstChild:g.lastChild],s&&b){for(x=(h=(c=(u=g[y]||(g[y]={}))[e]||[])[0]===v&&c[1])&&c[2],d=h&&g.childNodes[h];d=++h&&d&&d[p]||(x=h=0)||f.pop();)if(1===d.nodeType&&++x&&d===t){u[e]=[v,h,x];break}}else if(b&&(x=h=(c=(u=t[y]||(t[y]={}))[e]||[])[0]===v&&c[1]),!1===x)for(;(d=++h&&d&&d[p]||(x=h=0)||f.pop())&&(!(a?_(d,m):1===d.nodeType)||!++x||(b&&((u=d[y]||(d[y]={}))[e]=[v,x]),d!==t)););return(x-=i)===r||x%r===0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||Q.error("unsupported pseudo: "+e);return i[y]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?te((function(e,n){for(var r,o=i(e,t),s=o.length;s--;)e[r=a.call(e,o[s])]=!(n[r]=o[s])})):function(e){return i(e,0,n)}):i}},pseudos:{not:te((function(e){var t=[],n=[],r=ye(e.replace(C,"$1"));return r[y]?te((function(e,t,n,i){for(var o,s=r(e,null,i,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}})),has:te((function(e){return function(t){return Q(e,t).length>0}})),contains:te((function(e){return e=e.replace(X,G),function(t){return(t.textContent||M.text(t)).indexOf(e)>-1}})),lang:te((function(e){return V.test(e||"")||Q.error("unsupported lang: "+e),e=e.replace(X,G).toLowerCase(),function(t){var n;do{if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===function(){try{return c.activeElement}catch(e){}}()&&c.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:oe(!1),disabled:oe(!0),checked:function(e){return _(e,"input")&&!!e.checked||_(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return U.test(e.nodeName)},input:function(e){return W.test(e.nodeName)},button:function(e){return _(e,"input")&&"button"===e.type||_(e,"button")},text:function(e){var t;return _(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:se((function(){return[0]})),last:se((function(e,t){return[t-1]})),eq:se((function(e,t,n){return[n<0?n+t:n]})),even:se((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:se((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:se((function(e,t,n){var r;for(r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e})),gt:se((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}},r.pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=re(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=ie(t);function ce(){}function ue(e,t){var n,i,o,s,a,l,c,u=w[e+" "];if(u)return t?0:u.slice(0);for(a=e,l=[],c=r.preFilter;a;){for(s in n&&!(i=z.exec(a))||(i&&(a=a.slice(i[0].length)||a),l.push(o=[])),n=!1,(i=F.exec(a))&&(n=i.shift(),o.push({value:n,type:i[0].replace(C," ")}),a=a.slice(n.length)),r.filter)!(i=$[s].exec(a))||c[s]&&!(i=c[s](i))||(n=i.shift(),o.push({value:n,type:s,matches:i}),a=a.slice(n.length));if(!n)break}return t?a.length:a?Q.error(e):w(e,l).slice(0)}function de(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function he(e,t,n){var r=t.dir,i=t.next,o=i||r,s=n&&"parentNode"===o,a=b++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||s)return e(t,n,i);return!1}:function(t,n,l){var c,u,d=[v,a];if(l){for(;t=t[r];)if((1===t.nodeType||s)&&e(t,n,l))return!0}else for(;t=t[r];)if(1===t.nodeType||s)if(u=t[y]||(t[y]={}),i&&_(t,i))t=t[r]||t;else{if((c=u[o])&&c[0]===v&&c[1]===a)return d[2]=c[2];if(u[o]=d,d[2]=e(t,n,l))return!0}return!1}}function fe(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function pe(e,t,n,r,i){for(var o,s=[],a=0,l=e.length,c=null!=t;a<l;a++)(o=e[a])&&(n&&!n(o,r,i)||(s.push(o),c&&t.push(a)));return s}function ge(e,t,n,r,i,o){return r&&!r[y]&&(r=ge(r)),i&&!i[y]&&(i=ge(i,o)),te((function(o,s,l,c){var u,d,h,f,p=[],g=[],y=s.length,v=o||function(e,t,n){for(var r=0,i=t.length;r<i;r++)Q(e,t[r],n);return n}(t||"*",l.nodeType?[l]:l,[]),b=!e||!o&&t?v:pe(v,p,e,l,c);if(n?n(b,f=i||(o?e:y||r)?[]:s,l,c):f=b,r)for(u=pe(f,g),r(u,[],l,c),d=u.length;d--;)(h=u[d])&&(f[g[d]]=!(b[g[d]]=h));if(o){if(i||e){if(i){for(u=[],d=f.length;d--;)(h=f[d])&&u.push(b[d]=h);i(null,f=[],u,c)}for(d=f.length;d--;)(h=f[d])&&(u=i?a.call(o,h):p[d])>-1&&(o[u]=!(s[u]=h))}}else f=pe(f===s?f.splice(y,f.length):f),i?i(null,s,f,c):m.apply(s,f)}))}function me(e){for(var t,n,i,s=e.length,l=r.relative[e[0].type],c=l||r.relative[" "],u=l?1:0,d=he((function(e){return e===t}),c,!0),h=he((function(e){return a.call(t,e)>-1}),c,!0),f=[function(e,n,r){var i=!l&&(r||n!=o)||((t=n).nodeType?d(e,n,r):h(e,n,r));return t=null,i}];u<s;u++)if(n=r.relative[e[u].type])f=[he(fe(f),n)];else{if((n=r.filter[e[u].type].apply(null,e[u].matches))[y]){for(i=++u;i<s&&!r.relative[e[i].type];i++);return ge(u>1&&fe(f),u>1&&de(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(C,"$1"),n,u<i&&me(e.slice(u,i)),i<s&&me(e=e.slice(i)),i<s&&de(e))}f.push(n)}return fe(f)}function ye(e,t){var n,i=[],s=[],a=k[e+" "];if(!a){for(t||(t=ue(e)),n=t.length;n--;)(a=me(t[n]))[y]?i.push(a):s.push(a);a=k(e,function(e,t){var n=t.length>0,i=e.length>0,s=function(s,a,l,u,d){var f,p,g,y=0,b="0",x=s&&[],w=[],k=o,_=s||i&&r.find.TAG("*",d),q=v+=null==k?1:Math.random()||.1,D=_.length;for(d&&(o=a==c||a||d);b!==D&&null!=(f=_[b]);b++){if(i&&f){for(p=0,a||f.ownerDocument==c||(le(f),l=!h);g=e[p++];)if(g(f,a||c,l)){m.call(u,f);break}d&&(v=q)}n&&((f=!g&&f)&&y--,s&&x.push(f))}if(y+=b,n&&b!==y){for(p=0;g=t[p++];)g(x,w,a,l);if(s){if(y>0)for(;b--;)x[b]||w[b]||(w[b]=S.call(u));w=pe(w)}m.apply(u,w),d&&!s&&w.length>0&&y+t.length>1&&M.uniqueSort(u)}return d&&(v=q,o=k),x};return n?te(s):s}(s,i)),a.selector=e}return a}function ve(e,t,n,i){var o,s,a,l,c,u="function"==typeof e&&e,d=!i&&ue(e=u.selector||e);if(n=n||[],1===d.length){if((s=d[0]=d[0].slice(0)).length>2&&"ID"===(a=s[0]).type&&9===t.nodeType&&h&&r.relative[s[1].type]){if(!(t=(r.find.ID(a.matches[0].replace(X,G),t)||[])[0]))return n;u&&(t=t.parentNode),e=e.slice(s.shift().value.length)}for(o=$.needsContext.test(e)?0:s.length;o--&&(a=s[o],!r.relative[l=a.type]);)if((c=r.find[l])&&(i=c(a.matches[0].replace(X,G),K.test(s[0].type)&&ae(t.parentNode)||t))){if(s.splice(o,1),!(e=i.length&&de(s)))return m.apply(n,i),n;break}}return(u||ye(e,d))(i,t,!h,n,!t||K.test(e)&&ae(t.parentNode)||t),n}ce.prototype=r.filters=r.pseudos,r.setFilters=new ce,f.sortStable=y.split("").sort(T).join("")===y,le(),f.sortDetached=ne((function(e){return 1&e.compareDocumentPosition(c.createElement("fieldset"))})),M.find=Q,M.expr[":"]=M.expr.pseudos,M.unique=M.uniqueSort,Q.compile=ye,Q.select=ve,Q.setDocument=le,Q.tokenize=ue,Q.escape=M.escapeSelector,Q.getText=M.text,Q.isXML=M.isXMLDoc,Q.selectors=M.expr,Q.support=M.support,Q.uniqueSort=M.uniqueSort}();var O=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&M(e).is(n))break;r.push(e)}return r},I=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},P=M.expr.match.needsContext,L=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return p(t)?M.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?M.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?M.grep(e,(function(e){return a.call(t,e)>-1!==n})):M.filter(t,e,n)}M.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?M.find.matchesSelector(r,e)?[r]:[]:M.find.matches(e,M.grep(t,(function(e){return 1===e.nodeType})))},M.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(M(e).filter((function(){for(t=0;t<r;t++)if(M.contains(i[t],this))return!0})));for(n=this.pushStack([]),t=0;t<r;t++)M.find(e,i[t],n);return r>1?M.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&P.test(e)?M(e):e||[],!1).length}});var z,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=M.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||z,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:F.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof M?t[0]:t,M.merge(this,M.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:m,!0)),L.test(r[1])&&M.isPlainObject(t))for(r in t)p(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=m.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):p(e)?void 0!==n.ready?n.ready(e):e(M):M.makeArray(e,this)};H.prototype=M.fn,z=M(m);var B=/^(?:parents|prev(?:Until|All))/,V={children:!0,contents:!0,next:!0,prev:!0};function $(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}M.fn.extend({has:function(e){var t=M(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(M.contains(this,t[e]))return!0}))},closest:function(e,t){var n,r=0,i=this.length,o=[],s="string"!=typeof e&&M(e);if(!P.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&M.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?M.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?a.call(M(e),this[0]):a.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(M.uniqueSort(M.merge(this.get(),M(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),M.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return O(e,"parentNode")},parentsUntil:function(e,t,n){return O(e,"parentNode",n)},next:function(e){return $(e,"nextSibling")},prev:function(e){return $(e,"previousSibling")},nextAll:function(e){return O(e,"nextSibling")},prevAll:function(e){return O(e,"previousSibling")},nextUntil:function(e,t,n){return O(e,"nextSibling",n)},prevUntil:function(e,t,n){return O(e,"previousSibling",n)},siblings:function(e){return I((e.parentNode||{}).firstChild,e)},children:function(e){return I(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(_(e,"template")&&(e=e.content||e),M.merge([],e.childNodes))}},(function(e,t){M.fn[e]=function(n,r){var i=M.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=M.filter(r,i)),this.length>1&&(V[e]||M.uniqueSort(i),B.test(e)&&i.reverse()),this.pushStack(i)}}));var W=/[^\x20\t\r\n\f]+/g;function U(e){return e}function Y(e){throw e}function K(e,t,n,r){var i;try{e&&p(i=e.promise)?i.call(e).done(t).fail(n):e&&p(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}M.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return M.each(e.match(W)||[],(function(e,n){t[n]=!0})),t}(e):M.extend({},e);var t,n,r,i,o=[],s=[],a=-1,l=function(){for(i=i||e.once,r=t=!0;s.length;a=-1)for(n=s.shift();++a<o.length;)!1===o[a].apply(n[0],n[1])&&e.stopOnFalse&&(a=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},c={add:function(){return o&&(n&&!t&&(a=o.length-1,s.push(n)),function t(n){M.each(n,(function(n,r){p(r)?e.unique&&c.has(r)||o.push(r):r&&r.length&&"string"!==b(r)&&t(r)}))}(arguments),n&&!t&&l()),this},remove:function(){return M.each(arguments,(function(e,t){for(var n;(n=M.inArray(t,o,n))>-1;)o.splice(n,1),n<=a&&a--})),this},has:function(e){return e?M.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=s=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},M.extend({Deferred:function(t){var n=[["notify","progress",M.Callbacks("memory"),M.Callbacks("memory"),2],["resolve","done",M.Callbacks("once memory"),M.Callbacks("once memory"),0,"resolved"],["reject","fail",M.Callbacks("once memory"),M.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return M.Deferred((function(t){M.each(n,(function(n,r){var i=p(e[r[4]])&&e[r[4]];o[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&p(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(t,r,i){var o=0;function s(t,n,r,i){return function(){var a=this,l=arguments,c=function(){var e,c;if(!(t<o)){if((e=r.apply(a,l))===n.promise())throw new TypeError("Thenable self-resolution");c=e&&("object"==typeof e||"function"==typeof e)&&e.then,p(c)?i?c.call(e,s(o,n,U,i),s(o,n,Y,i)):(o++,c.call(e,s(o,n,U,i),s(o,n,Y,i),s(o,n,U,n.notifyWith))):(r!==U&&(a=void 0,l=[e]),(i||n.resolveWith)(a,l))}},u=i?c:function(){try{c()}catch(e){M.Deferred.exceptionHook&&M.Deferred.exceptionHook(e,u.error),t+1>=o&&(r!==Y&&(a=void 0,l=[e]),n.rejectWith(a,l))}};t?u():(M.Deferred.getErrorHook?u.error=M.Deferred.getErrorHook():M.Deferred.getStackHook&&(u.error=M.Deferred.getStackHook()),e.setTimeout(u))}}return M.Deferred((function(e){n[0][3].add(s(0,e,p(i)?i:U,e.notifyWith)),n[1][3].add(s(0,e,p(t)?t:U)),n[2][3].add(s(0,e,p(r)?r:Y))})).promise()},promise:function(e){return null!=e?M.extend(e,i):i}},o={};return M.each(n,(function(e,t){var s=t[2],a=t[5];i[t[1]]=s.add,a&&s.add((function(){r=a}),n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),s.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=s.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),o=i.call(arguments),s=M.Deferred(),a=function(e){return function(n){r[e]=this,o[e]=arguments.length>1?i.call(arguments):n,--t||s.resolveWith(r,o)}};if(t<=1&&(K(e,s.done(a(n)).resolve,s.reject,!t),"pending"===s.state()||p(o[n]&&o[n].then)))return s.then();for(;n--;)K(o[n],a(n),s.reject);return s.promise()}});var X=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;M.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&X.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},M.readyException=function(t){e.setTimeout((function(){throw t}))};var G=M.Deferred();function J(){m.removeEventListener("DOMContentLoaded",J),e.removeEventListener("load",J),M.ready()}M.fn.ready=function(e){return G.then(e).catch((function(e){M.readyException(e)})),this},M.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--M.readyWait:M.isReady)||(M.isReady=!0,!0!==e&&--M.readyWait>0||G.resolveWith(m,[M]))}}),M.ready.then=G.then,"complete"===m.readyState||"loading"!==m.readyState&&!m.documentElement.doScroll?e.setTimeout(M.ready):(m.addEventListener("DOMContentLoaded",J),e.addEventListener("load",J));var Z=function(e,t,n,r,i,o,s){var a=0,l=e.length,c=null==n;if("object"===b(n))for(a in i=!0,n)Z(e,t,a,n[a],!0,o,s);else if(void 0!==r&&(i=!0,p(r)||(s=!0),c&&(s?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(M(e),n)})),t))for(;a<l;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:c?t.call(e):l?t(e[0],n):o},Q=/^-ms-/,ee=/-([a-z])/g;function te(e,t){return t.toUpperCase()}function ne(e){return e.replace(Q,"ms-").replace(ee,te)}var re=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function ie(){this.expando=M.expando+ie.uid++}ie.uid=1,ie.prototype={cache:function(e){var t=e[this.expando];return t||(t={},re(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[ne(t)]=n;else for(r in t)i[ne(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][ne(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(ne):(t=ne(t))in r?[t]:t.match(W)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||M.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!M.isEmptyObject(t)}};var oe=new ie,se=new ie,ae=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,le=/[A-Z]/g;function ce(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(le,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:ae.test(e)?JSON.parse(e):e)}(n)}catch(e){}se.set(e,t,n)}else n=void 0;return n}M.extend({hasData:function(e){return se.hasData(e)||oe.hasData(e)},data:function(e,t,n){return se.access(e,t,n)},removeData:function(e,t){se.remove(e,t)},_data:function(e,t,n){return oe.access(e,t,n)},_removeData:function(e,t){oe.remove(e,t)}}),M.fn.extend({data:function(e,t){var n,r,i,o=this[0],s=o&&o.attributes;if(void 0===e){if(this.length&&(i=se.get(o),1===o.nodeType&&!oe.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(r=s[n].name).indexOf("data-")&&(r=ne(r.slice(5)),ce(o,r,i[r]));oe.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each((function(){se.set(this,e)})):Z(this,(function(t){var n;if(o&&void 0===t)return void 0!==(n=se.get(o,e))||void 0!==(n=ce(o,e))?n:void 0;this.each((function(){se.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){se.remove(this,e)}))}}),M.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=oe.get(e,t),n&&(!r||Array.isArray(n)?r=oe.access(e,t,M.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=M.queue(e,t),r=n.length,i=n.shift(),o=M._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){M.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return oe.get(e,n)||oe.access(e,n,{empty:M.Callbacks("once memory").add((function(){oe.remove(e,[t+"queue",n])}))})}}),M.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?M.queue(this[0],e):void 0===t?this:this.each((function(){var n=M.queue(this,e,t);M._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&M.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){M.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=M.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)(n=oe.get(o[s],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(t)}});var ue=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,de=new RegExp("^(?:([+-])=|)("+ue+")([a-z%]*)$","i"),he=["Top","Right","Bottom","Left"],fe=m.documentElement,pe=function(e){return M.contains(e.ownerDocument,e)},ge={composed:!0};fe.getRootNode&&(pe=function(e){return M.contains(e.ownerDocument,e)||e.getRootNode(ge)===e.ownerDocument});var me=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&pe(e)&&"none"===M.css(e,"display")};function ye(e,t,n,r){var i,o,s=20,a=r?function(){return r.cur()}:function(){return M.css(e,t,"")},l=a(),c=n&&n[3]||(M.cssNumber[t]?"":"px"),u=e.nodeType&&(M.cssNumber[t]||"px"!==c&&+l)&&de.exec(M.css(e,t));if(u&&u[3]!==c){for(l/=2,c=c||u[3],u=+l||1;s--;)M.style(e,t,u+c),(1-o)*(1-(o=a()/l||.5))<=0&&(s=0),u/=o;u*=2,M.style(e,t,u+c),n=n||[]}return n&&(u=+u||+l||0,i=n[1]?u+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=u,r.end=i)),i}var ve={};function be(e){var t,n=e.ownerDocument,r=e.nodeName,i=ve[r];return i||(t=n.body.appendChild(n.createElement(r)),i=M.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),ve[r]=i,i)}function xe(e,t){for(var n,r,i=[],o=0,s=e.length;o<s;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=oe.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&me(r)&&(i[o]=be(r))):"none"!==n&&(i[o]="none",oe.set(r,"display",n)));for(o=0;o<s;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}M.fn.extend({show:function(){return xe(this,!0)},hide:function(){return xe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){me(this)?M(this).show():M(this).hide()}))}});var we,Me,ke=/^(?:checkbox|radio)$/i,_e=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Se=/^$|^module$|\/(?:java|ecma)script/i;we=m.createDocumentFragment().appendChild(m.createElement("div")),(Me=m.createElement("input")).setAttribute("type","radio"),Me.setAttribute("checked","checked"),Me.setAttribute("name","t"),we.appendChild(Me),f.checkClone=we.cloneNode(!0).cloneNode(!0).lastChild.checked,we.innerHTML="<textarea>x</textarea>",f.noCloneChecked=!!we.cloneNode(!0).lastChild.defaultValue,we.innerHTML="<option></option>",f.option=!!we.lastChild;var qe={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 De(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&_(e,t)?M.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n<r;n++)oe.set(e[n],"globalEval",!t||oe.get(t[n],"globalEval"))}qe.tbody=qe.tfoot=qe.colgroup=qe.caption=qe.thead,qe.th=qe.td,f.option||(qe.optgroup=qe.option=[1,"<select multiple='multiple'>","</select>"]);var Ce=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,s,a,l,c,u,d=t.createDocumentFragment(),h=[],f=0,p=e.length;f<p;f++)if((o=e[f])||0===o)if("object"===b(o))M.merge(h,o.nodeType?[o]:o);else if(Ce.test(o)){for(s=s||d.appendChild(t.createElement("div")),a=(_e.exec(o)||["",""])[1].toLowerCase(),l=qe[a]||qe._default,s.innerHTML=l[1]+M.htmlPrefilter(o)+l[2],u=l[0];u--;)s=s.lastChild;M.merge(h,s.childNodes),(s=d.firstChild).textContent=""}else h.push(t.createTextNode(o));for(d.textContent="",f=0;o=h[f++];)if(r&&M.inArray(o,r)>-1)i&&i.push(o);else if(c=pe(o),s=De(d.appendChild(o),"script"),c&&Ee(s),n)for(u=0;o=s[u++];)Se.test(o.type||"")&&n.push(o);return d}var Te=/^([^.]*)(?:\.(.+)|)/;function Ne(){return!0}function Re(){return!1}function Oe(e,t,n,r,i,o){var s,a;if("object"==typeof t){for(a in"string"!=typeof n&&(r=r||n,n=void 0),t)Oe(e,a,n,r,t[a],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Re;else if(!i)return e;return 1===o&&(s=i,i=function(e){return M().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=M.guid++)),e.each((function(){M.event.add(this,t,i,r,n)}))}function Ie(e,t,n){n?(oe.set(e,t,!1),M.event.add(e,t,{namespace:!1,handler:function(e){var n,r=oe.get(this,t);if(1&e.isTrigger&&this[t]){if(r)(M.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=i.call(arguments),oe.set(this,t,r),this[t](),n=oe.get(this,t),oe.set(this,t,!1),r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else r&&(oe.set(this,t,M.event.trigger(r[0],r.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Ne)}})):void 0===oe.get(e,t)&&M.event.add(e,t,Ne)}M.event={global:{},add:function(e,t,n,r,i){var o,s,a,l,c,u,d,h,f,p,g,m=oe.get(e);if(re(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&M.find.matchesSelector(fe,i),n.guid||(n.guid=M.guid++),(l=m.events)||(l=m.events=Object.create(null)),(s=m.handle)||(s=m.handle=function(t){return void 0!==M&&M.event.triggered!==t.type?M.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(W)||[""]).length;c--;)f=g=(a=Te.exec(t[c])||[])[1],p=(a[2]||"").split(".").sort(),f&&(d=M.event.special[f]||{},f=(i?d.delegateType:d.bindType)||f,d=M.event.special[f]||{},u=M.extend({type:f,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&M.expr.match.needsContext.test(i),namespace:p.join(".")},o),(h=l[f])||((h=l[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,p,s)||e.addEventListener&&e.addEventListener(f,s)),d.add&&(d.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),i?h.splice(h.delegateCount++,0,u):h.push(u),M.event.global[f]=!0)},remove:function(e,t,n,r,i){var o,s,a,l,c,u,d,h,f,p,g,m=oe.hasData(e)&&oe.get(e);if(m&&(l=m.events)){for(c=(t=(t||"").match(W)||[""]).length;c--;)if(f=g=(a=Te.exec(t[c])||[])[1],p=(a[2]||"").split(".").sort(),f){for(d=M.event.special[f]||{},h=l[f=(r?d.delegateType:d.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=h.length;o--;)u=h[o],!i&&g!==u.origType||n&&n.guid!==u.guid||a&&!a.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(h.splice(o,1),u.selector&&h.delegateCount--,d.remove&&d.remove.call(e,u));s&&!h.length&&(d.teardown&&!1!==d.teardown.call(e,p,m.handle)||M.removeEvent(e,f,m.handle),delete l[f])}else for(f in l)M.event.remove(e,f+t[c],n,r,!0);M.isEmptyObject(l)&&oe.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,s,a=new Array(arguments.length),l=M.event.fix(e),c=(oe.get(this,"events")||Object.create(null))[l.type]||[],u=M.event.special[l.type]||{};for(a[0]=l,t=1;t<arguments.length;t++)a[t]=arguments[t];if(l.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,l)){for(s=M.event.handlers.call(this,l,c),t=0;(i=s[t++])&&!l.isPropagationStopped();)for(l.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,void 0!==(r=((M.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a))&&!1===(l.result=r)&&(l.preventDefault(),l.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,l),l.result}},handlers:function(e,t){var n,r,i,o,s,a=[],l=t.delegateCount,c=e.target;if(l&&c.nodeType&&!("click"===e.type&&e.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(o=[],s={},n=0;n<l;n++)void 0===s[i=(r=t[n]).selector+" "]&&(s[i]=r.needsContext?M(i,this).index(c)>-1:M.find(i,this,null,[c]).length),s[i]&&o.push(r);o.length&&a.push({elem:c,handlers:o})}return c=this,l<t.length&&a.push({elem:c,handlers:t.slice(l)}),a},addProp:function(e,t){Object.defineProperty(M.Event.prototype,e,{enumerable:!0,configurable:!0,get:p(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[M.expando]?e:new M.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return ke.test(t.type)&&t.click&&_(t,"input")&&Ie(t,"click",!0),!1},trigger:function(e){var t=this||e;return ke.test(t.type)&&t.click&&_(t,"input")&&Ie(t,"click"),!0},_default:function(e){var t=e.target;return ke.test(t.type)&&t.click&&_(t,"input")&&oe.get(t,"click")||_(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},M.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},M.Event=function(e,t){if(!(this instanceof M.Event))return new M.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ne:Re,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&M.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[M.expando]=!0},M.Event.prototype={constructor:M.Event,isDefaultPrevented:Re,isPropagationStopped:Re,isImmediatePropagationStopped:Re,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ne,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ne,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ne,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},M.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},M.event.addProp),M.each({focus:"focusin",blur:"focusout"},(function(e,t){function n(e){if(m.documentMode){var n=oe.get(this,"handle"),r=M.event.fix(e);r.type="focusin"===e.type?"focus":"blur",r.isSimulated=!0,n(e),r.target===r.currentTarget&&n(r)}else M.event.simulate(t,e.target,M.event.fix(e))}M.event.special[e]={setup:function(){var r;if(Ie(this,e,!0),!m.documentMode)return!1;(r=oe.get(this,t))||this.addEventListener(t,n),oe.set(this,t,(r||0)+1)},trigger:function(){return Ie(this,e),!0},teardown:function(){var e;if(!m.documentMode)return!1;(e=oe.get(this,t)-1)?oe.set(this,t,e):(this.removeEventListener(t,n),oe.remove(this,t))},_default:function(t){return oe.get(t.target,e)},delegateType:t},M.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=m.documentMode?this:r,o=oe.get(i,t);o||(m.documentMode?this.addEventListener(t,n):r.addEventListener(e,n,!0)),oe.set(i,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=m.documentMode?this:r,o=oe.get(i,t)-1;o?oe.set(i,t,o):(m.documentMode?this.removeEventListener(t,n):r.removeEventListener(e,n,!0),oe.remove(i,t))}}})),M.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){M.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return r&&(r===this||M.contains(this,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}})),M.fn.extend({on:function(e,t,n,r){return Oe(this,e,t,n,r)},one:function(e,t,n,r){return Oe(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,M(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Re),this.each((function(){M.event.remove(this,e,n,t)}))}});var Pe=/<script|<style|<link/i,Le=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function ze(e,t){return _(e,"table")&&_(11!==t.nodeType?t:t.firstChild,"tr")&&M(e).children("tbody")[0]||e}function Fe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Be(e,t){var n,r,i,o,s,a;if(1===t.nodeType){if(oe.hasData(e)&&(a=oe.get(e).events))for(i in oe.remove(t,"handle events"),a)for(n=0,r=a[i].length;n<r;n++)M.event.add(t,i,a[i][n]);se.hasData(e)&&(o=se.access(e),s=M.extend({},o),se.set(t,s))}}function Ve(e,t){var n=t.nodeName.toLowerCase();"input"===n&&ke.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function $e(e,t,n,r){t=o(t);var i,s,a,l,c,u,d=0,h=e.length,g=h-1,m=t[0],y=p(m);if(y||h>1&&"string"==typeof m&&!f.checkClone&&Le.test(m))return e.each((function(i){var o=e.eq(i);y&&(t[0]=m.call(this,i,o.html())),$e(o,t,n,r)}));if(h&&(s=(i=Ae(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=s),s||r)){for(l=(a=M.map(De(i,"script"),Fe)).length;d<h;d++)c=i,d!==g&&(c=M.clone(c,!0,!0),l&&M.merge(a,De(c,"script"))),n.call(e[d],c,d);if(l)for(u=a[a.length-1].ownerDocument,M.map(a,He),d=0;d<l;d++)c=a[d],Se.test(c.type||"")&&!oe.access(c,"globalEval")&&M.contains(u,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?M._evalUrl&&!c.noModule&&M._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},u):v(c.textContent.replace(je,""),c,u))}return e}function We(e,t,n){for(var r,i=t?M.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||M.cleanData(De(r)),r.parentNode&&(n&&pe(r)&&Ee(De(r,"script")),r.parentNode.removeChild(r));return e}M.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,s,a=e.cloneNode(!0),l=pe(e);if(!(f.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||M.isXMLDoc(e)))for(s=De(a),r=0,i=(o=De(e)).length;r<i;r++)Ve(o[r],s[r]);if(t)if(n)for(o=o||De(e),s=s||De(a),r=0,i=o.length;r<i;r++)Be(o[r],s[r]);else Be(e,a);return(s=De(a,"script")).length>0&&Ee(s,!l&&De(e,"script")),a},cleanData:function(e){for(var t,n,r,i=M.event.special,o=0;void 0!==(n=e[o]);o++)if(re(n)){if(t=n[oe.expando]){if(t.events)for(r in t.events)i[r]?M.event.remove(n,r):M.removeEvent(n,r,t.handle);n[oe.expando]=void 0}n[se.expando]&&(n[se.expando]=void 0)}}}),M.fn.extend({detach:function(e){return We(this,e,!0)},remove:function(e){return We(this,e)},text:function(e){return Z(this,(function(e){return void 0===e?M.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return $e(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||ze(this,e).appendChild(e)}))},prepend:function(){return $e(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ze(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return $e(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return $e(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(M.cleanData(De(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return M.clone(this,e,t)}))},html:function(e){return Z(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Pe.test(e)&&!qe[(_e.exec(e)||["",""])[1].toLowerCase()]){e=M.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(M.cleanData(De(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return $e(this,arguments,(function(t){var n=this.parentNode;M.inArray(this,e)<0&&(M.cleanData(De(this)),n&&n.replaceChild(t,this))}),e)}}),M.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){M.fn[e]=function(e){for(var n,r=[],i=M(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),M(i[a])[t](n),s.apply(r,n.get());return this.pushStack(r)}}));var Ue=new RegExp("^("+ue+")(?!px)[a-z%]+$","i"),Ye=/^--/,Ke=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Xe=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ge=new RegExp(he.join("|"),"i");function Je(e,t,n){var r,i,o,s,a=Ye.test(t),l=e.style;return(n=n||Ke(e))&&(s=n.getPropertyValue(t)||n[t],a&&s&&(s=s.replace(C,"$1")||void 0),""!==s||pe(e)||(s=M.style(e,t)),!f.pixelBoxStyles()&&Ue.test(s)&&Ge.test(t)&&(r=l.width,i=l.minWidth,o=l.maxWidth,l.minWidth=l.maxWidth=l.width=s,s=n.width,l.width=r,l.minWidth=i,l.maxWidth=o)),void 0!==s?s+"":s}function Ze(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(u){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",fe.appendChild(c).appendChild(u);var t=e.getComputedStyle(u);r="1%"!==t.top,l=12===n(t.marginLeft),u.style.right="60%",s=36===n(t.right),i=36===n(t.width),u.style.position="absolute",o=12===n(u.offsetWidth/3),fe.removeChild(c),u=null}}function n(e){return Math.round(parseFloat(e))}var r,i,o,s,a,l,c=m.createElement("div"),u=m.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",f.clearCloneStyle="content-box"===u.style.backgroundClip,M.extend(f,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,r,i;return null==a&&(t=m.createElement("table"),n=m.createElement("tr"),r=m.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="box-sizing:content-box;border:1px solid",n.style.height="1px",r.style.height="9px",r.style.display="block",fe.appendChild(t).appendChild(n).appendChild(r),i=e.getComputedStyle(n),a=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===n.offsetHeight,fe.removeChild(t)),a}}))}();var Qe=["Webkit","Moz","ms"],et=m.createElement("div").style,tt={};function nt(e){var t=M.cssProps[e]||tt[e];return t||(e in et?e:tt[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=Qe.length;n--;)if((e=Qe[n]+t)in et)return e}(e)||e)}var rt=/^(none|table(?!-c[ea]).+)/,it={position:"absolute",visibility:"hidden",display:"block"},ot={letterSpacing:"0",fontWeight:"400"};function st(e,t,n){var r=de.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function at(e,t,n,r,i,o){var s="width"===t?1:0,a=0,l=0,c=0;if(n===(r?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(c+=M.css(e,n+he[s],!0,i)),r?("content"===n&&(l-=M.css(e,"padding"+he[s],!0,i)),"margin"!==n&&(l-=M.css(e,"border"+he[s]+"Width",!0,i))):(l+=M.css(e,"padding"+he[s],!0,i),"padding"!==n?l+=M.css(e,"border"+he[s]+"Width",!0,i):a+=M.css(e,"border"+he[s]+"Width",!0,i));return!r&&o>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-a-.5))||0),l+c}function lt(e,t,n){var r=Ke(e),i=(!f.boxSizingReliable()||n)&&"border-box"===M.css(e,"boxSizing",!1,r),o=i,s=Je(e,t,r),a="offset"+t[0].toUpperCase()+t.slice(1);if(Ue.test(s)){if(!n)return s;s="auto"}return(!f.boxSizingReliable()&&i||!f.reliableTrDimensions()&&_(e,"tr")||"auto"===s||!parseFloat(s)&&"inline"===M.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===M.css(e,"boxSizing",!1,r),(o=a in e)&&(s=e[a])),(s=parseFloat(s)||0)+at(e,t,n||(i?"border":"content"),o,r,s)+"px"}function ct(e,t,n,r,i){return new ct.prototype.init(e,t,n,r,i)}M.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Je(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!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,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,a=ne(t),l=Ye.test(t),c=e.style;if(l||(t=nt(a)),s=M.cssHooks[t]||M.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(i=s.get(e,!1,r))?i:c[t];"string"==(o=typeof n)&&(i=de.exec(n))&&i[1]&&(n=ye(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=i&&i[3]||(M.cssNumber[a]?"":"px")),f.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,r))||(l?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,r){var i,o,s,a=ne(t);return Ye.test(t)||(t=nt(a)),(s=M.cssHooks[t]||M.cssHooks[a])&&"get"in s&&(i=s.get(e,!0,n)),void 0===i&&(i=Je(e,t,r)),"normal"===i&&t in ot&&(i=ot[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),M.each(["height","width"],(function(e,t){M.cssHooks[t]={get:function(e,n,r){if(n)return!rt.test(M.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?lt(e,t,r):Xe(e,it,(function(){return lt(e,t,r)}))},set:function(e,n,r){var i,o=Ke(e),s=!f.scrollboxSize()&&"absolute"===o.position,a=(s||r)&&"border-box"===M.css(e,"boxSizing",!1,o),l=r?at(e,t,r,a,o):0;return a&&s&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-at(e,t,"border",!1,o)-.5)),l&&(i=de.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=M.css(e,t)),st(0,n,l)}}})),M.cssHooks.marginLeft=Ze(f.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Je(e,"marginLeft"))||e.getBoundingClientRect().left-Xe(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),M.each({margin:"",padding:"",border:"Width"},(function(e,t){M.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+he[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(M.cssHooks[e+t].set=st)})),M.fn.extend({css:function(e,t){return Z(this,(function(e,t,n){var r,i,o={},s=0;if(Array.isArray(t)){for(r=Ke(e),i=t.length;s<i;s++)o[t[s]]=M.css(e,t[s],!1,r);return o}return void 0!==n?M.style(e,t,n):M.css(e,t)}),e,t,arguments.length>1)}}),M.Tween=ct,ct.prototype={constructor:ct,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||M.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(M.cssNumber[n]?"":"px")},cur:function(){var e=ct.propHooks[this.prop];return e&&e.get?e.get(this):ct.propHooks._default.get(this)},run:function(e){var t,n=ct.propHooks[this.prop];return this.options.duration?this.pos=t=M.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ct.propHooks._default.set(this),this}},ct.prototype.init.prototype=ct.prototype,ct.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=M.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){M.fx.step[e.prop]?M.fx.step[e.prop](e):1!==e.elem.nodeType||!M.cssHooks[e.prop]&&null==e.elem.style[nt(e.prop)]?e.elem[e.prop]=e.now:M.style(e.elem,e.prop,e.now+e.unit)}}},ct.propHooks.scrollTop=ct.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},M.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},M.fx=ct.prototype.init,M.fx.step={};var ut,dt,ht=/^(?:toggle|show|hide)$/,ft=/queueHooks$/;function pt(){dt&&(!1===m.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(pt):e.setTimeout(pt,M.fx.interval),M.fx.tick())}function gt(){return e.setTimeout((function(){ut=void 0})),ut=Date.now()}function mt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=he[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function yt(e,t,n){for(var r,i=(vt.tweeners[t]||[]).concat(vt.tweeners["*"]),o=0,s=i.length;o<s;o++)if(r=i[o].call(n,t,e))return r}function vt(e,t,n){var r,i,o=0,s=vt.prefilters.length,a=M.Deferred().always((function(){delete l.elem})),l=function(){if(i)return!1;for(var t=ut||gt(),n=Math.max(0,c.startTime+c.duration-t),r=1-(n/c.duration||0),o=0,s=c.tweens.length;o<s;o++)c.tweens[o].run(r);return a.notifyWith(e,[c,r,n]),r<1&&s?n:(s||a.notifyWith(e,[c,1,0]),a.resolveWith(e,[c]),!1)},c=a.promise({elem:e,props:M.extend({},t),opts:M.extend(!0,{specialEasing:{},easing:M.easing._default},n),originalProperties:t,originalOptions:n,startTime:ut||gt(),duration:n.duration,tweens:[],createTween:function(t,n){var r=M.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(r),r},stop:function(t){var n=0,r=t?c.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)c.tweens[n].run(1);return t?(a.notifyWith(e,[c,1,0]),a.resolveWith(e,[c,t])):a.rejectWith(e,[c,t]),this}}),u=c.props;for(function(e,t){var n,r,i,o,s;for(n in e)if(i=t[r=ne(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(s=M.cssHooks[r])&&"expand"in s)for(n in o=s.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(u,c.opts.specialEasing);o<s;o++)if(r=vt.prefilters[o].call(c,e,u,c.opts))return p(r.stop)&&(M._queueHooks(c.elem,c.opts.queue).stop=r.stop.bind(r)),r;return M.map(u,yt,c),p(c.opts.start)&&c.opts.start.call(e,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),M.fx.timer(M.extend(l,{elem:e,anim:c,queue:c.opts.queue})),c}M.Animation=M.extend(vt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ye(n.elem,e,de.exec(t),n),n}]},tweener:function(e,t){p(e)?(t=e,e=["*"]):e=e.match(W);for(var n,r=0,i=e.length;r<i;r++)n=e[r],vt.tweeners[n]=vt.tweeners[n]||[],vt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,s,a,l,c,u,d="width"in t||"height"in t,h=this,f={},p=e.style,g=e.nodeType&&me(e),m=oe.get(e,"fxshow");for(r in n.queue||(null==(s=M._queueHooks(e,"fx")).unqueued&&(s.unqueued=0,a=s.empty.fire,s.empty.fire=function(){s.unqueued||a()}),s.unqueued++,h.always((function(){h.always((function(){s.unqueued--,M.queue(e,"fx").length||s.empty.fire()}))}))),t)if(i=t[r],ht.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!m||void 0===m[r])continue;g=!0}f[r]=m&&m[r]||M.style(e,r)}if((l=!M.isEmptyObject(t))||!M.isEmptyObject(f))for(r in d&&1===e.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(c=m&&m.display)&&(c=oe.get(e,"display")),"none"===(u=M.css(e,"display"))&&(c?u=c:(xe([e],!0),c=e.style.display||c,u=M.css(e,"display"),xe([e]))),("inline"===u||"inline-block"===u&&null!=c)&&"none"===M.css(e,"float")&&(l||(h.done((function(){p.display=c})),null==c&&(u=p.display,c="none"===u?"":u)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",h.always((function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}))),l=!1,f)l||(m?"hidden"in m&&(g=m.hidden):m=oe.access(e,"fxshow",{display:c}),o&&(m.hidden=!g),g&&xe([e],!0),h.done((function(){for(r in g||xe([e]),oe.remove(e,"fxshow"),f)M.style(e,r,f[r])}))),l=yt(g?m[r]:0,r,h),r in m||(m[r]=l.start,g&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?vt.prefilters.unshift(e):vt.prefilters.push(e)}}),M.speed=function(e,t,n){var r=e&&"object"==typeof e?M.extend({},e):{complete:n||!n&&t||p(e)&&e,duration:e,easing:n&&t||t&&!p(t)&&t};return M.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in M.fx.speeds?r.duration=M.fx.speeds[r.duration]:r.duration=M.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){p(r.old)&&r.old.call(this),r.queue&&M.dequeue(this,r.queue)},r},M.fn.extend({fadeTo:function(e,t,n,r){return this.filter(me).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=M.isEmptyObject(e),o=M.speed(t,n,r),s=function(){var t=vt(this,M.extend({},e),o);(i||oe.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each((function(){var t=!0,i=null!=e&&e+"queueHooks",o=M.timers,s=oe.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&ft.test(i)&&r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||M.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=oe.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=M.timers,s=r?r.length:0;for(n.finish=!0,M.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<s;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish}))}}),M.each(["toggle","show","hide"],(function(e,t){var n=M.fn[t];M.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(mt(t,!0),e,r,i)}})),M.each({slideDown:mt("show"),slideUp:mt("hide"),slideToggle:mt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){M.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}})),M.timers=[],M.fx.tick=function(){var e,t=0,n=M.timers;for(ut=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||M.fx.stop(),ut=void 0},M.fx.timer=function(e){M.timers.push(e),M.fx.start()},M.fx.interval=13,M.fx.start=function(){dt||(dt=!0,pt())},M.fx.stop=function(){dt=null},M.fx.speeds={slow:600,fast:200,_default:400},M.fn.delay=function(t,n){return t=M.fx&&M.fx.speeds[t]||t,n=n||"fx",this.queue(n,(function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}}))},function(){var e=m.createElement("input"),t=m.createElement("select").appendChild(m.createElement("option"));e.type="checkbox",f.checkOn=""!==e.value,f.optSelected=t.selected,(e=m.createElement("input")).value="t",e.type="radio",f.radioValue="t"===e.value}();var bt,xt=M.expr.attrHandle;M.fn.extend({attr:function(e,t){return Z(this,M.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){M.removeAttr(this,e)}))}}),M.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?M.prop(e,t,n):(1===o&&M.isXMLDoc(e)||(i=M.attrHooks[t.toLowerCase()]||(M.expr.match.bool.test(t)?bt:void 0)),void 0!==n?null===n?void M.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=M.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!f.radioValue&&"radio"===t&&_(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(W);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),bt={set:function(e,t,n){return!1===t?M.removeAttr(e,n):e.setAttribute(n,n),n}},M.each(M.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=xt[t]||M.find.attr;xt[t]=function(e,t,r){var i,o,s=t.toLowerCase();return r||(o=xt[s],xt[s]=i,i=null!=n(e,t,r)?s:null,xt[s]=o),i}}));var wt=/^(?:input|select|textarea|button)$/i,Mt=/^(?:a|area)$/i;function kt(e){return(e.match(W)||[]).join(" ")}function _t(e){return e.getAttribute&&e.getAttribute("class")||""}function St(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(W)||[]}M.fn.extend({prop:function(e,t){return Z(this,M.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[M.propFix[e]||e]}))}}),M.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&M.isXMLDoc(e)||(t=M.propFix[t]||t,i=M.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=M.find.attr(e,"tabindex");return t?parseInt(t,10):wt.test(e.nodeName)||Mt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),f.optSelected||(M.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),M.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){M.propFix[this.toLowerCase()]=this})),M.fn.extend({addClass:function(e){var t,n,r,i,o,s;return p(e)?this.each((function(t){M(this).addClass(e.call(this,t,_t(this)))})):(t=St(e)).length?this.each((function(){if(r=_t(this),n=1===this.nodeType&&" "+kt(r)+" "){for(o=0;o<t.length;o++)i=t[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");s=kt(n),r!==s&&this.setAttribute("class",s)}})):this},removeClass:function(e){var t,n,r,i,o,s;return p(e)?this.each((function(t){M(this).removeClass(e.call(this,t,_t(this)))})):arguments.length?(t=St(e)).length?this.each((function(){if(r=_t(this),n=1===this.nodeType&&" "+kt(r)+" "){for(o=0;o<t.length;o++)for(i=t[o];n.indexOf(" "+i+" ")>-1;)n=n.replace(" "+i+" "," ");s=kt(n),r!==s&&this.setAttribute("class",s)}})):this:this.attr("class","")},toggleClass:function(e,t){var n,r,i,o,s=typeof e,a="string"===s||Array.isArray(e);return p(e)?this.each((function(n){M(this).toggleClass(e.call(this,n,_t(this),t),t)})):"boolean"==typeof t&&a?t?this.addClass(e):this.removeClass(e):(n=St(e),this.each((function(){if(a)for(o=M(this),i=0;i<n.length;i++)r=n[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==e&&"boolean"!==s||((r=_t(this))&&oe.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===e?"":oe.get(this,"__className__")||""))})))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+kt(_t(n))+" ").indexOf(t)>-1)return!0;return!1}});var qt=/\r/g;M.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=p(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,M(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=M.map(i,(function(e){return null==e?"":e+""}))),(t=M.valHooks[this.type]||M.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=M.valHooks[i.type]||M.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(qt,""):null==n?"":n:void 0}}),M.extend({valHooks:{option:{get:function(e){var t=M.find.attr(e,"value");return null!=t?t:kt(M.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,s="select-one"===e.type,a=s?null:[],l=s?o+1:i.length;for(r=o<0?l:s?o:0;r<l;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!_(n.parentNode,"optgroup"))){if(t=M(n).val(),s)return t;a.push(t)}return a},set:function(e,t){for(var n,r,i=e.options,o=M.makeArray(t),s=i.length;s--;)((r=i[s]).selected=M.inArray(M.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),M.each(["radio","checkbox"],(function(){M.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=M.inArray(M(e).val(),t)>-1}},f.checkOn||(M.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var Dt=e.location,Et={guid:Date.now()},Ct=/\?/;M.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return r=n&&n.getElementsByTagName("parsererror")[0],n&&!r||M.error("Invalid XML: "+(r?M.map(r.childNodes,(function(e){return e.textContent})).join("\n"):t)),n};var At=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};M.extend(M.event,{trigger:function(t,n,r,i){var o,s,a,l,c,d,h,f,y=[r||m],v=u.call(t,"type")?t.type:t,b=u.call(t,"namespace")?t.namespace.split("."):[];if(s=f=a=r=r||m,3!==r.nodeType&&8!==r.nodeType&&!At.test(v+M.event.triggered)&&(v.indexOf(".")>-1&&(b=v.split("."),v=b.shift(),b.sort()),c=v.indexOf(":")<0&&"on"+v,(t=t[M.expando]?t:new M.Event(v,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=b.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:M.makeArray(n,[t]),h=M.event.special[v]||{},i||!h.trigger||!1!==h.trigger.apply(r,n))){if(!i&&!h.noBubble&&!g(r)){for(l=h.delegateType||v,At.test(l+v)||(s=s.parentNode);s;s=s.parentNode)y.push(s),a=s;a===(r.ownerDocument||m)&&y.push(a.defaultView||a.parentWindow||e)}for(o=0;(s=y[o++])&&!t.isPropagationStopped();)f=s,t.type=o>1?l:h.bindType||v,(d=(oe.get(s,"events")||Object.create(null))[t.type]&&oe.get(s,"handle"))&&d.apply(s,n),(d=c&&s[c])&&d.apply&&re(s)&&(t.result=d.apply(s,n),!1===t.result&&t.preventDefault());return t.type=v,i||t.isDefaultPrevented()||h._default&&!1!==h._default.apply(y.pop(),n)||!re(r)||c&&p(r[v])&&!g(r)&&((a=r[c])&&(r[c]=null),M.event.triggered=v,t.isPropagationStopped()&&f.addEventListener(v,Tt),r[v](),t.isPropagationStopped()&&f.removeEventListener(v,Tt),M.event.triggered=void 0,a&&(r[c]=a)),t.result}},simulate:function(e,t,n){var r=M.extend(new M.Event,n,{type:e,isSimulated:!0});M.event.trigger(r,null,t)}}),M.fn.extend({trigger:function(e,t){return this.each((function(){M.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return M.event.trigger(e,t,n,!0)}});var Nt=/\[\]$/,Rt=/\r?\n/g,Ot=/^(?:submit|button|image|reset|file)$/i,It=/^(?:input|select|textarea|keygen)/i;function Pt(e,t,n,r){var i;if(Array.isArray(t))M.each(t,(function(t,i){n||Nt.test(e)?r(e,i):Pt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==b(t))r(e,t);else for(i in t)Pt(e+"["+i+"]",t[i],n,r)}M.param=function(e,t){var n,r=[],i=function(e,t){var n=p(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!M.isPlainObject(e))M.each(e,(function(){i(this.name,this.value)}));else for(n in e)Pt(n,e[n],t,i);return r.join("&")},M.fn.extend({serialize:function(){return M.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=M.prop(this,"elements");return e?M.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!M(this).is(":disabled")&&It.test(this.nodeName)&&!Ot.test(e)&&(this.checked||!ke.test(e))})).map((function(e,t){var n=M(this).val();return null==n?null:Array.isArray(n)?M.map(n,(function(e){return{name:t.name,value:e.replace(Rt,"\r\n")}})):{name:t.name,value:n.replace(Rt,"\r\n")}})).get()}});var Lt=/%20/g,jt=/#.*$/,zt=/([?&])_=[^&]*/,Ft=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ht=/^(?:GET|HEAD)$/,Bt=/^\/\//,Vt={},$t={},Wt="*/".concat("*"),Ut=m.createElement("a");function Yt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(W)||[];if(p(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Kt(e,t,n,r){var i={},o=e===$t;function s(a){var l;return i[a]=!0,M.each(e[a]||[],(function(e,a){var c=a(t,n,r);return"string"!=typeof c||o||i[c]?o?!(l=c):void 0:(t.dataTypes.unshift(c),s(c),!1)})),l}return s(t.dataTypes[0])||!i["*"]&&s("*")}function Xt(e,t){var n,r,i=M.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&M.extend(!0,e,r),e}Ut.href=Dt.href,M.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Dt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Dt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Wt,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":M.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Xt(Xt(e,M.ajaxSettings),t):Xt(M.ajaxSettings,e)},ajaxPrefilter:Yt(Vt),ajaxTransport:Yt($t),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var r,i,o,s,a,l,c,u,d,h,f=M.ajaxSetup({},n),p=f.context||f,g=f.context&&(p.nodeType||p.jquery)?M(p):M.event,y=M.Deferred(),v=M.Callbacks("once memory"),b=f.statusCode||{},x={},w={},k="canceled",_={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s)for(s={};t=Ft.exec(o);)s[t[1].toLowerCase()+" "]=(s[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=s[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(e,t){return null==c&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==c&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)_.always(e[_.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||k;return r&&r.abort(t),S(0,t),this}};if(y.promise(_),f.url=((t||f.url||Dt.href)+"").replace(Bt,Dt.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(W)||[""],null==f.crossDomain){l=m.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Ut.protocol+"//"+Ut.host!=l.protocol+"//"+l.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=M.param(f.data,f.traditional)),Kt(Vt,f,n,_),c)return _;for(d in(u=M.event&&f.global)&&0===M.active++&&M.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Ht.test(f.type),i=f.url.replace(jt,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Lt,"+")):(h=f.url.slice(i.length),f.data&&(f.processData||"string"==typeof f.data)&&(i+=(Ct.test(i)?"&":"?")+f.data,delete f.data),!1===f.cache&&(i=i.replace(zt,"$1"),h=(Ct.test(i)?"&":"?")+"_="+Et.guid+++h),f.url=i+h),f.ifModified&&(M.lastModified[i]&&_.setRequestHeader("If-Modified-Since",M.lastModified[i]),M.etag[i]&&_.setRequestHeader("If-None-Match",M.etag[i])),(f.data&&f.hasContent&&!1!==f.contentType||n.contentType)&&_.setRequestHeader("Content-Type",f.contentType),_.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Wt+"; q=0.01":""):f.accepts["*"]),f.headers)_.setRequestHeader(d,f.headers[d]);if(f.beforeSend&&(!1===f.beforeSend.call(p,_,f)||c))return _.abort();if(k="abort",v.add(f.complete),_.done(f.success),_.fail(f.error),r=Kt($t,f,n,_)){if(_.readyState=1,u&&g.trigger("ajaxSend",[_,f]),c)return _;f.async&&f.timeout>0&&(a=e.setTimeout((function(){_.abort("timeout")}),f.timeout));try{c=!1,r.send(x,S)}catch(e){if(c)throw e;S(-1,e)}}else S(-1,"No Transport");function S(t,n,s,l){var d,h,m,x,w,k=n;c||(c=!0,a&&e.clearTimeout(a),r=void 0,o=l||"",_.readyState=t>0?4:0,d=t>=200&&t<300||304===t,s&&(x=function(e,t,n){for(var r,i,o,s,a=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}s||(s=i)}o=o||s}if(o)return o!==l[0]&&l.unshift(o),n[o]}(f,_,s)),!d&&M.inArray("script",f.dataTypes)>-1&&M.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),x=function(e,t,n,r){var i,o,s,a,l,c={},u=e.dataTypes.slice();if(u[1])for(s in e.converters)c[s.toLowerCase()]=e.converters[s];for(o=u.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=u.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(s=c[l+" "+o]||c["* "+o]))for(i in c)if((a=i.split(" "))[1]===o&&(s=c[l+" "+a[0]]||c["* "+a[0]])){!0===s?s=c[i]:!0!==c[i]&&(o=a[0],u.unshift(a[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(e){return{state:"parsererror",error:s?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(f,x,_,d),d?(f.ifModified&&((w=_.getResponseHeader("Last-Modified"))&&(M.lastModified[i]=w),(w=_.getResponseHeader("etag"))&&(M.etag[i]=w)),204===t||"HEAD"===f.type?k="nocontent":304===t?k="notmodified":(k=x.state,h=x.data,d=!(m=x.error))):(m=k,!t&&k||(k="error",t<0&&(t=0))),_.status=t,_.statusText=(n||k)+"",d?y.resolveWith(p,[h,k,_]):y.rejectWith(p,[_,k,m]),_.statusCode(b),b=void 0,u&&g.trigger(d?"ajaxSuccess":"ajaxError",[_,f,d?h:m]),v.fireWith(p,[_,k]),u&&(g.trigger("ajaxComplete",[_,f]),--M.active||M.event.trigger("ajaxStop")))}return _},getJSON:function(e,t,n){return M.get(e,t,n,"json")},getScript:function(e,t){return M.get(e,void 0,t,"script")}}),M.each(["get","post"],(function(e,t){M[t]=function(e,n,r,i){return p(n)&&(i=i||r,r=n,n=void 0),M.ajax(M.extend({url:e,type:t,dataType:i,data:n,success:r},M.isPlainObject(e)&&e))}})),M.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),M._evalUrl=function(e,t,n){return M.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){M.globalEval(e,t,n)}})},M.fn.extend({wrapAll:function(e){var t;return this[0]&&(p(e)&&(e=e.call(this[0])),t=M(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return p(e)?this.each((function(t){M(this).wrapInner(e.call(this,t))})):this.each((function(){var t=M(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=p(e);return this.each((function(n){M(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){M(this).replaceWith(this.childNodes)})),this}}),M.expr.pseudos.hidden=function(e){return!M.expr.pseudos.visible(e)},M.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},M.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Gt={0:200,1223:204},Jt=M.ajaxSettings.xhr();f.cors=!!Jt&&"withCredentials"in Jt,f.ajax=Jt=!!Jt,M.ajaxTransport((function(t){var n,r;if(f.cors||Jt&&!t.crossDomain)return{send:function(i,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(s,i[s]);n=function(e){return function(){n&&(n=r=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Gt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),r=a.onerror=a.ontimeout=n("error"),void 0!==a.onabort?a.onabort=r:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout((function(){n&&r()}))},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}})),M.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),M.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return M.globalEval(e),e}}}),M.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),M.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=M("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),m.head.appendChild(t[0])},abort:function(){n&&n()}}}));var Zt,Qt=[],en=/(=)\?(?=&|$)|\?\?/;M.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Qt.pop()||M.expando+"_"+Et.guid++;return this[e]=!0,e}}),M.ajaxPrefilter("json jsonp",(function(t,n,r){var i,o,s,a=!1!==t.jsonp&&(en.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&en.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=p(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(en,"$1"+i):!1!==t.jsonp&&(t.url+=(Ct.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||M.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){s=arguments},r.always((function(){void 0===o?M(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Qt.push(i)),s&&p(o)&&o(s[0]),s=o=void 0})),"script"})),f.createHTMLDocument=((Zt=m.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Zt.childNodes.length),M.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(f.createHTMLDocument?((r=(t=m.implementation.createHTMLDocument("")).createElement("base")).href=m.location.href,t.head.appendChild(r)):t=m),o=!n&&[],(i=L.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&M(o).remove(),M.merge([],i.childNodes)));var r,i,o},M.fn.load=function(e,t,n){var r,i,o,s=this,a=e.indexOf(" ");return a>-1&&(r=kt(e.slice(a)),e=e.slice(0,a)),p(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),s.length>0&&M.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done((function(e){o=arguments,s.html(r?M("<div>").append(M.parseHTML(e)).find(r):e)})).always(n&&function(e,t){s.each((function(){n.apply(this,o||[e.responseText,t,e])}))}),this},M.expr.pseudos.animated=function(e){return M.grep(M.timers,(function(t){return e===t.elem})).length},M.offset={setOffset:function(e,t,n){var r,i,o,s,a,l,c=M.css(e,"position"),u=M(e),d={};"static"===c&&(e.style.position="relative"),a=u.offset(),o=M.css(e,"top"),l=M.css(e,"left"),("absolute"===c||"fixed"===c)&&(o+l).indexOf("auto")>-1?(s=(r=u.position()).top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(l)||0),p(t)&&(t=t.call(e,n,M.extend({},a))),null!=t.top&&(d.top=t.top-a.top+s),null!=t.left&&(d.left=t.left-a.left+i),"using"in t?t.using.call(e,d):u.css(d)}},M.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){M.offset.setOffset(this,e,t)}));var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===M.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===M.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=M(e).offset()).top+=M.css(e,"borderTopWidth",!0),i.left+=M.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-M.css(r,"marginTop",!0),left:t.left-i.left-M.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===M.css(e,"position");)e=e.offsetParent;return e||fe}))}}),M.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;M.fn[e]=function(r){return Z(this,(function(e,r,i){var o;if(g(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i}),e,r,arguments.length)}})),M.each(["top","left"],(function(e,t){M.cssHooks[t]=Ze(f.pixelPosition,(function(e,n){if(n)return n=Je(e,t),Ue.test(n)?M(e).position()[t]+"px":n}))})),M.each({Height:"height",Width:"width"},(function(e,t){M.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){M.fn[r]=function(i,o){var s=arguments.length&&(n||"boolean"!=typeof i),a=n||(!0===i||!0===o?"margin":"border");return Z(this,(function(t,n,i){var o;return g(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?M.css(t,n,a):M.style(t,n,i,a)}),t,s?i:void 0,s)}}))})),M.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){M.fn[t]=function(e){return this.on(t,e)}})),M.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),M.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){M.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}));var tn=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;M.proxy=function(e,t){var n,r,o;if("string"==typeof t&&(n=e[t],t=e,e=n),p(e))return r=i.call(arguments,2),o=function(){return e.apply(t||this,r.concat(i.call(arguments)))},o.guid=e.guid=e.guid||M.guid++,o},M.holdReady=function(e){e?M.readyWait++:M.ready(!0)},M.isArray=Array.isArray,M.parseJSON=JSON.parse,M.nodeName=_,M.isFunction=p,M.isWindow=g,M.camelCase=ne,M.type=b,M.now=Date.now,M.isNumeric=function(e){var t=M.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},M.trim=function(e){return null==e?"":(e+"").replace(tn,"$1")};var nn=e.jQuery,rn=e.$;return M.noConflict=function(t){return e.$===M&&(e.$=rn),t&&e.jQuery===M&&(e.jQuery=nn),M},void 0===t&&(e.jQuery=e.$=M),M}))}(i)),i.exports),a=n(s),l={"Visualization.Histogram.MeasureAxisLabel":{id:"Visualization.Histogram.MeasureAxisLabel",locale:{"en-US":"Frequency","zh-TW":"頻率","zh-CN":"频率","tr-TR":"Sıklık","sv-SE":"Frekvens","it-IT":"Frequenza","es-ES":"Frecuencia","de-DE":"Häufigkeit","pl-PL":"Częstotliwość","nl-NL":"Frequentie","ko-KR":"빈도","pt-BR":"Frequência","fr-FR":"Fréquence","ja-JP":"レコード数","ru-RU":"Частота"}},"waterfall.legend.positiveValue.label":{id:"waterfall.legend.positiveValue.label",locale:{"en-US":"Positive","zh-TW":"正值","zh-CN":"正","tr-TR":"Pozitif","sv-SE":"Positiv","it-IT":"Positivi","es-ES":"Positivo","de-DE":"Positiv","pl-PL":"Dodatnie","nl-NL":"Positief","ko-KR":"양수","pt-BR":"Positivo","fr-FR":"Positive","ja-JP":"正","ru-RU":"Положительное"}},"waterfall.legend.negativeValue.label":{id:"waterfall.legend.negativeValue.label",locale:{"en-US":"Negative","zh-TW":"負值","zh-CN":"负","tr-TR":"Negatif","sv-SE":"Negativ","it-IT":"Negativi","es-ES":"Negativo","de-DE":"Negativ","pl-PL":"Ujemne","nl-NL":"Negatief","ko-KR":"음수","pt-BR":"Negativo","fr-FR":"Négative","ja-JP":"負","ru-RU":"Отрицательное"}},"waterfall.legend.subtotal.label":{id:"waterfall.legend.subtotal.label",locale:{"en-US":"Subtotal","zh-TW":"小計","zh-CN":"小计","tr-TR":"Ara Toplam","sv-SE":"Deltotal","it-IT":"Subtotale","es-ES":"Subtotal","de-DE":"Teilsumme","pl-PL":"Suma częściowa","nl-NL":"Subtotaal","ko-KR":"소계","pt-BR":"Subtotal","fr-FR":"Sous-total","ja-JP":"小計","ru-RU":"Подытог"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"en-US":"Currently showing a limited data set.","zh-TW":"目前顯示的是有限的資料集。","zh-CN":"当前正显示有限的数据集。","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","sv-SE":"Just nu visas en begränsad uppsättning data.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","pt-BR":"Mostrando um conjunto de dados limitado.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","ja-JP":"現在、限定的なデータ セットを表示しています。","ru-RU":"В настоящее время отображается ограниченный набор данных."}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"en-US":"The chart is not displayed because it contains only undefined values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。","zh-CN":"未显示图表,因为它仅包含未定义的值。","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości niezdefiniowane.","nl-NL":"De grafiek wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения."}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"en-US":"The chart is not displayed because it contains only negative or zero values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。","zh-CN":"未显示图表,因为它仅包含负值或零值。","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa eller nollvärden","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","es-ES":"El gráfico no se muestra porque sólo contiene valores negativos o valores cero.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości ujemne lub zerowe.","nl-NL":"De grafiek wordt niet weergegeven omdat het alleen negatieve waarden of nulwaarden bevat.","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения."}},Object_Disclaimer_RequireNumericDimension:{id:"Object.Disclaimer.RequireNumericDimension",locale:{"en-US":"This visualization requires a numeric diemnsion."}},"properties.boxplot.calculationMode.tukey.elements.boxEnd":{id:"properties.boxplot.calculationMode.tukey.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.tukey.elements.boxMiddle":{id:"properties.boxplot.calculationMode.tukey.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Drittes Quartil","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.tukey.elements.boxStart":{id:"properties.boxplot.calculationMode.tukey.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.tukey.elements.firstWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.firstWhisker",locale:{"en-US":"Box start - {0} IQR","zh-TW":"方塊開始 - {0} IQR","zh-CN":"框开始 - {0} IQR","tr-TR":"Kutu başlangıcı - {0} IQR","sv-SE":"Rutans start - {0} IQR","it-IT":"Inizio scatola - {0} IQR","es-ES":"Inicio de caja - {0} IQR","de-DE":"Box-Beginn - {0} IQR","pl-PL":"Początek wykresu pudełkowego - {0} IQR","nl-NL":"Begin box - {0} IQR","ko-KR":"상자 시작 - {0} IQR","pt-BR":"Início da caixa - {0} IQR","fr-FR":"Début de la boîte - {0} IQR","ja-JP":"ボックス開始 - {0} IQR","ru-RU":"Начало поля - {0} IQR"}},"properties.boxplot.calculationMode.tukey.elements.lastWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.lastWhisker",locale:{"en-US":"Box end + {0} IQR","zh-TW":"方塊結束 + {0} IQR","zh-CN":"框结束 + {0} IQR","tr-TR":"Kutu bitişi + {0} IQR","sv-SE":"Rutans slut + {0} IQR","it-IT":"Fine scatola + {0} IQR","es-ES":"Fin de caja + {0} IQR","de-DE":"Box-Ende + {0} IQR","pl-PL":"Koniec wykresu pudełkowego - {0} IQR","nl-NL":"Einde box + {0} IQR","ko-KR":"상자 끝 + {0} IQR","pt-BR":"Fim da caixa + {0} IQR","fr-FR":"Fin de la boîte + {0} IQR","ja-JP":"ボックス終了 + {0} IQR","ru-RU":"Конец поля + {0} IQR"}},"properties.boxplot.calculationMode.stdDev.elements.boxEnd":{id:"properties.boxplot.calculationMode.stdDev.elements.boxEnd",locale:{"en-US":"Box middle + 1 standard deviation","zh-TW":"方塊中間 + 1 個標準差","zh-CN":"框中部 + 1 个标准偏差","tr-TR":"Kutu ortası + 1 standart sapma","sv-SE":"Rutans mitt + 1 standardavvikelse","it-IT":"Centro scatola + 1 deviazione standard","es-ES":"Mitad de la caja + 1 desviación estándar","de-DE":"Box-Mitte +1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego + 1 odch. stand","nl-NL":"Midden box + 1 standaardafwijking","ko-KR":"상자 중간 + 1개 표준 편차","pt-BR":"Meio da caixa + 1 desvio padrão","fr-FR":"Milieu de la boîte + 1 écart type","ja-JP":"ボックス中間 + 1 標準偏差","ru-RU":"Середина поля + 1 стандартное отклонение"}},"properties.boxplot.calculationMode.stdDev.elements.boxMiddle":{id:"properties.boxplot.calculationMode.stdDev.elements.boxMiddle",locale:{"en-US":"Average","zh-TW":"平均值","zh-CN":"平均值","tr-TR":"Ortalama","sv-SE":"Medel","it-IT":"Media","es-ES":"Media","de-DE":"Durchschnitt","pl-PL":"Średnia","nl-NL":"Gemiddelde","ko-KR":"평균","pt-BR":"Média","fr-FR":"Moyenne","ja-JP":"平均値","ru-RU":"Среднее"}},"properties.boxplot.calculationMode.stdDev.elements.boxStart":{id:"properties.boxplot.calculationMode.stdDev.elements.boxStart",locale:{"en-US":"Box middle - 1 standard deviation","zh-TW":"方塊中間 - 1 個標準差","zh-CN":"框中部 - 1 个标准偏差","tr-TR":"Kutu ortası - 1 standart sapma","sv-SE":"Rutans mitt - 1 standardavvikelse","it-IT":"Centro scatola - 1 deviazione standard","es-ES":"Mitad de la caja - {1} desviación estándar","de-DE":"Box-Mitte -1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego - 1 odch. stand","nl-NL":"Midden box - 1 standaardafwijking","ko-KR":"상자 중간 - 1개 표준 편차","pt-BR":"Середина поля - 1 стандартное отклонение","fr-FR":"Milieu de la boîte - 1 écart type","ja-JP":"ボックス中間 - 1 標準偏差","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.stdDev.elements.firstWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.firstWhisker",locale:{"en-US":"Box middle - {0} standard deviations","zh-TW":"方塊中間 - {0} 個標準差","zh-CN":"框中部 - {0} 个标准偏差","tr-TR":"Kutu ortası - {0} standart sapma","sv-SE":"Rutans mitt - {0} standardavvikelser","it-IT":"Centro scatola - {0} deviazioni standard","es-ES":"Mitad de la caja - {0} desviaciones estándar","de-DE":"Box-Mitte -{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego - {0} odch. stand","nl-NL":"Midden box - {0} standaardafwijkingen","ko-KR":"상자 중간 - {0}개 표준 편차","pt-BR":"Meio da caixa - {0} desvios padrão","fr-FR":"Milieu de la boîte - {0} écarts types","ja-JP":"ボックス中間 - {0} 標準偏差","ru-RU":"Середина поля - {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.stdDev.elements.lastWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.lastWhisker",locale:{"en-US":"Box middle + {0} standard deviations","zh-TW":"方塊中間 + {0} 個標準差","zh-CN":"框中部 + {0} 个标准偏差","tr-TR":"Kutu ortası + {0} standart sapma","sv-SE":"Rutans mitt + {0} standardavvikelser","it-IT":"Centro scatola + {0} deviazioni standard","es-ES":"Mitad de la caja + {0} desviaciones estándar","de-DE":"Box-Mitte +{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego + {0} odch. stand","nl-NL":"Midden box + {0} standaardafwijkingen","ko-KR":"상자 중간 + {0}개 표준 편차","pt-BR":"Meio da caixa + {0} desvios padrão","fr-FR":"Milieu de la boîte + {0} écarts types","ja-JP":"ボックス中間 + {0} 標準偏差","ru-RU":"Середина поля + {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.fractiles.elements.boxEnd":{id:"properties.boxplot.calculationMode.fractiles.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile<","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.boxMiddle":{id:"properties.boxplot.calculationMode.fractiles.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Median","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.fractiles.elements.boxStart":{id:"properties.boxplot.calculationMode.fractiles.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth",locale:{"en-US":"5th percentile","zh-TW":"第 5 個百分位數","zh-CN":"第 5 个百分位","tr-TR":"5. yüzdebirlik","sv-SE":"5:e percentilen","it-IT":"5° percentile","es-ES":"5º percentil","de-DE":"5. Perzentil","pl-PL":"5. percentyl","nl-NL":"5e percentiel","ko-KR":"5번째 백분위수","pt-BR":"5º percentil","fr-FR":"5e centile","ja-JP":"5 番目のパーセンタイル","ru-RU":"5-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first",locale:{"en-US":"1st percentile","zh-TW":"第 1 個百分位數","zh-CN":"第 1 个百分位","tr-TR":"1. yüzdebirlik","sv-SE":"1:e percentilen","it-IT":"1° percentile","es-ES":"1er percentil","de-DE":"1. Perzentil","pl-PL":"1. percentyl","nl-NL":"1e percentiel","ko-KR":"1번째 백분위수","pt-BR":"1º percentil","fr-FR":"1er centile","ja-JP":"1 番目のパーセンタイル","ru-RU":"1-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min",locale:{"en-US":"Minimum","zh-TW":"最小","zh-CN":"最小值","tr-TR":"En az","sv-SE":"Min","it-IT":"Minimo","es-ES":"Mínimo","de-DE":"Minimum","pl-PL":"Minimum","nl-NL":"Minimum","ko-KR":"최소","pt-BR":"Mínimo","fr-FR":"Minimale","ja-JP":"最小値","ru-RU":"Минимум"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth",locale:{"en-US":"10th percentile","zh-TW":"第 10 個百分位數","zh-CN":"第 10 个百分位","tr-TR":"10. yüzdebirlik","sv-SE":"10:e percentilen","it-IT":"10° percentile","es-ES":"10º percentil","de-DE":"10. Perzentil","pl-PL":"10. percentyl","nl-NL":"10e percentiel","ko-KR":"10번째 백분위수","pt-BR":"10º percentil","fr-FR":"10e centile","ja-JP":"10 番目のパーセンタイル","ru-RU":"10-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max",locale:{"en-US":"Maximum","zh-TW":"最大","zh-CN":"最大值","tr-TR":"En fazla","sv-SE":"Max","it-IT":"Massimo","es-ES":"Máximo","de-DE":"Maximum","pl-PL":"Maksimum","nl-NL":"Maximum","ko-KR":"최대","pt-BR":"Máximo","fr-FR":"Maximale","ja-JP":"最大値","ru-RU":"Максимум"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth",locale:{"en-US":"90th percentile","zh-TW":"第 90 個百分位數","zh-CN":"第 90 个百分位","tr-TR":"90. yüzdebirlik","sv-SE":"90:e percentilen","it-IT":"90° percentile","es-ES":"90º percentil","de-DE":"90. Perzentil","pl-PL":"90. percentyl","nl-NL":"90e percentiel","ko-KR":"90번째 백분위수","pt-BR":"90º percentil","fr-FR":"90e centile","ja-JP":"90 番目の百分位数","ru-RU":"90-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth",locale:{"en-US":"95th percentile","zh-TW":"第 95 個百分位數","zh-CN":"第 95 个百分位","tr-TR":"95. yüzdebirlik","sv-SE":"95:e percentilen","it-IT":"95° percentile","es-ES":"95º percentil","de-DE":"95. Perzentil","pl-PL":"95. percentyl","nl-NL":"95e percentiel","ko-KR":"95번째 백분위수","pt-BR":"95º percentil","fr-FR":"95e centile","ja-JP":"95 番目の百分位数","ru-RU":"95-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth",locale:{"en-US":"99th percentile","zh-TW":"第 99 個百分位數","zh-CN":"第 99 个百分位","tr-TR":"99. yüzdebirlik","sv-SE":"99:e percentilen","it-IT":"99° percentile","es-ES":"99º percentil","de-DE":"99. Perzentil","pl-PL":"99. percentyl","nl-NL":"99e percentiel","ko-KR":"99번째 백분위수","pt-BR":"99º percentil","fr-FR":"99e centile","ja-JP":"99 番目の百分位数","ru-RU":"99-й процентиль"}}};var c=Object.prototype.hasOwnProperty,u=Object.prototype.toString,d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===u.call(e)},p=function(e){if(!e||"[object Object]"!==u.call(e))return!1;var t,n=c.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&c.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||c.call(e,t)},g=function(e,t){d&&"__proto__"===t.name?d(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},m=function(e,t){if("__proto__"===t){if(!c.call(e,t))return;if(h)return h(e,t).value}return e[t]},y=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=m(a,n),a!==(i=m(t,n))&&(u&&i&&(p(i)||(o=f(i)))?(o?(o=!1,s=r&&f(r)?r:[]):s=r&&p(r)?r:{},g(a,{name:n,newValue:e(u,s,i)})):void 0!==i&&g(a,{name:n,newValue:i}));return a},v="2.8.2";function b(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function M(e){return!!e.changedTouches}function k(e){return"number"==typeof e&&!isNaN(e)}function _(e){return"number"!=typeof e||isNaN(e)}function S(e){const t=e.length;let n=NaN,r=NaN,i=NaN,o=NaN;for(let s=0;s<t;s++)n=isNaN(n)?e[s].x:Math.min(n,e[s].x),r=isNaN(r)?e[s].x:Math.max(r,e[s].x),i=isNaN(i)?e[s].y:Math.min(i,e[s].y),o=isNaN(o)?e[s].y:Math.max(o,e[s].y);return[n,i,r,o]}function q(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function D(e){return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}]}function E(e){const[t,n,r,i]=S(e);return{x:t,y:n,width:r-t,height:i-n}}function C(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function A(e){const{x:t,y:n,width:r,height:i,x1:o,x2:s,y1:a,y2:l,cx:c,cy:u,r:d,vertices:h}=e||{};return k(c)&&k(u)&&k(d)?"circle":k(o)&&k(s)&&k(a)&&k(l)?"line":k(t)&&k(n)&&k(r)&&k(i)?"rect":k(t)&&k(n)?"point":Array.isArray(h)?h.every((e=>Array.isArray(e)))?"geopolygon":"polygon":null}function T(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}var N=Math.PI,R=2*N,O=1e-6,I=R-O;function P(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function L(){return new P}function j(e){return function(){return e}}P.prototype=L.prototype={constructor:P,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var o=this._x1,s=this._y1,a=n-e,l=r-t,c=o-e,u=s-t,d=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>O)if(Math.abs(u*a-l*c)>O&&i){var h=n-o,f=r-s,p=a*a+l*l,g=h*h+f*f,m=Math.sqrt(p),y=Math.sqrt(d),v=i*Math.tan((N-Math.acos((p+d-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>O&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*f)+","+(this._x1=e+x*a)+","+(this._y1=t+x*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,r,i,o){e=+e,t=+t,o=!!o;var s=(n=+n)*Math.cos(r),a=n*Math.sin(r),l=e+s,c=t+a,u=1^o,d=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>O||Math.abs(this._y1-c)>O)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%R+R),d>I?this._+="A"+n+","+n+",0,1,"+u+","+(e-s)+","+(t-a)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>O&&(this._+="A"+n+","+n+",0,"+ +(d>=N)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var z=Math.abs,F=Math.atan2,H=Math.cos,B=Math.max,V=Math.min,$=Math.sin,W=Math.sqrt,U=1e-12,Y=Math.PI,K=Y/2,X=2*Y;function G(e){return e>=1?K:e<=-1?-K:Math.asin(e)}function J(e){return e.innerRadius}function Z(e){return e.outerRadius}function Q(e){return e.startAngle}function ee(e){return e.endAngle}function te(e){return e&&e.padAngle}function ne(e,t,n,r,i,o,s){var a=e-n,l=t-r,c=(s?o:-o)/W(a*a+l*l),u=c*l,d=-c*a,h=e+u,f=t+d,p=n+u,g=r+d,m=(h+p)/2,y=(f+g)/2,v=p-h,b=g-f,x=v*v+b*b,w=i-o,M=h*g-p*f,k=(b<0?-1:1)*W(B(0,w*w*x-M*M)),_=(M*b-v*k)/x,S=(-M*v-b*k)/x,q=(M*b+v*k)/x,D=(-M*v+b*k)/x,E=_-m,C=S-y,A=q-m,T=D-y;return E*E+C*C>A*A+T*T&&(_=q,S=D),{cx:_,cy:S,x01:-u,y01:-d,x11:_*(i/w-1),y11:S*(i/w-1)}}function re(){var e=J,t=Z,n=j(0),r=null,i=Q,o=ee,s=te,a=null;function l(){var l,c,u=+e.apply(this,arguments),d=+t.apply(this,arguments),h=i.apply(this,arguments)-K,f=o.apply(this,arguments)-K,p=z(f-h),g=f>h;if(a||(a=l=L()),d<u&&(c=d,d=u,u=c),d>U)if(p>X-U)a.moveTo(d*H(h),d*$(h)),a.arc(0,0,d,h,f,!g),u>U&&(a.moveTo(u*H(f),u*$(f)),a.arc(0,0,u,f,h,g));else{var m,y,v=h,b=f,x=h,w=f,M=p,k=p,_=s.apply(this,arguments)/2,S=_>U&&(r?+r.apply(this,arguments):W(u*u+d*d)),q=V(z(d-u)/2,+n.apply(this,arguments)),D=q,E=q;if(S>U){var C=G(S/u*$(_)),A=G(S/d*$(_));(M-=2*C)>U?(x+=C*=g?1:-1,w-=C):(M=0,x=w=(h+f)/2),(k-=2*A)>U?(v+=A*=g?1:-1,b-=A):(k=0,v=b=(h+f)/2)}var T=d*H(v),N=d*$(v),R=u*H(w),O=u*$(w);if(q>U){var I,P=d*H(b),j=d*$(b),B=u*H(x),J=u*$(x);if(p<Y&&(I=function(e,t,n,r,i,o,s,a){var l=n-e,c=r-t,u=s-i,d=a-o,h=d*l-u*c;if(!(h*h<U))return[e+(h=(u*(t-o)-d*(e-i))/h)*l,t+h*c]}(T,N,B,J,P,j,R,O))){var Z=T-I[0],Q=N-I[1],ee=P-I[0],te=j-I[1],re=1/$(function(e){return e>1?0:e<-1?Y:Math.acos(e)}((Z*ee+Q*te)/(W(Z*Z+Q*Q)*W(ee*ee+te*te)))/2),ie=W(I[0]*I[0]+I[1]*I[1]);D=V(q,(u-ie)/(re-1)),E=V(q,(d-ie)/(re+1))}}k>U?E>U?(m=ne(B,J,T,N,d,E,g),y=ne(P,j,R,O,d,E,g),a.moveTo(m.cx+m.x01,m.cy+m.y01),E<q?a.arc(m.cx,m.cy,E,F(m.y01,m.x01),F(y.y01,y.x01),!g):(a.arc(m.cx,m.cy,E,F(m.y01,m.x01),F(m.y11,m.x11),!g),a.arc(0,0,d,F(m.cy+m.y11,m.cx+m.x11),F(y.cy+y.y11,y.cx+y.x11),!g),a.arc(y.cx,y.cy,E,F(y.y11,y.x11),F(y.y01,y.x01),!g))):(a.moveTo(T,N),a.arc(0,0,d,v,b,!g)):a.moveTo(T,N),u>U&&M>U?D>U?(m=ne(R,O,P,j,u,-D,g),y=ne(T,N,B,J,u,-D,g),a.lineTo(m.cx+m.x01,m.cy+m.y01),D<q?a.arc(m.cx,m.cy,D,F(m.y01,m.x01),F(y.y01,y.x01),!g):(a.arc(m.cx,m.cy,D,F(m.y01,m.x01),F(m.y11,m.x11),!g),a.arc(0,0,u,F(m.cy+m.y11,m.cx+m.x11),F(y.cy+y.y11,y.cx+y.x11),g),a.arc(y.cx,y.cy,D,F(y.y11,y.x11),F(y.y01,y.x01),!g))):a.arc(0,0,u,w,x,g):a.lineTo(R,O)}else a.moveTo(0,0);if(a.closePath(),l)return a=null,l+""||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Y/2;return[H(r)*n,$(r)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:j(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:j(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:j(+e),l):n},l.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:j(+e),l):r},l.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:j(+e),l):i},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:j(+e),l):o},l.padAngle=function(e){return arguments.length?(s="function"==typeof e?e:j(+e),l):s},l.context=function(e){return arguments.length?(a=null==e?null:e,l):a},l}function ie(e){this._context=e}function oe(e){return new ie(e)}function se(e){return e[0]}function ae(e){return e[1]}function le(){var e=se,t=null,n=j(0),r=ae,i=j(!0),o=null,s=oe,a=null;function l(l){var c,u,d,h,f,p=l.length,g=!1,m=new Array(p),y=new Array(p);for(null==o&&(a=s(f=L())),c=0;c<=p;++c){if(!(c<p&&i(h=l[c],c,l))===g)if(g=!g)u=c,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),d=c-1;d>=u;--d)a.point(m[d],y[d]);a.lineEnd(),a.areaEnd()}g&&(m[c]=+e(h,c,l),y[c]=+n(h,c,l),a.point(t?+t(h,c,l):m[c],r?+r(h,c,l):y[c]))}if(f)return a=null,f+""||null}function c(){return function(){var e=se,t=ae,n=j(!0),r=null,i=oe,o=null;function s(s){var a,l,c,u=s.length,d=!1;for(null==r&&(o=i(c=L())),a=0;a<=u;++a)!(a<u&&n(l=s[a],a,s))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(l,a,s),+t(l,a,s));if(c)return o=null,c+""||null}return s.x=function(t){return arguments.length?(e="function"==typeof t?t:j(+t),s):e},s.y=function(e){return arguments.length?(t="function"==typeof e?e:j(+e),s):t},s.defined=function(e){return arguments.length?(n="function"==typeof e?e:j(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),s):i},s.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),s):r},s}().defined(i).curve(s).context(o)}return l.x=function(n){return arguments.length?(e="function"==typeof n?n:j(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:j(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:j(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:j(+e),r=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:j(+e),l):n},l.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:j(+e),l):r},l.lineX0=l.lineY0=function(){return c().x(e).y(n)},l.lineY1=function(){return c().x(e).y(r)},l.lineX1=function(){return c().x(t).y(n)},l.defined=function(e){return arguments.length?(i="function"==typeof e?e:j(!!e),l):i},l.curve=function(e){return arguments.length?(s=e,null!=o&&(a=s(o)),l):s},l.context=function(e){return arguments.length?(null==e?o=a=null:a=s(o=e),l):o},l}function ce(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function ue(e){return e}ie.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var de=Array.prototype.slice;function he(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function fe(e){this._context=e}function pe(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function ge(e,t){this._context=e,this._k=(1-t)/6}fe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:he(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:he(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},ge.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:pe(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:pe(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var me=function e(t){function n(e){return new ge(e,t)}return n.tension=function(t){return e(+t)},n}(0);function ye(e,t){this._context=e,this._alpha=t}ye.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var r=e._x1,i=e._y1,o=e._x2,s=e._y2;if(e._l01_a>U){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>U){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,s=(s*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,s,e._x2,e._y2)}(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ve=function e(t){function n(e){return t?new ye(e,t):new ge(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function be(e){return e<0?-1:1}function xe(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(be(o)+be(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function we(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Me(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,a=(o-r)/3;e._context.bezierCurveTo(r+a,i+a*t,o-a,s-a*n,o,s)}function ke(e){this._context=e}function _e(e){this._context=new Se(e)}function Se(e){this._context=e}function qe(e){this._context=e}function De(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),s=new Array(r);for(i[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,s[t]-=n*s[t-1];for(i[r-1]=s[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function Ee(e,t){this._context=e,this._t=t}function Ce(e,t){if((i=e.length)>1)for(var n,r,i,o=1,s=e[t[0]],a=s.length;o<i;++o)for(r=s,s=e[t[o]],n=0;n<a;++n)s[n][1]+=s[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function Ae(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Te(e,t){return e[t]}function Ne(e){for(var t,n=-1,r=0,i=e.length,o=-1/0;++n<i;)(t=+e[n][1])>o&&(o=t,r=n);return r}function Re(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function Oe(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",r=arguments.length>2?arguments[2]:void 0;const i={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};function s(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in i)&&(i[e]=t,!0)}function a(e){return i[e]||o.get(e)}function l(e,i){if(void 0!==i)return s(e,i);const o=a(e);return r&&void 0===o&&r.warn("".concat(e," does not exist in ").concat(n," registry")),o||a(t)}return t=o.default(),l.add=s,l.get=a,l.has=function(e){return!!i[e]||o.has(e)},l.remove=function(e){const t=i[e];return delete i[e],t},l.getKeys=function(){return Object.keys(i)},l.getValues=function(){return Object.keys(i).map((e=>i[e]))},l.default=function(e){return void 0!==e&&(t=e),t},l.register=s,l}function Ie(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Pe(e){return(e=Ie(Math.abs(e)))?e[1]:NaN}ke.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Me(this,this._t0,we(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Me(this,we(this,n=xe(this,e,t)),n);break;default:Me(this,this._t0,n=xe(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(_e.prototype=Object.create(ke.prototype)).point=function(e,t){ke.prototype.point.call(this,t,e)},Se.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},qe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=De(e),i=De(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[s],t[s]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},Ee.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var Le,je=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ze(e){if(!(t=je.exec(e)))throw new Error("invalid format: "+e);var t;return new Fe({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function Fe(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function He(e,t){var n=Ie(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}ze.prototype=Fe.prototype,Fe.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Be={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>He(100*e,t),r:He,s:function(e,t){var n=Ie(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(Le=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Ie(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Ve(e){return e}var $e,We,Ue,Ye=Array.prototype.map,Ke=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Xe(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?Ve:(t=Ye.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],s=0,a=t[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(e.substring(i-=a,i+a)),!((l+=a+1)>r));)a=t[s=(s+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",s=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?Ve:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(Ye.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=ze(e)).fill,n=e.align,d=e.sign,h=e.symbol,f=e.zero,p=e.width,g=e.comma,m=e.precision,y=e.trim,v=e.type;"n"===v?(g=!0,v="g"):Be[v]||(void 0===m&&(m=12),y=!0,v="g"),(f||"0"===t&&"="===n)&&(f=!0,t="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===h?o:/[%p]/.test(v)?l:"",w=Be[v],M=/[defgprs%]/.test(v);function k(e){var i,o,l,h=b,k=x;if("c"===v)k=w(e)+k,e="";else{var _=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),m),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),_&&0===+e&&"+"!==d&&(_=!1),h=(_?"("===d?d:c:"-"===d||"("===d?"":d)+h,k=("s"===v?Ke[8+Le/3]:"")+k+(_&&"("===d?")":""),M)for(i=-1,o=e.length;++i<o;)if(48>(l=e.charCodeAt(i))||l>57){k=(46===l?s+e.slice(i+1):e.slice(i))+k,e=e.slice(0,i);break}}g&&!f&&(e=r(e,1/0));var S=h.length+e.length+k.length,q=S<p?new Array(p-S+1).join(t):"";switch(g&&f&&(e=r(q+e,q.length?p-k.length:1/0),q=""),n){case"<":e=h+e+k+q;break;case"=":e=h+q+e+k;break;case"^":e=q.slice(0,S=q.length>>1)+h+e+k+q.slice(S);break;default:e=q+h+e+k}return a(e)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),k.toString=function(){return e+""},k}return{format:d,formatPrefix:function(e,t){var n=d(((e=ze(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(Pe(t)/3))),i=Math.pow(10,-r),o=Ke[8+r/3];return function(e){return n(i*e)+o}}}}!function(e){$e=Xe(e),We=$e.format,Ue=$e.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const Ge=new Date,Je=new Date;function Ze(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;let a;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=n=>Ze((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})),n&&(i.count=(t,r)=>(Ge.setTime(+t),Je.setTime(+r),e(Ge),e(Je),Math.floor(n(Ge,Je))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i:null)),i}const Qe=6e4,et=864e5,tt=6048e5,nt=Ze((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Qe)/et),(e=>e.getDate()-1));nt.range;const rt=Ze((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/et),(e=>e.getUTCDate()-1));rt.range;const it=Ze((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/et),(e=>Math.floor(e/et)));function ot(e){return Ze((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Qe)/tt))}it.range;const st=ot(0),at=ot(1),lt=ot(2),ct=ot(3),ut=ot(4),dt=ot(5),ht=ot(6);function ft(e){return Ze((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/tt))}st.range,at.range,lt.range,ct.range,ut.range,dt.range,ht.range;const pt=ft(0),gt=ft(1),mt=ft(2),yt=ft(3),vt=ft(4),bt=ft(5),xt=ft(6);pt.range,gt.range,mt.range,yt.range,vt.range,bt.range,xt.range;const wt=Ze((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));wt.every=e=>isFinite(e=Math.floor(e))&&e>0?Ze((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,wt.range;const Mt=Ze((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));function kt(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function _t(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function St(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<0?i=t+1:o=t}while(i<o)}return i}return 2!==e.length?(t=kt,n=(t,n)=>kt(e(t),n),r=(t,n)=>e(t)-n):(t=e===kt||e===_t?e:qt,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const s=i(e,t,n,o-1);return s>n&&r(e[s-1],t)>-r(e[s],t)?s-1:s},right:function(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<=0?i=t+1:o=t}while(i<o)}return i}}}function qt(){return 0}Mt.every=e=>isFinite(e=Math.floor(e))&&e>0?Ze((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,Mt.range;const Dt=St(kt).right;St((function(e){return null===e?NaN:+e})).center;var Et=Dt;class Ct extends Map{constructor(e,t=Tt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(At(this,e))}has(e){return super.has(At(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const r=t(n);e.has(r)&&(n=e.get(r),e.delete(r));return n}(this,e))}}function At({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Tt(e){return null!==e&&"object"==typeof e?e.valueOf():e}const Nt=Math.sqrt(50),Rt=Math.sqrt(10),Ot=Math.sqrt(2);function It(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=Nt?10:o>=Rt?5:o>=Ot?2:1;let a,l,c;return i<0?(c=Math.pow(10,-i)/s,a=Math.round(e*c),l=Math.round(t*c),a/c<e&&++a,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*s,a=Math.round(e/c),l=Math.round(t/c),a*c<e&&++a,l*c>t&&--l),l<a&&.5<=n&&n<2?It(e,t,2*n):[a,l,c]}function Pt(e,t,n){return It(e=+e,t=+t,n=+n)[2]}function Lt(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function jt(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function zt(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Ft(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,s=e.shortDays,a=e.months,l=e.shortMonths,c=Yt(i),u=Kt(i),d=Yt(o),h=Kt(o),f=Yt(s),p=Kt(s),g=Yt(a),m=Kt(a),y=Yt(l),v=Kt(l),b={a:function(e){return s[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return a[e.getMonth()]},c:null,d:mn,e:mn,f:wn,g:Nn,G:On,H:yn,I:vn,j:bn,L:xn,m:Mn,M:kn,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:rr,s:ir,S:_n,u:Sn,U:qn,V:En,w:Cn,W:An,x:null,X:null,y:Tn,Y:Rn,Z:In,"%":nr},x={a:function(e){return s[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return a[e.getUTCMonth()]},c:null,d:Pn,e:Pn,f:Hn,g:Zn,G:er,H:Ln,I:jn,j:zn,L:Fn,m:Bn,M:Vn,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:rr,s:ir,S:$n,u:Wn,U:Un,V:Kn,w:Xn,W:Gn,x:null,X:null,y:Jn,Y:Qn,Z:tr,"%":nr},w={a:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=g.exec(t.slice(n));return r?(e.m=m.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return _(e,t,n,r)},d:sn,e:sn,f:hn,g:tn,G:en,H:ln,I:ln,j:an,L:dn,m:on,M:cn,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:rn,Q:pn,s:gn,S:un,u:Gt,U:Jt,V:Zt,w:Xt,W:Qt,x:function(e,t,r){return _(e,n,t,r)},X:function(e,t,n){return _(e,r,t,n)},y:tn,Y:en,Z:nn,"%":fn};function M(e,t){return function(n){var r,i,o,s=[],a=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++a<c;)37===e.charCodeAt(a)&&(s.push(e.slice(l,a)),null!=(i=Ht[r=e.charAt(++a)])?r=e.charAt(++a):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),s.push(r),l=a+1);return s.push(e.slice(l,a)),s.join("")}}function k(e,t){return function(n){var r,i,o=zt(1900,void 0,1);if(_(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=jt(zt(o.y,0,1))).getUTCDay(),r=i>4||0===i?gt.ceil(r):gt(r),r=rt.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=Lt(zt(o.y,0,1))).getDay(),r=i>4||0===i?at.ceil(r):at(r),r=nt.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?jt(zt(o.y,0,1)).getUTCDay():Lt(zt(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,jt(o)):Lt(o)}}function _(e,t,n,r){for(var i,o,s=0,a=t.length,l=n.length;s<a;){if(r>=l)return-1;if(37===(i=t.charCodeAt(s++))){if(i=t.charAt(s++),!(o=w[i in Ht?t.charAt(s++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=M(n,b),b.X=M(r,b),b.c=M(t,b),x.x=M(n,x),x.X=M(r,x),x.c=M(t,x),{format:function(e){var t=M(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=k(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=M(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=k(e+="",!0);return t.toString=function(){return e},t}}}var Ht={"-":"",_:" ",0:"0"},Bt=/^\s*\d+/,Vt=/^%/,$t=/[\\^$*+?|[\]().{}]/g;function Wt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function Ut(e){return e.replace($t,"\\$&")}function Yt(e){return new RegExp("^(?:"+e.map(Ut).join("|")+")","i")}function Kt(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function Xt(e,t,n){var r=Bt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Gt(e,t,n){var r=Bt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Jt(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Zt(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Qt(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function en(e,t,n){var r=Bt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function tn(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function nn(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function rn(e,t,n){var r=Bt.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function on(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function sn(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function an(e,t,n){var r=Bt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ln(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function cn(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function un(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function dn(e,t,n){var r=Bt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function hn(e,t,n){var r=Bt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function fn(e,t,n){var r=Vt.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function pn(e,t,n){var r=Bt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function gn(e,t,n){var r=Bt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function mn(e,t){return Wt(e.getDate(),t,2)}function yn(e,t){return Wt(e.getHours(),t,2)}function vn(e,t){return Wt(e.getHours()%12||12,t,2)}function bn(e,t){return Wt(1+nt.count(wt(e),e),t,3)}function xn(e,t){return Wt(e.getMilliseconds(),t,3)}function wn(e,t){return xn(e,t)+"000"}function Mn(e,t){return Wt(e.getMonth()+1,t,2)}function kn(e,t){return Wt(e.getMinutes(),t,2)}function _n(e,t){return Wt(e.getSeconds(),t,2)}function Sn(e){var t=e.getDay();return 0===t?7:t}function qn(e,t){return Wt(st.count(wt(e)-1,e),t,2)}function Dn(e){var t=e.getDay();return t>=4||0===t?ut(e):ut.ceil(e)}function En(e,t){return e=Dn(e),Wt(ut.count(wt(e),e)+(4===wt(e).getDay()),t,2)}function Cn(e){return e.getDay()}function An(e,t){return Wt(at.count(wt(e)-1,e),t,2)}function Tn(e,t){return Wt(e.getFullYear()%100,t,2)}function Nn(e,t){return Wt((e=Dn(e)).getFullYear()%100,t,2)}function Rn(e,t){return Wt(e.getFullYear()%1e4,t,4)}function On(e,t){var n=e.getDay();return Wt((e=n>=4||0===n?ut(e):ut.ceil(e)).getFullYear()%1e4,t,4)}function In(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Wt(t/60|0,"0",2)+Wt(t%60,"0",2)}function Pn(e,t){return Wt(e.getUTCDate(),t,2)}function Ln(e,t){return Wt(e.getUTCHours(),t,2)}function jn(e,t){return Wt(e.getUTCHours()%12||12,t,2)}function zn(e,t){return Wt(1+rt.count(Mt(e),e),t,3)}function Fn(e,t){return Wt(e.getUTCMilliseconds(),t,3)}function Hn(e,t){return Fn(e,t)+"000"}function Bn(e,t){return Wt(e.getUTCMonth()+1,t,2)}function Vn(e,t){return Wt(e.getUTCMinutes(),t,2)}function $n(e,t){return Wt(e.getUTCSeconds(),t,2)}function Wn(e){var t=e.getUTCDay();return 0===t?7:t}function Un(e,t){return Wt(pt.count(Mt(e)-1,e),t,2)}function Yn(e){var t=e.getUTCDay();return t>=4||0===t?vt(e):vt.ceil(e)}function Kn(e,t){return e=Yn(e),Wt(vt.count(Mt(e),e)+(4===Mt(e).getUTCDay()),t,2)}function Xn(e){return e.getUTCDay()}function Gn(e,t){return Wt(gt.count(Mt(e)-1,e),t,2)}function Jn(e,t){return Wt(e.getUTCFullYear()%100,t,2)}function Zn(e,t){return Wt((e=Yn(e)).getUTCFullYear()%100,t,2)}function Qn(e,t){return Wt(e.getUTCFullYear()%1e4,t,4)}function er(e,t){var n=e.getUTCDay();return Wt((e=n>=4||0===n?vt(e):vt.ceil(e)).getUTCFullYear()%1e4,t,4)}function tr(){return"+0000"}function nr(){return"%"}function rr(e){return+e}function ir(e){return Math.floor(+e/1e3)}const or=Oe();or("d3-number",(function(e,t,n){let r,i;function o(e){return i(e)}function s(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return r=Xe(t),i=r.format(e),this},s(),o.format=function(e,i,o,a){return(o||a)&&(t=o,n=a,s()),r.format(e)(i)},o.pattern=function(t){return t&&(e=t,i=r.format(t)),e},o})),or("d3-time",(function(e){let t=Ft({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),n=t.format(e);function r(e){return n(e)}return r.format=function(e,n){return t.format(e)(n)},r.locale=function(){return t=Ft(...arguments),n=t.format(e),this},r.parse=function(e,n){return t.parse(e)(n)},r.parsePattern=function(e){return t.parse(e)},r}));const sr={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return or(t.type||"d3-number")(t.format||"")})(e)};function ar(e){let{id:t=sr.id,key:n=sr.key,min:r=sr.min,max:i=sr.max,type:o=sr.type,tags:s=sr.tags,title:a=sr.title,values:l=sr.values,value:c=sr.value,label:u=sr.label,formatter:d=sr.formatter}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{id:()=>t(e),key:()=>n(e),raw:()=>e,tags:()=>s(e),type:()=>o(e),min:()=>r(e),max:()=>i(e),title:()=>a(e),items:()=>l(e),formatter:()=>d(e),value:c,label:u}}const lr=e=>e.filter((e=>"number"==typeof e&&!isNaN(e))),cr=e=>e.reduce(((e,t)=>e+t),0),ur={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=lr(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=lr(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=lr(e);return t.length?t.reduce(((e,t)=>e+t),0):NaN},avg:e=>{const t=lr(e),n=t.length;return n?cr(t)/n:NaN}};function dr(e,t,n,r){const i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach((s=>{const a=n[s],l=i[s]={};-1!==["number","string","boolean"].indexOf(typeof a)?(l.type="primitive",l.value=a):"function"==typeof a?(l.type="function",l.value=a,l.label=a,l.field=o):"object"==typeof a&&(a.fields?l.fields=a.fields.map((n=>dr(e,t,{main:n},r).main)):void 0!==a.field?(l.type="field",l.field=t.field(a.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof a.filter&&(l.filter=a.filter),void 0!==a.value&&(l.value=a.value),void 0!==a.label&&(l.label=a.label),"function"==typeof a.reduce?l.reduce=a.reduce:a.reduce?l.reduce=ur[a.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?ur[l.field.reduce]:l.field.reduce),"function"==typeof a.reduceLabel?l.reduceLabel=a.reduceLabel:a.reduceLabel?l.reduceLabel=ur[a.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?ur[l.field.reduceLabel]:l.field.reduceLabel))})),i}function hr(e,t){const{main:n}=dr(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{});return{props:dr(e,t,e.props||{},n),main:n}}function fr(e,t,n,r){const i=Array(e.length),o=Array(e.length);let s;for(let t=0;t<e.length;t++)s=r?e[t][r]:e[t],i[t]=s.value,o[t]=s.label;const a=t.reduce,l=t.reduceLabel,c=a?a(i):i,u={value:c,label:l?l(o,c):n?n(c):String(c)};return r&&e[0][r].source?(u.source=e[0][r].source,u):!r&&e[0].source?(u.source=e[0].source,u):u}function pr(e,t){let{main:n,propsArr:r,props:i}=t,o=[];const s=n.field.formatter(),a={};return r.forEach((e=>{a[e]=i[e].field?i[e].field.formatter():e=>e})),o.push(...e.map((e=>{const t=fr(e.items,n,s);return r.forEach((n=>{t[n]=fr(e.items,i[n],a[n],n)})),t}))),o}function gr(e){let{cfg:t,itemData:n,obj:r,target:i,tracker:o,trackType:s}=e;const a="function"===s?t.trackBy(n):n[t.trackBy];let l=o[a];l||(l=o[a]={items:[],id:a},i.push(l)),l.items.push(r)}function mr(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let r=0;r<n;r++)t<e[r]&&(t=e[r]);return t}function yr(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let r=0;r<n;r++)t>e[r]&&(t=e[r]);return t}const vr={diverging:function(e,t){if((a=e.length)>0)for(var n,r,i,o,s,a,l=0,c=e[t[0]].length;l<c;++l)for(o=s=0,n=0;n<a;++n)(i=(r=e[t[n]][l])[1]-r[0])>=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=s,r[0]=s+=i):r[0]=o},none:Ce,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],o=i.length;r<o;++r){for(var s=0,a=0;s<n;++s)a+=e[s][r][1]||0;i[r][1]+=i[r][0]=-a/2}Ce(e,t)}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,s=e[0].length;o<s;++o){for(i=n=0;n<r;++n)i+=e[n][o][1]||0;if(i)for(n=0;n<r;++n)e[n][o][1]/=i}Ce(e,t)}},wiggle:function(e,t){if((i=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,o=0,s=1;s<r;++s){for(var a=0,l=0,c=0;a<i;++a){for(var u=e[t[a]],d=u[s][1]||0,h=(d-(u[s-1][1]||0))/2,f=0;f<a;++f){var p=e[t[f]];h+=(p[s][1]||0)-(p[s-1][1]||0)}l+=d,c+=h*d}n[s-1][1]+=n[s-1][0]=o,l&&(o-=c/l)}n[s-1][1]+=n[s-1][0]=o,Ce(e,t)}}},br={ascending:function(e){var t=e.map(Re);return Ae(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,r=e.length,i=e.map(Re),o=function(e){var t=e.map(Ne);return Ae(e).sort((function(e,n){return t[e]-t[n]}))}(e),s=0,a=0,l=[],c=[];for(t=0;t<r;++t)n=o[t],s<a?(s+=i[n],l.push(n)):(a+=i[n],c.push(n));return c.reverse().concat(l)},none:Ae,reverse:function(e){return Ae(e).reverse()}};function xr(e,t,n){const r={},i=t.stackKey,o=t.value,s=t.startProp||"start",a=t.endProp||"end",l=t.offset||"none",c=t.order||"none",u=t.valueRef||"";let d=0,h={};for(let t=0;t<e.items.length;t++){let n=e.items[t],o=u?n[u]:null;if(o&&o.source){let e="".concat(o.source.key||"","/").concat(o.source.field);h[e]||(h[e]=o.source)}let s=i(n);r[s]=r[s]||{items:[]},r[s].items.push(n),d=Math.max(d,r[s].items.length)}const f=Array.apply(null,{length:d}).map(Number.call,Number),p=Object.keys(r).map((e=>r[e].items)),g=function(){var e=j([]),t=Ae,n=Ce,r=Te;function i(i){var o,s,a=e.apply(this,arguments),l=i.length,c=a.length,u=new Array(c);for(o=0;o<c;++o){for(var d,h=a[o],f=u[o]=new Array(l),p=0;p<l;++p)f[p]=d=[0,+r(i[p],h,p,i)],d.data=i[p];f.key=h}for(o=0,s=t(u);o<c;++o)u[s[o]].index=o;return n(u,s),u}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:j(de.call(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:j(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?Ae:"function"==typeof e?e:j(de.call(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?Ce:e,i):n},i}().keys(f).value(((e,t)=>e[t]?o(e[t]):0)).order(br[c]).offset(vr[l]);let m=g(p),y=[];for(let e=0;e<m.length;e++){let t=m[e];for(let e=0;e<t.length;e++){let n=t[e],r=t[e].data[t.key];r&&(r[s]={value:n[0]},r[a]={value:n[1]},y.push(n[0],n[1]))}}let v=Object.keys(h).map((e=>{let t=n(h[e].key);return t?t.field(h[e].field):null})).filter((e=>!!e));const b=ar({title:v.map((e=>e.title())).join(", "),min:yr(y),max:mr(y),type:"measure",formatter:v[0]?v[0].formatter:void 0});e.fields.push(b)}function wr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).logger;if(Array.isArray(e))n.items=e.map((e=>({value:e,label:String(e)})));else if(e){if("collection"in e)n=w({},t.collection(e.collection));else{const i=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),s=e.label||(e=>e);if(e.groupBy||e.mapTo)r.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=i.hierarchy?i.hierarchy(e.hierarchy):null,n.fields=i.fields();else if(e.items)n.items=e.skipNormalize?e.items:e.items.map((e=>({value:o(e),label:String(s(e))})));else if(e.extract){const r=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];r.forEach((e=>{const r=e.source?t.dataset(e.source):i;r&&(n.items=[...n.items,...r.extract(e)],void 0!==e.field&&o.push(r.field(e.field)))})),o.length&&(n.fields=o),e.amend&&Array.isArray(e.amend)&&(n.items=[...n.items,...e.amend])}else if(void 0!==e.field&&i){const t=i.field(e.field);t&&(n.fields||(n.fields=[]),n.fields.push(t),"value"in e||(o=t.value||(e=>e),s=t.label||(e=>e),n.value=o),n.items=t.items().map((t=>({value:o(t),label:String(s(t)),source:{field:e.field}}))))}else e.fields&&e.fields.forEach((e=>{const r="object"==typeof e&&e.source?t.dataset(e.source):i;if(!r)return;let o;o="object"==typeof e&&void 0!==e.field?r.field(e.field):r.field(e),o&&(n.fields||(n.fields=[]),n.fields.push(o))}));n.items&&e.map&&(n.items=n.items.map(e.map))}e&&e.stack&&xr(n,e.stack,t.dataset)}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&n.items&&(n.items=n.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&n.items&&(n.items=n.items.sort(e.sort)),n}function Mr(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:wr;if(e.data){const r=i(e.data,t,n);if(r&&r.fields&&r.fields[0])return r.fields[0].formatter()}if(r=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(r)){return n.formatter.get(r)(e.format||"")}throw new Error("Formatter of type '".concat(r,"' was not found"))}function kr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const _r=Symbol("implicit");function Sr(){var e=new Ct,t=[],n=[],r=_r;function i(i){let o=e.get(i);if(void 0===o){if(r!==_r)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new Ct;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return Sr(t,n).unknown(r)},kr.apply(i,arguments),i}function qr(){var e,t,n=Sr().unknown(void 0),r=n.domain,i=n.range,o=0,s=1,a=!1,l=0,c=0,u=.5;function d(){var n=r().length,d=s<o,h=d?s:o,f=d?o:s;e=(f-h)/Math.max(1,n-l+2*c),a&&(e=Math.floor(e)),h+=(f-h-e*(n-l))*u,t=e*(1-l),a&&(h=Math.round(h),t=Math.round(t));var p=function(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r<i;)o[r]=e+r*n;return o}(n).map((function(t){return h+e*t}));return i(d?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),d()):r()},n.range=function(e){return arguments.length?([o,s]=e,o=+o,s=+s,d()):[o,s]},n.rangeRound=function(e){return[o,s]=e,o=+o,s=+s,a=!0,d()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(a=!!e,d()):a},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),d()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),d()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,d()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},n.copy=function(){return qr(r(),[o,s]).round(a).paddingInner(l).paddingOuter(c).align(u)},kr.apply(d(),arguments)}function Dr(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Er(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Cr(){}var Ar=.7,Tr=1/Ar,Nr="\\s*([+-]?\\d+)\\s*",Rr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Or="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ir=/^#([0-9a-f]{3,8})$/,Pr=new RegExp(`^rgb\\(${Nr},${Nr},${Nr}\\)$`),Lr=new RegExp(`^rgb\\(${Or},${Or},${Or}\\)$`),jr=new RegExp(`^rgba\\(${Nr},${Nr},${Nr},${Rr}\\)$`),zr=new RegExp(`^rgba\\(${Or},${Or},${Or},${Rr}\\)$`),Fr=new RegExp(`^hsl\\(${Rr},${Or},${Or}\\)$`),Hr=new RegExp(`^hsla\\(${Rr},${Or},${Or},${Rr}\\)$`),Br={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Vr(){return this.rgb().formatHex()}function $r(){return this.rgb().formatRgb()}function Wr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ir.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Ur(t):3===n?new Xr(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Yr(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Yr(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Pr.exec(e))?new Xr(t[1],t[2],t[3],1):(t=Lr.exec(e))?new Xr(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=jr.exec(e))?Yr(t[1],t[2],t[3],t[4]):(t=zr.exec(e))?Yr(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Fr.exec(e))?ti(t[1],t[2]/100,t[3]/100,1):(t=Hr.exec(e))?ti(t[1],t[2]/100,t[3]/100,t[4]):Br.hasOwnProperty(e)?Ur(Br[e]):"transparent"===e?new Xr(NaN,NaN,NaN,0):null}function Ur(e){return new Xr(e>>16&255,e>>8&255,255&e,1)}function Yr(e,t,n,r){return r<=0&&(e=t=n=NaN),new Xr(e,t,n,r)}function Kr(e,t,n,r){return 1===arguments.length?function(e){return e instanceof Cr||(e=Wr(e)),e?new Xr((e=e.rgb()).r,e.g,e.b,e.opacity):new Xr}(e):new Xr(e,t,n,null==r?1:r)}function Xr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Gr(){return`#${ei(this.r)}${ei(this.g)}${ei(this.b)}`}function Jr(){const e=Zr(this.opacity);return`${1===e?"rgb(":"rgba("}${Qr(this.r)}, ${Qr(this.g)}, ${Qr(this.b)}${1===e?")":`, ${e})`}`}function Zr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Qr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ei(e){return((e=Qr(e))<16?"0":"")+e.toString(16)}function ti(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ri(e,t,n,r)}function ni(e){if(e instanceof ri)return new ri(e.h,e.s,e.l,e.opacity);if(e instanceof Cr||(e=Wr(e)),!e)return new ri;if(e instanceof ri)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new ri(s,a,l,e.opacity)}function ri(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function ii(e){return(e=(e||0)%360)<0?e+360:e}function oi(e){return Math.max(0,Math.min(1,e||0))}function si(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Dr(Cr,Wr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Vr,formatHex:Vr,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ni(this).formatHsl()},formatRgb:$r,toString:$r}),Dr(Xr,Kr,Er(Cr,{brighter(e){return e=null==e?Tr:Math.pow(Tr,e),new Xr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Ar:Math.pow(Ar,e),new Xr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Xr(Qr(this.r),Qr(this.g),Qr(this.b),Zr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Gr,formatHex:Gr,formatHex8:function(){return`#${ei(this.r)}${ei(this.g)}${ei(this.b)}${ei(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Jr,toString:Jr})),Dr(ri,(function(e,t,n,r){return 1===arguments.length?ni(e):new ri(e,t,n,null==r?1:r)}),Er(Cr,{brighter(e){return e=null==e?Tr:Math.pow(Tr,e),new ri(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Ar:Math.pow(Ar,e),new ri(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Xr(si(e>=240?e-240:e+120,i,r),si(e,i,r),si(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ri(ii(this.h),oi(this.s),oi(this.l),Zr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Zr(this.opacity);return`${1===e?"hsl(":"hsla("}${ii(this.h)}, ${100*oi(this.s)}%, ${100*oi(this.l)}%${1===e?")":`, ${e})`}`}}));var ai=e=>()=>e;function li(e){return 1===(e=+e)?ci:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):ai(isNaN(t)?n:t)}}function ci(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):ai(isNaN(e)?t:e)}var ui=function e(t){var n=li(t);function r(e,t){var r=n((e=Kr(e)).r,(t=Kr(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=ci(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1);function di(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function hi(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),s=new Array(r);for(n=0;n<i;++n)o[n]=bi(e[n],t[n]);for(;n<r;++n)s[n]=t[n];return function(e){for(n=0;n<i;++n)s[n]=o[n](e);return s}}function fi(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function pi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function gi(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=bi(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var mi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,yi=new RegExp(mi.source,"g");function vi(e,t){var n,r,i,o=mi.lastIndex=yi.lastIndex=0,s=-1,a=[],l=[];for(e+="",t+="";(n=mi.exec(e))&&(r=yi.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),a[s]?a[s]+=i:a[++s]=i),(n=n[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:pi(n,r)})),o=yi.lastIndex;return o<t.length&&(i=t.slice(o),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)a[(n=l[r]).i]=n.x(e);return a.join("")})}function bi(e,t){var n,r=typeof t;return null==t||"boolean"===r?ai(t):("number"===r?pi:"string"===r?(n=Wr(t))?(t=n,ui):vi:t instanceof Wr?ui:t instanceof Date?fi:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?di:Array.isArray(t)?hi:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?gi:pi)(e,t)}function xi(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function wi(e){return+e}var Mi=[0,1];function ki(e){return e}function _i(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Si(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=_i(i,r),o=n(s,o)):(r=_i(r,i),o=n(o,s)),function(e){return o(r(e))}}function qi(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=_i(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(t){var n=Et(e,t,1,r)-1;return o[n](i[n](t))}}function Di(){var e,t,n,r,i,o,s=Mi,a=Mi,l=bi,c=ki;function u(){var e=Math.min(s.length,a.length);return c!==ki&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(s[0],s[e-1])),r=e>2?qi:Si,i=o=null,d}function d(t){return null==t||isNaN(t=+t)?n:(i||(i=r(s.map(e),a,l)))(e(c(t)))}return d.invert=function(n){return c(t((o||(o=r(a,s.map(e),pi)))(n)))},d.domain=function(e){return arguments.length?(s=Array.from(e,wi),u()):s.slice()},d.range=function(e){return arguments.length?(a=Array.from(e),u()):a.slice()},d.rangeRound=function(e){return a=Array.from(e),l=xi,u()},d.clamp=function(e){return arguments.length?(c=!!e||ki,u()):c!==ki},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function Ei(e,t,n,r){var i,o=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?Pt(t,e,n):Pt(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=ze(null==r?",f":r)).type){case"s":var s=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Pe(t)/3)))-Pe(Math.abs(e)))}(o,s))||(r.precision=i),Ue(r,s);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Pe(t)-Pe(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-Pe(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return We(r)}function Ci(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)===(t=+t))return[e];const r=t<e,[i,o,s]=r?It(t,e,n):It(e,t,n);if(!(o>=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let e=0;e<a;++e)l[e]=(o-e)/-s;else for(let e=0;e<a;++e)l[e]=(o-e)*s;else if(s<0)for(let e=0;e<a;++e)l[e]=(i+e)/-s;else for(let e=0;e<a;++e)l[e]=(i+e)*s;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return Ei(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),s=0,a=o.length-1,l=o[s],c=o[a],u=10;for(c<l&&(i=l,l=c,c=i,i=s,s=a,a=i);u-- >0;){if((i=Pt(l,c,n))===r)return o[s]=l,o[a]=c,t(o);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return e},e}function Ai(){var e=Di()(ki,ki);return e.copy=function(){return t=e,Ai().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},kr.apply(e,arguments),Ci(e)}function Ti(){var e,t=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[Et(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=Array.from(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Array.from(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return Ti().domain(t).range(n).unknown(e)},kr.apply(i,arguments)}function Ni(e){return void 0===e?e=>e:t=>e(t)}function Ri(e){return Math.max(0,Math.min(1,e))}function Oi(e){return"object"==typeof e}function Ii(e,t,n){const r=Math.abs(t-n)/(e+1),i=[];for(let o=1;o<=e;o++){const e=o*r;i.push(t<n?t+e:t-e)}return i}function Pi(e,t,n){if(1===e.length)return e;const r=e.concat([]);for(let i=0;i<e.length;i++){let o=e[i],s=e[i+1];0===i&&o!==n.start()?(r.push(...Ii(t,o,s)),o-=s-o,s=e[i],r.push(...Ii(t,o,s))):i===e.length-1&&s!==n.end()?(s=o+(o-e[i-1]),r.push(...Ii(t,o,s))):r.push(...Ii(t,o,s))}return r.filter((e=>e>=n.min()&&e<=n.max()))}function Li(e){let{distance:t,scale:n,minorCount:r=0,unitDivider:i=100,formatter:o}=e;const s=_(i)||_(t)?2:Math.max(t/i,2),a=Math.min(1e3,Math.round(s));let l=n.ticks(a);l.length<=1&&(l=n.ticks(a+1));const c=r>0?Pi(l,r,n):l;c.sort(((e,t)=>e-t));const u=c.map(Ni(o));return c.map(((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:u[t],value:e,isMinor:-1===l.indexOf(e)}}))}function ji(e){let{distance:t,scale:n,minorCount:r=0,unitDivider:i=100,formatter:o}=e;const s=_(i)||_(t)?2:Math.max(t/i,2),a=Math.min(1e3,Math.round(s)),l=a>10?10:a;n.nice(l);const c=n.ticks(a),u=r>0?Pi(c,r,n):c;u.sort(((e,t)=>e-t));const d=u.map(Ni(o));return u.map(((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:d[t],value:e,isMinor:-1===c.indexOf(e)}}))}function zi(e){let t,{settings:n,scale:r,distance:i,formatter:o=e=>e}=e;const s=n.minorTicks&&!_(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter((e=>"object"==typeof e?!_(e.value):!_(e)));t=function(e){let{values:t,scale:n,formatter:r=e=>e}=e;return t.sort(((e,t)=>(Oi(e)?e.value:e)-(Oi(t)?t.value:t))).filter(((e,t,r)=>{const i=Oi(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t})).map((e=>{const t=Oi(e),i=t?e.value:e,o=n(i);return{position:o,value:i,label:t&&void 0!==e.label?e.label:r(i),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?Ri(n(e.start)):o,end:t&&!isNaN(e.end)?Ri(n(e.end)):o}}))}({values:e,scale:r.copy(),formatter:o})}else if(_(n.ticks.count)){t=(n.ticks.tight?ji:Li)({distance:i,minorCount:s,unitDivider:n.ticks.distance,scale:r,formatter:o}),n.ticks.forceBounds&&function(e,t,n){const r=e.map((e=>e.position)),i=t.range();-1===r.indexOf(i[0])?e.splice(0,0,{position:i[0],start:i[0],end:i[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);const o=e[e.length-1];-1===r.indexOf(i[1])?e.push({position:i[1],start:i[1],end:i[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,r,o)}else{t=function(e){let{count:t,minorCount:n,scale:r,formatter:i}=e;return r.ticks((t-1)*n+t).map(((e,t)=>{const o=r(e);return{position:o,start:o,end:o,label:i(e),isMinor:t%(n+1)!==0,value:e}}))}({count:Math.min(1e3,n.ticks.count),minorCount:s,scale:r.copy(),formatter:o})}return t}function Fi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={};return Object.keys(t).forEach((i=>{const o=typeof e[i];r[i]="function"===o?e[i](n):"undefined"===o?t[i]:e[i]})),r}const Hi={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},Bi={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},Vi={count:NaN};function $i(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function Wi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Ai(),i={instance:null,invert:!1},o={data:t,resources:n},s=Fi(e,Hi,o);let a;function l(e){return _(e)?NaN:r(e)}s.ticks=Fi(e.ticks,Bi,o),s.minorTicks=Fi(e.minorTicks,Vi,o),l.data=()=>t,l.invert=function(e){return r.invert(e)},l.rangeRound=function(e){return r.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return r.clamp(e),l},l.cachedTicks=function(){return a},l.clearTicksCache=function(){return a=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=y(!0,{},s,e.settings),e.scale=l,a=zi(e),a):(a=r.ticks(e),a)},l.nice=function(e){return r.nice(e),l},l.tickFormat=function(e,t){return r.tickFormat(e,t)},l.interpolate=function(e){return r.interpolate(e),l},l.domain=function(e){return arguments.length?(r.domain(e),i.instance&&i.instance.domain([l.start(),l.end()]),l):r.domain()},l.range=function(e){return arguments.length?(r.range(e),l):r.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(e){let t=(l.start()-l.end())/e,n=[l.end()],r=[],i=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,s=l(e+i);n.push(o,o),r.push(s,s)}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){const i=Wi(e,t,n);return i.domain(l.domain()),i.range(l.range()),i.clamp(r.clamp()),i},l.norm=function(e){return $i(i,l),i.instance(e)},l.normInvert=function(e){return $i(i,l),i.instance.invert(e)};const{mini:c,maxi:u}=function(e,t){const n=+e.min,r=+e.max;let i=0,o=1;if(t&&t[0]){const n=t.map((e=>e.min())).filter((e=>!isNaN(e))),r=t.map((e=>e.max())).filter((e=>!isNaN(e)));if(i=n.length?Math.min(...n):Number.NaN,o=r.length?Math.max(...r):Number.NaN,isNaN(i)||isNaN(o))i=-1,o=1;else if(i===o&&0===i)i=-1,o=1;else if(i===o&&i)i-=Math.abs(.1*i),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){const t=o-i;i-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter((e=>!isNaN(e)));i=Math.min(...t,i),o=Math.max(...t,o)}}return{mini:isNaN(n)?i:n,maxi:isNaN(r)?o:r}}(s,t?t.fields:[]);return l.domain([c,u]),l.range(s.invert?[1,0]:[0,1]),i.invert=s.invert,l}const Ui={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function Yi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:t,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},r=Fi(e,Ui,n),i=t.items||[],o={},s=[],a=[];function l(e,n){e.data=()=>t,e.datum=e=>i[o[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>a,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,function(e){let{scale:t}=e;const n=t.domain(),r=t.data().items,i=t.labels?t.labels():n,o=t.bandwidth();return n.map(((e,n)=>{const s=t(e);return{position:s+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:s,end:s+o}}))}(t,n.trackBy)}}const c=qr();l(c,e),c.pxScale=function(t){const n=r.maxPxStep;if(isNaN(n))return c;const i=c.domain().length,o=Math.max(1,i-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;const s=c.copy();s.type=c.type,l(s,e);const a=o*n/t,u=(1-a)*c.align();return s.range(r.invert?[a+u,u]:[u,a+u]),s};const u="function"==typeof e.value?e.value:e=>e.datum.value,d="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<i.length;e++){const t=y({datum:i[e]},n),r=u(t,e);-1===s.indexOf(r)&&(s.push(r),a.push(d(t,e)),o[r]=e)}return c.domain(s),c.range(r.invert?r.range.slice().reverse():r.range),c.padding(isNaN(r.padding)?0:r.padding),isNaN(r.paddingInner)||c.paddingInner(r.paddingInner),isNaN(r.paddingOuter)||c.paddingOuter(r.paddingOuter),c.align(isNaN(r.align)?.5:r.align),c}const Ki={depth:0};function Xi(e,t,n){return e.ancestors().map((e=>t(y({datum:e.data},n)))).reverse().slice(1).toString()}const Gi=e=>e.min(),Ji=e=>e.max();function Zi(e,t){const n=e&&!isNaN(e.min),r=e&&!isNaN(e.max);let i=n?+e.min:0,o=r?+e.max:1;if(t&&t.length){if(!n){const e=t.map(Gi).filter(k);i=e.length?Math.min(...e):i}if(!r){const e=t.map(Ji).filter(k);o=e.length?Math.max(...e):o}}return[i,o]}const Qi={domain:[],range:[],invert:!1,min:NaN,max:NaN};function eo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Wi(e,t,n).clamp(!0).interpolate(ui),i=Fi(e,Qi,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,s=Array.isArray(i.range)&&i.range.length,a=r;y(!0,a,r);const[l,c]=Zi(i,t?t.fields:[]),u=o?i.domain.length:-1,d=n.theme?n.theme.palette("sequential",u>0?u:2):[],h=s?i.range:d;return a.range(i.invert?h.slice().reverse():h.slice()),a.domain(o?i.domain:function(e,t,n){const r=e.length;if(2===r)return[t,n];const i=[],o=(n-t)/(r-1);i.push(t);for(let e=1;e<r-1;e++)i.push(t+o*e);return i.push(n),i}(a.range(),l,c)),a}const to={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function no(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const ro={domain:[],range:[]};const io={domain:[],range:[],unknown:void 0},oo={domain:[],range:[],override:!1};const so=Oe();function ao(e,t,n){let r=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),r={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((e=>{r.extract.push({field:e})})));const i=wr(r,t,n);let o,s=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map((e=>"dimension"===e.type()?"band":"linear"));return-1!==t.indexOf("linear")?"linear":"band"}(e.fields):"linear"}(i);return"color"===s&&(s=i.fields&&i.fields[0]&&"dimension"===i.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(s)&&(o=n.scale.get(s),o=o(e,i,{theme:n.theme,logger:n.logger}),o.type=s),o}so("linear",Wi),so("band",Yi),so("h-band",(function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={data:n,resources:r},o=Fi(t,Ui,i);o.ticks=Fi(t.ticks,Ki,i),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let s=Yi(o);const{values:a,labels:l,items:c,ticks:u}=function(e,t,n){const r=t.ticks.depth,i=t.value,o=t.label,s=[],a=[],l={},c=[];let u=0;if(!e)return{values:s,labels:a,items:l,ticks:c};e.eachAfter((e=>{if(e.depth>0){const t=Xi(e,i,n),d=e.leaves()||[e],h=i(y({datum:e.data},n)),f=o(y({datum:e.data},n)),p=Array.isArray(e.children),g={key:t,count:d.length,value:h,label:f,leftEdge:Xi(d[0],i,n),rightEdge:Xi(d[Math.max(d.length-1,0)],i,n),node:e};p?(s.push("SPACER_".concat(u,"_SPACER")),u++):(s.push(t),a.push(f)),(r<=0&&!p||e.depth===r)&&c.push(g),l[t]=g}}));const d=e.height-1;return d>0&&s.splice(-d),{values:s,labels:a,items:l,ticks:c}}(n.root,o,i),d=function(e){const t=String(e),n=c[t];return s(n?o.invert?n.rightEdge:n.leftEdge:t)};y(!0,d,s),d.bandwidth=function(e){const t=c[String(e)],n=s.bandwidth();if(t&&!t.isLeaf){const e=d(t.leftEdge),r=d(t.rightEdge);return Math.abs(e-r)+n}return n},d.step=function(e){const t=c[String(e)],n=t?t.count:1;let r=s.step();return r*=n,r},d.data=()=>n,d.datum=e=>{const t=c[String(e)];return t?t.node.data:null},d.copy=()=>e(t,n,r),d.labels=()=>l,d.ticks=()=>u.map((e=>{const t=d(e.key),n=d.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}));const h=s.pxScale;return d.pxScale=function(e){return s=h(e),d},d.domain(a),d})),so("sequential-color",eo),so("threshold-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Ti(),i=Fi(e,to,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,s=Array.isArray(i.range)&&i.range.length;function a(e){return _(e)?NaN:r(e)}Object.keys(r).forEach((e=>a[e]=r[e]));const l=t.fields,[c,u]=Zi(i,l),d=o?i.domain.length:-1,h=n.theme?n.theme.palette("sequential",d>0?d:2):[];let f=s?i.range:h,p=[];return p=o?i.domain:i.nice?function(e,t,n){const r=2===e.length?10:Math.max(1,e.length),i=Ai().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;const o=Math.max(0,e.length-1);for(;i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}(f,c,u):[c+(u-c)/2],f.length>p.length+1?p=function(e,t,n){const r=e.length;if(2===r)return[t+(n-t)/2];const i=[],o=(n-t)/r;for(let e=1;e<r;e++)i.push(t+o*e);return i}(f,c,u):f.length<p.length+1&&(f=function(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;const i=eo().domain([n,r]).range(t);return[n,...no(e),r].map((e=>i(e)))}(p,f,c,u)),a.data=()=>t,a.range(i.invert?f.slice().reverse():f),a.domain(p),a})),so("categorical-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Sr(),i={data:t,resources:n},o=Fi(e,ro,i),s="function"==typeof e.value?e.value:e=>e.datum.value,a="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},u=[],d=[];for(let e=0;e<l.length;e++){const t=y({datum:l[e]},i),n=s(t,e);-1===u.indexOf(n)&&(u.push(n),d.push(a(t,e)),c[n]=e)}return r.data=()=>t,r.labels=()=>d,r.label=e=>d[u.indexOf(e)],r.datum=e=>l[c[e]],r.range(o.range),Array.isArray(o.domain)&&o.domain.length?r.domain(o.domain):r.domain(u),r}(e,t,n),i=n.theme,o=Fi(e,io,{data:t,resources:n});let s;if(o.explicit=Fi(e.explicit,oo,{data:t,resources:n}),s=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():i?i.palette("categorical",r.domain().length).slice():[],o.unknown)r.unknown(o.unknown);else if(i&&i.palette("unknown")){let e=i.palette("unknown");r.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=r.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],i=Math.floor(e.length/s.length);for(let e=1;e<i+1;e*=2)s=s.concat(s);if(o.explicit.override)for(let r=0;r<t.length;r++){const i=e.indexOf(t[r]);i>-1&&(s[i]=n[r])}else{const r=t.map(((t,r)=>[e.indexOf(t),t,n[r]])).sort(((e,t)=>e[0]-t[0]));r.forEach((t=>{const n=e.indexOf(t[1]);-1!==n&&s.splice(n,0,t[2])}))}s.length=e.length}return r.range(s),r}));var lo={};function co(){co.init.call(this)}lo.isObject=function(e){return"object"==typeof e&&null!==e},lo.isNumber=function(e){return"number"==typeof e},lo.isUndefined=function(e){return void 0===e},lo.isFunction=function(e){return"function"==typeof e};var uo=co;co.EventEmitter=co,co.prototype._events=void 0,co.prototype._maxListeners=void 0,co.defaultMaxListeners=10,co.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},co.prototype.setMaxListeners=function(e){if(!lo.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},co.prototype.emit=function(e){var t,n,r,i,o,s;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],lo.isUndefined(n))return!1;if(lo.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(lo.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(s=n.slice()).length,o=0;o<r;o++)s[o].apply(this,i)}return!0},co.prototype.addListener=function(e,t){var n;if(!lo.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,lo.isFunction(t.listener)?t.listener:t),this._events[e]?lo.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,lo.isObject(this._events[e])&&!this._events[e].warned)&&((n=lo.isUndefined(this._maxListeners)?co.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,lo.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),lo.isFunction(console.trace)&&console.trace()));return this},co.prototype.on=co.prototype.addListener,co.prototype.once=function(e,t){if(!lo.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},co.prototype.removeListener=function(e,t){var n,r,i,o;if(!lo.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||lo.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(lo.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},co.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],lo.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},co.prototype.listeners=function(e){return this._events&&this._events[e]?lo.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},co.listenerCount=function(e,t){return e._events&&e._events[t]?lo.isFunction(e._events[t])?1:e._events[t].length:0};var ho={mixin:e=>(Object.keys(uo.prototype).forEach((t=>{e[t]=uo.prototype[t]})),uo.init(e),e)};function fo(){let e=0,t=0,n=0,r=0;n=n||e;const i={move(e){this.moveTo(n+e)},moveTo(o){const s=Math.max(e,Math.min(t-r,o));n!==s&&(n=s,i.emit("update"))},update(o){let s=!1;({min:e=e,max:t=t}=o),void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,s=!0);const a=Math.max(e,Math.min(t-r,n));n!==a&&(n=a,s=!0),s&&i.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:r})};return ho.mixin(i),i}function po(e,t){const n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||fo();return o.update({min:n,max:r,viewSize:i}),o}function go(e,t){return e<=t}function mo(e,t){return e<t}function yo(e,t,n){let r=0;for(;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function vo(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=[];function i(){}return i.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{includeMax:r=!0,includeMin:i=!0}=n;e=r?go:mo,t=i?go:mo},i.add=e=>{let{min:t,max:n}=e;const i=yo(r,t),o=yo(r,n,!0),s=[i,o-i];i%2==0&&s.push(t),o%2==0&&s.push(n);const a=r.join(",");r.splice(...s);return a!==r.join(",")},i.remove=e=>{let{min:t,max:n}=e;const i=yo(r,t),o=yo(r,n,!0),s=[i,o-i];i%2==1&&s.push(t),o%2==1&&s.push(n);const a=r.join(",");r.splice(...s);return a!==r.join(",")},i.set=e=>{const t=r.join(",");r=[],Array.isArray(e)?e.forEach(i.add):i.add(e);return t!==r.join(",")},i.clear=()=>{const e=r.length>0;return r=[],e},i.containsValue=n=>function(e,t,n,r){const i=e.length;for(let o=1;o<i;o+=2)if(n(e[o-1],t)&&r(t,e[o]))return!0;return!1}(r,n,t,e),i.containsRange=e=>{let{min:t,max:n}=e;const i=yo(r,t,!0),o=yo(r,n);return i===o&&o%2==1},i.toggle=e=>i.containsRange(e)?i.remove(e):i.add(e),i.ranges=()=>{const e=[];for(let t=1;t<r.length;t+=2)e.push({min:r[t-1],max:r[t]});return e},i.configure(n),i}function bo(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const xo={key:void 0,includeMin:!0,includeMax:!0};function wo(e){let{items:t,collection:n,vc:r}=e;const i={},o=[];let s,a;for(let e=0,o=t.length;e<o;e++){s=t[e].key,n[s]||(n[s]=r()),a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[s].add(a[e])&&(i[s]=i[s]||[],i[s].push(a[e]))}const l=Object.keys(i);for(let e=0,t=l.length;e<t;e++)s=l[e],o.push({id:s,values:i[s]});return o}function Mo(e){let{items:t,collection:n}=e;const r={},i=[];let o,s;for(let e=0,i=t.length;e<i;e++)if(o=t[e].key,n[o]){s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[o].remove(s[e])&&(r[o]=r[o]||[],r[o].push(s[e]))}const a=Object.keys(r);for(let e=0,t=a.length;e<t;e++)o=a[e],i.push({id:o,values:r[o]});return i}function ko(e){const t={};let n,r;for(let i=0,o=e.length;i<o;i++){n=e[i].key,r=e[i].values||[e[i].value],t[n]||(t[n]=[]);for(let e=0;e<r.length;e++){-1===t[n].indexOf(r[e])&&t[n].push(r[e])}}return t}function _o(e){let{key:t,collection:n,obj:r,fn:i,value:o}=e;n[t]||(n[t]=i()),r[t]=r[t]||[],r[t].push(o),n[t].add(o)}function So(e,t){const n=[],r=Object.keys(e);let i,o;const s=e=>-1===t[i].indexOf(e);for(let a=0,l=r.length;a<l;a++)i=r[a],t[i]?(o=e[i].filter(s),o.length&&n.push({id:i,values:o})):n.push({id:i,values:e[i]});return n}function qo(e,t,n){const r=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,r=Array(n);for(let i=0;i<n;i++)r[i]=e[i].key in t?y({},e[i],{key:t[e[i].key]}):e[i];return r}(t,n);return e&&e.length?e.reduce(((e,t)=>t(e)),r):r}function Do(e){return e.replace(/(-[a-z])/g,(e=>e.toUpperCase().replace("-","")))}function Eo(e){return e.replace(/([A-Z])/g,(e=>"-".concat(e.toLowerCase())))}function Co(e,t,n){let{ranges:r,interceptors:i,rc:o,aliases:s,rangeConfig:a}=n;const l=qo(i["".concat(t,"Ranges")],e,s);let c=!1;return l.forEach((e=>{const n=e.key;if(r[n]||(r[n]=o(a.sources[n]||a.default)),"set"===t)c=r[n][t](e.ranges||e.range)||c;else{const i=e.ranges||[e.range];for(let e=0;e<i.length;e++)c=r[n][t](i[e])||c}})),c}function Ao(){let{vc:e=bo,rc:t=vo}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1,r={},i={},o={},s={sources:{},default:y({},xo)};const a={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},l=()=>{const e={values:{},ranges:{}};return Object.keys(i).forEach((t=>{e.values[t]=i[t].values()})),Object.keys(r).forEach((t=>{e.ranges[t]=r[t].ranges()})),e},c={ls:[],clear(){this.ls.forEach((e=>e.clear()))},start(){this.ls.forEach((e=>e.start()))},end(){this.ls.forEach((e=>e.end()))},update(){const e=l();this.ls.forEach((t=>t._state(e)))},updateValues(){const e=l();this.ls.forEach((t=>t._state({values:e.values})))},updateRanges(){const e=l();this.ls.forEach((t=>t._state({ranges:e.ranges})))}},u={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(s={sources:{},default:y({},xo)},e.ranges.forEach((e=>{const t={};Object.keys(xo).filter((e=>"key"!==e)).forEach((n=>{t[n]=void 0!==e[n]?e[n]:xo[n]})),void 0!==e.key?s.sources[e.key]=t:s.default=t})),Object.keys(r).forEach((e=>r[e].configure(s.sources[e]||s.default))),u.emit("update",[],[]))},link:e=>{if(u===e)throw new Error("Can't link to self");c.ls.push(e),e._state(l())},_state:e=>{if(!e)return l();if(e.values){const t=[];Object.keys(e.values).forEach((n=>{i[n]&&e.values[n].join(";")===i[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(i).forEach((n=>{e.values[n]||t.push({key:n,values:[]})})),t.length&&u.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach((n=>{r[n]&&e.ranges[n].join(";")===r[n].toString()||t.push({key:n,ranges:e.ranges[n]})})),Object.keys(r).forEach((n=>{e.ranges[n]||t.push({key:n,ranges:[]})})),t.length&&u.setRanges(t)}},start:function(){if(!n){n=!0;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];u.emit("start",...t),c.start()}},end:function(){if(n){n=!1,r={},i={};for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];u.emit("end",...t),c.end()}},isActive:()=>n,clear:()=>{const e=u.brushes().filter((e=>"value"===e.type&&e.brush.values().length)).map((e=>({id:e.id,values:e.brush.values()}))),t=Object.keys(r).length>0||e.length;r={},i={},t&&(u.emit("update",[],e),c.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(r).map((e=>({type:"range",id:e,brush:r[e]})))),e=e.concat(Object.keys(i).map((e=>({type:"value",id:e,brush:i[e]})))),e},addValue:(e,t)=>{u.addValues([{key:e,value:t}])},addValues:t=>{const r=qo(a.addValues,t,o),s=wo({vc:e,collection:i,items:r});u.emit("add-values",r),s.length&&(n||(n=!0,u.emit("start")),u.emit("update",s,[]),c.updateValues())}};return u.setValues=t=>{const r=qo(a.setValues,t,o),s=function(e){let{items:t,vCollection:n,vc:r}=e;const i={},o=ko(t);let s,a=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)s=u[e],c[s]=n[s].values().slice(),delete n[s];const d=e=>{n[s]&&n[s].contains(e)||_o({key:s,value:e,collection:n,obj:i,fn:r})},h=Object.keys(o);for(let e=0,t=h.length;e<t;e++)s=h[e],o[s].forEach(d);return l=So(c,i),a=So(i,c),[a,l]}({items:r,vCollection:i,vc:e});u.emit("set-values",r),(s[0].length>0||s[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",s[0],s[1]),c.updateValues())},u.removeValue=(e,t)=>{u.removeValues([{key:e,value:t}])},u.removeValues=e=>{const t=qo(a.removeValues,e,o),n=Mo({collection:i,items:t});u.emit("remove-values",t),n.length&&(u.emit("update",[],n),c.updateValues())},u.addAndRemoveValues=(t,r)=>{const s=qo(a.addValues,t,o),l=qo(a.removeValues,r,o),d=wo({vc:e,collection:i,items:s}),h=Mo({collection:i,items:l});u.emit("add-values",s),u.emit("remove-values",l),(d.length||h.length)&&(n||(n=!0,u.emit("start")),u.emit("update",d,h),c.updateValues())},u.toggleValue=(e,t)=>{u.toggleValues([{key:e,value:t}])},u.toggleValues=t=>{const r=qo(a.toggleValues,t,o),s=function(e){let{items:t,values:n,vc:r}=e;const i={},o={},s=[],a=[],l=ko(t);let c,u,d;const h=Object.keys(l);for(let e=0,t=h.length;e<t;e++){c=h[e],d=l[c];for(let e=0,t=d.length;e<t;e++)u=d[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):_o({key:c,value:u,collection:n,obj:i,fn:r})}const f=Object.keys(i);for(let e=0,t=f.length;e<t;e++)c=f[e],s.push({id:c,values:i[c]});const p=Object.keys(o);for(let e=0,t=p.length;e<t;e++)c=p[e],a.push({id:c,values:o[c]});return[s,a]}({items:r,values:i,vc:e});u.emit("toggle-values",r),(s[0].length>0||s[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",s[0],s[1]),c.updateValues())},u.containsValue=(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].contains(t)},u.addRange=(e,t)=>{u.addRanges([{key:e,range:t}])},u.addRanges=e=>{Co(e,"add",{ranges:r,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.removeRange=(e,t)=>{u.removeRanges([{key:e,range:t}])},u.removeRanges=e=>{Co(e,"remove",{ranges:r,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.setRange=(e,t)=>{u.setRanges([{key:e,range:t}])},u.setRanges=e=>{Co(e,"set",{ranges:r,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.toggleRange=(e,t)=>{u.toggleRanges([{key:e,range:t}])},u.toggleRanges=e=>{Co(e,"toggle",{ranges:r,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.containsRangeValue=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].containsValue(t)},u.containsRange=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].containsRange(t)},u.containsMappedData=(e,t,n)=>{let s=[];const a=Object.keys(e);let l,c,u,d;for(let t=0,n=a.length;t<n;t++){if(l=a[t],"value"===l)c=e,s[t]={key:"",i:t,bool:!1};else{if("source"===l)continue;c=e[l],s[t]={key:l,i:t,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in o&&(u=o[u]),d=c.value,r[u]?s[t].bool=Array.isArray(d)?r[u].containsRange({min:d[0],max:d[1]}):r[u].containsValue(d):i[u]&&i[u].contains(d)&&(s[t].bool=!0))}return t?(s=s.filter((e=>-1!==t.indexOf(e.key))),"and"===n?!!s.length&&!s.some((e=>!1===e.bool)):"xor"===n?!!s.length&&s.some((e=>e.bool))&&s.some((e=>!1===e.bool)):s.some((e=>e.bool))):s.some((e=>e.bool))},u.intercept=(e,t)=>{const n=Do(e);a[n]&&a[n].push(t)},u.removeInterceptor=(e,t)=>{const n=Do(e);if(!a[n])return;const r=a[n].indexOf(t);-1!==r&&a[n].splice(r,1)},u.removeAllInterceptors=e=>{const t=[];if(e){const n=Do(e);a[n]&&a[n].length&&t.push({name:e,handlers:a[n]})}else Object.keys(a).forEach((e=>{a[e].length&&t.push({name:Eo(e),handlers:a[e]})}));t.forEach((e=>{e.handlers.slice().forEach((t=>u.removeInterceptor(e.name,t)))}))},u.addKeyAlias=(e,t)=>{o[e]=t},u.removeKeyAlias=e=>{delete o[e]},ho.mixin(u),u}function To(e){return e*e*e}function No(e){return--e*e*e+1}function Ro(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}Oe();const Oo=["stroke","fill","color","backgroundColor","thumbColor"];function Io(e,t){const n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n);let s;for(s=0;s<r;++s)i[s]=Po(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(e){for(s=0;s<r;++s)o[s]=i[s](e);return o}}function Po(e,t,n){const r=typeof t;let i;return null==t||"boolean"===r?function(e){return()=>e}(t):("number"===r?pi:"string"===r?(i=Wr(t))&&Oo.includes(n)?(t=i,ui):vi:t instanceof Wr?ui:t instanceof Date?fi:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?di:Array.isArray(t)?Io:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Lo:pi)(e,t)}function Lo(e,t){const n={},r={};let i;for(i in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)i in e?n[i]=Po(e[i],t[i],i):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}function jo(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const zo={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},Fo=/^\$/;function Ho(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function Bo(e,t,n){const r=e[t];r&&r.scale&&r.scale.pxScale?r.scale=r.scale.pxScale(n):r&&r.pxScale&&(e[t]=r.pxScale(n))}function Vo(e,t){return e.pxScale?e.pxScale(t):e}const $o={normalizeSettings:function(e,t,n){const r=y({},e),i=y({},t);return Object.keys(r).forEach((e=>{i[e]={};const o=r[e],s=typeof o;if("function"==typeof o)i[e].fn=o;else if(Ho(o)){let n=t[e];"string"==typeof n&&Fo.test(n)&&(n=zo[n]);const r=typeof n;i[e]="undefined"===r||r===s?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(i[e].fn=o.fn),void 0!==o.scale&&(i[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(i[e].ref=o.ref))})),Object.keys(t).forEach((e=>{if(e in r)return;const n=t[e];"string"===typeof n&&Fo.test(n)?i[e]=zo[n]:i[e]=n})),i},resolveForItem:function(e,t,n){const r={},i=Object.keys(t),o=i.length,s=e.datum,a=e.datum;for(let l=0;l<o;l++){const o=i[l],c=t[o],u="object"==typeof a&&void 0!==c,d=u&&"string"==typeof c.ref,h=u&&o in a,f=d?a[c.ref]:h?a[o]:s;Ho(c)?r[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),r[o]=c.fn.call(null,e,n)):u&&c.scale&&f?(r[o]=c.scale(f.value),c.scale.bandwidth&&(r[o]+=c.scale.bandwidth()/2)):d&&f?r[o]=f.value:c.fn?r[o]=c.fn.call(null,e,n):r[o]=c}return r},updateScaleSize:Bo};function Wo(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((e,t)=>Array.isArray(t.children)?(e.push(...Wo(t.children)),e):(e.push(t),e)),[])}function Uo(e,t){let{context:n,data:r,style:i,filter:o,mode:s}=t;const a=e.chart.brush(n),l=r,c=i.active||{},u=i.inactive||{},d=[];Object.keys(c).forEach((e=>{d.push(e)})),Object.keys(u).forEach((e=>{-1===d.indexOf(e)&&d.push(e)}));const h=[];let f=!1;const p=()=>{let t=Wo(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},g=()=>{const e=p(),t=e.length;let n,r=!1;const i="function"==typeof l?l({brush:a}):l;for(let r=0;r<t;r++){if(n=e[r].data,!n)continue;e[r].__style||(e[r].__style={},d.forEach((t=>{e[r].__style[t]=e[r][t]})));const t=a.containsMappedData(n,i,s),o=h.indexOf(e[r]);let l=!1;t&&-1===o?(h.push(e[r]),l=!0):t||-1===o||(h.splice(o,1),l=!0),e[r].needToUpdate=l||f,e[r].isActive=t}for(let i=0;i<t;i++)if(n=e[i].data,n){if(e[i].needToUpdate){const t=y({},e[i],e[i].__style),n=e[i].isActive;d.forEach((r=>{e[i][r]=n&&r in c?"function"==typeof c[r]?c[r].call(null,t,h):c[r]:!n&&r in u?"function"==typeof u[r]?u[r].call(null,t,h):u[r]:e[i].__style[r]})),r=!0}delete e[i].needToUpdate}return f=!1,r},m=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,r=p(),i=r.length;for(let e=0;e<i;e++)r[e].data&&(r[e].__style=r[e].__style||{},d.forEach((t=>{r[e].__style[t]=r[e][t],t in u&&(r[e][t]="function"==typeof u[t]?u[t].call(null,r[e]):u[t])})));f=!0,h.length=0,n||e.renderer.render(e.nodes)},v=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,r=p(),i=r.length;for(let e=0;e<i;e++)r[e].__style&&(Object.keys(r[e].__style).forEach((t=>{r[e][t]=r[e].__style[t]})),r[e].__style=void 0);h.length=0,n||e.renderer.render(e.nodes)},b=()=>{if(g()){const t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return a.on("start",m),a.on("end",v),a.on("update",b),{isActive:()=>a.isActive(),update:()=>{h.length=0,f=!0,g()},cleanUp:function(){a.removeListener("start",m),a.removeListener("end",v),a.removeListener("update",b)}}}function Yo(e){let{nodes:t,action:n,chart:r,trigger:i}=e;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let{dataPoints:t,action:n,chart:r,trigger:i}=e;if(!i)return;const o=i.data||[""];let s={items:[],actionFn:"toggleRanges"},a={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(s.actionFn="".concat(n,"Ranges"),a.actionFn="".concat(n,"Values"));for(let e=0;e<t.length;e++){const n=t[e];n&&o.forEach((e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},s.items.push(e)):(e.value=t.value,a.items.push(e))}}))}i.contexts.forEach((e=>{s.items.length?r.brush(e)[s.actionFn](s.items):r.brush(e)[a.actionFn](a.items)}))}({dataPoints:o,action:n,chart:r,trigger:i})}function Ko(e){let{collisions:t,t:n,config:r,action:i}=e,o=[],s=!1;t.length>0&&(o=t,s=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const a=o.map((e=>e.node));return Yo({nodes:a,action:i,chart:r.chart,data:r.data,trigger:n}),s}function Xo(e,t,n){const r=n.element().getBoundingClientRect();let i=M(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,r):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,r);return null===i||i.x<0||i.y<0||i.x>r.width||i.y>r.height?[]:(t.touchRadius>0&&M(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!M(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function Go(e,t,n){return e?"function"==typeof e?e(t):e:n}const Jo={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontStyle:"font-style",textDecoration:"text-decoration",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function Zo(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?"M".concat(r.x," ").concat(r.y):"L".concat(r.x," ").concat(r.y),n+=" "}return t&&(n+="Z"),n}function Qo(e,t,n,r){const i=n/2,o=e-r/2,s=t-r/2,a=e-i,l=t-i;return[{x:o,y:s},{x:o,y:l},{x:o+r,y:l},{x:o+r,y:s},{x:a+n,y:s},{x:a+n,y:s+r},{x:o+r,y:s+r},{x:o+r,y:l+n},{x:o,y:l+n},{x:o,y:s+r},{x:a,y:s+r},{x:a,y:s}]}function es(e){return-e/180*Math.PI}function ts(e){return function(e){let t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),r=n*Math.cos(e),i=n*Math.sin(e);return{x1:r<0?1:0,y1:i<0?1:0,x2:r>=0?r:r+1,y2:i>=0?i:i+1}}(es(e))}function ns(e,t){return{x:e.x+t.x,y:e.y+t.y}}function rs(e,t){return{x:e.x-t.x,y:e.y-t.y}}function is(e,t){return{x:e.x*t,y:e.y*t}}function os(e,t){return e.x-t.x}function ss(e,t){return e.y-t.y}function as(e,t){return os(e,t)**2+ss(e,t)**2}function ls(e,t){return Math.sqrt(as(e,t))}function cs(e,t){return e.x*t.x+e.y*t.y}function us(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const r=Math.cos(t),i=Math.sin(t),o=rs(e,n);return ns({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}const ds={up:0,down:180,left:90,right:-90};function hs(e){let{x:t,y:n,size:r}=e;const i=r/2;return{type:"rect",x:t-i,y:n-i,width:r,height:r}}const fs=Oe();fs.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),fs.add("diamond",(function(e){const t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:Zo([{x:n,y:r+t/2},{x:n+t/2,y:r},{x:n+t,y:r+t/2},{x:n+t/2,y:r+t},{x:n,y:r+t/2}])}})),fs.add("saltire",(function(e){const t=es(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n);let o=e.size;const s=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*s;const a={x:e.x,y:e.y},l=Qo(e.x,e.y,o,i).map((e=>us(e,t,a)));return{type:"path",fill:"black",d:Zo(l)}})),fs.add("square",(function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),fs.add("triangle",(function(e){const t=e.size,n={x:e.x,y:e.y},r=ds[e.direction]||0,i=t/2,o=e.x-i,s=e.y-i;let a=[{x:o,y:s+t},{x:o+i,y:s},{x:o+t,y:s+t},{x:o,y:s+t}];const l=es(r);return a=a.map((e=>us(e,l,n))),{type:"path",fill:"black",d:Zo(a)}})),fs.add("line",(function(e){const t="vertical"===e.direction,n=e.size/2,r=e.x,i=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:r-(t?0:n),y1:i-(t?n:0),x2:r+(t?0:n),y2:i+(t?n:0),collider:hs(e)}})),fs.add("star",(function(e){const t=e.size,n=[],r=t/2,i=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,s=isNaN(e.startAngle)?90:e.startAngle,a=360/i;for(let t=1;t<=i;t++){const i=a*t+s,l=es(i),c=es(i+a/2),u=Math.sin(l),d=Math.cos(l),h=Math.sin(c),f=Math.cos(c);n.push({x:e.x+d*r,y:e.y+u*r}),n.push({x:e.x+f*o,y:e.y+h*o})}return{type:"path",fill:"black",d:Zo(n)}})),fs.add("n-polygon",(function(e){const t=[],n=e.size/2,r=Math.max(isNaN(e.sides)?6:e.sides,3),i=360/r,o=isNaN(e.startAngle)?0:e.startAngle;for(let s=1;s<=r;s++){const r=es(i*s+o),a=Math.sin(r),l=Math.cos(r);t.push({x:e.x+l*n,y:e.y+a*n})}return{type:"path",fill:"black",d:Zo(t)}})),fs.add("cross",(function(e){const t=e.x,n=e.y,r=e.size/2,i=isNaN(e.width)?r/2:e.width,o=Math.min(i,r);return{type:"path",fill:"black",d:Zo(Qo(t,n,e.size,o))}})),fs.add("bar",(function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,r=e.size/2,i=r/2/2;let o=[{x:t.x-r,y:t.y+i},{x:t.x-r,y:t.y-i},{x:t.x+r,y:t.y-i},{x:t.x+r,y:t.y+i}];if(n){const e=es(90);o=o.map((n=>us(n,e,t)))}const s=E(o);return s.type="rect",s.fill="black",s})),fs.add("rect",(function(e){const{x:t,y:n,size:r}=e,i=void 0===e.width?r:e.width,o=void 0===e.height?r:e.height;return{type:"rect",fill:"black",x:t-i/2,y:n-o/2,width:i,height:o}}));const ps=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fs;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((n=>{void 0!==Jo[n]&&"transform"!==n&&(e[n]=t[n])}))}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function gs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{dock:n="center",displayOrder:r=0,prioOrder:i=0,preferredSize:o=0,minimumLayoutMode:s,show:a=!0}=e;n=n||"center";return{computePreferredSize(e){let{inner:n,outer:r,children:i}=e;return"function"==typeof o?o({inner:n,outer:r,children:i,dock:this.dock()},t):o},dock(e){return void 0!==e?(n=e,this):"function"==typeof n?n(t):n},displayOrder(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},prioOrder(e){return void 0!==e?(i=e,this):"function"==typeof i?i(t):i},minimumLayoutMode(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s},show(e){return void 0!==e?(a=e,this):"function"==typeof a?a(t):a}}}function ms(e,t,n){const{require:r=[]}=t,i=t.mediator||{},{settings:o,formatter:s,scale:a,data:l,renderer:c,chart:u,dockConfig:d,mediator:h,instance:f,rect:p,style:g,registries:m,resolver:y,update:v,_DO_NOT_USE_getInfo:b,symbol:x,isVisible:w}=n;e.emit=()=>{},w&&(e.isVisible=w),Object.defineProperty(e,"settings",{get:o}),Object.defineProperty(e,"data",{get:l}),Object.defineProperty(e,"formatter",{get:s}),Object.defineProperty(e,"scale",{get:a}),Object.defineProperty(e,"mediator",{get:h}),Object.defineProperty(e,"style",{get:g}),Object.defineProperty(e,"registries",{get:m}),p&&Object.defineProperty(e,"rect",{get:p}),b&&(e._DO_NOT_USE_getInfo=b),Object.keys(t).forEach((n=>{var r;r=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some((e=>e===r))||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),r.forEach((t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:u}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:d}):"instance"===t?Object.defineProperty(e,"instance",{get:f}):"update"===t&&v?Object.defineProperty(e,"update",{get:v}):"resolver"===t?Object.defineProperty(e,"resolver",{get:y}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:x})})),Object.keys(i).forEach((t=>{e.mediator.on(t,i[t].bind(e))}))}function ys(e,t,n){const r=t=>e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0,i={};return i.displayOrder=r("displayOrder"),i.dock=r("dock"),i.prioOrder=r("prioOrder"),i.minimumLayoutMode=r("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==i.displayOrder?i.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==i.prioOrder?i.prioOrder:e.layout.prioOrder,e.layout.dock=i.dock||e.layout.dock,e.layout.minimumLayoutMode=i.minimumLayoutMode||e.layout.minimumLayoutMode,i.show=e.show,i.preferredSize=t,i}function vs(e,t,n){Object.keys(n.on||{}).forEach((r=>{e.eventListeners=e.eventListeners||[];const i=n.on[r].bind(e);e.eventListeners.push({event:r,listener:i}),t.on(r,i)})),e.emit=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.emit(e,...r)}}function bs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{defaultSettings:n={},_DO_NOT_USE_getInfo:r=()=>({})}=e,{chart:i,container:o,mediator:s,registries:a,theme:l,renderer:c}=t,u=ho.mixin({});let d,h,f,p,g,m=t.settings||{},v=y(!0,{},n,m),b=[],x=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$o,n={};return{resolve:function(r){let{data:i,settings:o,defaults:s={},scaled:a}=r;const l=n.norm=t.normalizeSettings(o,s,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};a&&Object.keys(a).forEach((e=>{l[e]&&t.updateScaleSize(l,e,a[e])}));const u=[];if(!i||!Array.isArray(i.items)){const e={data:i,resources:c};let r=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:r}}{let e;for(let r=0,o=i.items.length;r<o;r++){e={datum:i.items[r],data:i,resources:c};let o=t.resolveForItem(e,n.norm,r);o.data=i.items[r],u.push(o)}}return{settings:n.norm,items:u}}}}({chart:i}),M=!1;const k={nodes:[],chart:i,config:v.brush||{},renderer:null},_={tap:[],over:[]},S=[],q={},D=y({},m);function E(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const i=void 0!==e[t],o=void 0!==m[t];let s;for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return i&&("function"==typeof e[t]?s=e[t].call(q,...l):r&&(s=e[t])),o&&("function"==typeof m[t]?s=m[t].call(D,...l):r&&(s=m[t])),i||o||(s=n.call(q,...l)),s}}const C=E("preferredSize",(()=>0),!0),A=E("resize",(e=>{let{inner:t}=e;return t})),T=E("created"),N=E("beforeMount"),R=E("mounted"),O=E("beforeUnmount"),I=E("beforeUpdate"),P=E("updated"),L=E("beforeRender"),j=E("beforeDestroy"),z=E("destroyed"),F=e.render,H=()=>{v.brush&&(v.brush.consume||[]).forEach((e=>{e.context&&e.style&&S.push(Uo(k,e))}))},B=()=>{v.brush&&(v.brush.trigger||[]).forEach((e=>{"over"===e.on?_.over.push(e):_.tap.push(e)}))};Object.defineProperty(k,"data",{get:()=>b});const V=v.renderer||e.renderer,$=V?c||a.renderer(V)():c||a.renderer()();"function"==typeof $.settings&&$.settings(v.rendererSettings),k.renderer=$;const W={resources:i.logger?{logger:i.logger()}:{}};let U=gs(ys(v,C,i.logger()),W);const Y=e=>{e.key=v.key,e.element=$.element()},K=()=>{};K.dockConfig=()=>U,K.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(m=e.settings,v=y(!0,{},n,e.settings),U=gs(ys(v,C,i.logger()),W),k.config=v.brush||{}),v.scale&&(d=i.scale(v.scale)),v.data){const{rendererSettings:e}=v,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=wr(v.data,{dataset:i.dataset,collection:i.dataCollection},{logger:i.logger()},i.dataCollection);t?t.isFirst?(b=n,b.items&&(b.items=[...n.items])):b.items&&(b.items=[...b.items,...n.items||[]]):b=n}else b=d?d.data():[];"string"==typeof v.formatter||"object"==typeof v.formatter?h=i.formatter(v.formatter):d&&d.data().fields&&(h=d.data().fields[0].formatter()),g=l.style(v.style||{})},K.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=A({inner:e,outer:t});p=n?$.size(n):$.size(e),D.rect=y(!0,{computedPhysical:p.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),p=y(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},p)},K.getRect=()=>D.rect;const X=()=>{const e=$.renderArgs?$.renderArgs.slice(0):[],{rendererSettings:t}=v;let n=b;const r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return b.items&&r&&(n=w(w({},b),{},{items:b.items.slice(r.start,r.end)})),e.push({data:n}),e};let G,J,Z;function Q(e){const{rendererSettings:t}=v,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?k.nodes=[...e||[]]:k.nodes&&(k.nodes=[...k.nodes,...e||[]]):k.nodes=e}K.beforeMount=N,K.beforeRender=()=>{L({size:p})},K.render=()=>{const e=F.call(q,...X());Q(e),$.render(e),G=e,J=D.rect.computed},K.hide=()=>{K.unmount(),$.size({x:0,y:0,width:0,height:0}),$.clear()},K.beforeUpdate=()=>{I({settings:v,data:b})},K.update=()=>{Z&&Z.stop();const{rendererSettings:e,brush:t,animations:n}=v;if("function"==typeof(null==e?void 0:e.transform)&&e.transform())return $.render(),void(G=null);const r=F.call(q,...X());Q(r),S.forEach((e=>e.cleanUp())),S.length=0,_.tap=[],_.over=[],t&&(H(),B()),S.forEach((e=>{e.isActive()&&e.update()})),G&&n&&("function"==typeof n.enabled?n.enabled():n.enabled)?(n.compensateForLayoutChanges&&n.compensateForLayoutChanges({currentNodes:G,currentRect:D.rect.computed,previousRect:J}),Z=function(e,t,n,r){let i,{old:o,current:s}=e,{renderer:a}=t,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},d={nodes:[],ips:[]},h=[],f=null;const p=n.trackBy||jo,g={start(){let e={};if(o.forEach(((t,n)=>{let r=p(t,n);e[r]=t})),s.forEach(((t,n)=>{let r=p(t,n);if(e[r]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter((e=>!e.dummy)),r=t.points.filter((e=>!e.dummy)),i=r.map((e=>e.data.major.value)),o=n.filter((e=>i.includes(e.data.major.value))).map((e=>e.data.major.value)),s=n.filter((e=>o.includes(e.data.major.value))),a=r.filter((e=>o.includes(e.data.major.value)));return{old:s,current:a}}(e[r],t);d.ips.push(Lo(y({},e[r],{points:n.old}),y({},t,{points:n.current}))),l.push(y({},e[r],{commonPoints:n.old}))}else d.ips.push(Lo(e[r],t)),l.push(e[r]);d.nodes.push(t),e[r]=!1}else c.nodes.push(t),c.ips.push(Lo(y({},t,{r:.001,opacity:0}),t))})),Object.keys(e).forEach((t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(Lo(e[t],y({},e[t],{r:1e-4,opacity:0}))))})),h.push({name:"exiting",easing:To,duration:200,tweens:u.ips,nodes:[...l]}),h.push({name:"updating",easing:Ro,duration:400,tweens:d.ips,nodes:[]}),h.push({name:"entering",easing:No,duration:200,tweens:c.ips,nodes:[...d.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,i=e?l.filter(e).length:l.length,{isInit:o,shouldBeRemoved:s}=r.getValue("animations.updatingStageMeta");!1===o?(r.setValue("animations.updatingStageMeta.shouldBeRemoved",0===i),r.setValue("animations.updatingStageMeta.isInit",!0)):r.setValue("animations.updatingStageMeta.shouldBeRemoved",s&&0===i)}h.length&&(f=a.getScene(s),h[0].started=Date.now(),"undefined"!=typeof window&&(i=window.requestAnimationFrame(g.tick)))},tick(){let e=h[0];e||g.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,o=[],s=e.tweens.map((n=>n(e.easing(Math.min(1,t)))));const{adjustTweenedNodes:l}=n;if(l&&l(s),o.push(...s),o.push(...e.nodes),a.render(o),t>=1){h.shift();const{isInit:e,shouldBeRemoved:t}=r.getValue("animations.updatingStageMeta");h.length?"updating"===h[0].name&&t&&h.shift():(!0===e&&r.setValue("animations.updatingStageMeta.isInit",!1),g.stop())}i&&(i=window.requestAnimationFrame(g.tick))},stop(){i&&(window.cancelAnimationFrame(i),i=!1)},inProgress:()=>!!i,get targetScene(){return f}};return g}({old:G,current:r},{renderer:$},n,i.storage),Z.start()):$.render(r),G=r,J=D.rect.computed,$.setKey&&"string"==typeof m.key&&$.setKey(m.key)},K.updated=P,K.destroy=()=>{K.unmount(),j(f),$.destroy(),z(),f=null};const ee=e=>{k.nodes=e,S.forEach((e=>{e.isActive()&&e.update()})),$.render(e)};return ms(q,e,{settings:()=>v,data:()=>b,scale:()=>d,formatter:()=>h,renderer:()=>$,chart:()=>i,dockConfig:()=>U,mediator:()=>s,instance:()=>D,rect:()=>D.rect,style:()=>g,update:()=>ee,registries:()=>a,resolver:()=>x,symbol:()=>ps(a.symbol)}),ms(D,m,{settings:()=>v,data:()=>b,scale:()=>d,formatter:()=>h,renderer:()=>$,chart:()=>i,dockConfig:()=>U,mediator:()=>s,style:()=>g,_DO_NOT_USE_getInfo:r.bind(q),isVisible:()=>M}),K.getBrushedShapes=function(e,t,n){const r=[];if(v.brush&&v.brush.consume){const o=i.brush(e),s=$.findShapes("*");v.brush.consume.filter((t=>t.context===e)).forEach((e=>{for(let i=0;i<s.length;i++){const a=s[i];a.data&&o.containsMappedData(a.data,n||e.data,t)&&(Y(a),r.push(a),s.splice(i,1),i--)}}))}return r},K.findShapes=e=>{var t;const n=(null!==(t=Z)&&void 0!==t&&t.inProgress()?Z.targetScene:$).findShapes(e);for(let e=0,t=n.length;e<t;e++)Y(n[e]);return n},K.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=$.itemsAt(e);let r;r=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map((e=>e.node));for(let e=0,t=r.length;e<t;e++)Y(r[e]);return r},K.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];Yo({nodes:e,action:t.action||"toggle",trigger:t,chart:i,data:k.data})},K.mount=()=>{f=$.element&&$.element()?f:$.appendTo(o),$.setKey&&"string"==typeof m.key&&$.setKey(m.key),v.brush&&(H(),B()),vs(D,u,m),vs(q,u,e),M=!0},K.mounted=()=>R(f),K.unmount=()=>{[D,q].forEach((e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach((e=>{let{event:n,listener:r}=e;t.removeListener(n,r)})),e.eventListeners.length=0),e.emit=()=>{}}(e,u)})),_.tap=[],_.over=[],S.forEach((e=>{e.cleanUp()})),S.length=0,O(),M=!1},K.onBrushTap=e=>{_.tap.forEach((t=>{(function(e){let{e:t,t:n,config:r}=e;return Ko({collisions:Xo(t,n,r.renderer),t:n,config:r,action:Go(n.action,t,"toggle")})})({e:e,t:t,config:k})&&"stop"===t.globalPropagation&&i.toggleBrushing(!0)}))},K.onBrushOver=e=>{_.over.forEach((t=>{(function(e){let{e:t,t:n,config:r}=e;return Ko({collisions:Xo(t,n,r.renderer),t:n,config:r,action:Go(n.action,t,"set")})})({e:e,t:t,config:k})&&"stop"===t.globalPropagation&&i.toggleBrushing(!0)}))},K.def=q,K.ctx=D,K.renderer=()=>$,K.set({settings:m}),T(),K}function xs(e){const t=y(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const r=t.split(".");let i=e;for(let e=0;e<r.length;++e){const t=r[e];if(void 0===i[t])return n;i=i[t]}return i}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const r=t.split("."),i=r[r.length-1];let o=e;for(let e=0;e<r.length-1;++e){const t=r[e];void 0===o[t]&&(o[t]=Number.isNaN(+r[e+1])?{}:[]),o=o[t]}void 0!==n?o[i]=n:delete o[i]}(t,e,n)};return n}function ws(e,t,n){const r=ns(function(e,t){const n=cs(e,t)/cs(t,t)||1;return{x:t.x*n,y:t.y*n}}(rs(n,e),rs(t,e)),e);return r}function Ms(e,t,n){return ls(e,n)+ls(t,n)-ls(e,t)<1e-12}function ks(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function _s(e){return e.x1===e.x2&&e.y1===e.y2}function Ss(e){return e.width<=0||e.height<=0}function qs(e){return e.r<=0}function Ds(e){return e.edges.length<=2}function Es(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=Is(e,C(t.edges[r])),!0===n)return!0;return!1}function Cs(e,t){let n=!1;const{numPolygons:r,polygons:i}=t;for(let t=0;t<r;t++){if(n=$s(e,i[t]),!0===n)return!0}return!1}function As(e,t){if(qs(e))return!1;return as({x:e.cx,y:e.cy},t)<=e.r**2}function Ts(e,t){if(Ss(t)||qs(e))return!1;const n=t.width/2,r=t.height/2,i=t.x+n,o=t.y+r,s=e.r,a=e.cx,l=e.cy,c=Math.abs(a-i),u=Math.abs(l-o);if(c>n+s||u>r+s)return!1;if(c<=n||u<=r)return!0;return(c-n)**2+(u-r)**2<=s**2}function Ns(e,t){if(qs(e)||_s(t))return!1;const[n,r]=q(t);if(As(e,n)||As(e,r))return!0;const i={x:e.cx,y:e.cy},o=ws(n,r,i);return as(o,i)<=e.r**2&&Ms(n,r,o)}function Rs(e,t){if(Ds(t)||qs(e))return!1;if(Os(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let r=0;r<n;r++){if(Ns(e,C(t.edges[r])))return!0}return!1}function Os(e,t){if(Ds(e)||!zs(e.boundingRect(),t))return!1;const{x:n,y:r}=t,i=e.vertices;let o,s,a,l,c;for(o=!1,l=-1,s=i.length,a=s-1;++l<s;a=l){if(i[l].x===n&&i[l].y===r)return!0;if(i[l].y===i[a].y&&i[l].y===r&&(n-i[l].x)*(n-i[a].x)<=0)return!0;if(i[l].y<r&&r<=i[a].y||i[a].y<r&&r<=i[l].y){if(c=(i[a].x-i[l].x)*(r-i[l].y)/(i[a].y-i[l].y)+i[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function Is(e,t){if(Ds(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(Hs(t,C(e.edges[n])))return!0}const[n,r]=q(t);return Os(e,n)||Os(e,r)}function Ps(e,t){if(Ds(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(Fs(t,C(e.edges[n])))return!0}const[n,r,i,o]=D(t);return Os(e,n)||Os(e,r)||Os(e,i)||Os(e,o)}function Ls(e,t){return!Ss(e)&&!Ss(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function js(e,t){if(Ss(e)||Ss(t))return!1;return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}].every((t=>zs(e,t)))}function zs(e,t){return!Ss(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function Fs(e,t){if(_s(t)||Ss(e))return!1;const[n,r]=q(t);if(zs(e,n)||zs(e,r))return!0;const i=D(e);let o=i.length;for(let e=0;e<o;e++){if(Hs(C([i[e],i[3!==e?e+1:0]]),t))return!0}return!1}function Hs(e,t){const[n,r]=q(e),[i,o]=q(t),s=os(r,n),a=ss(r,n),l=os(o,i),c=ss(o,i),u=os(n,i),d=ss(n,i);let h=c*s-l*a;const f=l*d-c*u,p=s*d-a*u;let g,m;if(0===s&&0===a)return!1;if(0===l&&0===c)return!1;if(0===h){if(0===f&&0===p){if(0===s){if(0===a)return n.x===r.x&&n.y===r.y;g=ss(i,n)/a,m=ss(o,n)/a}else g=(i.x-n.x)/s,m=(o.x-n.x)/s;return!(g<0&&m<0||g>1&&m>1)}return!1}const y=f/h;return h=p/h,y>=0&&y<=1&&h>=0&&h<=1}function Bs(e,t){if(_s(e))return!1;const[n,r]=q(e);return Ms(n,r,t)}function Vs(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Ls(n,r)&&(js(n,r)?Es(e,t):Es(t,e))}function $s(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Ls(n,r)&&(js(r,n)?function(e,t){let n=!1;const{numPolygons:r,polygons:i}=e;for(let e=0;e<r;e++)if(n=Vs(t,i[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=Ys(e,C(t.edges[r])),!0===n)return!0;return!1}(e,t))}function Ws(e,t){if(qs(e))return!1;if(Us(t,{x:e.cx,y:e.cy}))return!0;const{numPolygons:n,polygons:r}=t;for(let t=0;t<n;t++){const n=r[t],i=n.edges.length;for(let t=0;t<i;t++){if(Ns(e,C(n.edges[t])))return!0}}return!1}function Us(e,t){if(!zs(e.boundingRect(),t))return!1;const{x:n,y:r}=t,i=e.numPolygons;let o,s,a,l,c,u,d=!1;for(s=0;s<i;s++)for(o=e.vertices[s],c=-1,a=o.length,l=a-1;++c<a;l=c){if(o[c].x===n&&o[c].y===r)return!0;if(o[c].y===o[l].y&&o[c].y===r&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<r&&r<=o[l].y||o[l].y<r&&r<=o[c].y){if(u=(o[l].x-o[c].x)*(r-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(d=!d)}}return d}function Ys(e,t){const[n,r]=q(t);if(Us(e,n)||Us(e,r))return!0;const{numPolygons:i,polygons:o}=e;for(let e=0;e<i;e++){const n=o[e];for(let e=0,r=n.edges.length;e<r;e++){if(Hs(t,C(n.edges[e])))return!0}}return!1}function Ks(e,t){const[n,r,i,o]=D(t);if(Us(e,n)||Us(e,r)||Us(e,i)||Us(e,o))return!0;const{numPolygons:s,polygons:a}=e;for(let e=0;e<s;e++){const n=a[e];for(let e=0,r=n.edges.length;e<r;e++){if(Fs(t,C(n.edges[e])))return!0}}return!1}const Xs=/^\$/,Gs="@extend";function Js(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function Zs(e,t,n){if("string"==typeof e){let r=t[e];return-1!==n.indexOf(e)&&Js(e),Xs.test(r)?(n.push(e),Zs(r,t,n)):r}let r=e;const i=y(!0,{},t,e),o={};if(e[Gs]){const o=e[Gs];-1!==n.indexOf(o)&&Js(o);let s=n.slice();s.push(o),r=y(!0,{},Zs(i[o],t,s),e)}return Object.keys(r).forEach((e=>{let t=n.slice();if(e===Gs||Xs.test(e))return;o[e]=r[e];let s=o[e];Xs.test(s)&&s in i?(-1!==n.indexOf(s)&&Js(s),t.push(s),s=i[s],"object"==typeof s||Xs.test(s)&&s in i?o[e]=Zs(s,i,t):o[e]=s):"object"==typeof s&&(o[e]=Zs(s,i,t))})),o}function Qs(e,t){return Zs(e,t,[])}function ea(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const r=e=>{e.forEach((e=>{const n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map((e=>e?e.length:0))}}))},i={palette:(e,n)=>((e,n)=>{const r=t[e];if(!r)return[];const i=r.sizes;for(let e=0;e<i.length;e++)if(n<=i[e])return r.colors[e];return r.colors[i.length-1]})(e,n),setPalettes:r,style:e=>Qs(e,n),setStyle:t=>{n=y({},e,t)}};return r(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),i}function ta(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function na(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return y(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function ra(e,t,n,r,i){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:r,margin:isNaN(i)?0:i}}function ia(e,t,n){if(void 0===e.cachedSize){const r=e.config.dock();let i,o=e.comp.preferredSize({inner:t,outer:n,dock:r});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},i="top"===r||"bottom"===r?o.height:"right"===r||"left"===r?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(i),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function oa(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function sa(e,t){const n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function aa(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const r=e.width-(t.x+t.width);r<n.right&&(t.width-=n.right-r),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const i=e.height-(t.y+t.height);i<n.bottom&&(t.height-=n.bottom-i)}function la(e,t,n,r,i){const o=y({},t),s=y({},n);oa(o,r),sa(s,r),aa(e,o,s);const a=function(e,t,n){const r=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),i=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=r&&t.height>=i}(e,o,i);return!!a&&(oa(t,r),sa(n,r),!0)}function ca(e){return{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y}}function ua(e){return E([].concat(...e.map(D)))}function da(e){let{visible:t,layoutRect:n,reducedRect:r,containerRect:i,translation:o}=e;const s=ra(r.x,r.y,r.width,r.height),a=ra(r.x,r.y,r.width,r.height),l={},c=t.slice(),u=c.slice().sort(((e,t)=>e.config.displayOrder()-t.config.displayOrder()));return t.sort(((e,t)=>{if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n})).forEach((e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=s.width,t.x=n.x,c.x=s.x,t.y=c.y=s.y-e.cachedSize,s.y-=e.cachedSize,s.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=s.x,t.y=c.y=s.y+s.height,t.width=n.width,c.width=s.width,t.height=c.height=e.cachedSize,s.height+=e.cachedSize;break;case"left":t.x=c.x=a.x-e.cachedSize,t.y=n.y,c.y=a.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=a.height,a.x-=e.cachedSize,a.width+=e.cachedSize;break;case"right":t.x=c.x=a.x+a.width,t.y=n.y,c.y=a.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=a.height,a.width+=e.cachedSize;break;case"center":t.x=c.x=r.x,t.y=c.y=r.y,t.width=c.width=r.width,t.height=c.height=r.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map((e=>l[e])).filter((e=>!!e));n.length>0&&(t=ua(n.map((e=>e.outerRect))),c=ua(n.map((e=>e.r))))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,r){const i={x:r.width/n.width,y:r.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=i.x<i.y,t=Math.min(i.x,i.y);i.x=t,i.y=t;const s=e?"height":"width",a=(r[s]-n[s]*i.x)*n.align;o.left=e?0:a,o.top=e?a:0}e.scaleRatio=i,e.margin=o,t.scaleRatio=i,t.margin=o,n.scaleRatio=i,n.margin=o}(c,t,n,i),c.edgeBleed=e.edgeBleed,c.computed=ca(c),t.edgeBleed=e.edgeBleed,t.computed=ca(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0})),u}function ha(e,t,n){const r=e.layoutModes||{},i=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof i?o=r[i.width]&&r[i.height]&&n.width>=r[i.width].width&&n.height>=r[i.height].height:o&&void 0!==i&&(o=r[i]&&n.width>=r[i].width&&n.height>=r[i].height),o}function fa(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function pa(e){let t=na(e);const n={};return n.layout=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const{logicalContainerRect:r,containerRect:i}=function(e,t){const n={x:0,y:0,width:0,height:0},r={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(r.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,r.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,r.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),r.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(r.width=n.width,r.height=n.height,r.preserveAspectRatio=!1),ta(r),ta(n),{logicalContainerRect:r,containerRect:n}}(e,t),[o,s]=function(e,t,n){const r=[],i=[];for(let o=0;o<e.length;++o){const s=e[o];fa(s);let a=s.dockConfig;const l=s.key,c=a.dock(),u=/@/.test(c)?c.split(",").map((e=>e.replace(/^\s*@/,""))):[];ha(t,a,n)?r.push({comp:s,key:l,config:a,referencedDocks:u}):i.push({comp:s,key:l,config:a,referencedDocks:u})}return[r,i]}(n,t,r),a=function(e){let{layoutRect:t,visible:n,hidden:r,settings:i}=e;const o=ra(t.x,t.y,t.width,t.height),s={left:0,right:0,top:0,bottom:0},a=n.slice();a.sort(((e,t)=>e.config.prioOrder()-t.config.prioOrder()));for(let e=0;e<a.length;++e){const n=a[e];ia(n,o,t),la(t,o,s,n,i)||(r.push(a.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let r=e[n];if(r.referencedDocks.length){const i=r.referencedDocks.every((e=>t.some((t=>t.key===e))));i&&t.push(e.splice(n,1)[0])}}}(n,r);const l=n.filter((e=>-1!==a.indexOf(e)));return n.length=0,n.push(...l),aa(t,o,s),o}({layoutRect:r,visible:o,hidden:s,settings:t}),l=da({visible:o,layoutRect:r,reducedRect:a,containerRect:i,translation:{x:e.x,y:e.y}});return s.forEach((e=>{e.comp.visible=!1;const t=ra();e.comp.resize(t,t)})),{visible:o.map((e=>e.comp)),hidden:s.map((e=>e.comp)),ordered:l.map((e=>e.comp))}},n.settings=function(e){t=na(e)},n}const ga=(e,t)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.hasKey&&r.key===t)return e[n]}return null},ma=e=>null==e?void 0:e.map((e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(w(w({},n),{},{children:ma(e.children)}))}})),ya=(e,t)=>({visible:[],hidden:t,ordered:[]}),va=e=>(t,n)=>{var r;const i=n.map(((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize(w(w({},t),{},{children:ma(e.children)}))}})),o=e=>n[e.index],{visible:s=i,hidden:a=[],ordered:l=s}=null!==(r=e(t,i))&&void 0!==r?r:{};return{visible:s.map(o),hidden:a.map(o),ordered:l.map(o)}},ba=e=>"function"==typeof e?va(e):(e=>{const t=pa(e);return va(((e,n)=>t.layout(e,n)))})(e);function xa(e,t,n){const r=t.left-n.left,i=t.top-n.top,o=A(e),s=y(!0,{},e);switch(o){case"circle":s.cx+=r,s.cy+=i;break;case"polygon":for(let e=0,t=s.vertices.length;e<t;e++){const t=s.vertices[e];t.x+=r,t.y+=i}break;case"geopolygon":for(let e=0;e<s.vertices.length;e++){const t=s.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n.x+=r,n.y+=i}}break;case"line":s.x1+=r,s.y1+=i,s.x2+=r,s.y2+=i;break;case"point":case"rect":s.x+=r,s.y+=i}return s}function wa(e,t){const n=[];let r=0;t.forEach((e=>{n.push(r),r++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(r+=t.length)})),t.forEach(((t,r)=>((e,t,n)=>{const r=t.instance.renderer().element();if(isNaN(n)||!r||!e||!e.children)return;const i=e.children[Math.max(0,n)];if(r===i)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==i?(e.insertBefore(r,i),o&&o.forEach((t=>{e.insertBefore(t,r)}))):(o&&o.forEach((t=>{e.appendChild(t,r)})),e.appendChild(r))})(e,t,n[r])))}function Ma(e,t){let{element:n,data:r=[],settings:i={},on:o={}}=e;const s=t.registries,a=t.logger,l=ea(t.style,t.palettes),c=[],u=y({},e),d=function(){const e={};return ho.mixin(e),e}();let h=[],f=null,p=null,g=null,m=[],v=()=>{},b=()=>{};const x={};let k=!1;const _=function(e){let{createComponent:t}=e;const n={};let r=[],i=[];const o=e=>{const n=t(e);return n&&(r.push(n),e.components&&(n.children=e.components.map((e=>o(e))).filter((e=>!!e)))),n},s=e=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)},a=(e,t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n],i=t.find((e=>r.hasKey&&r.key===e.key));i?r.children&&i.components&&a(r.children,i.components):(e.splice(n,1),s(r),r.children&&a(r.children,[]),r.instance.destroy())}},l=e=>{let{compList:t,data:n,excludeFromUpdate:r,formatters:i,scales:s,settingsList:a}=e;return a.map((e=>{const a=ga(t,e.key);return r.indexOf(e.key)>-1?(delete a.updateWith,a):a?(e.rendererSettings&&"function"==typeof a.instance.renderer().settings&&a.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(a.applyTransform=!0,a):(a.updateWith={formatters:i,scales:s,data:n,settings:e},e.components&&(a.children=l({compList:a.children||[],data:n,excludeFromUpdate:r,formatters:i,scales:s,settingsList:e.components})),a)):o(e)})).filter((e=>!!e))},c=e=>{let{components:t,hidden:n,layoutFn:r,ordered:i,rect:o,visible:s}=e;const{visible:a,hidden:l,ordered:u}=r(o,t);s.push(...a),n.push(...l),i.push(...u),a.forEach((e=>{if(e.children){var t,r;const o=ba(null!==(t=null===(r=e.settings)||void 0===r?void 0:r.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:i,rect:e.instance.getRect(),visible:s})}})),l.forEach((e=>{e.children&&c({components:e.children,hidden:n,layoutFn:ya,ordered:i,rect:null,visible:s})}))};return n.destroy=()=>{r.forEach((e=>e.instance.destroy())),r=[],i=[]},n.findComponentByKey=e=>ga(r,e),n.forEach=e=>{r.forEach(e)},n.layout=e=>{let{layoutSettings:t,rect:n}=e;const r=[],o=[],s=[],a=ba(t);return c({components:i,hidden:o,layoutFn:a,ordered:s,rect:n,visible:r}),{visible:r,hidden:o,ordered:s}},n.set=e=>{let{components:t}=e;i=t.map((e=>o(e))).filter((e=>!!e))},n.update=e=>{let{components:t,data:n,excludeFromUpdate:r,formatters:o,scales:s}=e;a(i,t),i=l({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:s,settingsList:t})},n}({createComponent:e=>{if(!s.component.has(e.type))return a.warn("Unknown component: ".concat(e.type)),!1;return{instance:bs(s.component(e.type),{settings:e,chart:u,mediator:d,registries:s,theme:l,container:n}),settings:y(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function S(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const r="function"==typeof e[t];let i;for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=r?e[t].call(u,...s):n.call(u,...s),i}}const q=()=>{let e;i.dockLayout?(a.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=i.dockLayout):e=i.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const{width:t,height:n}=e.getBoundingClientRect();return{x:0,y:0,width:t,height:n}}return{x:0,y:0,width:0,height:0}}(n);return _.layout({layoutSettings:e,rect:t})},D=S("created"),E=S("beforeMount"),C=S("mounted"),A=S("beforeUpdate"),T=S("updated"),N=S("beforeRender"),R=S("beforeDestroy"),O=S("destroyed"),I=function(e,t){let{partialData:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{formatters:r={},scales:i={},scroll:o={}}=t;v=function(e,t){let{types:n,logger:r}=t;const i={},o=[];return Array.isArray(e)?o.push(...e):(r.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach(((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(r.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let s=o({key:n,data:e.data,config:e.config});i[n]=s}})),e=>e?i[e]:i[Object.keys(i)[0]]}(e,{logger:a,types:s.data}),n||Object.keys(x).forEach((e=>x[e].clear())),t.palettes&&l.setPalettes(t.palettes),t.style&&l.setStyle(t.style),b=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:wr;const i={};return(e||[]).forEach((e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");i[e.key]=()=>r(e.data,t,n)})),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in i))throw new Error("Unknown data collection: ".concat(t));"function"==typeof i[t]&&(i[t]=i[t]());let r=i[t];if(n&&n.fields&&n.fields.filter){let e=r.fields.filter(n.fields.filter);r.fields.length!==e.length&&(r=y(r,{fields:e}))}return r}}(t.collections,{dataset:v},{logger:a});const c={theme:l,logger:a};f=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ao;const i={};return{get(o){let s;return"string"==typeof o&&e[o]?s=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(s=o.scale),s?(i[s]=i[s]||r(e[s],t,n),i[s]):r(o,t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(i,{dataset:v,collection:b},w(w({},c),{},{scale:s.scale})),p=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Mr;const i={};return{get(o){let s;return"string"==typeof o&&e[o]?s=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?s=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(s=o.type),s?(i[s]=i[s]||r(e[s],t,n),i[s]):r(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(r,{dataset:v,collection:b},w(w({},c),{},{formatter:s.formatter})),g=function(e,t){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=po(e[r],t?t[r]:null));return n}(o,g)};function P(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},r=e.filter((e=>!!e.key)).map((e=>e.key));m.forEach((e=>{e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()})),m=e.map((e=>{const r=e.key&&t[e.key]?t[e.key]:s.interaction(e.type)(u,d,n);return r.set(e),r}))}const L=e=>{const t=n.getBoundingClientRect(),r="clientX"in e?e.clientX:e.x,i="clientY"in e?e.clientY:e.y,o={x:r-t.left,y:i-t.top},s=[];return h.forEach((e=>{const t=e.instance.getRect();zs(t.computedPhysical?t.computedPhysical:{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y},o)&&s.push(e)})),s},j=()=>{if(c.length||!n)return;Object.keys(o).forEach((e=>{const t=o[e].bind(u);n.addEventListener(e,t),c.push({key:e,listener:t})}));const e={},t=t=>{t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=L(e)},r=t=>{const n=e.comps||L(t);if(!n.every((e=>e.instance.def.disableTriggers))&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=M(e),r=n?e.changedTouches[0]:e,i=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(r.clientX-t.x),s=isNaN(t.y)?0:Math.abs(r.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&s<=12&&i<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),k){k=!1;break}}},i=[];var s;i.push({key:"mousedown",listener:t}),i.push({key:"mouseup",listener:r}),("ontouchstart"in(s=n)&&"ontouchend"in s||navigator.maxTouchPoints>1)&&(i.push({key:"touchstart",listener:t}),i.push({key:"touchend",listener:r})),i.push({key:"mousemove",listener:e=>{const t=L(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),k){k=!1;break}}}}),i.forEach((e=>{n.addEventListener(e.key,e.listener),c.push(e)}))},z=()=>{c.forEach((e=>{let{key:t,listener:r}=e;return n.removeEventListener(t,r)})),c.length=0},F=()=>{n.innerHTML="",(()=>{const{components:e=[]}=i;N(),I(r,i),_.set({components:e});const{visible:t,hidden:o,ordered:s}=q();h=t,o.forEach((e=>{e.instance.hide(),e.visible=!1})),t.forEach((e=>e.instance.beforeMount())),t.forEach((e=>e.instance.mount())),t.forEach((e=>e.instance.beforeRender())),t.forEach((e=>e.instance.render())),t.forEach((e=>e.instance.mounted())),t.forEach((e=>{e.visible=!0})),wa(n,s)})(),j(),P(i.interactions)};return u.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{excludeFromUpdate:t=[]}=e;e.data&&(r=e.data),e.settings&&(i=e.settings,P(e.settings.interactions)),A(),I(r,i);const{formatters:n,scales:o,components:s=[]}=i;_.update({components:s,data:r,excludeFromUpdate:t,formatters:n,scales:o}),_.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),_.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()})),q()},u.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{partialData:t,excludeFromUpdate:o=[]}=e;let s;e.data&&(r=e.data),e.settings&&(i=e.settings,P(e.settings.interactions)),A(),I(r,i,{partialData:t});const{formatters:a,scales:l,components:c=[]}=i;_.update({components:c,data:r,excludeFromUpdate:o,formatters:a,scales:l}),_.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),_.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()}));const u=[],d=[];let f;if(t)_.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible&&u.push(e)})),f=u;else{const{visible:e,hidden:t,ordered:n}=q();h=e,f=e,s=n,e.forEach((e=>{e.updateWith&&e.visible?u.push(e):d.push(e)})),t.forEach((e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}d.forEach((e=>e.instance.beforeMount())),d.forEach((e=>e.instance.mount())),f.forEach((e=>e.instance.beforeRender())),f.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),t||wa(n,s),d.forEach((e=>e.instance.mounted())),u.forEach((e=>e.instance.updated())),h.forEach((e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1})),T()},u.destroy=()=>{R(),_.destroy(),z(),P(),delete u.update,delete u.destroy,O()},u.getAffectedShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=[];return h.filter((e=>null==r||e.key===r)).forEach((r=>{const o=r.instance.getBrushedShapes(e,t,n);i=[...i,...o]})),i},u.findShapes=e=>{let t=[];return h.forEach((n=>{const r=n.instance.findShapes(e);t=[...t,...r]})),t},u.componentsFromPoint=e=>L(e).map((e=>e.instance.ctx)),u.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[];const i=n.getBoundingClientRect();let o=h;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map((e=>e.key));o=h.filter((t=>-1!==e.indexOf(t.key))).map((n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]})))}for(let n=o.length-1;n>=0;n--){const s=o[n],a=xa(e,i,s.instance.renderer().element().getBoundingClientRect()),l=s.instance.shapesAt(a,s.opts),c=l.length>0&&"stop"===t.propagation;if(r=[...r,...l],r.length>0&&c)return r}return r},u.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const r=t.components[n].key;h.filter((e=>r===e.key)).forEach((r=>{let i=e.filter((e=>e.key===r.key));r.instance.brushFromShapes(i,t.components[n])}))}},u.scroll=function(){return function(e,t){return t[e]||(t[e]=fo()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",g)},u.dataset=e=>v(e),u.dataCollection=e=>b(e),u.scales=function(){return f.all()},u.formatters=function(){return p.all()},u.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return x[e]||(x[e]=Ao()),x[e]},u.scale=function(e){return f.get(e)},u.formatter=function(e){return p.get(e)},u.toggleBrushing=function(e){k=void 0!==e?e:!k},u.component=e=>{const t=_.findComponentByKey(e);return null==t?void 0:t.instance.ctx},u.logger=()=>a,u.theme=()=>l,u.storage=xs({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(u,"interactions",{get:()=>({instances:m,on(){j(),m.forEach((e=>e.on()))},off(){z(),m.forEach((e=>e.off()))}})}),D(),n&&(E(),F(),C(n),u.element=n),u}const ka=e=>{let t=Oe(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var _a=Oe();function Sa(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}const qa=e=>e.filter((e=>"number"==typeof e&&!isNaN(e)));const Da=e=>{let{key:t,data:n,cache:r,config:i}=e;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let{data:t,config:n}=e;const r=t.split("\n"),i=r[0],o=r[1];let s=",";if(n&&n.parse&&n.parse.delimiter)s=n.parse.delimiter;else if(i){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(i&&o){if(n.test(i)&&n.test(o)&&i.split(n).length===o.split(n).length){s=n;break}}else n.test(i)&&(s=n)}}return r.map((e=>e.split(s)))})({data:n,config:i})),Array.isArray(o)&&function(e){let t,{source:n,data:r,cache:i,config:o}=e,s=r;const a=o&&o.parse;Array.isArray(r[0])?a&&!1===a.headers?t=r[0].map(((e,t)=>t)):(t=r[0],s=r.slice(1)):t=Object.keys(r[0]);const l=!!a&&"function"==typeof a.row&&a.row;let c,u=t;u=a&&"function"==typeof a.fields?a.fields(u.slice()):t.map((e=>({key:e,title:e}))),Array.isArray(r[0])?c=u.map((()=>[])):(c={},u.forEach((e=>{c[e.key]=[]})));for(let e=0;e<s.length;e++){const t=l?l(s[e],e,u):s[e];if(t)if(Array.isArray(t))for(let e=0;e<u.length;e++)c[e].push(t[e]);else for(let e=0;e<u.length;e++)c[u[e].key].push(t[u[e].key])}const d=Array.isArray(c)?e=>c[e]:e=>c[u[e].key];for(let e=0;e<u.length;e++){const t=d(e),r=qa(t),o=r.length>0,s=o?"measure":"dimension",a=o?Math.min(...r):NaN,l=o?Math.max(...r):NaN;i.fields.push(ar(y({source:n,key:e,title:u[e].title,values:t,min:a,max:l,type:s},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:r,source:t,config:i})};function Ea(){let{key:e,data:t,config:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[]},i={key:()=>e,raw:()=>t,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}(e,{cache:r}),fields:()=>r.fields.slice(),extract:e=>function(e,t){const n=Array.isArray(e)?e:[e];let r=[];return n.forEach((e=>{if(void 0!==e.field){const n=t.field(e.field),i=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const{props:o,main:s}=hr(e,t),a=Object.keys(o),l=!!e.trackBy,c=typeof e.trackBy,u={},d=[],h=n.items(),f=[];for(let t=0;t<h.length;t++){const n=h[t];if(s.filter&&!s.filter(n))continue;const r=Sa(s,n,{key:i});a.forEach((e=>{const s=o[e];let a=s.field?s.field.items()[t]:n;r[e]=Sa(s,a,{key:i})})),l&&gr({cfg:e,itemData:n,obj:r,target:d,tracker:u,trackType:c}),f.push(r)}r=l?[...r,...pr(d,{main:s,propsArr:a,props:o})]:[...r,...f]}})),r}(e,i),hierarchy:()=>null};return Da({key:e,data:t,config:n,cache:r}),i}Ea.util={normalizeConfig:hr,collect:pr,track:gr};const Ca=Oe();Ca.default("matrix"),Ca("matrix",Ea),Ca("default",Ea);const Aa=Oe();function Ta(e,t,n){return Math.max(e,Math.min(t,n))}function Na(e){let{item:t,value:n,boxCenter:r,rendWidth:i,rendHeight:o,flipXY:s,symbol:a}=e,l="x",c="y",u=i,d=o,h=n<.5?90:-90;return s&&(l="y",c="x",u=o,d=i,h=n<.5?180:0),a(y({},t.oob,{[l]:r*u,[c]:Math.max(t.oob.size/2,Math.min(n*d,d-t.oob.size/2)),startAngle:h}))}function Ra(e){let{item:t,boxWidth:n,boxPadding:r,rendWidth:i,rendHeight:o,flipXY:s}=e,a="x",l="y",c="width",u="height",d=i,h=o;s&&(a="y",l="x",c="height",u="width",d=o,h=i);const{actualDiff:f,actualLow:p}=function(e){let{start:t,end:n,minPx:r=.1,maxPx:i=1}=e;const o=Math.max(t,n),s=Math.min(t,n),a=Ta(-.1,1.2,o),l=Ta(-.1,1.2,s),c=a*i-l*i,u=Math.max(r,c),d=(u-c)/2;return{actualDiff:u,startModifier:d,actualLow:l*i-d}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:h});return y({},t.box,{type:"rect",[a]:(r+t.major)*d,[l]:p,[u]:f,[c]:n*d,data:t.data||{},collider:{type:null}})}function Oa(e){let{item:t,from:n,to:r,boxCenter:i,rendWidth:o,rendHeight:s,flipXY:a}=e,l="x1",c="y1",u="x2",d="y2",h=o,f=s;return a&&(l="y1",c="x1",u="y2",d="x2",h=s,f=o),y({},t.line,{type:"line",[d]:Math.floor(n*f),[l]:i*h,[c]:Math.floor(r*f),[u]:i*h,data:t.data||{},collider:{type:null}})}function Ia(e){let{item:t,key:n,position:r,width:i,boxCenter:o,rendWidth:s,rendHeight:a,flipXY:l}=e,c="x1",u="y1",d="x2",h="y2",f=s,p=a;l&&(c="y1",u="x1",d="y2",h="x2",f=a,p=s);const g=i/2;return y({type:"line"},t[n],{[u]:Math.floor(r*p),[c]:(o-g)*f,[h]:Math.floor(r*p),[d]:(o+g)*f,r:g*f,cx:o*f,cy:r*p,width:i*f,data:t.data||{},collider:{type:null}})}function Pa(e,t,n){const{width:r,maxWidthPx:i,minWidthPx:o}=t.box,s=e>=0?1:-1;let a=Math.min(s*e*r,isNaN(i)?n:i/n);return a=isNaN(o)?a:Math.max(o/n,a),a*s}Aa("native",(function(e,t,n){let r,i,o={chart:e,mediator:t,element:n},s=[],a=!0;function l(){"function"==typeof r.enable&&(r.enable=r.enable.bind(o)()),r.enable&&Object.keys(r.events).forEach((e=>{const t=r.events[e].bind(o);n.addEventListener(e,t),s.push({key:e,listener:t})}))}function c(){s.forEach((e=>{let{key:t,listener:r}=e;n.removeEventListener(t,r)})),s=[]}return{get key(){return i},set(e){!function(e){i=e.key,r=e,r.events=r.events||[],void 0===r.enable&&(r.enable=!0)}(e),c(),a&&l()},off(){a=!1,c()},on(){a=!0,0===s.length&&l()},destroy(){c(),o=null,r=null}}}));const La={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},ja=Object.keys(La),za={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let{data:t}=e;const{width:n,height:r}=this.rect,i="horizontal"===this.settings.settings.orientation,{style:o,resolver:s,symbol:a}=this,l=ja.filter((e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show)),c={};l.forEach((e=>c[e]=La[e]));const u=function(e){let{keys:t,data:n,defaultSettings:r,style:i,settings:o,width:s,height:a,resolver:l}=e;const c=y(!0,{},r||{},i||{}),u={major:"horizontal"===o.orientation?a:s,minor:"horizontal"===o.orientation?s:a},d=o.major;let h;h="object"==typeof d&&"object"==typeof d.ref&&void 0!==d.ref.start&&void 0!==d.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:y(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof d&&void 0!==d.binStart&&void 0!==d.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:y(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const f=o.minor||{},p={};["start","end","min","max","med"].forEach((e=>{(f[e]||n.items&&n.items.length&&n.items[0][e])&&(p[e]={scale:f.scale,ref:e})}));let g,m={major:h,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:y(!0,{},p,f)})};for(let e=0,r=t.length;e<r;e++)o[g]&&!1===o[g].show||(g=t[e],m[g]=l.resolve({data:n,defaults:c[g],settings:o[g],scaled:u}));return m}({keys:l,data:t,defaultSettings:c,style:o,settings:this.settings.settings,width:n,height:r,resolver:s}),{settings:d,items:h}=u,f=function(e){let{width:t,height:n,flipXY:r,resolved:i,keys:o,symbol:s}=e;const a=[],l=i.major.items;if(!l.length)return a;const c=t,u=n,d=r?n:t,h=i.major.settings,f=["start","end","min","max","med"].filter((e=>void 0!==i.minor.settings[e])),p=f.length,g=o.filter((e=>"oob"!==e));let m,v,b,x,w,M,_,S,q;const D=o?o.length:0,E=g?g.length:0,C={box:function(){b.box&&k(b.start)&&k(b.end)&&m.push(Ra({item:b,boxWidth:x,boxPadding:w,rendWidth:c,rendHeight:u,flipXY:r}))},line:function(){k(b.min)&&k(b.start)&&m.push(Oa({item:b,from:b.min,to:b.start,boxCenter:M,rendWidth:c,rendHeight:u,flipXY:r})),k(b.max)&&k(b.end)&&m.push(Oa({item:b,from:b.max,to:b.end,boxCenter:M,rendWidth:c,rendHeight:u,flipXY:r}))},median:function(){b.median&&k(b.med)&&m.push(Ia({item:b,key:"median",position:b.med,width:x,boxCenter:M,rendWidth:c,rendHeight:u,flipXY:r}))},whisker:function(){if(b.whisker){const e=x*b.whisker.width;k(b.min)&&m.push(Ia({item:b,key:"whisker",position:b.min,width:e,boxCenter:M,rendWidth:c,rendHeight:u,flipXY:r})),k(b.max)&&m.push(Ia({item:b,key:"whisker",position:b.max,width:e,boxCenter:M,rendWidth:c,rendHeight:u,flipXY:r}))}}};function A(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let r=0;r<p;r++)e=b[f[r]],k(e)&&(t<e&&(t=e),n>e&&(n=e));_=t<0&&t!==-Number.MAX_VALUE,S=n>1&&n!==Number.MAX_VALUE,q=_||S}for(let e=0,t=l.length;e<t;e++){m=[],v=null;const t=l[e],n=t.data;let f=null,p=null;void 0!==h.binStart?(f=t.binStart,p=t.binEnd,v=h.binStart.scale):(v=h.major.scale,f=v?t.major:0);let k=0;v?v.bandwidth?(k=v.bandwidth(),f-=k/2):k=p-f:k=1,b=y({},{major:f,majorEnd:p},i.minor.items[e]);for(let t=0;t<D;t++)b[o[t]]=i[o[t]].items[e];if(x=Pa(k,b,d),w=(k-x)/2,M=w+b.major+x/2,A(),q)b.oob&&(_?m.push(Na({item:b,value:0,boxCenter:M,rendWidth:c,rendHeight:u,flipXY:r,symbol:s})):S&&m.push(Na({item:b,value:1,boxCenter:M,rendWidth:c,rendHeight:u,flipXY:r,symbol:s})));else for(let e=0;e<E;e++)b[g[e]]&&!1===b[g[e]].show||C[g[e]]();const T={type:"container",data:n,collider:{type:"bounds"},children:m};a.push(T)}return a}({width:n,height:r,flipXY:i,resolved:u,keys:l,symbol:a});return f}};const Fa={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},Ha=/px$/,Ba={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},Va={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function $a(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function Wa(e,t,n,r){let{width:i,height:o}=t;return e.filter((e=>!1!==e.show&&!isNaN(e.x+e.y))).map((e=>{let t=e,s=Ha.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);_(s)&&(t=Fa,s=n.min+t.size*(n.max-n.min));const[a,l]=function(e){let t=Ba.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),c=w(w({},l),{},{type:a,label:e.label,x:e.x*i,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,s)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity});t===e.errorShape&&(c.width=t.width);const u=r(c);return u.data=e.data,u}))}const Ua={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let{data:t}=e;const n=this.resolver.resolve({data:t,defaults:y({},Ba,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),{width:r,height:i}=this.rect,o=y({},Va,this.settings.settings.sizeLimits),s=n.items,a=function(e,t,n,r,i){const o=$a(e?e.scale:void 0,n),s=$a(t?t.scale:void 0,r);let a=Math.min(o.value*i[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],s.value*i[s.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*i[o.isBandwidth?"minRelDiscrete":"minRelExtent"],s.value*i[s.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(a)),maxGlobal:i.maxPx,minGlobal:i.minPx}}(n.settings.x,n.settings.y,r,i,o);return Wa(s,this.rect,a,this.settings.shapeFn||this.symbol)}};const Ya={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function Ka(e,t,n,r){let{x:i,y:o,width:s,height:a}=t;const l=re(),c={x:i+s/2,y:o+a/2},u=Math.min(s,a)/2,d=Math.min(s,a)/2,h=d/100;return e.map(((e,t)=>{const i=n[t];i.type="path";const o=d*i.outerRadius,s=u*i.innerRadius,a=h*i.cornerRadius;l.innerRadius(s),l.outerRadius(o),l.cornerRadius(a),i.arcDatum=e;const f=l.centroid(e),p=i.offset?function(e,t,n,r){let[i,o]=e;const s=Math.sqrt(i*i+o*o);i/=s,o/=s;const a=n-r;return{x:i*t*a,y:o*t*a}}(f,i.offset,o,s):{x:0,y:0};return i.transform="translate(".concat(p.x,", ").concat(p.y,") translate(").concat(c.x,", ").concat(c.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:s,outerRadius:o,cornerRadius:a,offset:{x:c.x+p.x,y:c.y+p.y}}},i}))}function Xa(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const Ga={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let{data:t}=e;const n=[],r=[],i=this.settings.settings,{items:o}=this.resolver.resolve({data:t,defaults:y({},Ya,this.style.slice),settings:i.slice});let s=0;for(let e=0,t=o.length;e<t;e++){const t=Xa(i,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),r.push(o[e]),s+=t)}const a=function(){var e=ue,t=ce,n=null,r=j(0),i=j(X),o=j(0);function s(s){var a,l,c,u,d,h=s.length,f=0,p=new Array(h),g=new Array(h),m=+r.apply(this,arguments),y=Math.min(X,Math.max(-X,i.apply(this,arguments)-m)),v=Math.min(Math.abs(y)/h,o.apply(this,arguments)),b=v*(y<0?-1:1);for(a=0;a<h;++a)(d=g[p[a]=a]=+e(s[a],a,s))>0&&(f+=d);for(null!=t?p.sort((function(e,n){return t(g[e],g[n])})):null!=n&&p.sort((function(e,t){return n(s[e],s[t])})),a=0,c=f?(y-h*b)/f:0;a<h;++a,m=u)l=p[a],u=m+((d=g[l])>0?d*c:0)+b,g[l]={data:s[l],index:a,value:d,startAngle:m,endAngle:u,padAngle:v};return g}return s.value=function(t){return arguments.length?(e="function"==typeof t?t:j(+t),s):e},s.sortValues=function(e){return arguments.length?(t=e,n=null,s):t},s.sort=function(e){return arguments.length?(n=e,t=null,s):n},s.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:j(+e),s):r},s.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:j(+e),s):i},s.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:j(+e),s):o},s}().sortValues(null);a.startAngle(i.startAngle),a.endAngle(i.endAngle),a.padAngle(i.padAngle);return Ka(a(n),y({},this.rect,{x:0,y:0}),r,s)}};const Ja=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],r=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((e=>{const n=Math.round(t[e.key]),i=t[e.key]-n;t[e.key]=n,r&&"append"===e.type&&(i>0?t[e.key]+=.5:t[e.key]-=.5)}))}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach((t=>{const n=e[t];n.items=[],n.append.forEach((e=>{n.items.push({key:e,type:"append"})})),n.round.forEach((e=>{n.items.push({key:e,type:"round"})}))})),t.multiple=e=>e.forEach((e=>t(e))),t}();class Za{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const r=e.substring(0,1);if("x"===r||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===r||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,r=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let r=n?this.height:this.width,i=n?this.width:this.height;e=e.fn({width:r,height:i,flipXY:n});const o=Object.keys(e);for(let r=0,i=o.length;r<i;r++){let i=o[r];t[Za.evaluateKey(i,n)]=e[i]}}else{const r=Object.keys(e);for(let i=0,o=r.length;i<o;i++){let o=r[i];const s=Za.evaluateKey(o,n),a=this.transposeCoordinate(s,e[o],n);t[s]=a}}return r&&Ja(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function Qa(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Za(...t)}function el(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const tl={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=Qa(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,Bo(this,"x",this.rect.width),Bo(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=y({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=y({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=el(this.x,this.rect.width),this.lines.y=el(this.y,this.rect.height),this.lines.y=this.lines.y.map((e=>y(e,{flipXY:!0})));let e=e=>{let{dir:t,isMinor:n}=e,r=this.lines[t].filter((e=>!!e.isMinor===n)),i=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:i,data:{items:r,dir:t}}).items.forEach((e=>{let n=e.data;var r,i;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(r=n.value)&&void 0!==r?r:null===(i=n.data)||void 0===i?void 0:i.value,dir:t})}))};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function nl(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===r||"right"===r){let i="right"===r;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}let i="bottom"===r;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function rl(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===r||"right"===r){let i="right"===r;return"\n M ".concat(e+=i?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}let i="bottom"===r;return t+=i?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function il(e,t,n){return e<t||e>n}function ol(e,t){if("string"==typeof e.formatter)return t.formatter(e.formatter);if("object"==typeof e.formatter)return t.formatter(e.formatter);if(void 0!==e.scale&&e.scale.data){const t=e.scale.data()&&e.scale.data().fields;return t&&t[0]?t[0].formatter():null}return null}function sl(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function al(e){var t,n;let{chart:r,blueprint:i,renderer:o,p:s,settings:a,items:l,slopeLine:c}=e,u=!0,d=!1,h=!1,f=!1,p=!1,g=y(!0,{},a.style.line,s.line||{}),m=y(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},a.style.label||{},{fill:g.stroke});if(d=c?i.processItem({type:"line",x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:g.stroke||"black",strokeWidth:g.strokeWidth||1,strokeDasharray:g.strokeDasharray,flipXY:!1,value:s.valueInfo?s.valueInfo.id:s.value}):i.processItem({type:"line",x1:s.position,y1:0,x2:s.position,y2:1,stroke:g.stroke||"black",strokeWidth:g.strokeWidth||1,strokeDasharray:g.strokeDasharray,flipXY:s.flipXY||!1,value:s.valueInfo?s.valueInfo.id:s.value}),s.label&&!1!==s.label.show&&(null==c||!c.slope||0===c.slope)){const e=y(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},a.style.label||{},{fill:g.stroke},s.label);let t,n={width:0,height:0},c="";t=ol(s,r),!1!==s.label.showValue&&(t?c=" (".concat(t(s.value),")"):s.scale&&(c=" (".concat(s.value,")"))),c&&(n=o.measureText({text:c,fontFamily:e.fontFamily,fontSize:e.fontSize}));let d=o.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),m={width:d.width+n.width,height:Math.max(d.height,n.height)},v=e.padding,b=sl(s.flipXY?e.vAlign:e.align),x=sl(s.flipXY?e.align:e.vAlign),w=Math.min(1+m.width+2*v,e.maxWidth*i.width,e.maxWidthPx),M=m.height+2*v,k=s.flipXY?M:w,_=s.flipXY?w:M;if(h=i.processItem({fn:t=>{let{width:n,height:r}=t,o=s.position*n-(s.flipXY?M:w)*(1-b);o=s.flipXY?o:Math.max(o,0);return{type:"rect",x:o,y:Math.max(Math.abs(x*r-_*x),0),width:s.flipXY?k:Math.min(k,i.width-o),height:_,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:s.flipXY||!1}),h.x<-1||h.x+h.width>i.width+1||h.y<-1||h.y+h.height>i.height+1)h=void 0;else{f={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:h.x+v,y:h.y+h.height/2+m.height/3,maxWidth:h.width-2*v-n.width,anchor:"start"},c&&(p={type:"text",text:c||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:f.x+3+(h.width-(n.width+2*v)),y:f.y});for(let e=0,t=l.length;e<t;e++){let t=l[e];"rect"===t.type?Ls(h,t)&&(u=!1):"line"===t.type&&s.flipXY===t.flipXY&&Fs(h,t)&&(u=!1)}}}if(d&&l.push(d),c&&0!==c.slope&&(!1!==(null===(t=c.label)||void 0===t?void 0:t.show)||!1!==(null===(n=c.label)||void 0===n?void 0:n.showValue))){var v,b,x;let e,t;const n=120;let a=!1!==(null===(v=c.label)||void 0===v?void 0:v.show)?null===(b=c.label)||void 0===b?void 0:b.text:"";if(!1!==(null===(x=c.label)||void 0===x?void 0:x.showValue)){var w;const t=ol(s,r),n=t?t(c.value):c.value;e="(".concat(c.slope,"x + ").concat(n,")"),a+=null!==(w=c.label)&&void 0!==w&&w.text?" ".concat(e):e}if(a.length>1){var M,k,_;const e=o.measureText({text:a,fontFamily:m.fontFamily,fontSize:m.fontSize});e.width=e.width>n?n:e.width;const s=function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});if(t>0){if(r.max()*t+n>=i.max())return!0}else if(t<0&&r.min()*t+n>=i.max())return!0;return!1}(r,c.slope,c.value)?function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});return r((i.max()-n)/t)}(r,c.slope,c.value):void 0,u=void 0===s||c.isRtl?m.padding:3*m.padding,h=void 0!==s||c.slope>0?3*m.padding:m.padding,f=function(e,t,n,r,i,o){let s=0;if(void 0!==n){if(n<.8)return s=e.slope<0||e.isRtl?3*o.padding:2*o.padding,e.isRtl,n*i.width+s;if(1===n)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding);if(n>.8)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding)}else if(e.slope>0)return t.x2-(r.width+2*o.padding);return e.isRtl?t.x1-(r.width+2*o.padding):t.x1}(c,d,s,e,i,m),p=Math.min(d.y1,d.y2);null!==(M=c.label)&&void 0!==M&&M.stroke&&(t={type:"rect",x:c.isRtl?Math.max(f,u)-2:Math.max(f,u)+2,y:Math.abs(Math.max(p,h)-e.height),rx:3,ry:3,width:e.width+m.padding,height:e.height-2,stroke:g.stroke,fill:g.stroke});const y={type:"text",text:a,fill:null!==(k=null===(_=c.label)||void 0===_?void 0:_.stroke)&&void 0!==k?k:g.stroke,opacity:m.opacity,fontFamily:m.fontFamily,fontSize:m.fontSize,x:t?t.x+2:Math.max(f,u)+2,y:t?t.y+e.height-m.padding:Math.abs(Math.max(p,h)-m.padding/2),anchor:"start",title:a,maxWidth:n,width:e.width};(function(e,t,n,r,i){for(let o=0,s=e.length;o<s;o++){const s=e[o];if("text"===(null==s?void 0:s.type)&&Math.abs(s.x-t.x)<Math.max(s.width+r,t.width+r)&&Math.abs(s.y-t.y)<n.height+i)return!0}return!1})(l,y,e,u,h)||(t&&l.push(t),l.push(y))}}u&&h&&f&&(l.push(h,f),p&&l.push(p))}function ll(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function cl(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function ul(e,t){const n=e.min();if(n===e.max()){const r=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return r?2:-1;if(t>n)return r?-1:2}return e(t)}function dl(e,t){return e&&t&&Math.abs(e.x-t.x)<1e-15&&Math.abs(e.y-t.y)<1e-15}const hl={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:()=>30,beforeRender(){this.blueprint=Qa(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){let e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(cl).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=ul(t,e.value);return y(e,{scale:t,position:n})}return y(e,{position:e.value})})),this.lines.y=this.lines.y.filter(cl).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=ul(t,e.value);return y(e,{scale:t,position:n,flipXY:!0})}return y(e,{position:e.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(ll(e)),!1))),this.lines.y=this.lines.y.filter((e=>!(!e.slope||0===e.slope)||(!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(ll(e)),!1))));let n=[];return[...this.lines.x,...this.lines.y].forEach((r=>{if(!0===r.show||void 0===r.show){let i;if(r.slope&&0!==r.slope){const e=this.chart.scale({scale:"x"}),n=this.chart.scale({scale:"y"}),o=e.min(),s=e.max(),a=n.min(),l=n.max();i=w(w({},r),{},{x1:void 0,y1:void 0,x2:void 0,y2:void 0});const c=o*r.slope+r.value,u=s*r.slope+r.value,d=(a-r.value)/r.slope,h=(l-r.value)/r.slope;let f=[];il(c,a,l)||(f[0]={x:ul(e,o),y:ul(n,c)}),il(d,o,s)||(f[1]={x:ul(e,d),y:1}),il(u,a,l)||(f[2]={x:ul(e,s),y:ul(n,u)}),il(h,o,s)||(f[3]={x:ul(e,h),y:0});if(f.filter((e=>!!e)).length>2&&function(e){dl(e[0],e[1])&&(e[1]=void 0),dl(e[1],e[2])&&(e[2]=void 0),dl(e[2],e[3])&&(e[3]=void 0),dl(e[3],e[0])&&(e[3]=void 0)}(f),f=f.filter((e=>!!e)),f.length<2)return void t["y".concat(c>l?0:1)].push(ll(r));i.x1=f[0].x,i.y1=f[0].y,i.x2=f[1].x,i.y2=f[1].y}else i=void 0;al({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:r,settings:e,items:n,slopeLine:i})}})),e.style.oob.show&&function(e){let{blueprint:t,oob:n,settings:r,items:i}=e;const o=Object.keys(n);let s=r.style.oob||{};for(let e=0,r=o.length;e<r;e++){const r=o[e],a=n[r];if(a.length>0){let e=r.charAt(1),n="y"===r.charAt(0),o=s.padding.x+s.width,l=s.padding.y+s.width,c="bottom";c=n?"1"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let{width:r,height:i}=t,u=e*r+("1"===e?-o:o),d=n?l:i-l;return"arc"===s.type?{type:"path",d:nl(n?d:u,n?u:d,s.width,c),x:u,y:d,stroke:s.stroke,fill:s.fill,strokeWidth:s.strokeWidth||0}:{type:"circle",cx:u,cy:d,r:s.width,stroke:s.stroke,fill:s.fill,strokeWidth:s.strokeWidth||0,opacity:s.opacity,data:a}},flipXY:n}),d=u.cx||u.x,h=u.cy||u.y;const f=a.map((e=>e.label?"".concat(e.label," (").concat(e.value,")"):"(".concat(e.value,")"))),p=f.reduce(((e,t,n)=>0===n?t:"".concat(e,"\n\n").concat(t)),"");let g={type:"text",text:a.length||"",title:p,x:d-.4*s.width,y:h+.4*s.width,fontFamily:s.text.fontFamily,fontSize:"".concat(1.3*s.width,"px"),stroke:s.text.stroke,fill:s.text.fill,strokeWidth:s.text.strokeWidth||0,opacity:s.text.opacity},m={type:"path",d:rl(d,h,s.width,c),x:d,y:h,stroke:s.triangle.stroke,fill:s.triangle.fill,strokeWidth:s.triangle.strokeWidth||0,opacity:s.triangle.opacity};i.push(u,g,m)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function fl(e){const t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){y(e,t.style)}(t,e),t}function pl(e){return"string"==typeof e||"number"==typeof e?e:"-"}function gl(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){const r=n.angle*(Math.PI/180),i=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,s="end"===t.anchor&&r<0,a="start"===t.anchor&&r>=0,l=t.boundingRect.y+(a||s?t.boundingRect.height:0),c=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map((e=>us(e,r,{x:t.x,y:t.y}))),u={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},d={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},h=r>=0?[u,d]:[d,u];c.push(...h),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const r=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:r,y:0,width:r<0?n.stepSize+r:n.stepSize,height:n.innerRect.height}}else{const r=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:r,width:n.innerRect.width,height:r<0?n.stepSize+r:n.stepSize}}const r=t.collider;r.x=Math.max(r.x,0),r.y=Math.max(r.y,0);const i=r.x+r.width-(n.outerRect.x+n.outerRect.width);r.width=i>0?r.width-i:r.width;const o=r.y+r.height-(n.outerRect.y+n.outerRect.height);r.height=o>0?r.height-o:r.height}(e,t,n)}function ml(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let r=0;if(e.tilted)r=e.stepSize*n;else{const i=t?e.textRect.height:e.textRect.width;r=Math.max(0,e.stepSize-i)*n}return r}function yl(e,t){var n,r;const i={type:"text",text:pl(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(r=e.data)||void 0===r?void 0:r.value};return"top"===t.align||"bottom"===t.align?(i.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+ml(t,!1),i.y="top"===t.align?t.innerRect.height:0,i.anchor=t.stepSize?"start":"middle",i.x+=isNaN(t.style.offset)?0:+t.style.offset):(i.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+ml(t,!0),i.x="left"===t.align?t.innerRect.width:0,i.anchor="left"===t.align?"end":"start",i.baseline=t.stepSize?"text-before-edge":"central",i.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(i,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,r=t.outerRect.width,i=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-i,s=e.x+i;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):s>r&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,r=t.outerRect.height,i=t.maxHeight/2,o=e.y-i,s=e.y+i;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):s>r&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(i,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(i,t),function(e,t){if(t.tilted){const n=-t.angle,r=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(r)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(r)/2):e.x-=t.maxHeight*Math.sin(r)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const i=Math.cos(r)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+i>n&&(e.maxWidth=(n-e.x-10)/Math.cos(r))}else{const n=t.paddingEnd;e.x-i<n&&(e.maxWidth=(e.x-n-10)/Math.cos(r))}}}(i,t),function(e,t){e.boundingRect=t.textBounds(e)}(i,t),gl(e,i,t),i}function vl(e,t){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){y(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){const n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function bl(e){return!e.isMinor&&e.position>=0&&e.position<=1}function xl(e){let{rect:t,state:n,majorTicks:r,measure:i,horizontal:o}=e;return o?function(e){let{majorTicks:t,measureText:n,rect:r,state:i}=e;const o="layered"===i.labels.activeMode?2:1,s=r.width,a=t.map((e=>e.label)).map((e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":""))).map(n).map((e=>e.width));for(let e=0;e<t.length;++e){const n=t[e];if(o*s*Math.abs(n.start-n.end)<a[e])return!0}return!1}({majorTicks:r,measureText:i,rect:t,state:n}):function(e){let{majorTicks:t,measureText:n,rect:r}=e;const i=r.height,o=n("M").height;return!(t.length<2)&&i*Math.abs(t[0].position-t[1].position)<o}({majorTicks:r,measureText:i,rect:t})}function wl(e){let{value:t,maxValue:n,minValue:r,range:i,modifier:o}=e;return isNaN(i)||isNaN(o)||(t=i*o),t>n&&(t=n),t<r&&(t=r),t}function Ml(e){let{isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:s,state:a}=e,l=0;const c={left:0,top:0,right:0,bottom:0},{maxLengthPx:u,minLengthPx:d}=s.labels;if(s.labels.show){const e=s.align,h="top"===e||"bottom"===e,f=h?n.inner.width:n.inner.height,p=o.ticks({settings:s,distance:f,formatter:r}).filter(bl),g=e=>{const t=i({text:e,fontSize:s.labels.fontSize,fontFamily:s.labels.fontFamily});return t.width=wl({value:t.width,maxValue:u,minValue:d}),t};if(t&&h&&"auto"===s.labels.mode&&(!function(e){let{majorTicks:t,measure:n,rect:r,state:i,settings:o}=e;const s=o.labels.maxGlyphCount,a="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=r.width;let d=0,h=0;if(isNaN(s))for(let e=0;e<t.length;e++){const r=t[e],i=r.label,o=n(i).width*(i.length>1?l:1);if(h=a*u*Math.abs(r.start-r.end),o+c>h)return!0}else if(h=a*u*t.reduce(((e,t)=>Math.min(Math.abs(t.start-t.end),e)),1/0),d=n("M").width*l*s,d+c>h)return!0;return!1}({majorTicks:p,measure:g,rect:n.inner,state:a,settings:s})?a.labels.activeMode="horizontal":a.labels.activeMode="tilted"),!s.labels.filterOverlapping&&"tilted"!==a.labels.activeMode&&xl({rect:n.inner,state:a,majorTicks:p,measure:g,horizontal:h})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let m,y;if("tilted"===a.labels.activeMode){const e=Math.abs(s.labels.tiltAngle)*(Math.PI/180);m=t=>wl({value:t.width,maxValue:u,minValue:d})*Math.sin(e)+t.height*Math.cos(e)}else m=h?e=>e.height:e=>wl({value:e.width,maxValue:u,minValue:d});if(h&&"tilted"!==a.labels.activeMode)y=["M"];else if(isNaN(s.labels.maxGlyphCount))y=p.map((e=>e.label));else{let e="";for(let t=0;t<s.labels.maxGlyphCount;t++)e+="M";y=[e]}const v=y.map(g),b=v.map(m),x=Math.max(...b,0);if(l+=x,l+=s.labels.margin,"layered"===a.labels.activeMode&&(l*=2),"tilted"===a.labels.activeMode){const e="bottom"===s.align==s.labels.tiltAngle>=0,t=Math.abs(s.labels.tiltAngle)*(Math.PI/180),r=(x-g("M").height*Math.cos(t))/Math.sin(t),i=e=>Math.min(r,e.width)*Math.cos(t)+e.height,o=(t,r)=>{const i=p[r]?p[r].position:0;return e?t-i*n.inner.width:t-(1-i)*n.inner.width},a=Math.min(s.labels.maxEdgeBleed,Math.max(...v.map(i).map(o),0))+s.paddingEnd;if(c[e?"left":"right"]=a,!s.labels.filterOverlapping&&function(e){let{majorTicks:t,measureText:n,rect:r,bleedSize:i,angle:o}=e;if(t.length<2)return!1;if(0===o)return!0;const s=Math.abs(o),a=1/(Math.min(r.outer.width-i,r.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(s*(Math.PI/180))/a}({majorTicks:p,measureText:g,rect:n,bleedSize:a,angle:s.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const kl=(e,t,n)=>e.width*Math.abs(t.position-n.position);function _l(e){let{layered:t,major:n,innerRect:r,outerRect:i,tick:o,index:s}=e;const a=t?2:1,l=n[s-a],c=n[s+a],u=l?kl(r,o,l)/2-2:1/0,d=c?kl(r,o,c)/2-2:1/0;return n.length<2?r.width:l?c?2*Math.min(u,d):(e=>{let{innerRect:t,outerRect:n,tick:r,prevWidth:i}=e;const o=t.x-n.x,s=n.width-t.width-o,a=t.width-t.width*r.position+s,l=2*Math.min(i,a),c=1===r.position?t.width/2-2:0;return Math.max(i,l,c)})({innerRect:r,outerRect:i,tick:o,prevWidth:u}):(e=>{let{innerRect:t,outerRect:n,tick:r,nextWidth:i}=e;const o=t.x-n.x,s=t.width*r.position+o,a=2*Math.min(i,s),l=0===r.position?t.width/2-2:0;return Math.max(i,a,l)})({innerRect:r,outerRect:i,tick:o,nextWidth:d})}function Sl(e){const t=e.innerRect,n={cx:t.width/2,cy:t.height/2},r=Math.min(t.height,t.width)/2*e.radius,i=r+e.style.strokeWidth,o={visible:!0,type:"path",arcDatum:{startAngle:e.startAngle,endAngle:e.endAngle},transform:"translate(0, 0) translate(".concat(n.cx,", ").concat(n.cy,")"),desc:{share:1,slice:{cornerRadius:0,innerRadius:r,outerRadius:i}},ticks:[]};return function(e,t){y(e,t.style)}(o,e),o}function ql(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Dl(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,s=t.endAngle,a=t.tickSize,l=s-o;let c=s-e.position*l;c-=Math.PI/2;const u=ql(r.cx,r.cy,i+a,c),d=ql(r.cx,r.cy,i,c),h={type:"line",x1:u.x,y1:u.y,x2:d.x,y2:d.y,value:e.value};return function(e,t){const n=w({},t.style);y(e,n)}(h,t),h}function El(e){return"string"==typeof e||"number"==typeof e?e:"-"}function Cl(e,t,n){let r;return r="left"===t?n.x:"right"===t?e.outerRect.width-n.x:Math.max(n.x,e.outerRect.width-n.x),r}function Al(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,s=t.endAngle,a=t.tickSize,l=s-o,c=.2;let u,d;u="top"===t.align||"bottom"===t.align?s-e.position*l:o+e.position*l,d=u<-.2&&u>-Math.PI+c?"left":u>.2&&u<Math.PI-c?"right":"center",u-=Math.PI/2;const h=function(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}(r.cx,r.cy,i+a+6,u);let f;f="left"===d?"end":"right"===d?"start":"middle";const p={type:"text",text:El(e.label),align:d,x:h.x,y:h.y,maxHeight:t.maxHeight,maxWidth:Cl(t,d,h),anchor:f,baseline:"middle"};return function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(p,t),function(e,t){e.boundingRect=t.textBounds(e)}(p,t),function(e,t,n){let r,i;const o=parseFloat(n.fontSize)||0;r=t.y-o/2,i=e.innerRect.height-(t.y+o/2),(r<0||i<0)&&(n.text="")}(t,h,p),p}function Tl(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function Nl(e){let t=0;return t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function Rl(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=Tl(e)+e.labels.margin,t}function Ol(e,t){return e.map((e=>vl(e,t)))}function Il(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function Pl(e){let{textMetrics:t,settings:n,innerRect:r,scale:i,tilted:o,layered:s,tick:a}=e;const l=t.height,c=Il(i,a),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=r.width-Rl(n)-n.paddingEnd;else if(s)u.width=c*r.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(r.height-Rl(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*r.width;return u.width=wl({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function Ll(e){let{textMetrics:t,settings:n,innerRect:r,outerRect:i,tilted:o,layered:s,tick:a,index:l,major:c}=e;const u=t.height,d={width:0,height:u};if("left"===n.align||"right"===n.align)d.width=r.width-Rl(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);d.width=(r.height-Rl(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else d.width=_l({layered:s,major:c,innerRect:r,outerRect:i,tick:a,index:l});return d.width=wl({value:d.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),d}function jl(e){let t;function n(){return t=Ll,n}function r(){return t=Pl,r}function i(e){let{settings:n,scale:r,innerRect:i,outerRect:o,measureText:s,ticks:a,state:l,textBounds:c}=e;const u=[],d=function(e){return e.filter((e=>!e.isMinor))}(a),h=function(e){return e.filter((e=>e.isMinor))}(a),f={innerRect:i,align:n.align,outerRect:o},p="tilted"===l.labels.activeMode,g="layered"===l.labels.activeMode;let m;if(n.arc&&(f.startAngle=n.arc.startAngle,f.endAngle=n.arc.endAngle,f.radius=n.arc.radius),n.line.show&&(f.style=n.line,f.padding=n.paddingStart,n.arc?u.push(Sl(f)):u.push(fl(f))),n.ticks.show&&(f.style=n.ticks,f.tickSize=n.ticks.tickSize,f.padding=Tl(n),n.arc?(f.padding=Nl(n),m=function(e,t){return e.map((e=>Dl(e,t)))}(d,f)):m=Ol(d,f)),n.labels.show){const e=Rl(n);f.style=n.labels,f.padding=e,f.tilted=p,f.layered=g,f.angle=n.labels.tiltAngle,f.paddingEnd=n.paddingEnd,f.textBounds=c;const a=(e,a)=>{f.textRect=function(e){let{style:t,measureText:n,tick:r}=e;return n({text:r.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:s,style:f.style});const l=t({textMetrics:f.textRect,settings:n,innerRect:i,outerRect:o,scale:r,tilted:p,layered:g,tick:e,major:d,index:a});f.maxWidth=l.width,f.maxHeight=l.height,f.stepSize=function(e){let{innerRect:t,scale:n,settings:r,tick:i}=e;return("top"===r.align||"bottom"===r.align?t.width:t.height)*Il(n,i)}({innerRect:i,scale:r,settings:n,tick:e})};let l=[];n.arc?(f.padding=function(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=Nl(e)+e.labels.margin,t}(n),l=function(e,t,n){return e.map(((e,r)=>{n(e,r);const i=Al(e,t);return i.data=e.data,i}))}(d,f,a)):l=!g||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map(((e,r)=>{n(e,r);const i=yl(e,t);return i.data=e.data,i}))}(d,f,a):function(e,t,n,r){const i=t.padding,o=Rl(n);return e.map(((e,s)=>{r(e,s);const a=o+t.maxHeight+n.labels.margin;t.layer=s%2,t.padding=s%2==0?i:a;const l=yl(e,t);return l.data=e.data,l}))}(d,f,n,a),n.labels.filterOverlapping&&function(e,t,n){let r=(t,n)=>Ls(T(1,e[t].boundingRect),T(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);r=(n,r)=>{const i=1/Math.abs(e[n].x-e[r].x),o=Math.sin(t*(Math.PI/180))/i;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let i=n+1;i<=Math.min(n+5,n+(e.length-1));i++)e[n]&&e[i]&&r(n,i)&&(i===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(i,1),t&&t.splice(i,1)),i--,n--)}(l,m,f),u.push(...l)}return n.minorTicks&&n.minorTicks.show&&h.length>0&&(f.style=n.minorTicks,f.tickSize=n.minorTicks.tickSize,f.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...Ol(h,f))),m&&u.push(...m),u}return n.build=i,r.build=i,e?r():n()}const zl={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},Fl={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const Hl={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){let{state:t,style:n,settings:r}=e;const i=y(!0,{},t.isDiscrete?zl:Fl,n),o=y(!0,{},i,r.settings),s=r.layout.dock||t.defaultDock;o.dock=s,o.align=function(e,t){const n=["top","bottom"],r=["left","right"];return-1!==n.indexOf(e)&&-1===r.indexOf(t)||-1!==r.indexOf(e)&&-1===n.indexOf(t)?e:t}(r.settings.align,s),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const{paddingStart:a,paddingEnd:l}=o;return o.paddingStart="function"==typeof a?a.call(null):a,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=jl(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(e,t,n){const r=t.labels.mode;return n&&e.isHorizontal?"auto"===r?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?r:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const{formatter:t,state:n,scale:r}=this,i=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=Vo(r,i);const o=function(e){let{isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:s,state:a}=e,l=0;const{size:c,edgeBleed:u,isToLarge:d}=Ml({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:s,state:a});if(l+=c,d)return{size:l};if(s.ticks.show&&(l+=s.ticks.margin,l+=s.ticks.tickSize),s.minorTicks&&s.minorTicks.show){const e=s.minorTicks.margin+s.minorTicks.tickSize;e>l&&(l=e)}if(s.line.show){const e=s.line.strokeWidth/2;l+=e,u[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(s.align)]=Math.ceil(e)}return l+=s.paddingStart,l+=s.paddingEnd,{size:l,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{settings:t}=e;this.setState(t)},resize(e){const{inner:t,outer:n}=e,r=y({},t,function(e){let{align:t,inner:n}=e;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),i=n||r;return y(this.state.innerRect,r),y(this.state.outerRect,i),n},beforeRender(){const{scale:e,formatter:t}=this,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=Vo(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((e=>e.position>=0&&e.position<=1))},render(){const{state:e}=this,t=[];return t.push(...this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:e})),Ja.multiple(t),t}};const Bl={render:()=>[]};function Vl(e,t,n){let r="";if("function"==typeof e)r=e();else if("string"==typeof e)r=e;else if(n){const e=(n.data().fields||[]).map((e=>e.title()));r=e.join(t)}return r}function $l(e,t){let n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}const Wl={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created(){this.definitionSettings=this.settings.settings;const e=this.settings.text,t=this.definitionSettings.join;this.title=Vl(e,t,this.scale)},preferredSize(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render(){const{title:e,definitionSettings:t,rect:n}=this,r=[];return r.push(function(e){let{title:t,definitionSettings:n,dock:r,rect:i,measureText:o,style:s}=e;const a={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:$l(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};y(a,s.text);const l=o(a);if("top"===r||"bottom"===r){let e=i.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=i.width-(n.paddingRight||0)),a.x=e,a.y="top"===r?i.height-n.paddingStart:n.paddingStart+l.height,a.dy="top"===r?-l.height/6:-l.height/3,a.maxWidth=.8*i.width}else{let e=i.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=i.height-n.paddingStart),a.y=e,a.x="left"===r?i.width-n.paddingStart:n.paddingStart,a.dx="left"===r?-l.height/3:l.height/3;const t="left"===r?270:90;a.transform="rotate(".concat(t,", ").concat(a.x+a.dx,", ").concat(a.y+a.dy,")"),a.maxWidth=.8*i.height}return isNaN(n.maxLengthPx)||(a.maxWidth=Math.min(a.maxWidth,n.maxLengthPx)),a}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),r},beforeUpdate(e){e.settings&&(y(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=Vl(t,n,this.scale)}};function Ul(e,t){const n=e.settings.layout.dock,r=e.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",s=e.rect[o],a=e.chart.scroll(e.settings.scroll);let l;{let e=t[i?"x":"y"];r&&(e=s-e);const n=a.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/s*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:e=>{let t=e[i?"x":"y"];if(r&&(t=s-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=a.getState(),o=(t-l.startOffset)/s*(n.max-n.min),c=l.startScroll+o;a.moveTo(c)},end:e=>{let t=e[i?"x":"y"];r&&(t=s-t);const n=a.getState();if(l.swipe){const e=(t-l.startOffset)/s*(n.max-n.min),r=l.startScroll+e;a.moveTo(r)}else{const e=t/s*(n.max-n.min)+n.min-n.viewSize/2;a.moveTo(e)}}}}function Yl(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const Kl={require:["chart","renderer"],on:{panStart(e){const t=Yl(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=Ul(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=Yl(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=Yl(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=Yl(e,this.renderer);Ul(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,r="top"===t||"bottom"===t,i=r?"width":"height",o=this.rect[i],s=this.chart.scroll(this.settings.scroll).getState();let a=o*(s.start-s.min)/(s.max-s.min);const l=o*s.viewSize/(s.max-s.min);return n&&(a=o-a-l),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:{position:"absolute",[r?"left":"top"]:"".concat(a,"px"),[r?"top":"left"]:"25%",[r?"height":"width"]:"50%",[i]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function Xl(e){let{h:t,isVertical:n,value:r,pos:i,align:o,borderHit:s,state:a,idx:l}=e;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let d=0,h="100%",f="100%";return a.targetRect&&"start"===a.settings.bubbles.align?(h="".concat(a.targetRect.x+a.targetRect.width,"px"),f="".concat(a.targetRect.y+a.targetRect.height,"px")):a.targetRect&&"end"===a.settings.bubbles.align&&(d=n?a.targetRect.x:a.targetRect.y,h="".concat(a.rect.width-d,"px"),f="".concat(a.rect.height-d,"px")),c||(i-=s),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(e){e.srcElement.children[0].style.backgroundColor=a.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":r,"data-key":[a.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?d:i,"px"),top:"".concat(n?i:d,"px"),height:n?"".concat(s,"px"):f,width:n?h:"".concat(s,"px"),pointerEvents:"auto"}},[t("div",{style:y({backgroundColor:a.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function Gl(e){let{h:t,isVertical:n,label:r,otherValue:i,rangeIdx:o,idx:s,pos:a,align:l,state:c,value:u}=e;const d="end"!==l,h="outside"===c.settings.bubbles.placement;let f,p="none";n?(f=d?"left":"right",h&&(p=d?"translate(-100%, 0px)":"translate(100%, 0px)")):(f=d?"top":"bottom",h&&(p=d?"translate(0px, -100%)":"translate(0px, 100%)"));let g=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===s;const m={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const v=g?t("input",{type:"text",value:u,style:w(w({},m),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,t,i)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,s].join("-"),"data-other-value":i,"data-idx":o,"data-bidx":s,style:m},[r]);return t("div",{style:{position:"absolute",[f]:"0",[n?"top":"left"]:"".concat(a,"px"),transform:p}},[v])}function Jl(e){let{h:t,isVertical:n,top:r,height:i,color:o,on:s,opacity:a}=e;return t("div",y({style:{backgroundColor:o,opacity:a,position:"absolute",left:n?0:"".concat(r,"px"),top:n?"".concat(r,"px"):0,height:n?"".concat(i,"px"):"100%",width:n?"100%":"".concat(i,"px"),pointerEvents:"auto"}},s),[])}function Zl(e){let{borderHit:t,els:n,isVertical:r,state:i,vStart:o,vEnd:s,idx:a}=e,l=0;i.targetRect&&(l=r?i.targetRect.y:i.targetRect.x);const c=!!i.scale,u=c?i.scale.norm(o)*i.size:o,d=c?i.scale.norm(s)*i.size:s,h=Math.abs(u-d),f=Math.min(u,d)+l,p=f+h;if(i.targetRect){const e=i.targetFillRect||i.targetRect,t=r?e.height:e.width,a=c?i.scale.norm(o)*t:o,l=c?i.scale.norm(s)*t:s,u=Math.abs(a-l),d=Math.min(a,l),h={h:i.h,isVertical:r,top:d,height:u,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(h.on={onmouseover(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[Jl(h)]))}const g=u<d?o:s,m=u<d?s:o,[y,v]=c?i.scale.domain():[Math.min(o,s),Math.max(o,s)],b=g+1e-5>=y&&g-1e-5<=v,x=m-1e-5<=v&&m+1e-5>=y;b&&n.push(Xl({h:i.h,isVertical:r,borderHit:t,value:g,pos:f,align:"start",state:i,idx:a})),x&&n.push(Xl({h:i.h,isVertical:r,borderHit:t,value:m,pos:p,align:"end",state:i,idx:a}));const w=i.settings.bubbles;if(w&&w.show){w.fontSize,w.fontFamily,w.fill;const e=[o,s];b&&n.push(Gl({h:i.h,isVertical:r,align:w.align,rangeIdx:a,idx:0,otherValue:m,value:g,label:"".concat(i.format(g,e)),pos:f,state:i})),x&&n.push(Gl({h:i.h,isVertical:r,align:w.align,rangeIdx:a,idx:1,otherValue:g,value:m,label:"".concat(i.format(m,e)),pos:p,state:i}))}}function Ql(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let r=e.current-e.start;return r=r<0?Math.max(r,n):Math.min(r,t),r}function ec(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach(((r,i)=>{e.active&&i===e.active.idx||Zl({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(r.min,r.max),vEnd:Math.max(r.min,r.max),idx:i})})),e.active){let r=e.start,i=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)r=Math.min(e.active.start,e.active.end),i=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)r=Math.min(e.start,e.current),i=Math.max(e.start,e.current);else{const t=Ql(e);r=e.active.start+t,i=e.active.end+t}Zl({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function tc(e){return{min:e.scale.min(),max:e.scale.max()}}function nc(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function rc(e,t,n){let r,i,o=e.ranges,s=-1;for(r=0;r<o.length;r++){if(o[r].min<=t&&t<=o[r].max){s=r,n.min=r?o[r-1].max:n.min,n.max=r+1<o.length?o[r+1].min:n.max;break}if(t<o[r].min){n.max=o[r].min,n.min=r?o[r-1].max:n.min;break}}-1===s&&o.length&&r>=o.length&&(n.min=o[o.length-1].max),-1!==s&&(i={idx:s,start:o[s].min,end:o[s].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=i}function ic(e){e.renderer.render(ec(e))}function oc(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map((e=>e.id())),i=t.brushes().filter((e=>"range"===e.type&&-1!==r.indexOf(e.id)))[0];return i?i.brush.ranges():[]}function sc(e,t){let n,r=1/0;const i=t.domain(),o=t.bandwidth()/2;for(let s=0;s<i.length;++s){const a=Math.abs(e-o-t(i[s]));a<r&&(r=a,n=i[s])}return n}function ac(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function lc(e){return E(e.reduce(((e,t)=>(e.push(...D(t.bounds)),e)),[]))}const cc={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=oc(this.state,this.state.brushInstance),this.state.active=null,ic(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),r=this.state.rect[0===this.state.direction?"height":"width"];let i=Vo(this.chart.scale(t.scale),r);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,r=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((t=>e.chart.component(t))).filter((e=>!!e&&!!e.rect)),i=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(i.length>0){const r=lc(i);if(t.size=r[0===e.state.direction?"height":"width"],t.scale=Vo(e.chart.scale(n.scale),t.size),t.targetRect=r,o.length>0){const e=lc(o);t.targetFillRect=e}}else if(r&&r.length>0){const n=r.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.rect.computedInner.height)})),{x0:r[0].rect.computedInner.x,y0:r[0].rect.computedInner.y,x1:r[0].rect.computedInner.x+r[0].rect.computedInner.width,y1:r[0].rect.computedInner.y+r[0].rect.computedInner.height});t.targetRect={x:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(this);if(i=o.scale?o.scale:i,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?r:o.size,this.state.settings=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,r){let i=e.ranges.map((e=>({min:e.min,max:e.max})));const o=e.scale.min(),s=e.scale.max();i[t]={min:Math.max(o,Math.min(n,r)),max:Math.min(s,Math.max(n,r))},e.ranges[t]=w({},i[t]);const a=e.scale.data();a&&a.fields&&a.fields.forEach((t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)}))}(this.state,e,t,n),this.emit("bubbleEnd"),ic(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,ic(this.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,data:n,scale:i,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(i,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=i;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=Wi(),this.state.scale.data=i.data,this.state.format||(this.state.format=(e,t)=>ac(i.range(),t)?function(e,t){const n=t.ticks(),r=t.domain().indexOf(sc(e,t));return-1!==r?n[r].label:"-"}(e,i):"-"),this.state.fauxBrushInstance=Ao(),this.state.findValues=e=>function(e,t){const n=t.domain(),r=t.range(),i=[];return e.forEach((e=>{if(!ac(r,[e.min,e.max]))return;const o=n.indexOf(sc(e.min,t)),s=n.indexOf(sc(e.max,t));i.push.apply(i,n.slice(Math.min(o,s),Math.max(o,s)+1))})),i}(e,i);return this.state.ranges=oc(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[ec(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(e){!function(e){let{state:t,e:n,renderer:r,ranges:i,targetSize:o}=e;if(t.started)return;t.edit=null;const s=n.center.x-n.deltaX,a=n.center.y-n.deltaY;let l=document.elementFromPoint(s,a);r.element().contains(l)||(l=null);const c={started:!0};t.offset=y({},r.element().getBoundingClientRect());const u=s-t.offset.left,d=a-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=i(t,t.fauxBrushInstance||t.brushInstance);const h=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(f/t.size),c.start=t.scale.normInvert(h/t.size);let p=t.ranges;const g=tc(t);let m,v,b=-1;if(l&&l.hasAttribute("data-idx"))b=parseInt(l.getAttribute("data-idx"),10),g.min=b>0?p[b-1].max:g.min,g.max=b+1<p.length?p[b+1].min:g.max;else{for(m=0;m<p.length;m++){if(p[m].min<=c.start&&c.start<=p[m].max){b=m,g.min=m?p[m-1].max:g.min,g.max=m+1<p.length?p[m+1].min:g.max;break}if(c.start<p[m].min){g.max=p[m].min,g.min=m?p[m-1].max:g.min;break}}-1===b&&p.length&&m>=p.length&&(g.min=p[p.length-1].max)}if(-1!==b||t.multi||(c.ranges=[],g.min=t.scale.min(),g.max=t.scale.max()),-1!==b)if(v={idx:b,start:p[b].min,end:p[b].max,limitLow:g.min,limitHigh:g.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),v.mode="modify";else{let e=t.scale.norm(v.start)*t.size,n=t.scale.norm(v.end)*t.size;Math.abs(h-e)<=o?(c.start=v.end,v.mode="modify"):Math.abs(h-n)<=o&&(c.start=v.start,v.mode="modify")}else v={idx:-1,start:c.start,end:c.current,limitLow:g.min,limitHigh:g.max,mode:"current"};c.active=v,"modify"!==v.mode&&t.targetRect&&!zs(t.targetRect,{x:u,y:d})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:oc,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=tc(e);rc(e,e.current,n)}(this.state,oc),ic(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,r=e.scale.normInvert(n);e.current=Math.max(Math.min(r,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){let t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=Ql(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});const n=e.scale.data();n&&n.fields&&n.fields.forEach((n=>{if(e.fauxBrushInstance){let r=oc(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),s=o.filter((e=>-1===i.indexOf(e))),a=i.filter((e=>-1===o.indexOf(e))),l=s.map((e=>({key:n.id(),value:e}))),c=a.map((e=>({key:n.id(),value:e})));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),ic(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(e){if(!this.state.editable)return;const t=e.srcEvent||e,n=t.target,r={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(r.rangeIdx)||JSON.stringify(r)===JSON.stringify(this.state.edit))return;this.state.edit=r,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const i=n.parentNode;ic(this.state);const o=i.querySelector("input");o.focus(),o.select()}};function uc(e){e.renderer.render(ec(e))}function dc(e){return e.rc.ranges()}function hc(e,t){const n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}const fc={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?0:1,r=this.state.rect[0===n?"height":"width"],i=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map((e=>this.chart.component(e))).filter((e=>!!e&&!!e.rect)),s=o[0]?o.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.rect.height)})),{x0:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=s?{x:s.x0-this.rect.x,y:s.y0-this.rect.y,width:s.x1-s.x0,height:s.y1-s.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=t,this.state.offset=i,this.state.rc=vo(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.size=r,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(e,t){return function(e,t,n){const r=Math.min(...n),i=Math.max(...n),o={x:e.direction?r+e.rect.x:e.rect.x,y:e.direction?e.rect.y:r+e.rect.y,width:e.direction?i-r:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:i-r},s=e.chart.shapesAt(o,e.settings.brush);if(0===s.length)return"-";const a=s.reduce(((n,i)=>{const o=n.bounds,s=i.bounds;return t===r?o[e.cssCoord.coord]<=s[e.cssCoord.coord]?n:i:o[e.cssCoord.coord]+o[e.cssCoord.area]>=s[e.cssCoord.coord]+s[e.cssCoord.area]?n:i})),l=e.settings.brush.components.reduce(((e,t)=>e.key===a.key?e:t));return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(a.data):Array.isArray(l.data)&&l.data.length?a.data[l.data[0]].label:a.data&&a.data.label?a.data.label:"-"}(this,e,t)},[]},start(e){!function(e){let{state:t,e:n,renderer:r,ranges:i,targetSize:o}=e;if(t.started)return;const s=n.center.x-n.deltaX,a=n.center.y-n.deltaY;let l=document.elementFromPoint(s,a);r.element().contains(l)||(l=null);const c={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);const u=s-t.offset.left,d=a-t.offset.top,h=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let p=f,g=h;c.start=h,c.current=f;let m=t.ranges;const y=nc(t);let v,b,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),y.min=x>0?m[x-1].max:y.min,y.max=x+1<m.length?m[x+1].min:y.max;else{for(v=0;v<m.length;v++){if(m[v].min<=g&&g<=m[v].max){x=v,y.min=v?m[v-1].max:y.min,y.max=v+1<m.length?m[v+1].min:y.max;break}if(g<m[v].min){y.max=m[v].min,y.min=v?m[v-1].max:y.min;break}}-1===x&&m.length&&v>=m.length&&(y.min=m[m.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(b={idx:x,start:m[x].min,end:m[x].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),b.mode="modify";else{let e=b.start,t=b.end;Math.abs(h-e)<=o?(c.start=b.end,b.mode="modify"):Math.abs(h-t)<=o&&(c.start=b.start,b.mode="modify")}else b={idx:-1,start:g,end:p,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=b,"modify"!==b.mode&&t.targetRect&&!zs(t.targetRect,{x:u,y:d})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:dc,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=nc(e);rc(e,e.current,n)}(this.state,dc),uc(this.state))},move(e){this.state.started&&(!function(e,t){const n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){const t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=Ql(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);let n=[];t.forEach((t=>{n=[...n,...hc(e,t)]})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),uc(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function pc(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],r=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map((e=>e.id())),i=t.brushes().filter((e=>"range"===e.type&&-1!==r.indexOf(e.id)))[0];return i?i.brush.ranges():[]}(e).map((i=>{const o=e.scale(i.min)*n,s=e.scale(i.max)*n,a=Math.min(o,s),l=Math.abs(o-s);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:a,width:t?r:l,y:t?a:0,height:t?l:r}}))}function gc(e,t,n,r){function i(){!function(e){e.renderer.render(pc(e))}(e)}function o(){!function(e){e.renderer.render(pc(e))}(e)}function s(){!function(e){e.renderer.render(pc(e))}(e)}e.brush=t,t&&(t.on("start",i),t.on("update",o),t.on("end",s),e.start=i,e.update=o,e.end=s,e.brush=t,e.scale=n,e.renderer=r)}function mc(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}const yc={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",r="horizontal"===n?this.rect.width:this.rect.height,i=Vo(this.chart.scale(e.scale),r);return mc(this.state),gc(this.state,t,i,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,pc(this.state)},beforeDestroy(){mc(this.state)}};function vc(e,t){const n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function bc(e,t,n){return as(e,t.points[0])<n.settings.snapIndicator.threshold**2}function xc(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function wc(e){let{state:t,start:n=null,end:r=null}=e;null!==n&&(t.snapIndicator.x1=n.x,t.snapIndicator.y1=n.y),null!==r&&(t.snapIndicator.x2=r.x,t.snapIndicator.y2=r.y)}function Mc(e,t){e.snapIndicator.visible=t}const kc={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=this.settings.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"})));const n=vc(this.state.rendererBounds,e);xc(this.state,n),wc({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=vc(this.state.rendererBounds,e);bc(t,this.state,this.settings)?Mc(this.state,!0):Mc(this.state,!1),xc(this.state,t),wc({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter((e=>e.visible));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const n=e.points[e.points.length-2],r=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=r.x+e.componentDelta.x,e.lineBrushShape.y2=r.y+e.componentDelta.y;const i=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(i,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;Mc(this.state,!1);bc(vc(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,r=e.componentDelta.y,i=e.points.map((e=>({x:e.x+n,y:e.y+r}))),o=t.shapesAt({vertices:i},{components:e.brushConfig});t.brushFromShapes(o,{components:e.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([])},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render(){}};function _c(e,t,n,r,i){let o,s=0,a=t.length-1;for(;s<a;){let l=Math.floor((s+a)/2);o=i(t[l]),o[n]+o[r]<e[n]?s=l+1:a=l}return s}function Sc(e){let{orientation:t,targetNodes:n,labels:r,container:i}=e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_c;const s=[],a="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const{textBounds:d,node:h}=r[t];if(d[a]<i[a]||d[a]+d[l]>i[a]+i[l])return!1;for(let e=o(d,s,a,l,c);e<s.length;e++)if(Ls(d,s[e].textBounds))return!1;const f=o(d,n,a,l,u),p=d[a]+d[l];for(let e=f;e<n.length;e++){const t=n[e].node;if(p<t.localBounds[a])break;if(Ls(d,t.localBounds)&&h!==t)return!1}return s.push(r[t]),!0}}const qc=4;function Dc(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Ec(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function Cc(e){return w(w({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function Ac(e,t,n){return n?e.width>=t.height:e.width>=t.width}function Tc(e,t,n){return n?e.height>=t.width:e.height>=t.height}function Nc(e,t,n,r,i){let o,s;return"v"===e?(o=r||i||Ac(t,n,!0),s=Tc(t,n,!r)):(o=Ac(t,n),s=i||Tc(t,n,!1)),o&&s}function Rc(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function Oc(e,t,n){const r={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(!n.overflow&&!function(e,t,n){return Ac(e,t,n.rotate)&&Tc(e,t,n.rotate)}(e,i,n))return!1;const o=.5*i.height;return n.rotate?(r.x=Rc(e.x,e.width,i.height,n.align)+o,r.y=Rc(e.y,e.height,i.width,n.justify),"right"===n.dock?r.transform="rotate(90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,") translate(").concat(i.width,", 0)"):r.transform="rotate(-90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,")")):(r.x=Rc(e.x,e.width,i.width,n.align),r.y=Rc(e.y,e.height,i.height,n.justify)+o),r}function Ic(e){let{bar:t,view:n,direction:r,position:i,padding:o=qc,measured:s}=e;const a={};if(y(a,t),i&&"inside"!==i)if("up"===r||"down"===r){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===i&&"up"===r||"opposite"===i&&"down"===r?(a.y=0,a.height=e):("outside"===i&&"down"===r||"opposite"===i&&"up"===r)&&(a.y=o,a.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===i&&"left"===r||"opposite"===i&&"right"===r?(a.x=0,a.width=e):("outside"===i&&"right"===r||"opposite"===i&&"left"===r)&&(a.x=o,a.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),r=Math.max(0,Math.min(e.y+e.height,t.height)),i=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=i,e.width=o-i,e.y=n,e.height=r-n}(a,n),function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{top:r=qc,bottom:i=qc,left:o=qc,right:s=qc}=n,a="function"==typeof o?o(t):o,l="function"==typeof s?s(t):s,c="function"==typeof r?r(t):r,u="function"==typeof i?i(t):i;e.x+=a,e.width-=a+l,e.y+=c,e.height-=c+u}(a,s,o),a}function Pc(e){let t,n,r,i,o,{direction:s,fitsHorizontally:a,measured:l,node:c,orientation:u,placementSettings:d,rect:h}=e,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ic;const p=[],g="h"===u?"width":"height";for(o=0;o<d.length;o++)if(r=d[o],i=f({bar:c.localBounds,view:h,direction:s,position:r.position,padding:r.padding,measured:l}),p.push(i),t=!o||i[g]>t[g]?i:t,Nc(u,i,l,a,r.overflow)){n=i;break}return n||(n=t,o=p.indexOf(n)),r=d[o],{bounds:n,placement:r}}function Lc(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{top:o=qc,bottom:s=qc,left:a=qc,right:l=qc}=i,c="function"==typeof a?a(t):a,u="function"==typeof l?l(t):l,d="function"==typeof o?o(t):o,h="function"==typeof s?s(t):s,f=e.x+e.dx,p=e.y+e.dy,g=n?Math.min(t.width,r.height):Math.min(t.height,r.width),m=n?Math.min(t.height,r.height):Math.min(t.width,r.width),y=.5*t.height,v=1e-9;return{x:(n?f-y:f)-c-v,y:(n?p:p-y)-d-v,width:m+(c+u)-v,height:g+(d+h)-v}}function jc(e){let{chart:t,targetNodes:n,rect:r,fitsHorizontally:i,collectiveOrientation:o}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Pc,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Oc,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Sc;const c=[],u={container:r,targetNodes:n,labels:[],orientation:o};let d,h,f,p,g,m,y,v,b,x,M,k,_,S;for(let e=0,l=n.length;e<l;e++){m=null,h=n[e],f=h.node,_=Dc(f,t),b=h.direction,S="left"===b||"right"===b?"h":"v";for(let t=0;t<h.texts.length;t++){if(p=h.texts[t],!Ec(p))continue;x=h.labelSettings[t],v=h.measurements[t],k=x.placements;const n=s({direction:b,fitsHorizontally:i,lblStngs:x,measured:v,node:f,orientation:S,placements:k,placementSettings:h.placementSettings[t],rect:r});if(m=n.bounds,M=n.placement,m&&M){var q;g=M.justify;const t="function"==typeof x.linkData?x.linkData(_,e):void 0,n="function"==typeof M.overflow?M.overflow(_,e):M.overflow;"up"===b&&(g=1-g),"opposite"===M.position&&(g=1-g),"left"===b&&(g=1-g);const r=!("h"===o||i);if(d=a(m,p,{justify:"h"===S?M.align:g,align:"h"===S?g:M.align,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:v,rotate:r,overflow:!!n,dock:null!==(q=x.dock)&&void 0!==q?q:"left"}),d){const n=Lc(d,v,r,m,M.padding);y="function"==typeof M.fill?M.fill(w(w({},_),{},{textBounds:n}),e):M.fill,d.fill=y,void 0!==t&&(d.data=t),"object"==typeof M.background&&(d.backgroundColor="function"==typeof M.background.fill?M.background.fill(w(w({},_),{},{textBounds:n}),e):M.background.fill,void 0!==d.backgroundColor&&(d.backgroundBounds=Lc(d,v,r,m,M.background.padding))),c.push(d),u.labels.push({node:f,textBounds:n})}}}}const D=c.filter(l(u));return[...D.filter((e=>void 0!==e.backgroundBounds)).map(Cc),...D]}function zc(e){const t=2*Math.PI;return(e%t+t)%t}function Fc(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function Hc(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function Bc(e,t,n){let{x:r,y:i}=t;if(r*r+i*i>e*e)return null;let o=Math.sin(n),s=Math.cos(n),a=r*s-i*o,l=e*e-a*a;if(l<0)return null;let c=Math.sqrt(l);return{x:a*s+o*c,y:-a*o+s*c}}function Vc(e){let t,n,{radius:r,size:i,angle:o}=e,{width:s,height:a}=i,l={x:s/2,y:a/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=Bc(r,l,o),!t)return null;t.y*=-1,n={x:-s,y:0};break;case 1:if(t=Bc(r,l,Math.PI-o),!t)return null;n={x:-s,y:-a};break;case 2:if(t=Bc(r,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-a};break;case 3:if(t=Bc(r,l,2*Math.PI-o),!t)return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:s,height:a}}function $c(e){let{slice:t,measured:n,padding:r}=e,{start:i,end:o,innerRadius:s,outerRadius:a}=t,l=a-s-2*r,c=o-i;if(c<Math.PI){let e=(n.height/2+r)/Math.tan(c/2);e>s&&(l=a-e-2*r)}if(l<0||l<n.minReqWidth)return null;const u=zc((i+o)/2);let d=a-r,h={x:Math.sin(u)*d,y:-Math.cos(u)*d,width:l,height:n.height};return u<Math.PI?(h.angle=u-Math.PI/2,h.anchor="end"):(h.angle=u+Math.PI/2,h.anchor="start"),h}function Wc(e){let{context:t,node:n,bounds:r}=e;let{start:i,end:o}=n.desc.slice;const s=zc((i+o)/2);switch(Math.floor(s/(Math.PI/2))){case 0:t.q1maxY=r.y-2,void 0===t.q2minY&&(t.q2minY=r.y+r.height+2);break;case 1:t.q2minY=r.y+r.height+2;break;case 2:t.q3minY=r.y+r.height+2;break;case 3:t.q4maxY=r.y-2,void 0===t.q3minY&&(t.q3minY=r.y+r.height+2)}}function Uc(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Yc(e,t,n){const r={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){let t=e.angle*(360/(2*Math.PI));r.transform="rotate(".concat(t,", ").concat(r.x,", ").concat(r.y,")")}return r}function Kc(e){let t,n,{slice:r,direction:i,position:o,padding:s,measured:a,view:l,context:c,store:u}=e,{start:d,end:h,innerRadius:f,offset:p}=r;switch(o){case"into":t="rotate"===i?$c({slice:r,measured:a,padding:s}):function(e){let{slice:t,padding:n,measured:r}=e,{start:i,end:o,innerRadius:s,outerRadius:a}=t;const l=zc((i+o)/2);let c=Vc({radius:a,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",Fs(c,{x1:0,y1:0,x2:Math.sin(i)*a,y2:-Math.cos(i)*a})||Fs(c,{x1:0,y1:0,x2:Math.sin(o)*a,y2:-Math.cos(o)*a})||Ts({cx:0,cy:0,r:s},c)?null:(Fc(c,n),c)):null}({slice:r,measured:a,padding:s});break;case"inside":n={start:d,end:h,innerRadius:0,outerRadius:f},t="rotate"===i?$c({slice:n,measured:a,padding:s}):function(e){let{slice:t,padding:n,measured:r,store:i}=e;const{start:o,end:s,outerRadius:a}=t,l=zc((o+s)/2);let c=Vc({radius:a,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",Fc(c,n),i.insideLabelBounds.some((e=>Ls(e,c)))?null:(i.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:a,padding:s,store:u});break;case"outside":t="rotate"===i?function(e){let{slice:t,measured:n,padding:r,view:i}=e,{start:o,end:s,outerRadius:a,offset:l}=t,c=a+r,u=s-o;if(u<Math.PI&&(n.height/2+r)/Math.tan(u/2)>c)return null;const d=zc((o+s)/2);let h=Math.sin(d)*c,f=-Math.cos(d)*c,p=n.width+1,g=d%Math.PI;if(g>Math.PI/2&&(g=Math.PI-g),Math.cos(g)>.001){let e=f<0?i.y:i.y+i.height,t=Math.abs(e-l.y)/Math.cos(g)-Math.tan(g)*(n.height/2)-2*r-a;t<p&&(p=t)}if(Math.sin(g)>.001){let e=h<0?i.x:i.x+i.width,t=Math.abs(e-l.x)/Math.sin(g)-n.height/2/Math.tan(g)-2*r-a;t<p&&(p=t)}if(p<=0||p<n.minReqWidth)return null;let m={x:h,y:f,width:p,height:n.height};return d<Math.PI?(m.angle=d-Math.PI/2,m.anchor="start"):(m.angle=d+Math.PI/2,m.anchor="end"),m}({slice:r,measured:a,padding:s,view:l}):function(e){let{slice:t,measured:n,padding:r,view:i,context:o}=e,{start:s,end:a,outerRadius:l,offset:c}=t;const u=zc((s+a)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),i))return null;let d=l+r+n.height/2,h=Math.sin(u)*d,f=-Math.cos(u)*d,p=n.width+1;if(u<Math.PI){let e=Math.abs(i.x+i.width-(h+c.x));e<p&&(p=e)}else{let e=Math.abs(i.x-(h+c.x));e<p&&(p=e)}if(p<n.minReqWidth)return null;let g={x:h,y:f,width:p,height:n.height};return u<Math.PI?g.anchor="start":g.anchor="end",g}({slice:r,measured:a,padding:s,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=p.x,t.y+=p.y,"outside"===o&&"rotate"!==i&&function(e,t,n){const{start:r,end:i,offset:o,outerRadius:s}=n,a=zc((r+i)/2);switch(Math.floor(a/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=s+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),r=n-e.y;if(e.y=n,r>1){let t=s+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),r=n-e.y;if(e.y=n,r>1){let t=s+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=s+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}}}(t,c,r)),t}function Xc(e){let{context:t,direction:n,measured:r,node:i,placementSettings:o,rect:s,store:a}=e,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Kc;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:i.desc.slice,view:s,direction:n,position:c.position,measured:r,padding:c.padding,store:a});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function Gc(e,t,n){const r=t.fontFamily,i="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:r,fontSize:i});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:r,fontSize:i}).width),o}const Jc=/\n+|\r+|\r\n/,Zc=/\s/,Qc=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function eu(e){return"string"==typeof e?-1!==e.search(Jc):-1!==String(e).search(Jc)}function tu(e){return-1!==e.search(Zc)}function nu(e){return-1!==e.search(Qc)}function ru(e,t,n){return Math.max(t,Math.min(n,e))}function iu(){let{string:e,separator:t="",reverse:n=!1,measureText:r=e=>({width:e.length,height:1}),mandatoryBreakIdentifiers:i=[eu],noBreakAllowedIdentifiers:o=[],suppressIdentifier:s=[tu,eu,e=>""===e],hyphenationIdentifiers:a=[nu]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=String(e).split(t);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(l);const c=l.length,u=n?e=>e>=0:e=>e<c;let d=n?c:-1;function h(e){const t=ru(e,0,c-1),n=l[t],u=r(n),d=function(e,t,n,r,i){return r.some((r=>r(e,t,n)))?1:i.some((r=>r(e,t,n)))?0:2}(n,t,l,i,o);return{index:t,value:n,breakOpportunity:d,suppress:s.some((e=>e(n,t,l))),hyphenation:a.some((e=>e(n,t,l))),width:u.width,height:u.height,done:!1}}return{next:function(e){return isNaN(e)?n?d--:d++:d=ru(e,0,c-1),u(d)?h(d):{done:!0}},peek:h,length:c}}const ou="…",su=/^\s*\d+(\.\d+)?px\s*$/i;function au(e){return"string"===typeof e&&su.test(e)}function lu(e){const t=e["font-size"]||e.fontSize;return au(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function cu(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const r=lu(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function uu(e,t){return{lines:[],line:"",width:0,maxLines:cu(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function du(e){e.lines.push(e.line),e.line="",e.width=0}function hu(e,t){e.line+=t.value,e.width+=t.width}function fu(e,t,n){if(t.width>e.maxWidth)return t;const r=t.index;for(let i=1;i<5;i++){const o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(r-i),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function pu(e,t,n){const r=iu({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=r.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?fu(e,t,r):t,du(e),hu(e,t)):hu(e,t)}}function gu(e,t){const n=iu({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),r=uu(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){du(r),i=!1;break}1===e.breakOpportunity?du(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?r.width+=e.width:(e=r.hyphens.enabled?fu(r,e,n):e,du(r),hu(r,e)):hu(r,e)}return{lines:r.lines,reduced:i}}function mu(e,t){const n=iu({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=uu(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){du(r),i=!1;break}1===e.breakOpportunity?du(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?du(r):e.width>r.maxWidth?pu(r,e,t):(du(r),hu(r,e)):hu(r,e)}return{lines:r.lines,reduced:i}}function yu(e){return{"break-all":gu,"break-word":mu}[e.wordBreak]}function vu(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const r=yu(n);if(!r)return;const i=e(n);if(i.width>n.maxWidth||eu(n.text)){const o=(lu(n)-i.height)/2,s=r(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,r){const i={type:"container",children:[]};void 0!==t.id&&(i.id=t.id);let o=0;return e.lines.forEach(((s,a)=>{const l=y({},t);l.text=s,l._lineBreak=!0,o+=n,e.reduced&&a===e.lines.length-1?l.text+=ou:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=r,o+=n,i.children.push(l)})),i}(s,n,o,i.height)}}}}function bu(e,t){const n=e["font-family"]||e.fontFamily,r=e["font-size"]||e.fontSize,i="string"==typeof e.text?e.text:"".concat(e.text),{maxWidth:o}=e;if(void 0===o)return i;let s=t({text:i,fontSize:r,fontFamily:n}).width;if(s<=o)return i;let a=0,l=i.length-1;for(;a<=l;){let e=Math.floor((a+l)/2);s=t({text:i.substr(0,e)+ou,fontSize:r,fontFamily:n}).width,s<=o?a=e+1:l=e-1}return i.substr(0,l)+ou}function xu(e){const t=e.baseline||e["dominant-baseline"];let n=0;const r=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*r;break;case"text-before-edge":n=.85*r;break;case"middle":n=.25*r;break;case"central":n=.35*r;break;case"mathemetical":n=r/2;break;case"text-after-edge":case"ideographic":n=.2*-r;break;default:n=0}return n}const wu={},Mu={},ku={fontSize:void 0,fontFamily:void 0};let _u;function Su(e,t){return!e&&!t||e===t}function qu(e){let{text:t,fontWeight:n,fontSize:r,fontFamily:i}=e;const o="".concat(t," ").concat(n," ").concat(r," ").concat(i);return"number"!=typeof Mu[o]&&(_u=_u||document.createElement("canvas").getContext("2d"),function(e){let{fontWeight:t,fontSize:n,fontFamily:r}=e;Su(ku.fontWeight,t)&&Su(ku.fontSize,n)&&Su(ku.fontFamily,r)||(_u.font=[t,n,r].filter((e=>!!e)).join(" "),ku.fontWeight=t,ku.fontSize=n,ku.fontFamily=r)}({fontWeight:n,fontSize:r,fontFamily:i}),Mu[o]=_u.measureText(t).width),Mu[o]}function Du(e){return"number"!=typeof wu[e]&&(wu[e]=function(e){if(au(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),wu[e]}function Eu(e){let{text:t,fontWeight:n,fontSize:r,fontFamily:i}=e;return{width:qu({text:t,fontWeight:n,fontSize:r,fontFamily:i}),height:Du(r)}}function Cu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Eu;const n=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,i=t({text:e.text,fontFamily:r,fontSize:n}),o=Math.min(e.maxWidth||i.width,i.width),s=e.x||0,a=e.y||0,l=e.dx||0,c={x:0,y:a+((e.dy||0)+xu(e))-.75*i.height,width:o,height:i.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?s+l-o/2:"end"===u?s+l-o:s+l,c}function Au(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Eu;const n=yu(e),r=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:i,fontSize:r});if(n&&(o.width>e.maxWidth||eu(e.text))){const o=n(e,(e=>t({text:e,fontFamily:i,fontSize:r}))),s=y({},e);let a=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let s=o.lines[e];s+=e===n-1&&o.reduced?ou:"";const c=t({text:s,fontSize:r,fontFamily:i}).width;c>=a&&(a=c,l=s)}s.text=l;const c=Cu(s,t);return c.height=lu(e)*o.lines.length,c}return Cu(e,t)}function Tu(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Nu(e,t,n){const r={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-i.width);return r.x=e.x+n.align*o,r.y=e.y+i.height/1.2,r}function Ru(e){let{cx:t,cy:n,r:r}=e;return{type:"circle",bounds:{cx:t,cy:n,r:r}}}function Ou(e){return e.desc&&e.desc.slice?function(e){let{start:t,end:n,innerRadius:r,outerRadius:i,offset:o}=e;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let s=0!==r?r:i;return Ru({cx:o.x,cy:o.y,r:s})}(e.desc.slice):"circle"===e.type?Ru(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var Iu={bar:function(e){let{settings:t,chart:n,nodes:r,rect:i,renderer:o,style:s}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jc;const l=y({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},s.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map((e=>y({},l,t,e))),u=t.labels.map((e=>e.placements.map((n=>y({},l,t,e,n))))),{fitsHorizontally:d,hasHorizontalDirection:h,targetNodes:f}=function(e){let{nodes:t,rect:n,chart:r,labelSettings:i,placementSettings:o,settings:s,renderer:a}=e;const l={},c=[];let u,d,h,f,p,g,m,y=!0,v=!1;for(let e=0;e<t.length;e++){if(d=t[e],f=d.localBounds,!Ls(f,n))continue;let b=Dc(d,r);u={node:d,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<i.length;t++)g=i[t],h="function"==typeof g.label?g.label(b,e):void 0,Ec(h)&&(m="function"==typeof s.direction?s.direction(b,e):s.direction||"up",v=v||"left"===m||"right"===m,l.fontFamily=g.fontFamily,l.fontSize="".concat(g.fontSize,"px"),l.text=h,p=a.measureText(l),u.measurements.push(p),u.texts.push(h),u.labelSettings.push(g),u.placementSettings.push(o[t]),u.direction=m,y=y&&p.width<=f.width-2*qc);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:v}}({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:c,placementSettings:u}),p=function(e){let{orientation:t="auto",defaultOrientation:n="h"}=e;switch(t.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return n}}({orientation:t.orientation,defaultOrientation:h?"h":"v"}),g="h"===p?"y":"x",m="h"===p?"height":"width";return f.sort(((e,t)=>e.node.localBounds[g]+e.node.localBounds[m]-(t.node.localBounds[g]+t.node.localBounds[m]))),a({chart:n,targetNodes:f,stngs:t,rect:i,fitsHorizontally:d,collectiveOrientation:p})},slice:function(e){let{settings:t,chart:n,nodes:r,rect:i,renderer:o,style:s}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xc,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Yc;const c=y({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},s.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map((e=>y({},c,t,e))),d=t.labels.map((e=>e.placements.map((n=>y({},c,t,e,n))))),h=[],f={insideLabelBounds:[]};r=function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.length;++o){const{start:s,end:a}=e[o].desc.slice,l=zc((s+a)/2);switch(Math.floor(l/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:r.push(e[o]);break;case 3:i.push(e[o])}}const o=(e,t)=>zc((e.desc.slice.start+e.desc.slice.end)/2)-zc((t.desc.slice.start+t.desc.slice.end)/2),s=(e,t)=>o(t,e);return t.sort(s),n.sort(o),r.sort(s),i.sort(o),t.concat(n,i,r)}(r);const p={};for(let e=0,t=r.length;e<t;e++){const t=r[e],s=Uc(t,n);for(let n=0;n<u.length;n++){const r=u[n],c="function"==typeof r.label?r.label(s,e):"";if(!c)continue;const g="function"==typeof r.direction?r.direction(s,e):r.direction||"horizontal",m="function"==typeof r.linkData?r.linkData(s,e):void 0,y=Gc(c,r,o),v=a({context:p,direction:g,lblStngs:r,measured:y,node:t,placementSettings:d[n],rect:i,store:f}),b=v.bounds,x=v.placement;if(b&&x){if("outside"===x.position&&"rotate"!==g){Wc({context:p,node:t,bounds:b});if(!ks(Hc(b),i))continue}const n="function"==typeof x.fill?x.fill(s,e):x.fill,o=l(b,c,{fill:n,fontSize:r.fontSize,fontFamily:r.fontFamily,textMetrics:y});o&&(void 0!==m&&(o.data=m),h.push(o),b.line&&(b.line.stroke=n,h.push(b.line)))}}}return h},rows:function(e){let{settings:t,chart:n,nodes:r,renderer:i,style:o}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Nu;const a=y({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);a.fontSize=parseInt(a.fontSize,10);const l=y({},a,t),c=t.labels.map((e=>y({},l,e))),u={},d=[];for(let e=0,t=r.length;e<t;e++){let t=r[e],o=Tu(t,n),{type:a,bounds:h}=Ou(t);if(!h)continue;let f,p=0,g=[],m=[],y="circle"===a?2*h.r*.9:h.height;for(p+=l.padding,f=0;f<c.length;f++){let t=c[f],n="function"==typeof t.label?t.label(o,e):"";u.fontFamily=t.fontFamily,u.fontSize="".concat(t.fontSize,"px"),u.text=n;let r=i.measureText(u);if(p+=r.height+t.padding,p>y)break;m.push(n),g.push(r)}const v=f,b=Math.max(0,y-p);let x;for(x="circle"===a?h.cy-.9*h.r:h.y,x+=l.justify*b+l.padding,f=0;f<v;f++){let t,n=c[f];if("circle"===a){let e=Math.max(Math.abs(x-h.cy),Math.abs(x+g[f].height-h.cy)),n=Math.sqrt(h.r*h.r-e*e);t={x:h.cx-n+l.padding,y:x,width:2*n-2*l.padding,height:g[f].height}}else t={x:h.x+l.padding,y:x,width:h.width-2*l.padding,height:g[f].height};x+=g[f].height+l.padding;let r="function"==typeof n.fill?n.fill(o,e):n.fill;const u="function"==typeof n.linkData?n.linkData(o,e):void 0;let p=s(t,m[f],{fill:r,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:g[f]});if(p){if(p.text&&p.text!==ou){const e=bu(p,i.measureText);if(ou===e)continue;p.ellipsed=e}void 0!==u&&(p.data=u),d.push(p)}}}return d}};const Pu={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach((e=>{e.strategy&&Iu[e.strategy.type]&&e.component&&t.push(...function(e,t){let{chart:n,source:r,rect:i,renderer:o,style:s}=e;if(!n.component(r.component))return[];const a=n.findShapes(r.selector).filter((e=>e.key===r.component));return t({chart:n,settings:r.strategy.settings,nodes:a,rect:{x:0,y:0,width:i.width,height:i.height},renderer:o,style:s})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},Iu[e.strategy.type]))})),t}};const Lu={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25}};function ju(e){let{x:t=0,y:n,item:r,globalMetrics:i,createSymbol:o,direction:s="ltr"}=e,a=r.label.displayObject,l=r.label.bounds,c=r.symbol.meta;const u="rtl"===s;let d={x:u?t+i.maxLabelBounds.width:t+i.maxSymbolSize+i.spacing,y:n,width:i.maxLabelBounds.width,height:Math.max(i.maxSymbolSize,i.maxLabelBounds.height)},h=function(e,t,n){const r=Math.max(0,e.width-t),i=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*r,y:e.y+t/2+n.justify*i}}({x:u?t+i.maxLabelBounds.width+i.spacing:t,y:n,width:i.maxSymbolSize,height:d.height},c.size,{align:void 0===c.align?.5:c.align,justify:void 0===c.justify?.5:c.justify});const f=o(y({},c,h));return delete f.collider,a.anchor=u?"end":"start",function(e,t,n){const r=n.textMetrics;if(e.height<r.height)return!1;const i=Math.max(0,e.width-r.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-r.height);t.x=e.x+n.align*i,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(d,a,{textMetrics:l,fontSize:parseInt(a.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:r.label.displayObject.data,children:[f,a],collider:{type:"rect",x:t,y:n,width:i.maxItemBounds.width,height:i.maxItemBounds.height}},metrics:d}}function zu(e,t){const n=e.items.length,r=Math.ceil(n/t),i="horizontal"===e.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*r+(r-1)*e.layout.margin[o]}function Fu(e,t){let n,r,i,o,{onScroll:s=()=>{}}=t,a=null,l=0;const c={itemize:t=>{n=function(e,t){let n,r,{resolved:i,dock:o}=e,s=[],a=i.items.items,l=i.symbols.items,c=i.labels.items,u=0,d=0,h=0;for(let e=0;e<a.length;e++){if(!1===a[e].show)continue;const i=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=y({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:i,title:i}),r={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},s.push(r),u=Math.max(l[e].size,u),d=Math.max(r.label.bounds.width,d),h=Math.max(r.label.bounds.height,h)}return{items:s,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,h),width:u+8+d},maxLabelBounds:{width:d,height:h}},layout:{margin:{vertical:void 0!==i.layout.item.vertical?i.layout.item.vertical:4,horizontal:void 0!==i.layout.item.horizontal?i.layout.item.horizontal:4},mode:i.layout.item.mode,size:i.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:i.layout.item.direction,scrollOffset:i.layout.item.scrollOffset}}}(t,e.renderer),a=isNaN(n.layout.scrollOffset)?a:n.layout.scrollOffset},getItemsToRender:t=>{i=t.viewRect,l=c.getContentOverflow(i);const s=c.extent();a=Math.max(0,Math.min(a,l)),o=y({},i);const u="horizontal"===c.orientation()?"x":"y";return o[u]-=a,o["x"===u?"width":"height"]=s,function(e,t,n){let{viewRect:r}=e,{itemized:i,create:o=ju,parallels:s,createSymbol:a}=n;const l=i.layout.direction,c=i.globalMetrics,u=i.items,d="horizontal"===i.layout.orientation;let h=0;const f=[],p=c.maxItemBounds.height,g=c.maxItemBounds.width,m=i.layout.margin.vertical+p,y=i.layout.margin.horizontal+g;let v=t.x,b=t.y,x=r.x-t.x;for(let e=0;e<u.length;e++){let n=o({y:b,x:"rtl"===l?r.x+x+r.width-g-(v-t.x):v,item:u[e],globalMetrics:c,direction:l,createSymbol:a});if((d&&v>=r.x-g||!d&&b>=r.y-p)&&f.push(n.item),h++,h>=s?(h=0,d?(v+=y,b=t.y):(b+=m,v=t.x)):d?b+=m:v+=y,!d&&b>r.y+r.height)break;if(d&&v>r.x+r.width)break}return f}(t,o,{itemized:n,parallels:r,createSymbol:e.symbol})},parallelize:(e,t)=>(r=function(e,t,n){const r=n.items.length,i="horizontal"===n.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical",s=n.globalMetrics.maxItemBounds[i]*r+(r-1)*n.layout.margin[o];let a=Math.ceil(s/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",r="width"===e?"horizontal":"vertical",i=n.layout.margin[r]||4,o=Math.floor((t+i)/(i+n.globalMetrics.maxItemBounds[e]));a=Math.min(a,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(a,l))}(e,t,n),r),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return zu(n,r)>i[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,zu(n,r)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:()=>"horizontal"===c.orientation()?i.x+i.width<o.x+o.width:i.y+i.height<o.y+o.height,hasPrev:()=>"horizontal"===c.orientation()?o.x<i.x:o.y<i.y,next:()=>{c.scroll(-c.getNextSize())},prev:()=>{c.scroll(c.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(l,a-e));t!==a&&(a=t,s())},offset:()=>a,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>zu(n,r),spread:()=>function(e,t){const n=t,r="horizontal"===e.layout.orientation?"height":"width",i="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*n+(n-1)*e.layout.margin[i]}(n,r)};return c}function Hu(e){return Object.keys(e).filter((t=>e[t])).join(" ")}const Bu={up:"▲",right:"▶",down:"▼",left:"◀"};function Vu(e,t){let{size:n,isActive:r,direction:i,nav:o,attrs:s}=t,a={},l="";const c=s;o&&o.button&&("function"==typeof o.button.class?a=o.button.class({direction:i}):o.button.class&&(a=o.button.class),"function"==typeof o.button.content&&(l=o.button.content(e,{direction:i})),void 0!==o.button.tabIndex&&(c.tabindex=o.button.tabIndex));const u={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(a).length||(u.border="0",u.background="none"),(!r||o&&o.disabled)&&(c.disabled="disabled"),e("button",y({class:Hu(a),style:u},c),[l||e("span",{style:{pointerEvents:"none"}},[Bu[i]])])}function $u(e){let t;const n={itemize:e=>{t=function(e){let{dock:t,navigation:n}=e;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:n}}(e)},render:r=>function(e,t,n,r){let{rect:i,itemRenderer:o}=t;if(!e||!e.renderArgs)return;e.size(i);const s=e.renderArgs[0],a="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const d=a?["right","left"]:["down","up"];l&&a&&d.reverse();const h=[s("div",{style:{position:"relative",display:"flex","flex-direction":a?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!a?"rtl":"ltr"},[Vu(s,{size:32,isActive:c,direction:d[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),Vu(s,{size:32,isActive:u,direction:d[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(h)}(n.renderer,r,t,e),extent:()=>32,spread:()=>64};return n}function Wu(e){let t;const n={itemize:n=>{t=function(e,t){let{resolved:n}=e;if(!1===n.title.item.show)return null;const r=y({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(r.anchor&&"start"!==r.anchor?"end"===r.anchor&&(r.anchor="start"):r.anchor="end"),void 0===n.title.settings.text){const e=t.scale.data().fields;r.text=e&&e[0]?e[0].title():""}return{displayObject:r,bounds:t.renderer.textBounds(r)}}(n,e)},render:e=>{!function(e,t,n){let{rect:r}=e;if(!t)return;const i=[];if(t.size(r),n){const e={start:0,end:r.width,middle:r.width/2};i.push(y({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(i)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function Uu(e,t,n,r){let i,o,s,{itemRenderer:a,navigationRenderer:l,titleRenderer:c,isPreliminary:u=!1}=r,d=0;const h={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:h.x,y:h.y,width:h.width,height:c.spread()},"horizontal"===n){i={x:h.x,y:h.y,width:c.extent(),height:c.spread()};const e=h.width-i.width-(i.width?t.spacing:0),n=h.height;a.parallelize(e,u?void 0:n);const r=a.extent()>e?l.extent():0,f=a.spread(),p=r?l.spread():0;o={x:i.x+i.width+(i.width?t.spacing:0),y:h.y+Math.max(0,(p-f)/2),width:h.width-r-i.width-(r?t.spacing:0)-(i.width?t.spacing:0),height:n},s={x:o.x+o.width+(r?t.spacing:0),y:h.y,width:r,height:h.height},i.y=o.y;"rtl"===a.direction()&&(s.x=h.x,o.x=s.x+s.width+(s.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),d=Math.max(i.height,p,a.spread())}else{const e=h.height-i.height-(i.height?t.spacing:0),n=h.width;a.parallelize(e,u?void 0:n);const r=a.extent()>e?l.extent():0;s={x:h.x,y:h.y+h.height-r,width:h.width,height:r},o={x:h.x,y:i.y+i.height+(i.height?t.spacing:0),width:h.width,height:h.height-i.height-(i.height?t.spacing:0)-s.height-(s.height?t.spacing:0)},d=Math.max(c.extent(),r?l.spread():0,a.spread())}return o=y({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),s.x+=e.x,s.y+=e.y,i.x+=e.x,i.y+=e.y,{title:y({},e,i),content:y({},e,o),navigation:y({},e,s),orientation:n,preferredSize:d}}function Yu(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const r=e.settings.layout.dock;if("threshold-color"===e.scale.type){const i=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):i&&(o=i.formatter());for(let e=0;e<t.length-1;e++){const r={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};i&&(r.source={field:i.id()}),n.items.push(r)}"vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")&&n.items.reverse()}else{const r=e.scale.labels?e.scale.labels():null;n.items=t.map(((t,n)=>{const i=e.scale.datum?y({},e.scale.datum(t)):{value:t};return i.value=t,e.scale.label?i.label=e.scale.label(t):r&&(i.label=r[n]),i}))}const i=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:y(!0,{},Lu.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:Lu.layout,settings:e.settings.settings.layout}),s=e.resolver.resolve({data:n,defaults:y(!0,{},Lu.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),a=y(!0,{},(e.settings.settings.item||{}).shape);void 0===a.fill&&e.settings.scale&&(a.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:y(!0,{},Lu.item.shape,e.style.item.shape),settings:a}),c=e.resolver.resolve({data:n,defaults:y(!0,{},{show:Lu.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function u(e,n){let r=e.data.value,i=t[n+1];e.data.value=[r,i]}"threshold-color"===e.scale.type&&("vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")?(c.items.reverse().forEach(u),c.items.reverse()):c.items.forEach(u));return{title:i,labels:s,symbols:l,items:c,layout:o}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function Ku(e){const{rect:t,settings:n,state:r,itemRenderer:i,navigationRenderer:o,titleRenderer:s}=e,a=n.layout.dock,l="top"===a||"bottom"===a?"horizontal":"vertical",c=Uu(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:s});e.renderer.size(c.content);let u=i.getItemsToRender({viewRect:y({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:i}),s.render({rect:c.title}),e.state.views={layout:c},u}const Xu={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(e){if(!this.state.interaction.started)return;const t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t},panend(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=Ku(this);this.update(e)},this.itemRenderer=Fu(this,{onScroll:this.onScroll}),this.navigationRenderer=$u(this),this.titleRenderer=Wu(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),Yu(this)},preferredSize(e){return function(e,t){let n=0;const r=e.settings.layout.dock||"center",i="top"===r||"bottom"===r?"horizontal":"vertical",o=e.state.display,s=Uu(t.inner,o,i,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=s.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){Yu(this)},render(){return Ku(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function Gu(e,t){let n=0;const r=e.state.isVertical?"justify":"align",i=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",s=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[s](),n*=Math.min(1,Math.max(e.stgns[r],0)),t[i]+=n}function Ju(e,t,n){const r=n[e];return"object"==typeof r?-1!==r.valid.indexOf(t)?t:r.default:n.default}function Zu(e){return Ju(e.layout.dock,e.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function Qu(e,t){const n={x:0,y:0,width:0,height:0},r=e.stgns.padding;return n.x=r.left,n.y=r.top,n.width=t.width-r.left-r.right,n.height=t.height-r.top-r.bottom,n}function ed(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,r=e.chart.scale(e.stgns.fill),i=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let r=n,i=e.stgns.tick.label;!i&&e.formatter?i=e.formatter:!i&&t.data().fields&&(i=t.data().fields[0].formatter()),"function"==typeof i&&(r=n.map(i).map(String));const o=n.map(((n,i)=>{const o=r[i];return{value:n,label:o,pos:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}}));return o}(e,i),s=Ju((a=e.settings).layout.dock,a.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"});var a;if(void 0===n.text){const e=i.data().fields;n.text=e&&e[0]?e[0].title():""}const l=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),c=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),u={isVertical:t,nodes:[],title:{anchor:Zu(e.settings),textMetrics:l,textBounds:c,requiredWidth:()=>{if(!n.show)return 0;let e=c.width,r=n.maxLengthPx;return t||(e+=n.padding,r+=n.padding),Math.min(e,r,u.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=c.height;return t&&(e+=n.padding),Math.min(e,u.rect.height)}},ticks:{values:o,anchor:s,length:Math.min(Math.max(...o.map((e=>e.textMetrics.width))),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===s?Math.max(...u.ticks.values.map((e=>e.textMetrics.height)))+e.stgns.tick.padding:0,height:Math.max(...o.map((e=>e.textMetrics.height)))},legend:{fillScale:r,majorScale:i,length:()=>{const n=t?"height":"width",r=t?"requiredHeight":"requiredWidth",i=Math.min(u.rect[n],u.rect[n]*e.stgns.length)-u.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return u}const td={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize(e){const t=this.state;t.rect=Qu(this,e.inner);let n=this.stgns.size;const r=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=r;const i=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce(((e,t)=>e+t.textMetrics.height),0);if(e>this.state.legend.length())return i;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return i;n+=Math.max(...t.ticks.values.map((e=>e.textMetrics.height)))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+r,n):Math.max(n,t.title.requiredWidth()+r)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=ed(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=ed(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=Qu(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,r="left"===t.ticks.anchor,i="top"===t.ticks.anchor;let o=t.rect.x,s=t.rect.y,a="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,s+=t.title.textMetrics.height,s+=i?t.rect.height-t.title.textBounds.height:0,a="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,s+=t.title.textMetrics.height,s+=i?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=r?t.rect.width:0,s+=t.title.textMetrics.height,a=r?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(s,t.rect.y+t.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:a,title:n.title.text};return Gu(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale;return t.domain().map((e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))}))).sort(((e,t)=>e.offset-t.offset))}(this),n=function(e,t){const n=e.state,r=e.stgns,i=n.rect;let o=i.x,s=i.y,a=n.isVertical?r.size:n.legend.length(),l=n.isVertical?n.legend.length():r.size;"left"===n.ticks.anchor?o+=n.rect.width-r.size:"top"===n.ticks.anchor&&(s+=n.rect.height-r.size),"top"===n.title.anchor?s+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:s,width:a,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return Gu(e,c),c}(this,t),r=function(e,t){const n=e.state,r=e.stgns;let i="start";const o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},s=n.ticks.values.map((s=>{let a=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*s.pos,u=0===s.pos?"text-before-edge":"text-after-edge"):a=t.x+t.width*s.pos,"right"===n.ticks.anchor?(a=t.x+r.size+r.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(a=t.x-r.tick.padding,i="end"):"top"===n.ticks.anchor?(l=t.y-r.tick.padding,c-=.25*s.textMetrics.height,i=0===s.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,c=.8*s.textMetrics.height,i=0===s.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:a,y:l,dx:0,dy:c,text:s.label,fontSize:r.tick.fontSize,fontFamily:r.tick.fontFamily,fill:r.tick.fill,maxWidth:n.isVertical?r.tick.maxLengthPx:Math.min(r.tick.maxLengthPx,n.legend.length()/2),anchor:i,textBoundsFn:e.renderer.textBounds,title:s.label,baseline:u}}));return{type:"container",id:"legend-seq-ticks",children:[...s,o]}}(this,n),i={id:"legend-seq-target",type:"container",children:[n,r]};this.state.nodes.push(i)},render(){return this.state.nodes}};const nd={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},layers:{curve:"linear",show:!0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function rd(e,t){let{generatorType:n,item:r,data:i,major:o,minor:s,layerObj:a,stngs:l}=t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,generatorType:n,major:o,minor:s,layerObj:a,stngs:l,opacity:r.opacity,stroke:r.stroke,strokeWidth:r.strokeWidth,strokeLinejoin:r.strokeLinejoin,fill:c||r.fill,data:i};return r.strokeDasharray&&(u.strokeDasharray=r.strokeDasharray),u}function id(e){const{metaLayers:t,coordinates:n,layers:r,lines:i,areas:o}=function(e){let{data:t,stngs:n,rect:r,resolver:i,style:o,domain:s}=e;const{width:a,height:l}=r,c=i.resolve({data:t,defaults:nd.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:a,minor:"vertical"===n.orientation?a:l}}),u=!n.connect&&s.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),d={};let h=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=d[n]?d[n].items[d[n].items.length-1]:null,r=e?s.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&s.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==r&&d[n].items.push({dummy:!0})}d[n]=d[n]||{order:h++,id:n,items:[],dataItems:[],consumableData:{}},d[n].dataItems.push(t.data),d[n].items.push(t)}const f=Object.keys(d).map((e=>(d[e].consumableData=w({points:d[e].dataItems},d[e].dataItems[0]),d[e]))),p={items:f.map((e=>e.consumableData))},g=n.layers||{};return{coordinates:c,metaLayers:f,layers:i.resolve({data:p,defaults:{curve:nd.layers.curve,show:nd.layers.show},settings:{curve:g.curve,show:g.show}}),lines:i.resolve({data:p,defaults:y({},nd.layers.line,o.line),settings:g.line}),areas:i.resolve({data:p,defaults:y({},nd.layers.area,o.area),settings:g.area})}}(e),s=[];return t.forEach(((t,a)=>{const l=r.items[a];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let d,h;for(let r=0;r<t.items.length;r++){if(d=t.items[r],h=d.data,!d.dummy){if(isNaN(d.major))continue;e.missingMinor0&&(d.minor0=n.settings.minor.scale?n.settings.minor.scale(h.minor0?h.minor0.value:0):0),isNaN(d.minor)||c.push(d.minor),l.data.push(d.data)}u.push(d)}const f=c.sort(((e,t)=>e-t))[Math.floor((c.length-1)/2)];s.push({layerObj:l,lineObj:i.items[a],areaObj:o.items[a],median:f,points:u,consumableData:t.consumableData})})),s}const od={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let{data:t}=e;const{width:n,height:r}=this.rect;this.stngs=this.settings.settings||{};const i=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,o=id({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:i,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){const e=o.map((e=>({id:e.layerObj.id,data:e.layerObj.data}))).sort(this.stngs.layers.sort).map((e=>e.id));o.sort(((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id)))}else o.sort(((e,t)=>e.median-t.median));return function(e,t){let{width:n,height:r,missingMinor0:i,stngs:o}=t;const s=[],a=o.layers||{};return e.forEach((e=>{const{lineObj:t,layerObj:l,areaObj:c,points:u}=e;let d={size:r,p:"y"},h={size:n,p:"x"};if("vertical"===o.orientation){const e=y(!0,{},h);h=y(!0,{},d),d=y(!0,{},e)}a.area&&!1!==c.show&&s.push(rd(u,{data:e.consumableData,item:c,generatorType:"area",major:h,minor:d,layerObj:l,stngs:o})),t&&!1!==t.show&&(s.push(rd(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"1"),major:h,minor:d,layerObj:l,stngs:o},"none")),!i&&a.area&&!1!==c.show&&!1!==t.showMinor0&&s.push(rd(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"0"),major:h,minor:d,layerObj:l,stngs:o},"none")))})),s}(o,{width:n,height:r,missingMinor0:i,stngs:this.stngs})}};function sd(e,t){let n,r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,r=t.center.y):(n=t.clientX,r=t.clientY);const o=n-e.state.boundingRect.left,s=r-e.state.boundingRect.top;return{x:i?Math.max(0,Math.min(o,e.rect.width)):o,y:i?Math.max(0,Math.min(s,e.rect.height)):s}}function ad(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function ld(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-r}}const cd={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=sd(this,e,!1);zs({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=this.settings.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"}))),this.state.start=sd(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=sd(this,e),function(e){if(e.state.active){const t=ad(e,e.state.start),n=ad(e,e.state.end),r=e.chart.shapesAt(ld(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([y({type:"rect"},ld(t.state.start,t.state.end),t.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{Array.isArray(e.contexts)&&e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function ud(e,t,n){let{renderer:r,style:i,props:o,h:s}=n;const a=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,r){return r.content({h:e,style:n,data:t})}(s,e,i,o),c=s("div",{dir:o.direction,class:Hu(y({"pic-tooltip":!0},a.tooltip)),style:y({position:"relative",display:"inline-block"},t.computedTooltipStyle)},s("div",{style:i.content,class:Hu(y({"pic-tooltip-content":!0},a.content))},l),s("div",{class:Hu(y({"pic-tooltip-arrow":!0},a.arrow)),style:y({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(c),r.element().children[0]}function dd(e){let{defaultDuration:t,defaultDelay:n}=e,r=null,i=null,o=!1;const s=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach((t=>t(e)))},e.on=(e,n)=>{Array.isArray(e)?e.forEach((e=>t[e].push(n))):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach((e=>{t[e].length=0}))},e}(),a=function(){},l=()=>{r=null,i=null,o=!1,s.set("fulfilled")};return a.invoke=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;r&&(clearTimeout(r),s.set("debounced")),s.set("pending"),r=setTimeout((()=>{e(),o=!0,r=null,s.set("active")}),c),a>0&&(i&&clearTimeout(i),i=setTimeout(l,a+Math.max(c,0)))},a.clear=()=>{o?s.set("cancelled"):r&&(clearTimeout(r),s.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},a.on=(e,t)=>{s.on(e,t)},a.destroy=()=>{a.clear(),s.destroy()},a}function hd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)"),inside:"translate(-50%, -50%)"}}function fd(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n},inside:{x:-e/2,y:-t/2}}}function pd(e,t){const n=e>0?"-":"+";return e=Math.abs(e),void 0===t&&(t=e),{left:{left:"100%",top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},top:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"100%",borderWidth:"".concat(t,"px")},bottom:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(t,"px")},inside:{left:"0px",top:"0px",borderWidth:"0px"}}}function gd(e,t,n,r,i,o){const s=t+o.x,a=n+o.y,l=i;return!(s<0||a<0)&&!(s+r>e.width||a+l>e.height)}function md(e){let{area:t,vx:n,vy:r,width:i,height:o,offset:s}=e;const a=n+s.x,l=r+s.y,c=i,u=o;let d=a<0?-a:0,h=l<0?-l:0;return d+=a+c>t.width?-(a+c-t.width):0,h+=l+u>t.height?-(l+u-t.height):0,{x:d,y:h}}function yd(e){let{options:t,pointer:n,width:r,height:i,dockOrder:o,x:s,y:a}=e;const{targetBounds:l}=n,c=hd(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(s,"px"),top:"".concat(a,"px"),transform:u},computedArrowStyle:pd(t.offset)[t.dock],dock:t.dock};const d={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},h=fd(r,i,t.offset),f=[],p="target"===t.area?s:l.left+s,g="target"===t.area?a:l.top+a;for(let e=0;e<o.length;e+=1){const n=o[e],l=md({area:d,vx:p,vy:g,width:r,height:i,offset:h[n]}),u={left:"".concat(s,"px"),top:"".concat(a,"px"),transform:c[n]},m=pd(t.offset)[n];0!==l.x&&(u.width="".concat(r-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(s+l.x,"px"),m.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:m,dock:n,rect:{width:r,height:i}};if(0===l.x&&0===l.y)return y;y.offset=l,f.push(y)}return f.sort(((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x))),f[0]}function vd(e,t,n){const r=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!r)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const i=r.rect;return y({scaleRatio:i.scaleRatio},i.computedInner)}const bd={bounds:function(e){let{resources:t,nodes:n,pointer:r,width:i,height:o,options:s}=e;const{targetBounds:a}=r,{x:l,y:c,width:u,height:d}=t.getNodeBoundsRelativeToTarget(n[0]),h={left:{x:l,y:c+d/2},right:{x:l+u,y:c+d/2},top:{x:l+u/2,y:c},bottom:{x:l+u/2,y:c+d},inside:{x:l+u/2,y:c+d/2}},f=hd(s.offset),p=f[s.dock];if(p)return{computedTooltipStyle:{left:"".concat(h[s.dock].x,"px"),top:"".concat(h[s.dock].y,"px"),transform:p},computedArrowStyle:pd(s.offset)[s.dock],dock:s.dock};const g={width:"target"===s.area?a.width:window.innerWidth,height:"target"===s.area?a.height:window.innerHeight},m=fd(i,o,s.offset),y=["top","left","right","bottom","inside"];for(let e=0;e<y.length;e+=1){const t=y[e];if(gd(g,"target"===s.area?h[t].x:a.left+h[t].x,"target"===s.area?h[t].y:a.top+h[t].y,i,o,m[t]))return{computedTooltipStyle:{left:"".concat(h[t].x,"px"),top:"".concat(h[t].y,"px"),transform:f[t]},computedArrowStyle:pd(s.offset)[t],dock:t}}const v=function(e){let{options:t,docks:n,dockOffsets:r,targetBounds:i,area:o,width:s}=e;const a="top",l="target"===t.area?n[a].x:i.left+n[a].x,c=("target"===t.area?n[a].y:(i.top,n[a].y),r[a]),u=l+c.x,d=(c.y,s);let h=n.top.x;return u<0&&u+d>o.width||(u<0?h-=u:u+d>o.width&&(h-=u+d-o.width)),h}({options:s,docks:h,dockOffsets:m,targetBounds:a,area:g,width:i});return{computedTooltipStyle:{left:"".concat(v,"px"),top:"".concat(h.top.y,"px"),transform:f.top},computedArrowStyle:pd(s.offset+v-h.top.x,s.offset).top,dock:"top"}},pointer:function(e){let{options:t,pointer:n,width:r,height:i}=e;const{x:o,y:s}=n;return yd({x:o,y:s,pointer:n,width:r,height:i,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let{options:t,pointer:n,width:r,height:i,nodes:o,resources:s}=e;const a=o[0],{dx:l,dy:c}=n,u=s.getComponentBoundsFromNode(a),d=l+u.x+u.width/2,h=c+u.y+u.height/2,{start:f,end:p,outerRadius:g}=a.desc.slice,m=(f+p)/2-Math.PI/2,y=2*Math.PI,v=(m%y+y)%y;let b=["top","left","right","bottom"];return"auto"===t.dock&&(b=v<=Math.PI/4||v>=7*Math.PI/4?["right","top","bottom","left"]:v<=3*Math.PI/4?["bottom","left","right","top"]:v<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),yd({x:d+g*u.scaleRatio.x*Math.cos(v),y:h+g*u.scaleRatio.y*Math.sin(v),pointer:n,width:r,height:i,options:t,dockOrder:b})}};function xd(e,t){let{width:n,height:r}=e,{chart:i,state:o,props:s}=t;const a={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:e=>vd(e,o.pointer,i),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const r=vd(e,t,n),i=e.bounds;return{x:r.x+t.dx+i.x,y:r.y+t.dy+i.y,width:i.width,height:i.height}}(e,o.pointer,i)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:r},l=typeof s.placement;if("object"===l&&"function"==typeof s.placement.fn)return s.placement.fn(a);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=y(c,s.placement(a))),"object"===l&&bd[s.placement.type]?c=y(c,s.placement):"string"===l&&bd[s.placement]&&(c=y(c,{type:s.placement})),a.options=c;const u=bd[c.type](a);let{x:d,y:h,width:f,height:p}=a.resources.getComponentBoundsFromNode(a.nodes[0]);return d+=a.pointer.dx,f+=d,h+=a.pointer.dy,p+=h,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,d,parseFloat(u.computedTooltipStyle.left)),f),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,h,parseFloat(u.computedTooltipStyle.top)),p),"px"),u}let wd;function Md(){wd=null}const kd={duration:8e3,delay:500,filter:e=>e.filter((e=>e.data&&void 0!==e.data.value)),extract:e=>e.node.data.value,content:e=>{let{h:t,data:n}=e;return n.map((e=>t("div",{},e)))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every(((e,n)=>t[n]&&JSON.stringify(e.data)===JSON.stringify(t[n].data))),placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0};const _d={require:["chart","renderer"],defaultSettings:{settings:kd,style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide(){this.hide()},show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,{nodes:n,duration:r,delay:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let{chart:n,state:r}=t,i=0,o=0;e.center?(i+=e.center.x,o+=e.center.y):(i+=e.clientX,o+=e.clientY);const s=n.element.getBoundingClientRect(),a=r.targetElement.getBoundingClientRect(),l=i,c=o,u=s.left-a.left,d=s.top-a.top,h=i-s.left,f=o-s.top;return i-=a.left,o-=a.top,{x:i,y:o,dx:u,dy:d,cx:h,cy:f,clientX:l,clientY:c,targetBounds:a,chartBounds:s}}(e,this),t=Array.isArray(n)?this.props.filter(n):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke((()=>this.invokeRenderer(this.state.activeNodes)),r,i)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=dd({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",(()=>{!function(e){wd&&wd!==e&&wd()}(t),wd=t,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(()=>{const e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,y({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,y({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),wd===t&&(wd=null),this.state.tooltipElm=void 0})),this.dispatcher.on("active",(()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}))},created(){this.init(this.settings)},beforeUpdate(e){let{settings:t}=e;this.dispatcher&&(this.dispatcher.destroy(),Md()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),Md()},appendTo(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;const{width:e,height:t}=this.state.targetElement.getBoundingClientRect();this.renderer.destroy(),this.renderer.size({width:e,height:t}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let{chart:n,scale:r,props:i,h:o}=t;const s={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},a=[];return e.forEach((e=>{if("function"==typeof i.extract){const t=y({node:e},s);a.push(i.extract(t))}})),a}(e,this),n=xd(ud(t,{},this).getBoundingClientRect(),this);this.state.tooltipElm=ud(t,n,this)}};const Sd={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes(this.props.selector).filter((e=>e.key===this.props.target)),t=e.filter((e=>e.collider)).map((e=>e.collider));t.forEach((e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var qd={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},Dd=/([astvzqmhlc])([^astvzqmhlc]*)/gi,Ed=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function Cd(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(Dd,((e,n,r)=>{const i=function(e){const t=e.match(Ed);return t?t.map(Number):[]}(r);let o=n.toLowerCase(),s=n;if("m"===o&&i.length>2&&(t.push([s,...i.splice(0,2)]),o="l",s="m"===s?"l":"L"),i.length<qd[o])return"";for(t.push([s,...i.splice(0,qd[o])]);i.length>=qd[o]&&i.length&&qd[o];)t.push([s,...i.splice(0,qd[o])]);return""})),t}const Ad=2*Math.PI;function Td(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function Nd(e,t,n,r,i){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*r+e**3*i}function Rd(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||function(e,t,n,r){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+r.x-(n.x+n.x))+Math.abs(t.y+r.y-(n.y+n.y))}(e,t,n,r)<=10)return i[i.length-1]!==e&&i.push(e),i.push(r),i;const s=Td(e,t),a=Td(t,n),l=Td(n,r),c={x:Nd(.5,e.x,t.x,n.x,r.x),y:Nd(.5,e.y,t.y,n.y,r.y)},u=Td(s,a),d=Td(a,l);return Rd(e,s,u,c,i,o-1),Rd(c,d,l,r,i,o-1),i}function Od(e,t,n){const{cp1:r,cp2:i}=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return Rd(e,r,i,n)}function Id(e,t,n){const r=[],i=!!e[4],o=!!e[5],s=e[3];let a,l,c,u,d=e[6],h=e[7],f=e[1],p=e[2];if("a"===e[0]&&(d+=t,h+=n),t===h&&n===h)return r;if(!f||!p)return r.push({x:d,y:h}),r;({cx:a,cy:l,rx:f,ry:p,sweepAngle:c,startAngle:u}=function(e,t,n,r,i,o,s,a,l){let c,u,d,h,f,p;const g=es(n%360),m=Math.cos(g),y=Math.sin(g),v=(a-o)/2,b=(l-s)/2,x=m*v+y*b,w=m*b-y*v;p=x**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,p>1&&(p=Math.sqrt(p),e*=p,t*=p);const M=e*w,k=t*x,_=M**2+k**2,S=(e*t)**2-_;let q=Math.sqrt(Math.max(S/_,0));r===i&&(q=-q);const D=q*(M/t),E=q*(-k/e);h=m*D-y*E+(a+o)/2,f=y*D+m*E+(l+s)/2;const C=(x-D)/e,A=(w-E)/t,T=(-x-D)/e,N=(-w-E)/t;return c=Math.atan2(A,C),c+=c<0?Ad:0,u=Math.atan2(N,T),u+=u<0?Ad:0,d=u-c,!i&&c<u?d-=Ad:i&&u<c&&(d+=Ad),d%=Ad,{startAngle:c,sweepAngle:d,cx:h,cy:f,rx:e,ry:t}}(f,p,s,i,o,d,h,t,n));const g=Math.abs(c*Math.sqrt((f**2+p**2)/2)),m=Math.ceil(g/10),y=c/m;for(let e=1;e<=m;e++){const t=(u+y*e)%Ad,n=Math.cos(t),i=Math.sin(t);r.push({x:a+n*f+-i*n,y:l+i*p+n*i})}return r}function Pd(e){const t=Cd(e),n=[],r=[];let i=0,o=0,s=null,a=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],d=u[0];switch("S"!==d&&"s"!==d&&"C"!==d&&"c"!==d&&(s=null,a=null),"T"!==d&&"t"!==d&&"Q"!==d&&"q"!==d&&(l=null,c=null),d){case"m":r.length&&n.push(r.splice(0));case"l":i+=u[1],o+=u[2],r.push({x:i,y:o});break;case"M":r.length&&n.push(r.splice(0));case"L":i=u[1],o=u[2],r.push({x:i,y:o});break;case"H":i=u[1],r.push({x:i,y:o});break;case"h":i+=u[1],r.push({x:i,y:o});break;case"V":o=u[1],r.push({x:i,y:o});break;case"v":o+=u[1],r.push({x:i,y:o});break;case"a":r.push(...Id(u,i,o)),i+=u[6],o+=u[7];break;case"A":r.push(...Id(u,i,o)),i=u[6],o=u[7];break;case"c":r.push(...Rd({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o},{x:u[5]+i,y:u[6]+o})),s=u[3]+i,a=u[4]+o,i+=u[5],o+=u[6];break;case"C":r.push(...Rd({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),s=u[3],a=u[4],i=u[5],o=u[6];break;case"s":null!==s&&null!==s||(s=i,a=o),r.push(...Rd({x:i,y:o},{x:2*i-s,y:2*o-a},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),s=u[1]+i,a=u[2]+o,i+=u[3],o+=u[4];break;case"S":null!==s&&null!==s||(s=i,a=o),r.push(...Rd({x:i,y:o},{x:2*i-s,y:2*o-a},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),s=u[1],a=u[2],i=u[3],o=u[4];break;case"Q":r.push(...Od({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],i=u[3],o=u[4];break;case"q":r.push(...Od({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),l=u[1]+i,c=u[2]+o,i+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...Od({x:i,y:o},{x:l,y:c},{x:u[1],y:u[2]})),i=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...Od({x:i,y:o},{x:l,y:c},{x:u[1]+i,y:u[2]+o})),i+=u[1],o+=u[2];break;case"z":case"Z":r.length&&r.push({x:r[0].x,y:r[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];Math.abs(n.x-r.x)<1e-12&&Math.abs(n.y-r.y)<1e-12&&(e.splice(t,1),t--)}}(r),n.push(r.splice(0)),n}const Ld={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter((e=>e.key===this.props.target)),t=[];e.forEach((e=>{Pd(e.attrs.d).forEach((e=>{e.forEach((e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var jd=[function(e){e.component("box",za),e.component("box-marker",za)},function(e){e.component("point",Ua),e.component("point-marker",Ua)},function(e){e.component("pie",Ga)},function(e){e.component("grid-line",tl)},function(e){e.component("ref-line",hl)},function(e){e.component("axis",Hl)},function(e){e.component("container",Bl)},function(e){e.component("text",Wl)},function(e){e.component("scrollbar",Kl)},function(e){e.component("brush-range",cc),e.component("brush-area-dir",fc)},function(e){e.component("range",yc)},function(e){e.component("brush-lasso",kc)},function(e){e.component("labels",Pu)},function(e){e.component("legend-cat",Xu)},function(e){e.component("legend-seq",td)},function(e){e.component("line",od)},function(e){e.component("brush-area",cd)},function(e){e.component("tooltip",_d)},function(e){e.component("debug-collider",Sd)},function(e){e.component("debug-path-to-points",Ld)}];let zd=class{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let e=[];const t=this.children.length;let n,r;for(n=0;n<t;n++)r=this.children[n],e.push(r),r.children.length&&(e=[...e,...r.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map((e=>e.toJSON()))}}};class Fd{constructor(){let{x:e=0,y:t=0,width:n=0,height:r=0,minWidth:i=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x:e,y:t,width:n,height:r,minWidth:i,minHeight:o})}set(){let{x:e=0,y:t=0,width:n=0,height:r=0,minWidth:i=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="rect",n>=0?(this.x=e,this.width=Math.max(n,i)):(this.x=e+Math.min(n,-i),this.width=-Math.min(n,-i)),r>=0?(this.y=t,this.height=Math.max(r,o)):(this.y=t+Math.min(r,-o),this.height=-Math.min(r,-o))}containsPoint(e){return zs(this,e)}intersectsLine(e){return Fs(this,C(e))}intersectsRect(e){return Ls(this,E(e))}intersectsCircle(e){return Ts(e,this)}intersectsPolygon(e){return Ps(e,this)}intersectsGeoPolygon(e){return Ks(e,this)}points(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}class Hd{constructor(){let{cx:e=0,cy:t=0,r:n=0,minRadius:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({cx:e,cy:t,r:n,minRadius:r})}set(){let{cx:e=0,cy:t=0,r:n=0,minRadius:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="circle",this.cx=e,this.cy=t,this.r=Math.max(n,r),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return As(this,e)}intersectsLine(e){return Ns(this,C(e))}intersectsRect(e){return Ts(this,E(e))}intersectsCircle(e){return n=e,!qs(t=this)&&!qs(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return Rs(this,e)}intersectsGeoPolygon(e){return Ws(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class Bd{constructor(){let{x1:e=0,y1:t=0,x2:n=0,y2:r=0,tolerance:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x1:e,y1:t,x2:n,y2:r,tolerance:i})}set(){let{x1:e=0,y1:t=0,x2:n=0,y2:r=0,tolerance:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="line",this.x1=e,this.y1=t,this.x2=n,this.y2=r,this.tolerance=Math.max(0,Math.round(i)),this.vectors=this.points(),this.zeroSize=e===n&&t===r}containsPoint(e){if(this.tolerance>0){return Ns({cx:e.x,cy:e.y,r:this.tolerance},this)}return Bs(this,e)}intersectsLine(e){return Hs(this,C(e))}intersectsRect(e){return Fs(E(e),this)}intersectsCircle(e){return Ns(e,this)}intersectsPolygon(e){return Is(e,this)}intersectsGeoPolygon(e){return Ys(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class Vd{constructor(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polygon",this.vertices=e.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return Os(this,e)}intersectsCircle(e){return Rs(e,this)}intersectsLine(e){return Is(this,C(e))}intersectsRect(e){return Ps(this,E(e))}intersectsPolygon(e){return Vs(this,e)}intersectsGeoPolygon(e){return $s(e,this)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function $d(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Vd(...t)}function Wd(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function Ud(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}class Yd{constructor(){let{vertices:e=[[]]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="geopolygon",this.vertices=e.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)Ud(this.vertices[e]),this.vertices[e].length>2&&Wd(this.vertices[e]),this.polygons[e]=$d({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return Us(this,e)}intersectsCircle(e){return Ws(e,this)}intersectsLine(e){return Ys(this,C(e))}intersectsRect(e){return Ks(this,E(e))}intersectsPolygon(e){return $s(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Ls(n,r)&&(js(r,n)?Cs(t,e):Cs(e,t))}(this,e)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function Kd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Yd(...t)}class Xd{constructor(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({points:e})}set(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polyline",this.segments=[],this._points=e.slice(),this._points.length>1)for(let e=0,r=this._points.length-1;e<r;e++)t=this._points[e],n=this._points[e+1],(t.x!==n.x||t.y!==n.y)&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y});var t,n}containsPoint(e){return this.segments.some((t=>Bs(t,e)))}intersectsCircle(e){return this.segments.some((t=>Ns(e,t)))}intersectsLine(e){const t=C(e);return this.segments.some((e=>Hs(e,t)))}intersectsRect(e){const t=E(e);return this.segments.some((e=>Fs(t,e)))}intersectsPolygon(e){return this.segments.some((t=>Is(e,t)))}intersectsGeoPolygon(e){return this.segments.some((t=>Ys(e,t)))}points(){return this._points}}const Gd=Oe();function Jd(e,t){return Gd.get(e)(t)}Gd.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Fd(...t)})),Gd.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Hd(...t)})),Gd.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Bd(...t)})),Gd.add("polygon",$d),Gd.add("geopolygon",Kd),Gd.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Xd(...t)}));class Zd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach((e=>{const t=Jd(e.type,e);t&&this.geometries.push(t)}))}containsPoint(e){return this.geometries.some((t=>t.containsPoint(e)))}intersectsLine(e){return this.geometries.some((t=>t.intersectsLine(e)))}intersectsRect(e){return this.geometries.some((t=>t.intersectsRect(e)))}intersectsCircle(e){return this.geometries.some((t=>t.intersectsCircle(e)))}intersectsPolygon(e){return this.geometries.some((t=>t.intersectsPolygon(e)))}intersectsGeoPolygon(e){return this.geometries.some((t=>t.intersectsGeoPolygon(e)))}}class Qd{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new Qd).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,r,i;if(e instanceof Qd&&(e=e._elements),Array.isArray(e)){for(r=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(i=0;i<3;i++)r[t][n]+=this._elements[t][i]*e[i][n];this._elements=r}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,r,i,o){return this.multiply([[e,n,i],[t,r,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],r=this._elements[1][0],i=this._elements[1][1],o=this._elements[1][2],s=this._elements[2][0],a=this._elements[2][1],l=this._elements[2][2],c=0;return c=e*i*l+t*o*s+n*r*a-n*i*s-t*r*l-e*o*a,c}invert(){let e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],r=this._elements[0][2],i=this._elements[1][0],o=this._elements[1][1],s=this._elements[1][2],a=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-s*l,r*l-n*c,n*s-r*o],[s*a-i*c,t*c-r*a,r*i-t*s],[i*l-o*a,a*n-t*l,t*o-n*i]],this.multiply(1/e),this}transpose(){const e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map((e=>e.join("\t"))).join("\n"))}isIdentity(){const e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}transformPoint(e){let t,n,r=[e.x,e.y,1],i=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=r[n]*i[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,r,i,o,s=this._elements,a=[];for(i=0;i<e.length;i++){for(t=[e[i].x,e[i].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)o[n]+=t[r]*s[n][r];a.push({x:o[0],y:o[1]})}return a}get elements(){const e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}const eh=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function th(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const r=t.args[1],i=t.args[2];e.translate(r,i),e.rotate(n),e.translate(-r,-i)}else 1===t.args.length&&e.rotate(n)}function nh(e,t){const n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function rh(e,t){const n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function ih(e,t){t.args.length>=6&&e.transform(...t.args)}function oh(e,t){const n=function(e){let t,n=[];for(;null!==(t=eh.exec(e));){const e=t[2].trim(),r=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:r.filter((e=>e.trim().length>0)).map((e=>Number(e)))})}return n}(e);let r;for(let e=0,i=n.length;e<i;e++)r=n[e],"rotate"===r.cmd?th(t,r):"scale"===r.cmd?nh(t,r):"matrix"===r.cmd?ih(t,r):"translate"===r.cmd&&rh(t,r)}const sh={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},ah={type:(e,t)=>t.filter((t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()})),attr:(e,t,n,r)=>r.filter((r=>{const i=r.attrs[e];if(!t)return void 0!==i;if(void 0===i)return!1;switch(t){case"=":return n===String(i);case"!=":return n!==String(i);default:return!1}})),universal:e=>e,tag:(e,t)=>t.filter((t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))};function lh(e,t){if(!t||!t.length||!e||"function"!=typeof ah[e.type])return[];switch(e.type){case"type":case"tag":return ah[e.type](e.value,t);case"attr":return ah[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return ah[e.type](t);default:return[]}}var ch={find:function(e,t){const n=[],r=[];let i,o;if(t.isBranch){let s;i=function(e){const t=[];let n,r,i,o;return e.split(/\s*,\s*/).forEach((e=>{e=e.trim(),n=[];const s=t=>{i=e.match(sh[t]),i&&(o=!0,e=e.slice(i[0].length),r={type:t,value:i[0]},"attr"===t&&(i=i[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),r.attribute=i[1],r.operator=i[2],r.attributeValue=i[3]),n.push(r))};for(;e&&(o=!1,i=e.match(/^\s*([>+~]|\s)\s*/),i&&(o=!0,n.push({type:" ",value:i[0]}),e=e.slice(i[0].length)),Object.keys(sh).forEach(s),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););})),t}(e),o=t.descendants;for(let e=0,t=i.length;e<t;e++){s=i[e];const t=[];let n=o.slice(),a=!1;s.reverse().forEach((e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(a=!1);n=lh(e,n),a=!0})),a&&t.push(n);const l=t[0].filter((e=>{let n,r=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(r);r&&n<0;)r=r.parent,n=t[e].indexOf(r);if(n<0)return!1}return!0}));r.push(l)}for(let e=0,t=r.length;e<t;e++)for(let t=0,i=r[e].length;t<i;t++)n.indexOf(r[e][t])<0&&n.push(r[e][t])}return n||[]}};function uh(e,t,n){const r=e.type;let i=e.points();n&&(i=i.every((e=>Array.isArray(e)))?i.map((e=>n.transformPoints(e))):n.transformPoints(i)),function(e,t){for(let n=0,r=e.length;n<r;n++)e[n].x/=t,e[n].y/=t}(i,t);let o=null;if("rect"===r||"bounds"===r)o=E(i),o.type=r;else if("circle"===r)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(i,e.r),o.type=r;else if("line"===r)o=C(i),o.type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:Zo(i,"polygon"===r)}}else if("geopolygon"===r){let e="";for(let t=0;t<i.length;t++)e+=Zo(i[t],!0);o={type:"path",d:e}}return o}class dh{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{x:n,y:r,width:i,height:o}=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n,y:r,width:i,height:o}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((e=>uh(e,t,n)))}:uh(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map((e=>new dh(e))),this._parent=()=>e.parent?new dh(e.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,r=this._getElementBoundingRect();let i=r.left,o=r.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const{left:t=0,top:n=0}=e.getBoundingClientRect();i-=t,o-=n}return n.x+=i,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function hh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new dh(...t)}class fh{constructor(e){this._node=hh(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function ph(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new fh(...t)}function gh(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=ph(n);const e=n.parent;e&&"stage"!==e.type&&gh(e,t.parent)}}function mh(e,t,n){if(null===e.colliderType)return null;const r=function(e,t){let n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{const r={x:t.cx,y:t.cy};({x:n.cx,y:n.cy}=e.inverseModelViewMatrix.transformPoint(r)),n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((e=>Array.isArray(e)))?Kd(n):$d(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let r=e.descendants.length-1;r>=0;r--){const i=e.descendants[r];if(null!==i.collider&&i.collider[t](n)){const e=ph(i);return gh(i,e),e}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){const t=ph(e);return gh(e,t),t}return null}(e,t,r)}function yh(e,t,n,r){const i=e.length;for(let o=0;o<i;o++){const i=e[o],s=mh(i,t,r);s&&n.push(s),!i.children||s||i.collider||yh(i.children,t,n,r)}}function vh(e,t,n){const r=e.length;for(let i=0;i<r;i++){const r=e[i];if(null!==mh(r,t,n))return!0;if(r.children&&!r.collider)return vh(r.children,t,n)}return!1}function bh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(A(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=D(e).map((e=>is(e,t))),["intersectsRect",n];case"line":return n=q(e).map((e=>is(e,t))),["intersectsLine",n];case"point":return n=is(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map((e=>is(e,t))),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map((e=>e.map((e=>is(e,t))))),["intersectsGeoPolygon",n];default:return[]}}function xh(e,t){const[n,r]=bh(t,e.dpi),i=[];return n&&(yh([e],n,i,r),function(e,t){for(let n=0,r=t.length;n<r;n++)t[n].input=e}(t,i)),i}function wh(e,t){const[n,r]=bh(t,e.dpi);return vh([e],n,r)}class Mh extends zd{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const{data:t,desc:n,tag:r,strokeReference:i,fillReference:o}=e;var s,a;s=this.attrs,a=e,Object.keys(Jo).forEach((e=>{const t=a[e];void 0!==t&&(s[Jo[e]]=t)})),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=y(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return ch.find(e,this).map((e=>hh(e)))}getItemsFrom(e){return xh(this,e)}containsPoint(e){return wh(this,e)}intersectsLine(e){return wh(this,e)}intersectsRect(e){return wh(this,e)}intersectsCircle(e){return wh(this,e)}intersectsPolygon(e){return wh(this,e)}intersectsGeoPolygon(e){return wh(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Qd;void 0!==this.attrs.transform&&oh(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Qd;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),r=e.attrs,i=Object.keys(r);if(n.length!==i.length)return!1;for(let e=0;e<n.length;e++){const i=n[e];if(!Object.hasOwnProperty.call(r,i))return!1;if(t[i]!==r[i])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(e){this._mvm=e,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(e){this._node=e}get node(){return this._node}set collider(e){const t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Zd(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=Jd("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=Jd(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class kh extends zd{addChild(e){if(!(e&&e instanceof zd))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const _h=kh.prototype;class Sh extends Mh{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const{collider:t}=e,n=y({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},[r,,i]=e.bounds(t),{x:o,y:s}=r,{x:a,y:l}=i,c=isNaN(n.width)?a:Math.max(a,n.width+n.x),u=isNaN(n.height)?l:Math.max(l,n.height+n.y);n.x=isNaN(n.x)?o:Math.min(o,n.x),n.y=isNaN(n.y)?s:Math.min(s,n.y),n.width=c-n.x,n.height=u-n.y,this.__boundingRect[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=y({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}addChild(e){const t=_h.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=y({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=_h.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=y({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;if(_h.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=y(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(_h.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=y(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function qh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Sh(...t)}class Dh extends Sh{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const Eh=kh.prototype,Ch=["x1","x2","y1","y2","id","offset","style"];class Ah extends Mh{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=Ch.length;r!==i;r++)n=Ch[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return Eh.addChild.call(this,e)}addChildren(e){return Eh.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return Eh.removeChild.call(this,e),this}removeChildren(e){return Eh.removeChildren.call(this,e),this}}function Th(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ah(...t)}const Nh=kh.prototype,Rh=["patternUnits","x","y","width","height","id"];class Oh extends Mh{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=Rh.length;r!==i;r++)n=Rh[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return Nh.addChild.call(this,e)}addChildren(e){return Nh.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return Nh.removeChild.call(this,e),this}removeChildren(e){return Nh.removeChildren.call(this,e),this}}class Ih extends Mh{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:r=0,height:i=0,rx:o=0,ry:s=0,collider:a}=e,l=y({type:"rect",x:t,y:n,width:r,height:i},a);super.set(e),r>=0?(this.attrs.x=t,this.attrs.width=r):(this.attrs.x=t+r,this.attrs.width=-r),i>=0?(this.attrs.y=n,this.attrs.height=i):(this.attrs.y=n+i,this.attrs.height=-i),o>0&&(this.attrs.rx=o),s>0&&(this.attrs.ry=s),this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=D(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[r,i,o,s]=S(n);return this.__boundingRect[e]={x:r,y:i,width:o-r,height:s-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}class Ph extends Mh{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cx:t=0,cy:n=0,r:r=0,collider:i}=e,o=y({type:"circle",cx:t,cy:n,r:r},i);super.set(e),this.attrs.cx=t,this.attrs.cy=n,this.attrs.r=r,this.collider=o,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const{cx:t,cy:n,r:r,r:i}=this.attrs,o=t-r,s=n-i;let a=2*r,l=2*i,c=[{x:o,y:s},{x:o+a,y:s},{x:o+a,y:s+l},{x:o,y:s+l}];if(e&&this.modelViewMatrix){c=this.modelViewMatrix.transformPoints(c);const[t,n,r,i]=S(c);a=r-t,l=i-n,this.__bounds[e]=[{x:t,y:n},{x:t+a,y:n},{x:t+a,y:n+l},{x:t,y:n+l}]}else this.__bounds[e]=c;return this.__bounds[e]}}class Lh extends Mh{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x1:t=0,y1:n=0,x2:r=0,y2:i=0,collider:o}=e;super.set(e),this.attrs.x1=t,this.attrs.y1=n,this.attrs.x2=r,this.attrs.y2=i;const s={type:"line",x1:t,y1:n,x2:r,y2:i};this.collider=y(s,o),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=q(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const[n,r,i,o]=S(t),s=n!==i||r!==o;return this.__boundingRect[e]={x:n,y:r,width:s?Math.max(1,i-n):0,height:s?Math.max(1,o-r):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const jh=Math.PI/2;function zh(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function Fh(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const Hh={step:function(e){return new Ee(e,.5)},stepAfter:function(e){return new Ee(e,1)},stepBefore:function(e){return new Ee(e,0)},linear:oe,basis:function(e){return new fe(e)},cardinal:me.tension(0),catmullRom:ve,monotonex:function(e){return new ke(e)},monotoney:function(e){return new _e(e)},natural:function(e){return new qe(e)}};function Bh(e){if(e.length<2)return!1;const t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}class Vh extends Mh{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=re();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const{major:t,minor:n,layerObj:r,points:i,stngs:o,generatorType:s}=e,a=le(),l=o.coordinates?o.coordinates.defined:null;a[t.p]((e=>e.major*t.size))["".concat(n.p,"1")]((e=>e.minor*n.size))["".concat(n.p,"0")]((e=>e.minor0*n.size)).curve(Hh["monotone"===r.curve?"monotone".concat(t.p):r.curve]),l?a.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined)):a.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)));const c=o.connect?i.filter(a.defined()):i,u=("area"===s?a:a[s]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=Pd(this.attrs.d),this.segments.length>1&&this.segments.every((e=>Bh(e))))return void(this.collider=y({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach((t=>{if(t.length<=1);else if(Bh(t))this.collider=y({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=[],i=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const s=e[n-1],a=e[n],l=e[n+1],c=zh(a,s),u=zh(a,l),d=(c+u)/2,h=d+Math.PI,f=Math.max(d,h),p=Math.min(d,h),g=c>u;if(1===n){const e=zh(s,a);r.push(Fh(s,e-jh,t)),i.unshift(Fh(s,e+jh,t))}const m=g?f:p,y=g?p:f;if(r.push(Fh(a,m,t)),i.unshift(Fh(a,y,t)),n===o-1){const e=zh(l,a);r.push(Fh(l,e+jh,t)),i.unshift(Fh(l,e-jh,t))}}return{type:"polygon",vertices:[...r,...i]}}(t,n,e.collider)}else this.collider=y({type:"polyline",points:t},e.collider)}))}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:Pd(this.attrs.d),this.points=function(e){const t=[];let n,r=e.length;for(let i=0;i<r;i++){n=e[i];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,[n,r,i,o]=S(t);return this.__boundingRect[e]={x:n||0,y:r||0,width:i-n||0,height:o-r||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}function $h(e){let{data:t,_boundingRect:n,_textBoundsFn:r}=e;return null!=t&&(n||r)}class Wh extends Mh{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,dx:r=0,dy:i=0,textBoundsFn:o,text:s,title:a,collider:l,boundingRect:c,ellipsed:u}=e;super.set(e),this.attrs.x=t,this.attrs.y=n,this.attrs.dx=r,this.attrs.dy=i,this.attrs.text=s,void 0!==a&&(this.attrs.title=String(a)),"object"==typeof c?this._textBoundsFn=()=>c:"function"==typeof o&&(this._textBoundsFn=o),"string"==typeof u&&(this.ellipsed=u),this.collider=y({type:$h(this)?"bounds":null},l),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=D(e),r=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n,[i,o,s,a]=S(r);return this.__boundingRect[t]={x:i,y:o,width:s-i,height:a-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const Uh=Oe();function Yh(e,t){return Uh.get(e)(t)}Uh.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ih(...t)})),Uh.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ph(...t)})),Uh.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Wh(...t)})),Uh.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Lh(...t)})),Uh.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Vh(...t)})),Uh.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Dh(...t)})),Uh.add("container",qh),Uh.add("defs",qh),Uh.add("linearGradient",Th),Uh.add("radialGradient",Th),Uh.add("conicGradient",Th),Uh.add("stop",Th),Uh.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Oh(...t)}));const Kh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.length-1]}return n.save=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=n(),o={};let s="";for(let t=0;t<e.length;t++)s=e[t],void 0!==i[s]&&(o[s]=i[s]);return y(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function Xh(e,t){if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)t[n](e)}function Gh(e,t,n){e.node=n[t],e.index=t}function Jh(e,t,n,r){let i=!1;const o={siblings:e,node:null,index:0};for(let s=0,a=e.length;s<a;s++){if(Gh(o,s,e),Xh(o,r.create),i="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,i)continue;o.node=Kh.save(o.node);const a=Yh(o.node.type,o.node);a&&(o.node.transform&&(n.save(),oh(o.node.transform,n)),n.isIdentity()||(a.modelViewMatrix=n.clone()),t.addChild(a),o.node.children&&Jh(o.node.children,a,n,r),o.node.transform&&n.restore()),Kh.restore()}}function Zh(e){let{items:t,stage:n,dpi:r,on:i={}}=e;return n||(n=Yh("stage",r)),Jh(t,n,new Qd,i),n}function Qh(e,t,n){const{orientation:r,degree:i,stops:o=[]}=n;let s=null;if("radial"===r){const n=t.boundingRect();s=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else if("conic"===r){const t=n.startAngle||0,r=n.x||0,i=n.y||0;s=e.createConicGradient(t,r,i)}else{const r=ts(i);["x1","x2","y1","y2"].forEach((e=>{e in n&&(r[e]=n[e])}));const o=t.boundingRect();s=e.createLinearGradient(o.x+r.x1*o.width,o.y+r.y1*o.height,o.x+r.x2*o.width,o.y+r.y2*o.height)}for(let e=0,t=o.length;e<t;e++){let t=o[e];s.addColorStop(t.offset,t.color)}return s}function ef(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function tf(){let{x:e,y:t,width:n,height:r,scaleRatio:i,margin:o,edgeBleed:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const a={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return a.x=isNaN(e)?a.x:e,a.y=isNaN(t)?a.y:t,a.width=isNaN(n)?a.width:n,a.height=isNaN(r)?a.height:r,void 0!==i&&(a.scaleRatio.x=isNaN(i.x)?a.scaleRatio.x:i.x,a.scaleRatio.y=isNaN(i.y)?a.scaleRatio.y:i.y),void 0!==o&&(a.margin.left=isNaN(o.left)?0:o.left,a.margin.top=isNaN(o.top)?0:o.top),"object"==typeof s&&["left","right","top","bottom"].forEach((e=>{!isNaN(s[e])&&s[e]>0&&(a.edgeBleed[e]=s[e],a.edgeBleed.bool=!0)})),a.computedPhysical={x:Math.round(a.margin.left+(a.x-a.edgeBleed.left)*a.scaleRatio.x),y:Math.round(a.margin.top+(a.y-a.edgeBleed.top)*a.scaleRatio.y),width:Math.round((a.width+a.edgeBleed.left+a.edgeBleed.right)*a.scaleRatio.x),height:Math.round((a.height+a.edgeBleed.top+a.edgeBleed.bottom)*a.scaleRatio.y)},a}function nf(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:Eu,textBounds:Au,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function rf(e){return t=>{let{node:n}=t;"text"===n.type&&function(e){return null!=e}(n.data)&&!n.textBoundsFn&&(n.textBoundsFn=e.textBounds)}}const of=200,sf=200;class af{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,{rect:n,dpiRatio:r,canvasBufferSize:i}=e;t=i?"function"==typeof i?i(n):i:{width:n.computedPhysical.width+2*of,height:n.computedPhysical.height+2*sf},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*r),this.bufferCanvas.height=Math.round(t.height*r)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const lf=Oe();function cf(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function uf(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function df(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function hf(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Object.keys(r);for(let i=0,o=n.length;i<o;i++){let o=n[i];const s=o[0],a=o[1],l=o[2];if(s in t.attrs&&!(a in r)&&e[a]!==t.attrs[s]){const n=l?l(t.attrs[s]):t.attrs[s];"function"==typeof e[a]?e[a](n):e[a]=n}}for(let t=0,n=i.length;t<n;t++){const n=i[t];e[n]=r[n]}}function ff(e,t,n,r){for(let i=0,o=e.length;i<o;i++){let o=e[i],s={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?s.fillStyle=Qh(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(s.fillStyle=r.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?s.strokeStyle=Qh(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(s.strokeStyle=r.patterns.create(o.attrs.stroke))),hf(t,o,n,s),o.modelViewMatrix&&df(o.modelViewMatrix.elements,t),lf.has(o.type)&&lf.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&ff(o.children,t,n,r),t.restore()}}function pf(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zh;const r={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let i,o=!1,s=tf();const a=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",cf]];let l;const c=nf();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(r).forEach((t=>{void 0!==e[t]&&(r[t]=e[t])})),r),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof r.transform||t||(t=new af(e)),n.appendChild(e),e),c.getScene=r=>{const i=uf(t&&t.getContext()||e.getContext("2d")),o=s.scaleRatio.x,a=s.scaleRatio.y,l={type:"container",children:r,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*i*o,", ").concat(s.edgeBleed.top*i*a,")"):""};return 1===i&&1===o&&1===a||(l.transform+="scale(".concat(i*o,", ").concat(i*a,")")),n({items:[l],dpi:i,on:{create:[vu(c.measureText),rf(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let r={};return{create(e){const i=e.key;return i?(r[i]=r[i]||ef(e,t,n),r[i]):ef(e,t,n)},clear(){r={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),d=uf(u),h=t&&r.transform();if(h)return e.width=e.width,function(e){let{el:t,dpiRatio:n,transform:r}=e;if("object"==typeof r){const e=[r.horizontalScaling,r.horizontalSkewing,r.verticalSkewing,r.verticalScaling,r.horizontalMoving*n,r.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:d,transform:h}),t.apply(),!0;o&&(e.style.left="".concat(s.computedPhysical.x,"px"),e.style.top="".concat(s.computedPhysical.y,"px"),e.style.width="".concat(s.computedPhysical.width,"px"),e.style.height="".concat(s.computedPhysical.height,"px"),e.width=Math.round(s.computedPhysical.width*d),e.height=Math.round(s.computedPhysical.height*d),t&&t.updateSize({rect:s,dpiRatio:d,canvasBufferSize:r.canvasBufferSize}));const f=c.getScene(n),p=!i||!f.equals(i);l.clear();const g=o||p,m="function"==typeof r.progressive&&r.progressive();return g&&(m&&!m.isFirst||c.clear(),ff(f.children,u,a,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,m&&!m.isFirst&&f.children.unshift(...i.children),i=f,g},c.itemsAt=e=>i?i.getItemsFrom(e):[],c.findShapes=e=>i?i.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),i=null,c),c.size=e=>{if(e){const t=tf(e);JSON.stringify(s)!==JSON.stringify(t)&&(o=!0,s=t)}return s},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),i=null},c}function gf(e,t){lf.add(e,t)}function mf(e,t){return Math.max(0,Math.min(e,t))}const yf=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),vf=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),bf=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function xf(e){return yf.test(e)}function wf(e){return vf.test(e)||bf.test(e)}function Mf(e){let t,n,r=e?e.length:0;for(t=0;t<r;t++){if(n=e[t],xf(n))return"ltr";if(wf(n))return"rtl"}return"ltr"}const kf={start:"end",end:"start",center:"center",middle:"middle"};function _f(e,t){return"rtl"===t?kf[e]:e}function Sf(e,t){const n=[];let r;const i=[],o=[],s=[];let a,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),a=e.map(c),l=t.map(c);for(let e=0,r=t.length;e<r;e++){-1===a.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?i.push(e[t]):s.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=Sf([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=Sf(s[e].children||[],o[e].content.children||[]),o[e].object=s[e].object,o[e].children=o[e].diff.items;return r=o.concat(n),n.isTree=!0,i.isTree=!0,o.isTree=!0,s.isTree=!0,r.isTree=!0,{added:n,updatedNew:o,updatedOld:s,removed:i,items:r}}function qf(e,t,n){for(let r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function Df(e,t){for(let n=0,r=e.length;n<r;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function Ef(e,t,n,r){let i;for(let o=0,s=e.length;o<s;o++)i=e[o],null!==i.object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(qf(i.diff.added,i.object,t),Df(i.diff.removed,r),Ef(i.diff.items,t,n,r)))}function Cf(e,t,n,r,i,o){const s=Sf(e,t);return qf(s.added,n,r),Df(s.removed,o),Ef(s.items,r,i,o),s.items}gf("rect",(function(e,t){let{g:n,doFill:r,doStroke:i}=t;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,r,i,o,s){o=mf(r/2,o>0?o:s),s=mf(i/2,s>0?s:o),e.moveTo(t,n+s),e.lineTo(t,n+i-s),e.quadraticCurveTo(t,n+i,t+o,n+i),e.lineTo(t+r-o,n+i),e.quadraticCurveTo(t+r,n+i,t+r,n+i-s),e.lineTo(t+r,n+s),e.quadraticCurveTo(t+r,n,t+r-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+s)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),r&&n.fill(),i&&n.stroke()})),gf("circle",(function(e,t){let{g:n,doFill:r,doStroke:i}=t;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),r&&n.fill(),i&&n.stroke()})),gf("line",(function(e,t){let{g:n,doStroke:r}=t;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),r&&n.stroke()})),gf("path",(function(e,t){let{g:n,doStroke:r,doFill:i}=t;const o=new Path2D(e.d);i&&n.fill(o),r&&n.stroke(o)})),gf("text",(function(e,t){let{g:n,ellipsed:r,doStroke:i}=t;const o=r||bu(e,Eu);n.font=[e["font-style"],e["font-weight"],e["font-size"],e["font-family"]].filter((e=>!!e)).join(" ");const s=Mf(e.text);n.canvas.dir!==s&&(n.canvas.dir=s);const a=_f("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);a&&n.textAlign!==a&&(n.textAlign=a);const l=xu(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),i&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}));const Af="http://www.w3.org/2000/svg",Tf=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(Af,"container"===e?"g":e);return t.appendChild(n),n},Nf=e=>{e.parentNode&&e.parentNode.removeChild(e)},Rf=(e,t)=>{if((e=>{switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}})(t)){for(const n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||bu(t.attrs,Eu);const n=Mf(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",_f(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(Af,"title");n.textContent=t.attrs.title,e.appendChild(n)}else e.setAttribute(n,t.attrs[n]);else{const r=+e.getAttribute(n)||0;let i=0;i="dominant-baseline"===n?xu(t.attrs):t.attrs[n],e.setAttribute("dy",i+r)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class Of{constructor(e,t,n,r){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=r}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function If(){return new Of(Cf,Tf,Rf,Nf)}function Pf(e){let t,n,r,i=0;if(0===(e=JSON.stringify(e)).length)return i;for(t=0,r=e.length;t<r;t++)n=e.charCodeAt(t),i=(i<<5)-i+n,i&=i;return i}function Lf(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Af,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Zh;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:If)();let r,i,o,s=!1,a=tf();const l={transform:void 0,disableScreenReader:!1},c=nf(),u={type:"defs",children:[]},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Pf,n={},r=Date.now();const i={onCreate(i){let o={};i.node&&"object"==typeof i.node.fill&&"pattern"===i.node.fill.type&&i.node.fill.shapes&&(o.fill=i.node.fill),i.node&&"object"==typeof i.node.stroke&&"pattern"===i.node.stroke.type&&i.node.stroke.shapes&&(o.stroke=i.node.stroke),Object.keys(o).forEach((s=>{let a="";const l=o[s],c=t(l),u="picasso-pattern-".concat(r,"-").concat(c);if("undefined"!=typeof window&&(a=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach((e=>{t.children.push(e)})),e.push(t),n[c]=!0}i.node["".concat(s,"Reference")]="url('".concat(a,"#").concat(u,"')")}))},clear(){n={}}};return i}(u.children),h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Pf,n={},r=Date.now();const i={getOrCreateGradient(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=t(i[o]),l="picasso-gradient-".concat(r,"-").concat(a);if(!n[a]){let{orientation:t,degree:r,stops:s=[]}=i[o],c={};void 0===r&&(r=90),"radial"===t?c.type="radialGradient":(c=ts(r),["x1","x2","y1","y2"].forEach((e=>{e in i[o]&&(c[e]=i[o][e])})),c.type="linearGradient"),c.id=l,c.children=s.map((e=>{let{offset:t,color:n,opacity:r}=e;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==r?r:1)}})),e.push(c),n[a]=l}return"url('".concat(s,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=i.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=i.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return i}(u.children);return c.element=()=>r,c.root=()=>i,c.settings=e=>(e&&Object.keys(l).forEach((t=>{void 0!==e[t]&&(l[t]=e[t])})),l),c.appendTo=t=>(r||(r=t.ownerDocument.createElementNS(e,"svg"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none",r.setAttribute("xmlns",e),i=t.ownerDocument.createElementNS(e,"g"),i.style.pointerEvents="auto",r.appendChild(i)),t.appendChild(r),r),c.getScene=e=>{const n=a.scaleRatio.x,r=a.scaleRatio.y,i={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*n,", ").concat(a.edgeBleed.top*r,")"):""};return 1===n&&1===r||(i.transform+="scale(".concat(n,", ").concat(r,")")),t({items:[i],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},h.onCreate,d.onCreate,vu(c.measureText),rf(c)]}})},c.render=e=>{if(!r)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const{horizontalScaling:e,horizontalSkewing:n,verticalSkewing:r,verticalScaling:o,horizontalMoving:s,verticalMoving:a}=t;return i.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(r,", ").concat(o,", ").concat(s,", ").concat(a,")"),!0}i.style.transform="";l.disableScreenReader&&r.setAttribute("aria-hidden",!0),s&&(r.style.left="".concat(a.computedPhysical.x,"px"),r.style.top="".concat(a.computedPhysical.y,"px"),r.setAttribute("width",a.computedPhysical.width),r.setAttribute("height",a.computedPhysical.height)),h.clear(),d.clear(),u.children.length=0;const f=c.getScene(e),p=!o||!f.equals(o),g=s||p;return g&&(c.clear(),n.render(f.children,i)),s=!1,o=f,g},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!i)return c;o=null;const e=i.cloneNode(!1);return r.replaceChild(e,i),i=e,c},c.destroy=()=>{r&&r.parentNode&&r.parentNode.removeChild(r),r=null,i=null},c.size=e=>{if(e){const t=tf(e);JSON.stringify(a)!==JSON.stringify(t)&&(s=!0,a=t)}return a},c}var jf,zf,Ff,Hf,Bf,Vf,$f,Wf={},Uf=[],Yf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Kf(e,t){for(var n in t)e[n]=t[n];return e}function Xf(e){var t=e.parentNode;t&&t.removeChild(e)}function Gf(e,t,n){var r,i,o,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?jf.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Jf(e,s,r,i,null)}function Jf(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++Ff:i};return null==i&&null!=zf.vnode&&zf.vnode(o),o}function Zf(e){return e.children}function Qf(e,t){this.props=e,this.context=t}function ep(e,t){if(null==t)return e.__?ep(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?ep(e):null}function tp(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return tp(e)}}function np(e){(!e.__d&&(e.__d=!0)&&Hf.push(e)&&!rp.__r++||Bf!==zf.debounceRendering)&&((Bf=zf.debounceRendering)||Vf)(rp)}function rp(){var e,t,n,r,i,o,s,a;for(Hf.sort($f);e=Hf.shift();)e.__d&&(t=Hf.length,r=void 0,i=void 0,s=(o=(n=e).__v).__e,(a=n.__P)&&(r=[],(i=Kf({},o)).__v=o.__v+1,hp(a,o,i,n.__n,void 0!==a.ownerSVGElement,null!=o.__h?[s]:null,r,null==s?ep(o):s,o.__h),fp(r,o),o.__e!=s&&tp(o)),Hf.length>t&&Hf.sort($f));rp.__r=0}function ip(e,t,n,r,i,o,s,a,l,c){var u,d,h,f,p,g,m,y=r&&r.__k||Uf,v=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(f=n.__k[u]=null==(f=t[u])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?Jf(null,f,null,null,f):Array.isArray(f)?Jf(Zf,{children:f},null,null,null):f.__b>0?Jf(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=n,f.__b=n.__b+1,null===(h=y[u])||h&&f.key==h.key&&f.type===h.type)y[u]=void 0;else for(d=0;d<v;d++){if((h=y[d])&&f.key==h.key&&f.type===h.type){y[d]=void 0;break}h=null}hp(e,f,h=h||Wf,i,o,s,a,l,c),p=f.__e,(d=f.ref)&&h.ref!=d&&(m||(m=[]),h.ref&&m.push(h.ref,null,f),m.push(d,f.__c||p,f)),null!=p?(null==g&&(g=p),"function"==typeof f.type&&f.__k===h.__k?f.__d=l=op(f,l,e):l=sp(e,f,h,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&h.__e==l&&l.parentNode!=e&&(l=ep(h))}for(n.__e=g,u=v;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=ap(r).nextSibling),mp(y[u],y[u]));if(m)for(u=0;u<m.length;u++)gp(m[u],m[++u],m[++u])}function op(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?op(r,t,n):sp(n,r,r,i,r.__e,t));return t}function sp(e,t,n,r,i,o){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<r.length;l+=1)if(a==i)break e;e.insertBefore(i,o),s=o}return void 0!==s?s:i.nextSibling}function ap(e){var t,n,r;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=ap(n)))return r;return null}function lp(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Yf.test(t)?n:n+"px"}function cp(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||lp(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||lp(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?dp:up,o):e.removeEventListener(t,o?dp:up,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function up(e){return this.l[e.type+!1](zf.event?zf.event(e):e)}function dp(e){return this.l[e.type+!0](zf.event?zf.event(e):e)}function hp(e,t,n,r,i,o,s,a,l){var c,u,d,h,f,p,g,m,y,v,b,x,w,M,k,_=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(c=zf.__b)&&c(t);try{e:if("function"==typeof _){if(m=t.props,y=(c=_.contextType)&&r[c.__c],v=c?y?y.props.value:c.__:r,n.__c?g=(u=t.__c=n.__c).__=u.__E:("prototype"in _&&_.prototype.render?t.__c=u=new _(m,v):(t.__c=u=new Qf(m,v),u.constructor=_,u.render=yp),y&&y.sub(u),u.props=m,u.state||(u.state={}),u.context=v,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=_.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=Kf({},u.__s)),Kf(u.__s,_.getDerivedStateFromProps(m,u.__s))),h=u.props,f=u.state,u.__v=t,d)null==_.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==_.getDerivedStateFromProps&&m!==h&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(m,v),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(m,u.__s,v)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=m,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<u._sb.length;b++)u.__h.push(u._sb[b]);u._sb=[],u.__h.length&&s.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(m,u.__s,v),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(h,f,p)}))}if(u.context=v,u.props=m,u.__P=e,x=zf.__r,w=0,"prototype"in _&&_.prototype.render){for(u.state=u.__s,u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),M=0;M<u._sb.length;M++)u.__h.push(u._sb[M]);u._sb=[]}else do{u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(r=Kf(Kf({},r),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(p=u.getSnapshotBeforeUpdate(h,f)),k=null!=c&&c.type===Zf&&null==c.key?c.props.children:c,ip(e,Array.isArray(k)?k:[k],t,n,r,i,o,s,a,l),u.base=t.__e,t.__h=null,u.__h.length&&s.push(u),g&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=pp(n.__e,t,n,r,i,o,s,l);(c=zf.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),zf.__e(e,t,n)}}function fp(e,t){zf.__c&&zf.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){zf.__e(e,t.__v)}}))}function pp(e,t,n,r,i,o,s,a){var l,c,u,d=n.props,h=t.props,f=t.type,p=0;if("svg"===f&&(i=!0),null!=o)for(;p<o.length;p++)if((l=o[p])&&"setAttribute"in l==!!f&&(f?l.localName===f:3===l.nodeType)){e=l,o[p]=null;break}if(null==e){if(null===f)return document.createTextNode(h);e=i?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,h.is&&h),o=null,a=!1}if(null===f)d===h||a&&e.data===h||(e.data=h);else{if(o=o&&jf.call(e.childNodes),c=(d=n.props||Wf).dangerouslySetInnerHTML,u=h.dangerouslySetInnerHTML,!a){if(null!=o)for(d={},p=0;p<e.attributes.length;p++)d[e.attributes[p].name]=e.attributes[p].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||cp(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||cp(e,o,t[o],n[o],r)}(e,h,d,i,a),u)t.__k=[];else if(p=t.props.children,ip(e,Array.isArray(p)?p:[p],t,n,r,i&&"foreignObject"!==f,o,s,o?o[0]:n.__k&&ep(n,0),a),null!=o)for(p=o.length;p--;)null!=o[p]&&Xf(o[p]);a||("value"in h&&void 0!==(p=h.value)&&(p!==e.value||"progress"===f&&!p||"option"===f&&p!==d.value)&&cp(e,"value",p,d.value,!1),"checked"in h&&void 0!==(p=h.checked)&&p!==e.checked&&cp(e,"checked",p,d.checked,!1))}return e}function gp(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){zf.__e(e,n)}}function mp(e,t,n){var r,i;if(zf.unmount&&zf.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||gp(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){zf.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&mp(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||Xf(e.__e),e.__=e.__e=e.__d=void 0}function yp(e,t,n){return this.constructor(e,n)}function vp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createElement:t=document.createElement.bind(document)}=e;let n,r,i=tf();const o={transform:void 0,disableScreenReader:!1},s=nf();return s.element=()=>n,s.root=()=>n,s.settings=e=>(e&&Object.keys(o).forEach((t=>{void 0!==e[t]&&(o[t]=e[t])})),o),s.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),s.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const{horizontalScaling:e,horizontalSkewing:r,verticalSkewing:i,verticalScaling:o,horizontalMoving:s,verticalMoving:a}=t;return n.style.transform="matrix(".concat(e,", ").concat(r,", ").concat(i,", ").concat(o,", ").concat(s,", ").concat(a,")"),!0}n.style.transform="";let s;return o.disableScreenReader&&n.setAttribute("aria-hidden",!0),n.style.left="".concat(i.computedPhysical.x,"px"),n.style.top="".concat(i.computedPhysical.y,"px"),n.style.width="".concat(i.computedPhysical.width,"px"),n.style.height="".concat(i.computedPhysical.height,"px"),s=Array.isArray(e)?Gf("div",null,e):e,r=function(e,t,n){var r,i,o;zf.__&&zf.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],hp(t,e=(!r&&n||t).__k=Gf(Zf,null,[e]),i||Wf,Wf,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?jf.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),fp(o,e)}(s,n,r),!0},s.renderArgs=[Gf],s.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;r=null}return s},s.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,r=null},s.size=e=>(e&&(i=tf(e)),i),s}jf=Uf.slice,zf={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},Ff=0,Qf.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Kf({},this.state),"function"==typeof e&&(e=e(Kf({},n),this.props)),e&&Kf(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),np(this))},Qf.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),np(this))},Qf.prototype.render=Zf,Hf=[],Vf="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,$f=function(e,t){return e.__v.__b-t.__v.__b},rp.__r=0;var bp=[function(e){e.renderer("svg",Lf)},function(e){e.renderer("canvas",pf)},function(e){e.renderer("dom",vp)}];const xp={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const wp=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(){let{level:e=xp.OFF,pipe:t=console}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e;const r={[xp.OFF]:()=>{},[xp.ERROR]:function(){return t.error(...arguments)},[xp.WARN]:function(){return t.warn(...arguments)},[xp.INFO]:function(){return t.info(...arguments)},[xp.DEBUG]:function(){return t.log(...arguments)}},i=function(e){if(e&&!(n<e)){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];(r[e]||r[xp.DEBUG])(...i)}};return{log:i,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(xp.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(xp.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(xp.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(xp.DEBUG,...t)},level:e=>("number"==typeof e&&(n=e),n),LOG_LEVEL:xp}}(t.logger),i={component:Oe(n.component,"component",r),data:Oe(n.data,"data",r),formatter:Oe(n.formatter,"formatter",r),interaction:Oe(n.interaction,"interaction",r),renderer:ka(n.renderer),scale:Oe(n.scale,"scale",r),symbol:Oe(n.symbol,"symbol",r),logger:r};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:y({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},i)}return t.renderer&&t.renderer.prio&&i.renderer.default(t.renderer.prio[0]),o.use=function(e){return function(e){e(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i)},o.chart=e=>Ma(e,{registries:i,logger:r,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(i).forEach((e=>{o[e]=i[e]})),o.version=v,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:_a,data:Ca,formatter:or,interaction:Aa,renderer:ka(),scale:so,symbol:fs});function Mp(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kp(Object(n),!0).forEach((function(t){Mp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}jd.forEach(wp.use),bp.forEach(wp.use),[].forEach(wp.use);var Sp=Object.prototype.hasOwnProperty,qp=Object.prototype.toString,Dp=Object.defineProperty,Ep=Object.getOwnPropertyDescriptor,Cp=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===qp.call(e)},Ap=function(e){if(!e||"[object Object]"!==qp.call(e))return!1;var t,n=Sp.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Sp.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Sp.call(e,t)},Tp=function(e,t){Dp&&"__proto__"===t.name?Dp(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Np=function(e,t){if("__proto__"===t){if(!Sp.call(e,t))return;if(Ep)return Ep(e,t).value}return e[t]},Rp=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=Np(a,n),a!==(i=Np(t,n))&&(u&&i&&(Ap(i)||(o=Cp(i)))?(o?(o=!1,s=r&&Cp(r)?r:[]):s=r&&Ap(r)?r:{},Tp(a,{name:n,newValue:e(u,s,i)})):void 0!==i&&Tp(a,{name:n,newValue:i}));return a};function Op(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=i.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),a=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(r)&&r.some(((e,t)=>e!==t))){const e=r.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function Ip(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function Pp(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:s,row:a,sourceKey:l,target:c,targetProp:u,columnOrder:d}=e,h=r;if(i.field&&i.field!==n){const e=Op(i.field,o,{cache:t},d);if(-1===e)return;h=Rp({qRow:s},e(a))}c[u]=Ip(i,h,{key:l})}function Lp(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const s=t.raw(),a=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),d=Object.keys(c),h=!!i[e].trackBy,f=typeof i[e].trackBy,p={},g=[],m=[];for(let t=0;t<s.qDataPages.length;t++){const o=Op(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let y=0;y<s.qDataPages[t].qMatrix.length;y++){const v=s.qDataPages[t].qArea.qTop+y,b=Rp({qRow:v},o(s.qDataPages[t].qMatrix[y])),x=Ip(u,b,{key:a});if(!(u.filter&&!u.filter(b))){for(let e=0;e<d.length;e++){const r=c[d[e]];let i=r.fields||[r];r.fields&&(x[d[e]]=[]);for(let o=0;o<i.length;o++)Pp({cache:n,f:l,mainCell:b,p:i[o],prop:d[e],page:s.qDataPages[t],rowIdx:v,row:s.qDataPages[t].qMatrix[y],sourceKey:a,target:r.fields?x[d[e]]:x,targetProp:r.fields?o:d[e],columnOrder:s.qColumnOrder});if(r.fields){const t=x[d[e]].map((e=>e.value)),n=x[d[e]].map((e=>e.label));x[d[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[d[e]].value)}}}h&&r.track({cfg:i[e],itemData:b,obj:x,target:g,tracker:p,trackType:f}),m.push(x)}}}const y=h?r.collect(g,{main:u,propsArr:d,props:c}):m;o=[...o,...y]}return o}function jp(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function zp(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Hp)):void 0===t&&(t=Fp);for(var n,r,i,o,s,a=new $p(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new $p(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(Vp)}function Fp(e){return e.children}function Hp(e){return Array.isArray(e)?e[1]:null}function Bp(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Vp(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function $p(e){this.data=e,this.depth=this.height=0,this.parent=null}function Wp(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}$p.prototype=zp.prototype={constructor:$p,count:function(){return this.eachAfter(jp)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;e=n.pop(),t=r.pop();for(;e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return zp(this).eachBefore(Bp)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var Up={depth:-1},Yp={},Kp={};function Xp(e){return e.id}function Gp(e){return e.parentId}function Jp(){var e,t=Xp,n=Gp;function r(r){var i,o,s,a,l,c,u,d,h=Array.from(r),f=t,p=n,g=new Map;if(null!=e){const t=h.map(((t,n)=>function(e){e=`${e}`;let t=e.length;Qp(e,t-1)&&!Qp(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,r)))),n=t.map(Zp),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(Zp(e)),h.push(Kp));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,i=h.length;s<i;++s)o=h[s],c=h[s]=new $p(o),null!=(u=f(o,s,r))&&(u+="")&&(d=c.id=u,g.set(d,g.has(d)?Yp:c)),null!=(u=p(o,s,r))&&(u+="")&&(c.parent=u);for(s=0;s<i;++s)if(u=(c=h[s]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===Yp)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===Kp&&1===a.children.length;)a=a.children[0],--i;for(let e=h.length-1;e>=0&&(c=h[e]).data===Kp;--e)c.data=null}if(a.parent=Up,a.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(Vp),a.parent=null,i>0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=Wp(e),r):t},r.parentId=function(e){return arguments.length?(n=Wp(e),r):n},r.path=function(t){return arguments.length?(e=Wp(t),r):e},r}function Zp(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Qp(e,t););return e.slice(0,t)}function Qp(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function eg(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=eg(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=eg(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function tg(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...tg(e[i].children,t-1,n)]);return r}function ng(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>tg(e.children,r-1,n)}return!1}const rg=/^qDimensionInfo(?:\/(\d+))?/,ig=/^\/?qMeasureInfo\/(\d+)/,og=/\/qAttrExprInfo\/(\d+)/,sg=/\/qAttrDimInfo\/(\d+)/;function ag(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function lg(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,d=r;const h=n.qEffectiveInterColumnSortOrder,f=ag(n);return rg.test(d)&&(i=!0,o=+rg.exec(d)[1],d=r.replace(rg,"")),ig.test(d)&&("K"===n.qMode?c=+ig.exec(d)[1]:h&&-1!==h.indexOf(-1)?(c=+ig.exec(d)[1],u=0):u=+ig.exec(d)[1],d=d.replace(ig,"")),d&&(sg.exec(d)?a=+sg.exec(d)[1]:og.exec(d)&&(s=+og.exec(d)[1])),l=i?"S"===n.qMode?f[o]:h?h.indexOf(o):o:h&&-1!==h.indexOf(-1)?h.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function cg(e,t){let n,r,i=ng(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function ug(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function dg(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const d=l[n];let h,f,p,g,m,y;if("primitive"===d.type?(p=d.value,y=String(d.value)):("function"==typeof d.value&&(h=e=>d.value(e,r)),"function"==typeof d.label&&(f=e=>d.label(e,r)),d.accessor?(g=d.accessor(r),Array.isArray(g)?(m=g.map(d.valueAccessor),d.attrAccessor&&(m=m.map(d.attrAccessor)),h&&(p=m.map(h),h=null),f&&(y=m.map(f),f=null),p=d.reduce?d.reduce(p):p,y=d.reduceLabel?d.reduceLabel(y,p):String(p)):(p=d.attrAccessor?d.attrAccessor(d.valueAccessor(g)):d.valueAccessor(g),y=p)):(p=i,y=i)),a.fields){const e=h?h(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=h?h(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,r):c,label:"function"==typeof a.label?a.label(u,r):u})}}const hg=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=eg(r,e);return o&&o[0]?(t.tree=zp(o[0],n.children||(e=>e[i])),t.tree):null};const fg=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],a=i.fields?i.fields:[i];for(let e=0;e<a.length;e++){const t=a[e];if(t.field!==s){const e=cg(o,lg(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function pg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),s="S"===i.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}(e),r=e.fields(),i=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),s={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var a;const t=n[i[e]],o="".concat(r,"__").concat(null!==(a=t.qElemNumber)&&void 0!==a?a:t.qElemNo);s[o]||(s[o]=_p({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];s[r].qValues.push(t)}}const l=Object.keys(s).map((e=>s[e]));return Jp().id((e=>e.__id)).parentId((e=>e.__parent))(l)}(t):hg(i,n,e);if(!s)return null;const a=s.height,l=[];for(let o=0;o<=a;o++){let s=null;if(o>0)if("S"===i.qMode){let e=ag(i)[o-1];s=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),s=n.fields[e]}const{props:a,main:c}=r.normalizeConfig(_p(_p({},e),{},{field:s?s.key():void 0}),t),u=Object.keys(a);l[o]={propsArr:u,props:a,main:c};const d=s?lg(s,{cube:i}):{fieldDepth:0};fg({propsArr:u,props:a,cube:i,cache:n,itemDepthObject:d,f:s})}const c=s.copy().descendants(),u=s.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,r=l[u[e].depth].main,i=c[e],s=i.data,a=ug(r,s,{key:o});dg({propsArr:t,props:n,item:i,itemData:s,ret:a,sourceKey:o}),u[e].data=a}return s}function gg(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<i.length;s++)if(void 0!==i[s].field){const a=t.raw(),l=t.key();if(!hg(a,n,e))continue;const c="object"==typeof i[s].field?i[s].field:t.field(i[s].field),{props:u,main:d}=r.normalizeConfig(i[s],t),h=Object.keys(u),f=lg(c,{cube:a}),{nodeFn:p,attrFn:g,valueFn:m}=cg({fieldDepth:0},f);fg({propsArr:h,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!i[s].trackBy,v=typeof i[s].trackBy,b={},x=[],w=p(n.tree),M=[];for(let e=0;e<w.length;e++){const t=w[e],n=g?g(m(t)):m(t);if(d.filter&&!d.filter(n))continue;const o=ug(d,n,{key:l});dg({propsArr:h,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[s],itemData:n,obj:o,target:x,tracker:b,trackType:v}),M.push(o)}const k=y?r.collect(x,{main:d,propsArr:h,props:u}):M;o=[...o,...k]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var mg=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){
18
18
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
19
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),x=m>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=t[0]).length%l,d=h.length,v=0;v<d;v++)g+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}}));function mg(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const yg={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},bg=/%\)?$/,vg=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,xg=/^\(oct\)/i,wg=/^\(dec\)/i,kg=/^\(hex\)/i,Mg=/^\(bin\)/i,_g=/^\(rom\)/i,Sg=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,qg=/#|0/g;function Dg(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function Cg(e,t,n){let r;return vg.test(t)?e=Dg(e,Number(/\d{2}/.exec(t)[0]),t,n):xg.test(t)?e=Dg(e,8,t,n):wg.test(t)?e=Dg(e,10,t,n):kg.test(t)?e=Dg(e,16,t,n):Mg.test(t)?e=Dg(e,2,t,n):_g.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<s.length;n++)if(s[n]<=i){r+=a[n],i-=s[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}function Eg(e,t,n){const r=mg(e);return n?r:new RegExp(r||"",t)}function Ag(e,t,n,r){let i,o,s,a,l,c,u,h,d,f=e.pattern;var p,g;r&&(e.abbreviate=!0),p=t,(g=n)&&(g=mg(g)),p&&(p=mg(p)),d=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(g,"[#0]+)?")),s=f.match(d),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(i=s.split(n),o=i.pop(),s=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(Eg(c,"g"),t)),u=n,n=".",u&&(s=s.replace(Eg(u,"g"),n)),h=s.match(/#/g),h=h?h.length:0;const m=f.split(u);let y;m[1]&&(y=m[1].match(qg)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=y?y.length:2,e.percentage=bg.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(Eg(t,null,!0),"|").concat(Eg(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class Tg{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return yg;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new Tg(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Sg.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Sg.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Sg.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Ag(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Ag(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Ag(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=Cg(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let r,i,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(r=t[a-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(h=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number(e.toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=gg(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(a=i.length;a<n;a++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),a=0;a<t;a++)l+="#";e=gg(l,e)}e=e.replace(u.numericRegex,(e=>e===s?u.groupTemp:e===o?u.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function Ng(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return s=i(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=i(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function Rg(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Tg(...t)}(i,e,t,n,r),s=Ng(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,r){return s.clear(),o.format(t,e,n,r)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const Og="D",Ig="T",Pg="TS",Lg="IV",jg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],zg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Fg=["January","February","March","April","May","June","July","August","September","October","November","December"],Hg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Bg(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Vg(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function $g(e,t){let n,r=function(e){const t=e,n=24*Vg(t),r=60*Vg(n),i=60*Vg(r),o=1e3*Vg(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,s=r.m,a=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:s,s:a,f:l,t:u}}class Wg{constructor(e,t,n){const r=e||{};if(r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:jg,qDayNames:zg,qLongMonthNames:Fg,qMonthNames:Hg}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),!t){t={[Ig]:r.qTimeFmt||"hh:mm:ss",[Og]:r.qDateFmt||"YYYY-MM-DD",[Pg]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new Wg(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=$g(e,t));const i=(o=this,s=r,{"Y+|y+":{Y:"".concat(Number("".concat(s.year).slice(-2))),YY:Bg("".concat(s.year).slice(-2),2),YYY:Bg("".concat(s.year).slice(-3),3),def:e=>Bg("".concat(s.year),e.length)},"M+":{M:s.month+1,MM:Bg("".concat(s.month+1),2),MMM:o.locale_months_abbr[s.month],def:o.locale_months[s.month]},"W+|w+":{W:s.day,WW:Bg("".concat(s.day),2),WWW:o.locale_days_abbr[s.day],def:o.locale_days[s.day]},"D+|d+":{D:s.date,def:e=>Bg("".concat(s.date),e.length)},"h+|H+":{h:s.h,def:e=>Bg("".concat(s.h),e.length)},"m+":{m:s.m,def:e=>Bg("".concat(s.m),e.length)},"s+|S+":{s:s.s,def:e=>Bg("".concat(s.s),e.length)},"f+|F+":{def(e){let t="".concat(s.f),n=e.length-t.length;if(n>0)for(let e=0;e<n;e++)t+="0";else n<0&&(t=t.slice(0,e.length));return t}},"t{1,2}|T{1,2}":{def(e){let t=s.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,s;const a=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&a.push(e);const l=new RegExp(a.join("|"),"g"),c=t.replace(l,(e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}));return c}}function Ug(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Wg(...t)}function Yg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Ug(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=Ng(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==Lg?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=Ug(i,e,t),r=Ng(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function Kg(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Yg(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(i,"##"),o="U"),Rg(n,r,i,o,t)}function Xg(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===a?"first":"avg",h=Kg(t,i),d="dimension"===a?"first":(e,t)=>h(t),f={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(f)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:d,formatter:()=>h,tags:()=>t.qTags};return f}function Gg(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const s="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),a={instance:Xg(Np({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},i))};return a.attrDims=Gg("qAttrDimInfo",t,n,s,Np({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=Gg("qAttrExprInfo",t,n,s,Np({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=Gg("qMeasureInfo",t,n,s,Np({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a}))}function Jg(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},i=t;if(!i)throw new Error('Missing "data" input');if(!i.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=Jg.util,s={cache:r,cube:i,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},a={key:()=>e,raw:()=>i,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,s),fields:()=>r.fields.slice(),extract:e=>s.extractor(e,a,r,o),hierarchy:e=>s.hierarchy(e,a,r,o),_cache:()=>r};"K"===i.qMode||"T"===i.qMode||!i.qMode&&i.qNodesOnDim?(s.extractor=pg,s.hierarchy=fg,s.pages="K"===i.qMode?i.qStackedDataPages:i.qTreeDataPages):"S"===i.qMode?(s.extractor=Pp,s.pages=i.qDataPages,s.hierarchy=fg):s.extractor=()=>[],s.fieldExtractor=e=>s.extractor({field:e},a,r,o);const l="S"===i.qMode?e=>e.qElemNumber:void 0,c="S"===i.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...Gg("qDimensionInfo",i,e,"",Np({},s,{value:l,type:"dimension"}))),r.wrappedFields.push(...Gg("qMeasureInfo",i,e,"",Np({},s,{value:c,type:"measure"}))),r.fields=r.wrappedFields.map((e=>e.instance));const u=e=>{e.forEach((e=>{r.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)}))};return u(r.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=a.field(t.from),i=Xg(kp({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>s.extractor({field:e},a,r,o),key:t.key,type:n.type(),localeInfo:s.localeInfo,value:n.value},t.override||{}));r.virtualFields.push(i)})),r.allFields.push(...r.virtualFields),a}const Zg=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Qg=/\/qDimensionInfo(?:\/(\d+))?/,em=/\/qMeasureInfo\/(\d+)/,tm=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,nm=/\/qAttrExprInfo\/(\d+)/,rm=/\/?qHyperCube/,im=/\/?qTreeData/,om=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),sm=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function am(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],s={},a=e.isActive();let l=!1;if(e.brushes().forEach((e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",s=e=>e;rm.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=om):im.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=sm);let a=!0;if(Qg.test(e)&&(r=+Qg.exec(e)[1]),em.test(e)&&(i=+em.exec(e)[1]),tm.test(e)){i=-1,r=0;const e=+tm.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),a=!1}if(nm.test(e)){const e=i;if(t){i=0;const s=Qp(o,t);i+=(s.qMeasureInfo||[]).length,r>-1?(i=s.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=s.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=s.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+nm.exec(n)[1]}else r>-1?(r=-1,i=+nm.exec(n)[1]):i+=+nm.exec(n)[1]+1}return Zg.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,a=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||a>=o)&&o>-1?n.forEach((e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})})):n.forEach((e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!s.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&a)return[{method:"resetMadeSelections",params:[]}];var c;s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o}function lm(e){Jg.util=e.data("matrix").util,e.data("q",Jg),e.formatter("q-number",Rg),e.formatter("q-time",Yg)}lm.qBrushHelper=am,lm.selections=am;const cm={click:"Tap",Click:"Tap",tap:"Tap",pan:"Pan",swipe:"Swipe",rotate:"Rotate",press:"Press",pinch:"Pinch"};function um(e){return cm[e]||e}function hm(e){return function(t,n,r){let i,o,s,a,l=[],c=!0;function u(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&(i.gestures.forEach((t=>{t.options=t.options||{},void 0===t.options.enable&&(t.options.enable=!0),"function"==typeof t.options.enable&&(t.options.enable=t.options.enable.bind(o));const n=um(t.type);e&&e[n]&&(t.options.event=t.options.event||t.type.toLowerCase(),s=s||new e.Manager(r),s.add(new e[n](t.options)),Object.keys(t.events).forEach((e=>{t.events[e]=t.events[e].bind(o),s.on(e,t.events[e])})),l.push(t))})),i.gestures.forEach((t=>{const n=um(t.type);e&&e[n]&&(t.recognizeWith&&s.get(t.options.event).recognizeWith(t.recognizeWith.split(" ").filter((e=>""!==e))),t.requireFailure&&s.get(t.options.event).requireFailure(t.requireFailure.split(" ").filter((e=>""!==e))))})))}function h(){l.forEach((e=>{Object.keys(e.events).forEach((t=>{s.off(t,e.events[t])})),s.remove(e.options.event)})),l=[]}return{get key(){return a},set(e){!function(e){a=e.key,i=e,o={chart:t,mediator:n,settings:i},i.gestures=i.gestures||[],void 0===i.enable&&(i.enable=!0)}(e),h(),c&&u()},off(){c=!1,h()},on(){c=!0,0===l.length&&u()},destroy(){h(),s&&s.destroy(),s=null,o=null,i=null}}}}var dm,fm={exports:{}};
19
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,d,h=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=h-m,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=m>0?e.substring(b,h):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0===+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(d=t[0]).length%l,h=d.length,b=0;b<h;b++)g+=d.charAt(b),!((b-y+1)%l)&&b<h-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}}));function yg(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const vg={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},bg=/%\)?$/,xg=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,wg=/^\(oct\)/i,Mg=/^\(dec\)/i,kg=/^\(hex\)/i,_g=/^\(bin\)/i,Sg=/^\(rom\)/i,qg=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Dg=/#|0/g;function Eg(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function Cg(e,t,n){let r;return xg.test(t)?e=Eg(e,Number(/\d{2}/.exec(t)[0]),t,n):wg.test(t)?e=Eg(e,8,t,n):Mg.test(t)?e=Eg(e,10,t,n):kg.test(t)?e=Eg(e,16,t,n):_g.test(t)?e=Eg(e,2,t,n):Sg.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<s.length;n++)if(s[n]<=i){r+=a[n],i-=s[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}function Ag(e,t,n){const r=yg(e);return n?r:new RegExp(r||"",t)}function Tg(e,t,n,r){let i,o,s,a,l,c,u,d,h,f=e.pattern;var p,g;r&&(e.abbreviate=!0),p=t,(g=n)&&(g=yg(g)),p&&(p=yg(p)),h=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(g,"[#0]+)?")),s=f.match(h),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(i=s.split(n),o=i.pop(),s=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(Ag(c,"g"),t)),u=n,n=".",u&&(s=s.replace(Ag(u,"g"),n)),d=s.match(/#/g),d=d?d.length:0;const m=f.split(u);let y;m[1]&&(y=m[1].match(Dg)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=y?y.length:2,e.percentage=bg.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(Ag(t,null,!0),"|").concat(Ag(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class Ng{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return vg;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new Ng(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],qg.test(e[0])&&(r.positive.isFunctional=!0),e[1]?qg.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?qg.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Tg(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Tg(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Tg(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,s,a,l,c,u=this._prepared,d="",h="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=Cg(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let r,i,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(r=t[a-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=mg(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(a=i.length;a<n;a++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),h=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),a=0;a<t;a++)l+="#";e=mg(l,e)}e=e.replace(u.numericRegex,(e=>e===s?u.groupTemp:e===o?u.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+h+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function Rg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return s=i(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=i(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function Og(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ng(...t)}(i,e,t,n,r),s=Rg(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,r){return s.clear(),o.format(t,e,n,r)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const Ig="D",Pg="T",Lg="TS",jg="IV",zg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Fg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Hg=["January","February","March","April","May","June","July","August","September","October","November","December"],Bg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Vg(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function $g(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Wg(e,t){let n,r=function(e){const t=e,n=24*$g(t),r=60*$g(n),i=60*$g(r),o=1e3*$g(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,s=r.m,a=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:s,s:a,f:l,t:u}}class Ug{constructor(e,t,n){const r=e||{};if(r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:zg,qDayNames:Fg,qLongMonthNames:Hg,qMonthNames:Bg}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),!t){t={[Pg]:r.qTimeFmt||"hh:mm:ss",[Ig]:r.qDateFmt||"YYYY-MM-DD",[Lg]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new Ug(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=Wg(e,t));const i=(o=this,s=r,{"Y+|y+":{Y:"".concat(Number("".concat(s.year).slice(-2))),YY:Vg("".concat(s.year).slice(-2),2),YYY:Vg("".concat(s.year).slice(-3),3),def:e=>Vg("".concat(s.year),e.length)},"M+":{M:s.month+1,MM:Vg("".concat(s.month+1),2),MMM:o.locale_months_abbr[s.month],def:o.locale_months[s.month]},"W+|w+":{W:s.day,WW:Vg("".concat(s.day),2),WWW:o.locale_days_abbr[s.day],def:o.locale_days[s.day]},"D+|d+":{D:s.date,def:e=>Vg("".concat(s.date),e.length)},"h+|H+":{h:s.h,def:e=>Vg("".concat(s.h),e.length)},"m+":{m:s.m,def:e=>Vg("".concat(s.m),e.length)},"s+|S+":{s:s.s,def:e=>Vg("".concat(s.s),e.length)},"f+|F+":{def(e){let t="".concat(s.f),n=e.length-t.length;if(n>0)for(let e=0;e<n;e++)t+="0";else n<0&&(t=t.slice(0,e.length));return t}},"t{1,2}|T{1,2}":{def(e){let t=s.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,s;const a=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&a.push(e);const l=new RegExp(a.join("|"),"g"),c=t.replace(l,(e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}));return c}}function Yg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ug(...t)}function Kg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Yg(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=Rg(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==jg?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=Yg(i,e,t),r=Rg(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function Xg(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Kg(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(i,"##"),o="U"),Og(n,r,i,o,t)}function Gg(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===a?"first":"avg",d=Xg(t,i),h="dimension"===a?"first":(e,t)=>d(t),f={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(f)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:h,formatter:()=>d,tags:()=>t.qTags};return f}function Jg(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const s="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),a={instance:Gg(Rp({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},i))};return a.attrDims=Jg("qAttrDimInfo",t,n,s,Rp({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=Jg("qAttrExprInfo",t,n,s,Rp({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=Jg("qMeasureInfo",t,n,s,Rp({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a}))}function Zg(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},i=t;if(!i)throw new Error('Missing "data" input');if(!i.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=Zg.util,s={cache:r,cube:i,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},a={key:()=>e,raw:()=>i,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,s),fields:()=>r.fields.slice(),extract:e=>s.extractor(e,a,r,o),hierarchy:e=>s.hierarchy(e,a,r,o),_cache:()=>r};"K"===i.qMode||"T"===i.qMode||!i.qMode&&i.qNodesOnDim?(s.extractor=gg,s.hierarchy=pg,s.pages="K"===i.qMode?i.qStackedDataPages:i.qTreeDataPages):"S"===i.qMode?(s.extractor=Lp,s.pages=i.qDataPages,s.hierarchy=pg):s.extractor=()=>[],s.fieldExtractor=e=>s.extractor({field:e},a,r,o);const l="S"===i.qMode?e=>e.qElemNumber:void 0,c="S"===i.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...Jg("qDimensionInfo",i,e,"",Rp({},s,{value:l,type:"dimension"}))),r.wrappedFields.push(...Jg("qMeasureInfo",i,e,"",Rp({},s,{value:c,type:"measure"}))),r.fields=r.wrappedFields.map((e=>e.instance));const u=e=>{e.forEach((e=>{r.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)}))};return u(r.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=a.field(t.from),i=Gg(_p({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>s.extractor({field:e},a,r,o),key:t.key,type:n.type(),localeInfo:s.localeInfo,value:n.value},t.override||{}));r.virtualFields.push(i)})),r.allFields.push(...r.virtualFields),a}const Qg=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],em=/\/qDimensionInfo(?:\/(\d+))?/,tm=/\/qMeasureInfo\/(\d+)/,nm=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,rm=/\/qAttrExprInfo\/(\d+)/,im=/\/?qHyperCube/,om=/\/?qTreeData/,sm=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),am=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function lm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],s={},a=e.isActive();let l=!1;if(e.brushes().forEach((e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",s=e=>e;im.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=sm):om.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=am);let a=!0;if(em.test(e)&&(r=+em.exec(e)[1]),tm.test(e)&&(i=+tm.exec(e)[1]),nm.test(e)){i=-1,r=0;const e=+nm.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),a=!1}if(rm.test(e)){const e=i;if(t){i=0;const s=eg(o,t);i+=(s.qMeasureInfo||[]).length,r>-1?(i=s.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=s.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=s.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+rm.exec(n)[1]}else r>-1?(r=-1,i=+rm.exec(n)[1]):i+=+rm.exec(n)[1]+1}return Qg.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,a=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||a>=o)&&o>-1?n.forEach((e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})})):n.forEach((e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!s.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&a)return[{method:"resetMadeSelections",params:[]}];var c;s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o}function cm(e){Zg.util=e.data("matrix").util,e.data("q",Zg),e.formatter("q-number",Og),e.formatter("q-time",Kg)}cm.qBrushHelper=lm,cm.selections=lm;const um={click:"Tap",Click:"Tap",tap:"Tap",pan:"Pan",swipe:"Swipe",rotate:"Rotate",press:"Press",pinch:"Pinch"};function dm(e){return um[e]||e}function hm(e){return function(t,n,r){let i,o,s,a,l=[],c=!0;function u(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&(i.gestures.forEach((t=>{t.options=t.options||{},void 0===t.options.enable&&(t.options.enable=!0),"function"==typeof t.options.enable&&(t.options.enable=t.options.enable.bind(o));const n=dm(t.type);e&&e[n]&&(t.options.event=t.options.event||t.type.toLowerCase(),s=s||new e.Manager(r),s.add(new e[n](t.options)),Object.keys(t.events).forEach((e=>{t.events[e]=t.events[e].bind(o),s.on(e,t.events[e])})),l.push(t))})),i.gestures.forEach((t=>{const n=dm(t.type);e&&e[n]&&(t.recognizeWith&&s.get(t.options.event).recognizeWith(t.recognizeWith.split(" ").filter((e=>""!==e))),t.requireFailure&&s.get(t.options.event).requireFailure(t.requireFailure.split(" ").filter((e=>""!==e))))})))}function d(){l.forEach((e=>{Object.keys(e.events).forEach((t=>{s.off(t,e.events[t])})),s.remove(e.options.event)})),l=[]}return{get key(){return a},set(e){!function(e){a=e.key,i=e,o={chart:t,mediator:n,settings:i},i.gestures=i.gestures||[],void 0===i.enable&&(i.enable=!0)}(e),d(),c&&u()},off(){c=!1,d()},on(){c=!0,0===l.length&&u()},destroy(){d(),s&&s.destroy(),s=null,o=null,i=null}}}}var fm,pm={exports:{}};
20
20
  /*! Hammer.JS - v2.0.7 - 2016-04-22
21
21
  * http://hammerjs.github.io/
22
22
  *
23
23
  * Copyright (c) 2016 Jorik Tangelder;
24
- * Licensed under the MIT license */var pm=(dm||(dm=1,function(e){!function(t,n,r,i){var o,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l=Math.round,c=Math.abs,u=Date.now;function h(e,t,n){return setTimeout(b(e,n),t)}function d(e,t,n){return!!Array.isArray(e)&&(f(e,n[t],n),!0)}function f(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function p(e,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var g=p((function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&e[r[o]]===i)&&(e[r[o]]=t[r[o]]),o++;return e}),"extend","Use `assign`."),m=p((function(e,t){return g(e,t,!0)}),"merge","Use `assign`.");function y(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function b(e,t){return function(){return e.apply(t,arguments)}}function v(e,t){return"function"==typeof e?e.apply(t&&t[0]||i,t):e}function x(e,t){return e===i?t:e}function w(e,t,n){f(S(t),(function(t){e.addEventListener(t,n,!1)}))}function k(e,t,n){f(S(t),(function(t){e.removeEventListener(t,n,!1)}))}function M(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function _(e,t){return e.indexOf(t)>-1}function S(e){return e.trim().split(/\s+/g)}function q(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function D(e){return Array.prototype.slice.call(e,0)}function C(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var s=e[o][t];q(i,s)<0&&r.push(e[o]),i[o]=s,o++}return r=r.sort((function(e,n){return e[t]>n[t]})),r}function E(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),a=0;a<s.length;){if((r=(n=s[a])?n+o:t)in e)return r;a++}return i}var A=1;function T(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var N="ontouchstart"in t,R=E(t,"PointerEvent")!==i,O=N&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),I="touch",P="mouse",L=24,j=["x","y"],z=["clientX","clientY"];function F(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){v(e.options.enable,[e])&&n.handler(t)},this.init()}function H(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,s=1&t&&r-o==0,a=12&t&&r-o==0;n.isFirst=!!s,n.isFinal=!!a,s&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=B(t)),o>1&&!n.firstMultiple?n.firstMultiple=B(t):1===o&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,h=t.center=V(r);t.timeStamp=u(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=Y(l,h),t.distance=U(l,h),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=W(t.deltaX,t.deltaY);var d=$(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=c(d.x)>c(d.y)?d.x:d.y,t.scale=a?function(e,t){return U(t[0],t[1],z)/U(e[0],e[1],z)}(a.pointers,r):1,t.rotation=a?function(e,t){return Y(t[1],t[0],z)+Y(e[1],e[0],z)}(a.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(l>25||a.velocity===i)){var u=t.deltaX-a.deltaX,h=t.deltaY-a.deltaY,d=$(l,u,h);r=d.x,o=d.y,n=c(d.x)>c(d.y)?d.x:d.y,s=W(u,h),e.lastInterval=t}else n=a.velocity,r=a.velocityX,o=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=s}(n,t);var f=e.element;M(t.srcEvent.target,f)&&(f=t.srcEvent.target),t.target=f}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function B(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:l(e.pointers[n].clientX),clientY:l(e.pointers[n].clientY)},n++;return{timeStamp:u(),pointers:t,center:V(t),deltaX:e.deltaX,deltaY:e.deltaY}}function V(e){var t=e.length;if(1===t)return{x:l(e[0].clientX),y:l(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:l(n/t),y:l(r/t)}}function $(e,t,n){return{x:t/e||0,y:n/e||0}}function W(e,t){return e===t?1:c(e)>=c(t)?e<0?2:4:t<0?8:16}function U(e,t,n){n||(n=j);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function Y(e,t,n){n||(n=j);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}F.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(T(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(T(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4},X="mousedown",G="mousemove mouseup";function J(){this.evEl=X,this.evWin=G,this.pressed=!1,F.apply(this,arguments)}y(J,F,{handler:function(e){var t=K[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:P,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:I,3:"pen",4:P,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,F.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),y(ne,F,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Z[r],o=Q[e.pointerType]||e.pointerType,s=o==I,a=q(t,e.pointerId,"pointerId");1&i&&(0===e.button||s)?a<0&&(t.push(e),a=t.length-1):12&i&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(a,1))}});var re={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ie(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,F.apply(this,arguments)}function oe(e,t){var n=D(e.touches),r=D(e.changedTouches);return 12&t&&(n=C(n.concat(r),"identifier")),[n,r]}y(ie,F,{handler:function(e){var t=re[e.type];if(1===t&&(this.started=!0),this.started){var n=oe.call(this,e,t);12&t&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}}});var se={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ae="touchstart touchmove touchend touchcancel";function le(){this.evTarget=ae,this.targetIds={},F.apply(this,arguments)}function ce(e,t){var n=D(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,s=D(e.changedTouches),a=[],l=this.target;if(o=n.filter((function(e){return M(e.target,l)})),1===t)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<s.length;)r[s[i].identifier]&&a.push(s[i]),12&t&&delete r[s[i].identifier],i++;return a.length?[C(o.concat(a),"identifier"),a]:void 0}function ue(){F.apply(this,arguments);var e=b(this.handler,this);this.touch=new le(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function he(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,de.call(this,t)):12&e&&de.call(this,t)}function de(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),2500)}}function fe(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),s=Math.abs(n-i.y);if(o<=25&&s<=25)return!0}return!1}y(le,F,{handler:function(e){var t=se[e.type],n=ce.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}}),y(ue,F,{handler:function(e,t,n){var r=n.pointerType==I,i=n.pointerType==P;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)he.call(this,t,n);else if(i&&fe.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var pe=E(a.style,"touchAction"),ge=pe!==i,me="compute",ye="auto",be="manipulation",ve="none",xe="pan-x",we="pan-y",ke=function(){if(!ge)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(r){e[r]=!n||t.CSS.supports("touch-action",r)})),e}();function Me(e,t){this.manager=e,this.set(t)}Me.prototype={set:function(e){e==me&&(e=this.compute()),ge&&this.manager.element.style&&ke[e]&&(this.manager.element.style[pe]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return f(this.manager.recognizers,(function(t){v(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(_(e,ve))return ve;var t=_(e,xe),n=_(e,we);return t&&n?ve:t||n?t?xe:we:_(e,be)?be:ye}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=_(r,ve)&&!ke[ve],o=_(r,we)&&!ke[we],s=_(r,xe)&&!ke[xe];if(i){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}if(!s||!o)return i||o&&6&n||s&&n&L?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var _e=32;function Se(e){this.options=o({},this.defaults,e||{}),this.id=A++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function qe(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function De(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Ce(e,t){var n=t.manager;return n?n.get(e):e}function Ee(){Se.apply(this,arguments)}function Ae(){Ee.apply(this,arguments),this.pX=null,this.pY=null}function Te(){Ee.apply(this,arguments)}function Ne(){Se.apply(this,arguments),this._timer=null,this._input=null}function Re(){Ee.apply(this,arguments)}function Oe(){Ee.apply(this,arguments)}function Ie(){Se.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Pe(e,t){return(t=t||{}).recognizers=x(t.recognizers,Pe.defaults.preset),new Le(e,t)}function Le(e,t){var n;this.options=o({},Pe.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(R?ne:O?le:N?ue:J))(n,H),this.touchAction=new Me(this,this.options.touchAction),je(this,!0),f(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function je(e,t){var n,r=e.element;r.style&&(f(e.options.cssProps,(function(i,o){n=E(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Se.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(d(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ce(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return d(e,"dropRecognizeWith",this)||(e=Ce(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(d(e,"requireFailure",this))return this;var t=this.requireFail;return-1===q(t,e=Ce(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(d(e,"dropRequireFailure",this))return this;e=Ce(e,this);var t=q(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+qe(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+qe(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=_e},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!v(this.options.enable,[this,t]))return this.reset(),void(this.state=_e);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},y(Ee,Se,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(8&n||!i)?16|t:r||i?4&n?8|t:2&t?4|t:2:_e}}),y(Ae,Ee,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(we),e&L&&t.push(xe),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,s=e.deltaY;return i&t.direction||(6&t.direction?(i=0===o?1:o<0?2:4,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===s?1:s<0?8:16,n=s!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return Ee.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=De(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),y(Te,Ee,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ve]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),y(Ne,Se,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ye]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=h((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return _e},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}}),y(Re,Ee,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ve]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),y(Oe,Ee,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ae.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&L&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=De(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),y(Ie,Se,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[be]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||U(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,s&&o?this.count+=1:this.count=1,this._input=e,0==this.count%t.taps)return this.hasRequireFailures()?(this._timer=h((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return _e},failTimeout:function(){return this._timer=h((function(){this.state=_e}),this.options.interval,this),_e},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Pe.VERSION="2.0.7",Pe.defaults={domEvents:!1,touchAction:me,enable:!0,inputTarget:null,inputClass:null,preset:[[Re,{enable:!1}],[Te,{enable:!1},["rotate"]],[Oe,{direction:6}],[Ae,{direction:6},["swipe"]],[Ie],[Ie,{event:"doubletap",taps:2},["tap"]],[Ne]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Le.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof Se)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(d(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(d(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=q(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==i&&t!==i){var n=this.handlers;return f(S(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==i){var n=this.handlers;return f(S(e),(function(e){t?n[e]&&n[e].splice(q(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var r=n.createEvent("Event");r.initEvent(e,!0,!0),r.gesture=t,t.target.dispatchEvent(r)}(e,t);var r=this.handlers[e]&&this.handlers[e].slice();if(r&&r.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<r.length;)r[i](t),i++}},destroy:function(){this.element&&je(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(Pe,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:_e,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:L,DIRECTION_ALL:30,Manager:Le,Input:F,TouchAction:Me,TouchInput:le,MouseInput:J,PointerEventInput:ne,TouchMouseInput:ue,SingleTouchInput:ie,Recognizer:Se,AttrRecognizer:Ee,Tap:Ie,Pan:Ae,Swipe:Oe,Pinch:Te,Rotate:Re,Press:Ne,on:w,off:k,each:f,merge:m,extend:g,assign:o,inherit:y,bindFn:b,prefixed:E}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=Pe,e.exports?e.exports=Pe:t.Hammer=Pe}(window,document)}(fm)),fm.exports),gm=n(pm);function mm(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var ym={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),s="center"===r?t:`* ${t}`,a="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:i},e("span",{ref:this.alignToRef,style:a,title:s},s))}};function bm(e){const t=xp();return t.renderer.prio([e||"canvas"]),t.use(lm),t.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",hm(e))};e.interaction("hammer",hm(Hammer))}(gm)),t.use(mm),t.component("disclaimer",ym),t}const vm={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};var xm,wm={exports:{}};var km=(xm||(xm=1,function(e){self,e.exports=(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},s=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(h,n),h!==(i=l(t,n))&&(p&&i&&(s(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},a(h,{name:n,newValue:e(p,u,i)})):void 0!==i&&a(h,{name:n,newValue:i}));return h}},645:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},s=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(h,n),h!==(i=l(t,n))&&(p&&i&&(s(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},a(h,{name:n,newValue:e(p,u,i)})):void 0!==i&&a(h,{name:n,newValue:i}));return h}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Te});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],s=e;for(r=0;r<i.length-1;++r)void 0===s[i[r]]&&(s[i[r]]=Number.isNaN(+i[r+1])?{}:[]),s=s[i[r]];if(void 0!==n){var a=s[o];return s[o]=n,{updated:n,previous:a}}return delete s[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},s={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var a="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return a+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var s=r.qDerivedFieldData.qDerivedFieldLists[o],a=0;a<s.qFieldDefs.length;++a){var l=s.qFieldDefs[a];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function g(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function m(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function b(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function v(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,s=void 0===o?"Sum":o,a=e.valueComp,l=void 0===a?"0":a;if(!n.showExcludedValues)return"";if(r&&1===r.length){var c=b(u(r[0],i),p(0));return"".concat(s,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var h=u(r[0],i),d=u(r[1],i),f=p(0),g=p(1),m=b(h,f),y=b(d,g);return"".concat(s,"({1<").concat(m,",").concat(y,">}").concat(l,")")}return"".concat(s,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function w(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const k={isFullRange:h,getNumDimensions:w,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,s=c(f(t));if(!n.showExcludedValues)return s;var a=v({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(s," + ").concat(a).concat(l,")")}if(r&&2===r.length){var h=p(0),d=p(1);return"If(Count(".concat(h,") * Count(").concat(d,") > 0, ").concat(s," + ").concat(a).concat(l,")")}return s},getRowNoComp:d,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:g,getAboveCompSuffix:m,getAboveComp:function(e,t,n,r){return g(e,t)+n+m(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:v,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===w({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",s=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(s,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(s,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(a);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+a.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,s=void 0===o?2:o;if(!t&&!n)return!0;var a=w({properties:t,layout:n});return a>=i&&a<=s},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(a),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find((function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null}));i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=s.OPTIONS.find((function(t){return t.value===e.decomposition}));return t?s.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(s.EXPRESSIONS).find((function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return s.EXPRESSIONS[n]&&r.includes(s.EXPRESSIONS[n].toLowerCase())&&(t=n),n})),t}};function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _(e){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_(e)}var S=t().bind(null,!0),q={},D=Array.isArray;function C(e){return null!=e&&!Array.isArray(e)&&"object"===_(e)}function E(e){return void 0===e}function A(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function T(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach((function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=E(e[n||t])?o:e[t],e=e[n||t]}})),e}function N(e,t){var n=!0;if(C(e)&&C(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){N(e[r],t[r])||(n=!1)})),n);if(D(e)&&D(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!N(e[r],t[r]))return!1;return!0}return e===t}q.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?S({},{val:e}).val:e}(t[i]),s=e[i],a="".concat(n,"/").concat(i);N(o,s)||A(t,i)||(E(s)?r.push({op:"add",path:a,value:o}):C(o)&&C(s)?r=r.concat(q.generate(s,o,a)):D(o)&&D(s)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function s(e,t,n){if(e[n]&&E(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(N(t,i))return r;if(!E(t[0])&&E(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var a=i.length-1;a>=0;a-=1)-1===(o=s(t,i[a].qInfo&&i[a].qInfo.qId,a))?(r.push({op:"remove",path:"".concat(n,"/").concat(a)}),i.splice(a,1)):r=r.concat(q.generate(i[a],t[o],"".concat(n,"/").concat(a)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=s(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(s,o,a)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){E(t[i])&&!A(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},q.apply=function(e,t){t.forEach((function(t){var n,r,i=T(e,t.path),o=t.path.split("/").splice(-1)[0],s=o&&Number.isNaN(+o)?i[o]:i[+o]||i,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,s=e),"add"===t.op||"replace"===t.op)if(D(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(D(s)&&D(t.value)){var l,c=t.value.slice();s.length=0,(l=s).push.apply(l,function(e){if(Array.isArray(e))return M(e)}(r=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(C(s)&&C(t.value))n=s,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!A(n,e)&&delete n[e]})),S(s,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var u=T(e,t.from);D(i)?i.splice(+o,0,u.splice(+a,1)[0]):(i[o]=u[a],delete u[a])}else"remove"===t.op&&(D(i)?i.splice(+o,1):delete i[o])}))},q.clone=function(e){return S({},e)},q.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},q.updateObject=function(e,t){Object.keys(e).length?q.apply(e,q.generate(e,t)):S(e,t)};const R=q,O=function(e,n,r){if(!e)return Promise.resolve();var i=R.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(i,!0)):Promise.resolve()};var I="accumulation";function P(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===I)return n[r]}function L(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===I)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var j={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const z={translationKey:"properties.modifier.accumulation",needDimension:k.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=k.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=k.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=k.getNumStepComp(n,l),d=k.getAboveComp(n,l,u,h),f=k.getRangeComp("RangeSum",d);if(k.needDimension({modifier:n,properties:r,layout:i})){var p=k.getDimComp(c,1),g=k.getDimComp(c,0),m=k.getAggrComp(f,p,g);f=n.showExcludedValues?k.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:m}):m}return f},extractInputExpression:k.extractInputExpression,initModifier:function(e){k.initModifier(e,j)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(L(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(L(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(L(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(L(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=P(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=P(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(L(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(I))return!1;var o=P(t,e);return o&&!o.disabled}};return n}};var F="movingAverage";function H(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===F)return n[r]}function B(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===F)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var V={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const $={translationKey:"properties.modifier.movingAverage",needDimension:k.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,s=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=a;void 0===c&&(c=k.getNumDimensions({properties:i,layout:s}));var u=o(i,"qHyperCubeDef.qDimensions",[]),h=r.showExcludedValues&&r.nullSuppression,d=k.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:h}),f=k.getNumStepComp(r,c),p=k.getAboveComp(r,c,d,f);if(r.nullSuppression)t=k.getRangeComp("RangeAvg",p);else{var g=k.getRangeComp("RangeSum",p),m=function(e,t){var n=k.getRowNoComp(e,t);if(!k.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(g," / ").concat(m)}var y=t;if(k.needDimension({modifier:r,properties:i,layout:s})){var b=k.getDimComp(u,1),v=k.getDimComp(u,0),x=k.getAggrComp(y,b,v);y=r.showExcludedValues?k.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:k.extractInputExpression,initModifier:function(e){k.initModifier(e,V)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(B(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(B(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(B(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(B(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=H(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=H(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(B(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(B(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(F))return!1;var o=H(t,e);return o&&!o.disabled}};return n}};var W="timeSeriesDecomposition";function U(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===W)return n[r]}function Y(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===W)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var K={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const X={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:k.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?k.generateTSDExpression(n,t,r):t},extractInputExpression:k.extractInputExpression,initModifier:function(e,t){k.initModifier(e,K),""===e.decomposition&&t&&(e.decomposition=k.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(Y(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:s.OPTIONS},steps:{refFn:function(t){return"".concat(Y(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=U(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map((function(e){return e.qDef.modifiers.map((function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e})),e}))}},show:function(t){var n=U(t,e);return n&&!n.fullRange}}},show:function(e,t){return k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(W))return!1;var o=U(t,e);return o&&!o.disabled}};return n}};var G="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===G)return n[r]}function Z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===G)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:k.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:k.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=k.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=k.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=k.getAboveComp(n,l,u),d="".concat(u," - ").concat(h);if(k.needDimension({modifier:n,properties:r,layout:i})){var f=k.getDimComp(c,1),p=k.getDimComp(c,0),g=k.getAggrComp(d,f,p);d=n.showExcludedValues?k.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:g}):g}return d},initModifier:function(e){Object.keys(Q).forEach((function(t){void 0===e[t]&&(e[t]=Q[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(Z(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(G))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function se(e){return 2===e?"{1}":""}function ae(e,t,n){return 1===e?"{$<".concat(k.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ce(e,t,n){return 0===e&&t>1?"<".concat(k.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:k.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=k.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=k.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,r,i,o,s){var a=se(t),l=ae(t,n,r),c=""===a&&""===l?"":a||l,u=le(i,o),h=ce(i,o,s),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=k.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(h," Aggr(").concat(c," ").concat(e,", ").concat(d,"))")}(u,h,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach((function(t){void 0===e[t]&&(e[t]=oe[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:se,getFieldSelectionComp:ae,getTotalComp:le,getSelectedDimComp:ce};var he="qDef.base",de="qDef.qDef",fe="qDef.base.qDef",pe="qLibraryId",ge="qDef.base.qLibraryId";const me={getExpression:function(e){var t=o(e,fe);return void 0!==t?t:o(e,de)},getExpressionRef:function(e){return void 0!==o(e,fe)?fe:de},getLibraryIdRef:function(e){return o(e,ge)?ge:pe},getLibraryId:function(e){return o(e,ge)||o(e,pe)},getLabelRef:function(e){return o(e,he)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,he)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",be="qDef.base.qDef",ve="qLibraryId",xe="qDef.base.qLibraryId",we="qDef.qLabel",ke="qDef.qLabelExpression",Me="qDef.base.qLabel",_e="qDef.base.qLabelExpression",Se="qDef.qAggrFunc",qe="qDef.base.qAggrFunc",De={initBase:function(e,t){(t||De.isValid(e))&&(n(e,be,o(e,ye)),n(e,xe,o(e,ve)),n(e,Me,o(e,we)),n(e,_e,o(e,ke)))},restoreBase:function(e){De.isValid(e)&&(n(e,ye,o(e,be)),n(e,ve,o(e,xe)),n(e,we,o(e,Me)),n(e,ke,o(e,_e)),o(e,Se)&&o(e,qe)&&n(e,Se,o(e,qe)),delete e.qDef.base)},isValid:function(e){var t=o(e,be),n=o(e,xe);return void 0!==t||void 0!==n}};const Ce=De;function Ee(e){return Ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ee(e)}var Ae={accumulation:z,movingAverage:$,difference:ee,normalization:ue,timeSeriesDecomposition:X};const Te={modifiers:Ae,apply:Re,applyModifiers:Oe,cleanUpMeasure:Ie,destroy:function(e){e&&Ne[e.id]&&Ne[e.id].masterItemSubscriber&&(Ne[e.id].masterItemSubscriber&&Ne[e.id].masterItemSubscriber.unsubscribe(),delete Ne[e.id])},hasActiveModifiers:Pe,getActiveModifier:Le,initBase:Ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return Ae[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return Ae[e]&&Ae[e].isApplicable({properties:n,layout:r})}))},measureBase:me,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=Fe(e);Ye({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ze({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:je};var Ne={};function Re(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,s=void 0!==i&&i,a=e.masterItem,l=!1;Ne[n.id]=Ne[n.id]||{isFirstTime:!0};var c=Ne[n.id].isFirstTime;if(Ne[n.id].isFirstTime=!1,r&&"object"===Ee(r))return Oe({model:n,properties:r});var u=n?n.layout:void 0,h=o(u,"qSelectionInfo.qInSelections");if(s||h)return Promise.resolve(l);var d=o(u,"qHyperCube.qMeasureInfo"),f=Ne[n.id].lastReloadTime;if(Ne[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Pe({measures:d,layout:u})){var p=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ue({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:d,layout:u,model:n,lastReloadTime:f});return p||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Ye({modifiers:Fe(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:d,layout:u,masterItem:a,isFirstTime:c})?n.getEffectiveProperties().then((function(e){var r=t()(!0,{},e);Be(r);var i=Qe(r);return Ke({model:n}).then((function(t){return Xe({libraryIds:i,model:n}).then((function(i){return p&&function(e){var t=e.properties;ze(t).forEach((function(e){return function(e){var t=e.measure;if(Ue({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===Ee(e)&&!e.disabled){if(n++,"object"!==Ee(Ae[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=Ae[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&$e(t)&&k.simplifyExpression(t.qDef.base.qDef)!==k.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:r}),Oe({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:i,dimensionAndFieldList:t})}))}))})):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===Ee(e.base)}))}(d)?n.getEffectiveProperties().then((function(e){return function(e){var n=e.model,r=e.properties,i=Qe(r);return et({model:n,libraryIds:i}).then((function(){var e=t()(!0,{},r);return ze(r).forEach((function(e){return Ie(e)})),Je({oldProperties:e,newProperties:r,model:n})}))}({model:n,properties:e})})):Promise.resolve(l)}function Oe(e){var n=e.model,r=e.oldProperties,i=e.properties,s=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,h=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),Be(i);var d=Qe(i);return et({model:n,libraryIds:d,masterItem:c}).then((function(){return function(e){var n=e.measures,r=e.properties,i=e.model,s=e.libraryItemsProps,a=e.dimensionAndFieldList;if(n||(n=ze(r)),!n.length)return Promise.resolve();if(!Pe({measures:n,properties:r}))return n.forEach((function(e){return Ie(e)})),Promise.resolve();var l=s?void 0:Qe(r);return Ke({model:i,dimensionAndFieldList:a}).then((function(e){return Xe({libraryIds:l,model:i,libraryItemsProps:s}).then((function(i){n.forEach((function(n){Ye({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,s=e.dimensionAndFieldList,a=0;Ce.isValid(n)||Ce.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach((function(e){if("object"===Ee(e)&&!e.disabled){if(a++,"object"!==Ee(Ae[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(a>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Ae[e.type].initModifier(e,n);var l=n.qLibraryId||u&&u.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,s=e.libraryItemsProps[e.libraryId],a=s.qMeasure.qDef,l=""===a?a:Ae[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||s.qMeasure.qLabel)&&(n.qDef.qLabel=s.qMeasure.qLabel),(n.qDef.qLabelExpression||s.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=s.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&s.qMeasure.qNumFormat&&(n.qDef.qNumFormat=s.qMeasure.qNumFormat,n.qDef.isCustomFormatted=s.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=s.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:s}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Ae[r.type].updateModifier&&Ae[r.type].updateModifier(r,i.qHyperCubeDef);var s=me.getExpression(n),a=""===s?s:Ae[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=a,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||s,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:s}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||je(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&je(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}}))}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),Ve(n)):Ie(n)}))}))}))}({measures:s,properties:i,model:n,libraryItemsProps:u,dimensionAndFieldList:h}).then((function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)}))}))}function Ie(e){!function(e){var t=Fe(e);return Array.isArray(t)&&t.some((function(e){return"object"===Ee(e)&&!e.disabled&&!Ae[e.type]}))}(e)?Ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Ve(e)}function Pe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ye({modifiers:Fe(e),properties:n,layout:r})}))}function Le(e){var t=Fe(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Ae[r.type]&&!r.disabled)return r}}function je(e){var t=Le(e);return!t||Ae[t.type].enableTotalsFunction(e)}function ze(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function Fe(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function He(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function Be(e){ze(e).forEach((function(e){return function(e){var n=Le(e);n&&(void 0!==n.outputExpression&&He(n)!==e.qDef.qDef?delete e.qDef.base:!Ce.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)}))}function Ve(e){var t=Fe(e);Array.isArray(t)&&t.forEach((function(t){"object"===Ee(t)&&(t.disabled||!Ae[t.type]&&He(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function $e(e){return e.base||e.qDef&&e.qDef.base}function We(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function Ue(e){var t=e.measure,n=e.properties,r=e.layout;return!We(t)&&Ye({modifiers:Fe(t),properties:n,layout:r})}function Ye(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==Ee(e)||e.disabled||!Ae[e.type])&&(void 0===i[e.type]&&(i[e.type]=Ae[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Ke(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));r.push(o);var s=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(s),Promise.all(r).then((function(){return i}))}function Xe(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,s={},a=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){s[e]=t}))}));a.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){s[e]=t}))}));a.push(t)})),Promise.all(a).then((function(){return s}))}function Ge(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Ge)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Ge)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ge)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ge);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):O(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Ze(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===Ee(e)&&!e.disabled&&Ae[e.type]&&Ae[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Qe(e){var t=ze(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=Fe(t);if(Ye({modifiers:r,properties:e})){var o=We(t);o&&n.push(o),i=i||Ze({modifiers:r,properties:e})}})),o(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Ne[t.id].masterItemSubscriber=Ne[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},s={},a={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&a[n]&&a[n].forEach((function(n){t[n]=o(e,n)})),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,a=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),s={},t.forEach((function(e){s[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach((function(e){i[e]||s[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&a.push(u(e,"getMeasure"))})),Object.keys(s).forEach((function(e){s[e]&&!r[e]&&a.push(u(e,"getDimension"))}))),Promise.all(a)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return Re({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),Ne[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(r,{default:()=>Be});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(""!==s){if(void 0===i[s]||null===i[s])return n;i=i[s]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,s=0;s<r.length-1;++s){var a=r[s];void 0!==o[a]&&null!==o[a]||(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function s(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const h={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:u};var d=n(645),f=n.n(d);const p=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,s(r.qDimensions));var a,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(a=i.excludedDimensions).push.apply(a,s(l))},g=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var s,a=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");a&&(s=i.excludedMeasures).push.apply(s,l(a))},m=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&h.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},b=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},v=function(e){e.forEach((function(e){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))};function x(e,t,n){var r,i,s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var a=o.getValue(e,"qLayoutExclude.quarantine");a[n]||(a[n]={}),a[n][t]=s}var w=n(229),k=n.n(w);function M(e,t){var n=k()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function _(e,t){return k()(!0,{},t,e)}function S(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var q=Math.pow(2,53)-1;function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const E=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},A=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},T=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},N=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},R=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},O=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,s=e.defaultDimension,a=n.data[0];for(t=0;t<a.dimensions.length;++t){var l=M(a.dimensions[t],s);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<a.excludedDimensions.length;++t){var c=M(a.excludedDimensions[t],s);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},I=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,s=e.defaultMeasure,a=n.data[0];for(t=0;t<a.measures.length;++t){var l=_(a.measures[t],s);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<a.excludedMeasures.length;++t){var c=_(a.excludedMeasures[t],s);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},P=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},s=r.measures||{max:0},a=S(s.max,i.dimensions.length,q),l=S(s.min,i.dimensions.length,0);return{maxDimensions:S(o.max,a,q),minDimensions:S(o.min,l,0),maxMeasures:a,minMeasures:l}},L=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(h.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,h.indexRemoved(n.qInterColumnSortOrder,o))},j=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=k()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]})),null===(i=k()(!0,{},n,i)).components&&(i.components=[]),i},z=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=t.data[0];return s.dimensions.length>n&&n>0||s.measures.length>i&&i>0||s.excludedDimensions.length>0&&s.dimensions.length+s.excludedDimensions.length>r||s.excludedMeasures.length>0&&s.measures.length+s.excludedMeasures.length>o||!i&&s.measures.length>0||!n&&s.dimensions.length>0},F=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=e.newHyperCubeDef,a=t.data[0];s.qLayoutExclude||(s.qLayoutExclude={}),s.qLayoutExclude.qHyperCubeDef||(s.qLayoutExclude.qHyperCubeDef={}),(a.dimensions.length>n&&n>0||a.excludedDimensions&&a.excludedDimensions.length&&a.dimensions.length+a.excludedDimensions.length>r)&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(a.measures.length>i&&i>0||a.excludedMeasures&&a.excludedMeasures.length&&a.measures.length+a.excludedMeasures.length>o)&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&a.measures.length&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&a.dimensions.length&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},H=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var s=o.getValue(n,i||"").qHyperCubeDef,a=function(e){if(Array.isArray(e))return D(e)}(t=s.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();s.qDimensions=[],a.forEach((function(e){s.qDimensions.push(e),r.dimensions.added(e,n)}))}},B=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var s=o.getValue(n,i||"").qHyperCubeDef,a=function(e){if(Array.isArray(e))return C(e)}(t=s.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();s.qMeasures=[],a.forEach((function(e){s.qMeasures.push(e),r.measures.added(e,n)}))}},V=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f().isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))};function $(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}const W={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),s=t.qProperty,a=o.getValue(s,n||""),l=a.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:s}),n&&(i.properties.qHyperCubeDef=l,delete a.qHyperCubeDef),b({exportFormat:i,properties:s}),r||v(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,s=void 0===i?{}:i,a=e.defaultPropertyValues,l=void 0===a?{}:a,c=e.hypercubePath,u=e.extension,h=e.supportedFilters,d=void 0===h||h,f=e.isHCModifierSupported,p=void 0===f||f,g={qChildren:[]},m=j({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,b=o.getValue(m,c||"").qHyperCubeDef,v=P({exportFormat:t,dataDefinition:s}),x=v.maxDimensions,w=v.minDimensions,k=v.maxMeasures,M=v.minMeasures,_=l.defaultDimension,S=void 0===_?N():_,q=l.defaultMeasure,D=void 0===q?R():q;b.qDimensions.length=0,b.qMeasures.length=0,z({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:k,minMeasures:M})&&F({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:k,minMeasures:M,newHyperCubeDef:b}),O({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:b,defaultDimension:S}),I({exportFormat:t,maxMeasures:k,minMeasures:M,newHyperCubeDef:b,defaultMeasure:D}),H({newProperties:m,dataDefinition:s,hypercubePath:c}),B({newProperties:m,dataDefinition:s,hypercubePath:c}),L({exportFormat:t,newHyperCubeDef:b}),A("qMaxStackedCells",y,b),A("qNoOfLeftDims",y,b),T("qInitialDataFetch",y,b,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),T("qMode",y,b,"S"),T("qReductionMode",y,b,"N"),T("qSortbyYValue",y,b),T("qIndentMode",y,b),T("qShowTotalsAbove",y,b),E(m,t,r),g.qProperty=m;var C=o.getValue(u||{},"support.modifiers");return V({measures:b.qMeasures,modifierTypes:C}),d&&$(g.qProperty,"storedFilters"),"S"===b.qMode&&p&&$(g.qProperty,"dynamicScript"),g}};var U={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function Y(e,t,n,r){t=t||[];var i=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var s=e.splice(i,1);t.push(s[0])}return t}function K(e,t){return e.length!==t}const X={create:function(e,t){if(!e||!U[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var s=e[o][n],a=t.length;if(Y(s,t,r,i),K(t,a))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},G={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>0&&G.getNumMeasures(e)<=1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)>0},expression:function(e){return G.getNumMeasures(e)>=1}}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumMeasures(e)>=1}}};var Q={scatterplot:Z,"sn-scatter-plot":Z,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)<=1},expression:function(e){return G.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>=1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)>=1},expression:function(e){return G.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=h.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=X.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})),t.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}))}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,s=e.measures,a=e.label;te(r,i);var l=r[r.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=X.create(X.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=s)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=h.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:f,measures:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function ie(e,t,n,r){var i,o,s,a={};switch(e){case"dimension":n.qLibraryId?(a.type="dimension",a.name=n.qLibraryId,a.id=n.qLibraryId):(a.type="field",t?(a.name=n.label||n.qDef,a.id=n.qDef):(a.name=n.qDef.qFieldDefs[0],a.label=(s=n.qDef).qLabelExpression?s.qLabelExpression:s.qFieldLabels&&s.qFieldLabels[0]?s.qFieldLabels[0]:s.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:f().measureBase.getLibraryId(e)}(n,t),i?(a.type="measure",a.name=i,a.id=i,o=function(e,t){return f().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(a.expression=o)):(a.type="expression",t?(a.name=n.label||n.qExpression,a.id=n.qExpression):(a.name=n.qDef.qDef,a.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return a}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function se(e,t,n,r){var i=t.type,o=e.color,s=o.mode,a=G.getItemLabel(t);switch(ne(e,a||""),i){case"field":s="byDimension",o.byDimDef={label:t.label||G.wrapFieldName(t.name),key:G.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":s="byMeasure",o.byMeasureDef={label:a,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":s="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":s="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}o.auto=!1,o.mode=s}function ae(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byDimDef");if(s&&ne(e,s.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,se(e,i)}(e,t);else if(function(e){return!e||!e.key}(s)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),s=Number(i[1]),a=o.getValue(t,"layers.".concat(s,".type"));return 2===e.length&&"map"===r&&"point"===a}(n,e,t)?0:n.length-1],i=X.IDMAP.COLOR_BY_ALTERNATIVE,s=h.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return se(e,ie("dimension",!!s,s||r)),!!s}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ce=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ue=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},he=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),s=o.getValue(e,"".concat(t,"qDimensions"),[]),a=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(s,l):!(n={auto:i,colorMode:r,dimensions:s}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?ae(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,s=e.properties,a=o.getValue(s,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==a&&!i.length)}({auto:i,colorMode:r,dimensions:s,measures:a,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byMeasureDef");if(s&&ne(e,s.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,se(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(s,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],s=X.IDMAP.COLOR_BY_ALTERNATIVE,a=h.findItemByPropertyValue(i.qAttributeExpressions,"id",s);return se(e,ie("measure",!!a,a||r[0])),!!a}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,s)}(e,t)},de=function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},fe=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},pe=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},ge=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},me=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=W.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],s=o.dimensions.concat(o.excludedDimensions),a=o.measures.concat(o.excludedMeasures),l=X.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return X.moveByIdFromGroup(s,[],"qAttributeDimensions",c),X.moveByIdFromGroup(s,[],"qAttributeExpressions",c),X.moveByIdFromGroup(a,[],"qAttributeExpressions",u),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,s=e.hypercubePath,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=W.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:s,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty,d=o.getValue(h,"visualization"),f=o.getValue(h,"qHyperCubeDef.qDimensions",[]),p=o.getValue(h,"color.mode",""),g=o.getValue(h,"color.auto",""),m=ce(h,d),y=ue({canColorBy:m,autoColor:g,colorMode:p,dimensions:f});return m[p]?fe({shouldUpdateColorBy:y,properties:h})&&pe(h):ge(h),y&&he(h,"qHyperCubeDef."),me(h)&&le(h,"color.persistent",!0),de(f),u}};var be=["bar","marker","line"];const ve=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||k()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||k()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,s=i.qHyperCubeDef,a=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),be.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(s);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&k()(a,n.properties.measureAxes[t[0].axis])):k()(a,n.properties.measureAxes[0])}},we=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},ke={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,s=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),a=s.properties;return o?(x(a,"measureAxis.min","supportedAutoMinMax"),x(a,"measureAxis.max","supportedAutoMinMax")):(x(a,"measureAxis.min","unsupportedAutoMinMax"),x(a,"measureAxis.max","unsupportedAutoMinMax")),s},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,s=e.measureType,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty;return ve({initialProperties:n,properties:h}),xe({exportFormat:t,initialProperties:n,properties:h,measureType:s}),we(h.qHyperCubeDef),h.qHyperCubeDef.qColumnOrder=[],h.qHyperCubeDef.columnOrder=[],u}};function Me(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function _e(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,s=e.itemPath,a=o.getValue(i,s);if(void 0!==a){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var c=Me(n,r,l);o.setValue(t,c,a),o.setValue(i,s,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})}))}function Se(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,s=e.itemPath,a=o.getValue(i,"qDef.cId");if(a){var l=Me(n,r,a),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,s,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})}))}var qe="qHyperCubeDef.qMeasures",De="conditionalColoring",Ce="measures",Ee="qDef.conditionalColoring";const Ae={quarantine:function(e){_e({properties:e,arrayPath:qe,quarantineName:De,arrayName:Ce,itemPath:Ee})},unquarantine:function(e){Se({properties:e,arrayPath:qe,itemPath:Ee,arrayName:Ce,quarantineName:De})}};var Te="qHyperCubeDef.qMeasures",Ne="measures",Re="qHyperCubeDef.qDimensions",Oe="dimensions",Ie="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Pe="alternativeMeasures",Le="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",je="alternativeDimensions",ze="qCalcCondition",Fe="conditionalShowHide";const He={quarantine:function(e){_e({properties:e,arrayPath:Te,quarantineName:Fe,arrayName:Ne,itemPath:ze}),_e({properties:e,arrayPath:Re,quarantineName:Fe,arrayName:Oe,itemPath:ze})},unquarantine:function(e){Se({properties:e,arrayPath:Te,quarantineName:Fe,arrayName:Ne,itemPath:ze}),Se({properties:e,arrayPath:Re,quarantineName:Fe,arrayName:Oe,itemPath:ze})},quarantineAlternative:function(e){_e({properties:e,arrayPath:Ie,quarantineName:Fe,arrayName:Pe,itemPath:ze}),_e({properties:e,arrayPath:Le,quarantineName:Fe,arrayName:je,itemPath:ze})},unquarantineAlternative:function(e){Se({properties:e,arrayPath:Ie,quarantineName:Fe,arrayName:Pe,itemPath:ze}),Se({properties:e,arrayPath:Le,quarantineName:Fe,arrayName:je,itemPath:ze})}},Be={hypercube:W,colorChart:ye,axisChart:ke,quarantineProperty:x,unquarantineProperty:$,quarantineArrayProp:_e,unquarantineArrayProp:Se,conditionalColoring:Ae,conditionalShow:He}})(),r.default})()}(wm)),wm.exports),Mm=n(km);const _m={AUTO:!0,BIN_COUNT:10,BIN_SIZE:10,LABEL:"x",OFFSET:0,COUNT_DISTINCT:!1,BIN_MODE:"maxCount"};Object.freeze(_m);const Sm={version:"1.0.0",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"S",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},bins:{auto:_m.AUTO,binCount:"",binSize:_m.BIN_SIZE,offset:_m.OFFSET,countDistinct:_m.COUNT_DISTINCT,binMode:_m.BIN_MODE},color:{bar:{paletteColor:{index:6,color:"#4477aa"}}},dataPoint:{showLabels:!1},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",label:"",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function qm(e){const{translator:t}=e;return{path:"/qHyperCubeDef",dimensions:{min:1,max:1,description:()=>t.get("Visualization.Histogram.Binning")},measures:{min:0,max:0}}}function Dm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Cm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||Am(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Em(e){return function(e){if(Array.isArray(e))return Dm(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Am(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Am(e,t){if(e){if("string"==typeof e)return Dm(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dm(e,t):void 0}}var Tm=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],Nm=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var Rm=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function Om(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],s=t.getStyle("","","fontFamilies");return Array.isArray(s)&&s.length?o.push.apply(o,Em(new Set([r].concat(Em(s.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(Em(o.map((function(e){return Rm(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],Em(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?Nm:Tm}(i).map((function(e){return Rm(e)}))))}function Im(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,s=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return s()},getOptions:function(){return Om({theme:t,translator:n,defaultValue:s(),flags:o})}}}var Pm,Lm,jm=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],zm=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function Fm(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,Em(new Set([n].concat(Em(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(Em(r.map((function(e){return zm(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],Em(jm.map((function(e){return zm(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function Hm(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:Im({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:Fm({theme:t,translator:n,id:r,path:i})}}function Bm(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,s=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),a=s.id,l=s.paths,c={};l.forEach((function(e){for(var r=e.split("."),i=c,s=0;s<r.length;s++){var l=r[s];s===r.length-1?i[l]=Hm({theme:t,translator:n,id:a,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}}));var u=function(e){for(var t=e.split("."),n=c,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}var Vm,$m=function(){if(Lm)return Pm;Lm=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return Pm=function e(){var t,n,r,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=a(h,n),h!==(l=a(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},s(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&s(h,{name:n,newValue:l}));return h},Pm}();function Wm(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Um(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ym(){}(Vm=$m)&&Vm.__esModule&&Object.prototype.hasOwnProperty.call(Vm,"default")&&Vm.default;var Km=1/.7,Xm="\\s*([+-]?\\d+)\\s*",Gm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Zm=/^#([0-9a-f]{3,8})$/,Qm=new RegExp(`^rgb\\(${Xm},${Xm},${Xm}\\)$`),ey=new RegExp(`^rgb\\(${Jm},${Jm},${Jm}\\)$`),ty=new RegExp(`^rgba\\(${Xm},${Xm},${Xm},${Gm}\\)$`),ny=new RegExp(`^rgba\\(${Jm},${Jm},${Jm},${Gm}\\)$`),ry=new RegExp(`^hsl\\(${Gm},${Jm},${Jm}\\)$`),iy=new RegExp(`^hsla\\(${Gm},${Jm},${Jm},${Gm}\\)$`),oy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function sy(){return this.rgb().formatHex()}function ay(){return this.rgb().formatRgb()}function ly(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Zm.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?cy(t):3===n?new fy(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?uy(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?uy(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Qm.exec(e))?new fy(t[1],t[2],t[3],1):(t=ey.exec(e))?new fy(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ty.exec(e))?uy(t[1],t[2],t[3],t[4]):(t=ny.exec(e))?uy(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ry.exec(e))?vy(t[1],t[2]/100,t[3]/100,1):(t=iy.exec(e))?vy(t[1],t[2]/100,t[3]/100,t[4]):oy.hasOwnProperty(e)?cy(oy[e]):"transparent"===e?new fy(NaN,NaN,NaN,0):null}function cy(e){return new fy(e>>16&255,e>>8&255,255&e,1)}function uy(e,t,n,r){return r<=0&&(e=t=n=NaN),new fy(e,t,n,r)}function hy(e){return e instanceof Ym||(e=ly(e)),e?new fy((e=e.rgb()).r,e.g,e.b,e.opacity):new fy}function dy(e,t,n,r){return 1===arguments.length?hy(e):new fy(e,t,n,null==r?1:r)}function fy(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function py(){return`#${by(this.r)}${by(this.g)}${by(this.b)}`}function gy(){const e=my(this.opacity);return`${1===e?"rgb(":"rgba("}${yy(this.r)}, ${yy(this.g)}, ${yy(this.b)}${1===e?")":`, ${e})`}`}function my(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yy(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function by(e){return((e=yy(e))<16?"0":"")+e.toString(16)}function vy(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new wy(e,t,n,r)}function xy(e){if(e instanceof wy)return new wy(e.h,e.s,e.l,e.opacity);if(e instanceof Ym||(e=ly(e)),!e)return new wy;if(e instanceof wy)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new wy(s,a,l,e.opacity)}function wy(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function ky(e){return(e=(e||0)%360)<0?e+360:e}function My(e){return Math.max(0,Math.min(1,e||0))}function _y(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Wm(Ym,ly,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:sy,formatHex:sy,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return xy(this).formatHsl()},formatRgb:ay,toString:ay}),Wm(fy,dy,Um(Ym,{brighter(e){return e=null==e?Km:Math.pow(Km,e),new fy(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new fy(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fy(yy(this.r),yy(this.g),yy(this.b),my(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:py,formatHex:py,formatHex8:function(){return`#${by(this.r)}${by(this.g)}${by(this.b)}${by(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:gy,toString:gy})),Wm(wy,(function(e,t,n,r){return 1===arguments.length?xy(e):new wy(e,t,n,null==r?1:r)}),Um(Ym,{brighter(e){return e=null==e?Km:Math.pow(Km,e),new wy(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new wy(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new fy(_y(e>=240?e-240:e+120,i,r),_y(e,i,r),_y(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new wy(ky(this.h),My(this.s),My(this.l),my(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=my(this.opacity);return`${1===e?"hsl(":"hsla("}${ky(this.h)}, ${100*My(this.s)}%, ${100*My(this.l)}%${1===e?")":`, ${e})`}`}}));const Sy=Math.PI/180,qy=180/Math.PI,Dy=4/29,Cy=6/29,Ey=3*Cy*Cy;function Ay(e){if(e instanceof Ty)return new Ty(e.l,e.a,e.b,e.opacity);if(e instanceof Py)return Ly(e);e instanceof fy||(e=hy(e));var t,n,r=Iy(e.r),i=Iy(e.g),o=Iy(e.b),s=Ny((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=s:(t=Ny((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Ny((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Ty(116*s-16,500*(t-s),200*(s-n),e.opacity)}function Ty(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Ny(e){return e>.008856451679035631?Math.pow(e,1/3):e/Ey+Dy}function Ry(e){return e>Cy?e*e*e:Ey*(e-Dy)}function Oy(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Iy(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Py(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Ly(e){if(isNaN(e.h))return new Ty(e.l,0,0,e.opacity);var t=e.h*Sy;return new Ty(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Wm(Ty,(function(e,t,n,r){return 1===arguments.length?Ay(e):new Ty(e,t,n,null==r?1:r)}),Um(Ym,{brighter(e){return new Ty(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ty(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new fy(Oy(3.1338561*(t=.96422*Ry(t))-1.6168667*(e=1*Ry(e))-.4906146*(n=.82521*Ry(n))),Oy(-.9787684*t+1.9161415*e+.033454*n),Oy(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Wm(Py,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Py)return new Py(e.h,e.c,e.l,e.opacity);if(e instanceof Ty||(e=Ay(e)),0===e.a&&0===e.b)return new Py(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*qy;return new Py(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Py(e,t,n,null==r?1:r)}),Um(Ym,{brighter(e){return new Py(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Py(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Ly(this).rgb()}}));var jy=e=>()=>e;function zy(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):jy(isNaN(e)?t:e)}!function e(t){var n=function(e){return 1==(e=+e)?zy:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):jy(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=dy(e)).r,(t=dy(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=zy(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1);var Fy="center",Hy="bottom";function By(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(void 0===i[s])return n;i=i[s]}return i}[{key:"NoDataExist",alignment:Fy,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:Fy,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every((function(e){return"NaN"===e.qMin&&"NaN"===e.qMax}))}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:Fy,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:Fy},{key:"DataRangeIncludingZero",alignment:Hy},{key:"LimitedData",alignment:Hy},{key:"NegativeOrZeroValues",alignment:Hy}].reduce((function(e,t){return e[t.key]=t,e}),{});var Vy,$y=["__proto__","constructor"];function Wy(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!$y.some((function(e){return r.includes(e)}))){for(var o=e,s=0;s<r.length-1;++s){var a=r[s];void 0===o[a]&&(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}}}function Uy(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function Yy(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Xy)):void 0===t&&(t=Ky);for(var n,r,i,o,s,a=new Zy(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new Zy(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(Jy)}function Ky(e){return e.children}function Xy(e){return Array.isArray(e)?e[1]:null}function Gy(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Jy(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Zy(e){this.data=e,this.depth=this.height=0,this.parent=null}Zy.prototype=Yy.prototype={constructor:Zy,count:function(){return this.eachAfter(Uy)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Yy(this).eachBefore(Gy)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},Vy=function(e){
24
+ * Licensed under the MIT license */var gm=(fm||(fm=1,function(e){!function(t,n,r,i){var o,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l=Math.round,c=Math.abs,u=Date.now;function d(e,t,n){return setTimeout(v(e,n),t)}function h(e,t,n){return!!Array.isArray(e)&&(f(e,n[t],n),!0)}function f(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function p(e,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var g=p((function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&e[r[o]]===i)&&(e[r[o]]=t[r[o]]),o++;return e}),"extend","Use `assign`."),m=p((function(e,t){return g(e,t,!0)}),"merge","Use `assign`.");function y(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function v(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return"function"==typeof e?e.apply(t&&t[0]||i,t):e}function x(e,t){return e===i?t:e}function w(e,t,n){f(S(t),(function(t){e.addEventListener(t,n,!1)}))}function M(e,t,n){f(S(t),(function(t){e.removeEventListener(t,n,!1)}))}function k(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function _(e,t){return e.indexOf(t)>-1}function S(e){return e.trim().split(/\s+/g)}function q(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function D(e){return Array.prototype.slice.call(e,0)}function E(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var s=e[o][t];q(i,s)<0&&r.push(e[o]),i[o]=s,o++}return r=r.sort((function(e,n){return e[t]>n[t]})),r}function C(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),a=0;a<s.length;){if((r=(n=s[a])?n+o:t)in e)return r;a++}return i}var A=1;function T(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var N="ontouchstart"in t,R=C(t,"PointerEvent")!==i,O=N&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),I="touch",P="mouse",L=24,j=["x","y"],z=["clientX","clientY"];function F(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){b(e.options.enable,[e])&&n.handler(t)},this.init()}function H(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,s=1&t&&r-o===0,a=12&t&&r-o===0;n.isFirst=!!s,n.isFinal=!!a,s&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=B(t)),o>1&&!n.firstMultiple?n.firstMultiple=B(t):1===o&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,d=t.center=V(r);t.timeStamp=u(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=Y(l,d),t.distance=U(l,d),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=W(t.deltaX,t.deltaY);var h=$(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=h.x,t.overallVelocityY=h.y,t.overallVelocity=c(h.x)>c(h.y)?h.x:h.y,t.scale=a?function(e,t){return U(t[0],t[1],z)/U(e[0],e[1],z)}(a.pointers,r):1,t.rotation=a?function(e,t){return Y(t[1],t[0],z)+Y(e[1],e[0],z)}(a.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(l>25||a.velocity===i)){var u=t.deltaX-a.deltaX,d=t.deltaY-a.deltaY,h=$(l,u,d);r=h.x,o=h.y,n=c(h.x)>c(h.y)?h.x:h.y,s=W(u,d),e.lastInterval=t}else n=a.velocity,r=a.velocityX,o=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=s}(n,t);var f=e.element;k(t.srcEvent.target,f)&&(f=t.srcEvent.target),t.target=f}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function B(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:l(e.pointers[n].clientX),clientY:l(e.pointers[n].clientY)},n++;return{timeStamp:u(),pointers:t,center:V(t),deltaX:e.deltaX,deltaY:e.deltaY}}function V(e){var t=e.length;if(1===t)return{x:l(e[0].clientX),y:l(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:l(n/t),y:l(r/t)}}function $(e,t,n){return{x:t/e||0,y:n/e||0}}function W(e,t){return e===t?1:c(e)>=c(t)?e<0?2:4:t<0?8:16}function U(e,t,n){n||(n=j);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function Y(e,t,n){n||(n=j);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}F.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(T(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&M(this.element,this.evEl,this.domHandler),this.evTarget&&M(this.target,this.evTarget,this.domHandler),this.evWin&&M(T(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4},X="mousedown",G="mousemove mouseup";function J(){this.evEl=X,this.evWin=G,this.pressed=!1,F.apply(this,arguments)}y(J,F,{handler:function(e){var t=K[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:P,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:I,3:"pen",4:P,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,F.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),y(ne,F,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Z[r],o=Q[e.pointerType]||e.pointerType,s=o==I,a=q(t,e.pointerId,"pointerId");1&i&&(0===e.button||s)?a<0&&(t.push(e),a=t.length-1):12&i&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(a,1))}});var re={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ie(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,F.apply(this,arguments)}function oe(e,t){var n=D(e.touches),r=D(e.changedTouches);return 12&t&&(n=E(n.concat(r),"identifier")),[n,r]}y(ie,F,{handler:function(e){var t=re[e.type];if(1===t&&(this.started=!0),this.started){var n=oe.call(this,e,t);12&t&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}}});var se={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ae="touchstart touchmove touchend touchcancel";function le(){this.evTarget=ae,this.targetIds={},F.apply(this,arguments)}function ce(e,t){var n=D(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,s=D(e.changedTouches),a=[],l=this.target;if(o=n.filter((function(e){return k(e.target,l)})),1===t)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<s.length;)r[s[i].identifier]&&a.push(s[i]),12&t&&delete r[s[i].identifier],i++;return a.length?[E(o.concat(a),"identifier"),a]:void 0}function ue(){F.apply(this,arguments);var e=v(this.handler,this);this.touch=new le(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function de(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,he.call(this,t)):12&e&&he.call(this,t)}function he(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),2500)}}function fe(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),s=Math.abs(n-i.y);if(o<=25&&s<=25)return!0}return!1}y(le,F,{handler:function(e){var t=se[e.type],n=ce.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}}),y(ue,F,{handler:function(e,t,n){var r=n.pointerType==I,i=n.pointerType==P;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)de.call(this,t,n);else if(i&&fe.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var pe=C(a.style,"touchAction"),ge=pe!==i,me="compute",ye="auto",ve="manipulation",be="none",xe="pan-x",we="pan-y",Me=function(){if(!ge)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(r){e[r]=!n||t.CSS.supports("touch-action",r)})),e}();function ke(e,t){this.manager=e,this.set(t)}ke.prototype={set:function(e){e==me&&(e=this.compute()),ge&&this.manager.element.style&&Me[e]&&(this.manager.element.style[pe]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return f(this.manager.recognizers,(function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(_(e,be))return be;var t=_(e,xe),n=_(e,we);return t&&n?be:t||n?t?xe:we:_(e,ve)?ve:ye}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=_(r,be)&&!Me[be],o=_(r,we)&&!Me[we],s=_(r,xe)&&!Me[xe];if(i){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}if(!s||!o)return i||o&&6&n||s&&n&L?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var _e=32;function Se(e){this.options=o({},this.defaults,e||{}),this.id=A++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function qe(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function De(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Ee(e,t){var n=t.manager;return n?n.get(e):e}function Ce(){Se.apply(this,arguments)}function Ae(){Ce.apply(this,arguments),this.pX=null,this.pY=null}function Te(){Ce.apply(this,arguments)}function Ne(){Se.apply(this,arguments),this._timer=null,this._input=null}function Re(){Ce.apply(this,arguments)}function Oe(){Ce.apply(this,arguments)}function Ie(){Se.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Pe(e,t){return(t=t||{}).recognizers=x(t.recognizers,Pe.defaults.preset),new Le(e,t)}function Le(e,t){var n;this.options=o({},Pe.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(R?ne:O?le:N?ue:J))(n,H),this.touchAction=new ke(this,this.options.touchAction),je(this,!0),f(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function je(e,t){var n,r=e.element;r.style&&(f(e.options.cssProps,(function(i,o){n=C(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Se.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(h(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ee(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return h(e,"dropRecognizeWith",this)||(e=Ee(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(h(e,"requireFailure",this))return this;var t=this.requireFail;return-1===q(t,e=Ee(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(h(e,"dropRequireFailure",this))return this;e=Ee(e,this);var t=q(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+qe(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+qe(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=_e},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!b(this.options.enable,[this,t]))return this.reset(),void(this.state=_e);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},y(Ce,Se,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(8&n||!i)?16|t:r||i?4&n?8|t:2&t?4|t:2:_e}}),y(Ae,Ce,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(we),e&L&&t.push(xe),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,s=e.deltaY;return i&t.direction||(6&t.direction?(i=0===o?1:o<0?2:4,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===s?1:s<0?8:16,n=s!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return Ce.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=De(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),y(Te,Ce,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[be]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),y(Ne,Se,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ye]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=d((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return _e},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}}),y(Re,Ce,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[be]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),y(Oe,Ce,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ae.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&L&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=De(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),y(Ie,Se,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ve]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||U(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,s&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=d((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return _e},failTimeout:function(){return this._timer=d((function(){this.state=_e}),this.options.interval,this),_e},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Pe.VERSION="2.0.7",Pe.defaults={domEvents:!1,touchAction:me,enable:!0,inputTarget:null,inputClass:null,preset:[[Re,{enable:!1}],[Te,{enable:!1},["rotate"]],[Oe,{direction:6}],[Ae,{direction:6},["swipe"]],[Ie],[Ie,{event:"doubletap",taps:2},["tap"]],[Ne]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Le.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof Se)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(h(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(h(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=q(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==i&&t!==i){var n=this.handlers;return f(S(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==i){var n=this.handlers;return f(S(e),(function(e){t?n[e]&&n[e].splice(q(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var r=n.createEvent("Event");r.initEvent(e,!0,!0),r.gesture=t,t.target.dispatchEvent(r)}(e,t);var r=this.handlers[e]&&this.handlers[e].slice();if(r&&r.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<r.length;)r[i](t),i++}},destroy:function(){this.element&&je(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(Pe,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:_e,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:L,DIRECTION_ALL:30,Manager:Le,Input:F,TouchAction:ke,TouchInput:le,MouseInput:J,PointerEventInput:ne,TouchMouseInput:ue,SingleTouchInput:ie,Recognizer:Se,AttrRecognizer:Ce,Tap:Ie,Pan:Ae,Swipe:Oe,Pinch:Te,Rotate:Re,Press:Ne,on:w,off:M,each:f,merge:m,extend:g,assign:o,inherit:y,bindFn:v,prefixed:C}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=Pe,e.exports?e.exports=Pe:t.Hammer=Pe}(window,document)}(pm)),pm.exports),mm=n(gm);function ym(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var vm={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),s="center"===r?t:`* ${t}`,a="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:i},e("span",{ref:this.alignToRef,style:a,title:s},s))}};function bm(e){const t=wp();return t.renderer.prio([e||"canvas"]),t.use(cm),t.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",hm(e))};e.interaction("hammer",hm(Hammer))}(mm)),t.use(ym),t.component("disclaimer",vm),t}const xm={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};var wm,Mm={exports:{}};var km=(wm||(wm=1,function(e){self,e.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},s=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],h=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h<f;++h)if(null!=(t=arguments[h]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(s(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},a(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&a(d,{name:n,newValue:i}));return d}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},s=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],h=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h<f;++h)if(null!=(t=arguments[h]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(s(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},a(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&a(d,{name:n,newValue:i}));return d}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Te});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],s=e;for(r=0;r<i.length-1;++r)void 0===s[i[r]]&&(s[i[r]]=Number.isNaN(+i[r+1])?{}:[]),s=s[i[r]];if(void 0!==n){var a=s[o];return s[o]=n,{updated:n,previous:a}}return delete s[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},s={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var a="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return a+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var s=r.qDerivedFieldData.qDerivedFieldLists[o],a=0;a<s.qFieldDefs.length;++a){var l=s.qFieldDefs[a];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function g(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function m(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,s=void 0===o?"Sum":o,a=e.valueComp,l=void 0===a?"0":a;if(!n.showExcludedValues)return"";if(r&&1===r.length){var c=v(u(r[0],i),p(0));return"".concat(s,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var d=u(r[0],i),h=u(r[1],i),f=p(0),g=p(1),m=v(d,f),y=v(h,g);return"".concat(s,"({1<").concat(m,",").concat(y,">}").concat(l,")")}return"".concat(s,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function w(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const M={isFullRange:d,getNumDimensions:w,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,s=c(f(t));if(!n.showExcludedValues)return s;var a=b({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(s," + ").concat(a).concat(l,")")}if(r&&2===r.length){var d=p(0),h=p(1);return"If(Count(".concat(d,") * Count(").concat(h,") > 0, ").concat(s," + ").concat(a).concat(l,")")}return s},getRowNoComp:h,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return h(e,t)},getAboveCompPrefix:g,getAboveCompSuffix:m,getAboveComp:function(e,t,n,r){return g(e,t)+n+m(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===w({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",s=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(s,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(s,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(a);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+a.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,s=void 0===o?2:o;if(!t&&!n)return!0;var a=w({properties:t,layout:n});return a>=i&&a<=s},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(a),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find((function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null}));i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=s.OPTIONS.find((function(t){return t.value===e.decomposition}));return t?s.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(s.EXPRESSIONS).find((function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return s.EXPRESSIONS[n]&&r.includes(s.EXPRESSIONS[n].toLowerCase())&&(t=n),n})),t}};function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _(e){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_(e)}var S=t().bind(null,!0),q={},D=Array.isArray;function E(e){return null!=e&&!Array.isArray(e)&&"object"===_(e)}function C(e){return void 0===e}function A(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function T(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach((function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=C(e[n||t])?o:e[t],e=e[n||t]}})),e}function N(e,t){var n=!0;if(E(e)&&E(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){N(e[r],t[r])||(n=!1)})),n);if(D(e)&&D(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!N(e[r],t[r]))return!1;return!0}return e===t}q.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?S({},{val:e}).val:e}(t[i]),s=e[i],a="".concat(n,"/").concat(i);N(o,s)||A(t,i)||(C(s)?r.push({op:"add",path:a,value:o}):E(o)&&E(s)?r=r.concat(q.generate(s,o,a)):D(o)&&D(s)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function s(e,t,n){if(e[n]&&C(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(N(t,i))return r;if(!C(t[0])&&C(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var a=i.length-1;a>=0;a-=1)-1===(o=s(t,i[a].qInfo&&i[a].qInfo.qId,a))?(r.push({op:"remove",path:"".concat(n,"/").concat(a)}),i.splice(a,1)):r=r.concat(q.generate(i[a],t[o],"".concat(n,"/").concat(a)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=s(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(s,o,a)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){C(t[i])&&!A(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},q.apply=function(e,t){t.forEach((function(t){var n,r,i=T(e,t.path),o=t.path.split("/").splice(-1)[0],s=o&&Number.isNaN(+o)?i[o]:i[+o]||i,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,s=e),"add"===t.op||"replace"===t.op)if(D(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(D(s)&&D(t.value)){var l,c=t.value.slice();s.length=0,(l=s).push.apply(l,function(e){if(Array.isArray(e))return k(e)}(r=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(E(s)&&E(t.value))n=s,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!A(n,e)&&delete n[e]})),S(s,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var u=T(e,t.from);D(i)?i.splice(+o,0,u.splice(+a,1)[0]):(i[o]=u[a],delete u[a])}else"remove"===t.op&&(D(i)?i.splice(+o,1):delete i[o])}))},q.clone=function(e){return S({},e)},q.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},q.updateObject=function(e,t){Object.keys(e).length?q.apply(e,q.generate(e,t)):S(e,t)};const R=q,O=function(e,n,r){if(!e)return Promise.resolve();var i=R.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(i,!0)):Promise.resolve()};var I="accumulation";function P(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===I)return n[r]}function L(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===I)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var j={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const z={translationKey:"properties.modifier.accumulation",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=M.getNumStepComp(n,l),h=M.getAboveComp(n,l,u,d),f=M.getRangeComp("RangeSum",h);if(M.needDimension({modifier:n,properties:r,layout:i})){var p=M.getDimComp(c,1),g=M.getDimComp(c,0),m=M.getAggrComp(f,p,g);f=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:m}):m}return f},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,j)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(L(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(L(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(L(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(L(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=P(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=P(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(L(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(I))return!1;var o=P(t,e);return o&&!o.disabled}};return n}};var F="movingAverage";function H(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===F)return n[r]}function B(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===F)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var V={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const $={translationKey:"properties.modifier.movingAverage",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,s=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=a;void 0===c&&(c=M.getNumDimensions({properties:i,layout:s}));var u=o(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,h=M.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:d}),f=M.getNumStepComp(r,c),p=M.getAboveComp(r,c,h,f);if(r.nullSuppression)t=M.getRangeComp("RangeAvg",p);else{var g=M.getRangeComp("RangeSum",p),m=function(e,t){var n=M.getRowNoComp(e,t);if(!M.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(g," / ").concat(m)}var y=t;if(M.needDimension({modifier:r,properties:i,layout:s})){var v=M.getDimComp(u,1),b=M.getDimComp(u,0),x=M.getAggrComp(y,v,b);y=r.showExcludedValues?M.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,V)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(B(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(B(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(B(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(B(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=H(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=H(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(B(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(B(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(F))return!1;var o=H(t,e);return o&&!o.disabled}};return n}};var W="timeSeriesDecomposition";function U(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===W)return n[r]}function Y(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===W)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var K={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const X={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?M.generateTSDExpression(n,t,r):t},extractInputExpression:M.extractInputExpression,initModifier:function(e,t){M.initModifier(e,K),""===e.decomposition&&t&&(e.decomposition=M.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(Y(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:s.OPTIONS},steps:{refFn:function(t){return"".concat(Y(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=U(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map((function(e){return e.qDef.modifiers.map((function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e})),e}))}},show:function(t){var n=U(t,e);return n&&!n.fullRange}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(W))return!1;var o=U(t,e);return o&&!o.disabled}};return n}};var G="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===G)return n[r]}function Z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===G)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=M.getAboveComp(n,l,u),h="".concat(u," - ").concat(d);if(M.needDimension({modifier:n,properties:r,layout:i})){var f=M.getDimComp(c,1),p=M.getDimComp(c,0),g=M.getAggrComp(h,f,p);h=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:g}):g}return h},initModifier:function(e){Object.keys(Q).forEach((function(t){void 0===e[t]&&(e[t]=Q[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(Z(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(G))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function se(e){return 2===e?"{1}":""}function ae(e,t,n){return 1===e?"{$<".concat(M.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ce(e,t,n){return 0===e&&t>1?"<".concat(M.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=n.selectionScope,h=n.dimensionalScope;return function(e,t,n,r,i,o,s){var a=se(t),l=ae(t,n,r),c=""===a&&""===l?"":a||l,u=le(i,o),d=ce(i,o,s),h=function(e){for(var t=[],n=0;n<e;n++)t[n]=M.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(d," Aggr(").concat(c," ").concat(e,", ").concat(h,"))")}(u,d,n.field,n.value,h,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach((function(t){void 0===e[t]&&(e[t]=oe[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:se,getFieldSelectionComp:ae,getTotalComp:le,getSelectedDimComp:ce};var de="qDef.base",he="qDef.qDef",fe="qDef.base.qDef",pe="qLibraryId",ge="qDef.base.qLibraryId";const me={getExpression:function(e){var t=o(e,fe);return void 0!==t?t:o(e,he)},getExpressionRef:function(e){return void 0!==o(e,fe)?fe:he},getLibraryIdRef:function(e){return o(e,ge)?ge:pe},getLibraryId:function(e){return o(e,ge)||o(e,pe)},getLabelRef:function(e){return o(e,de)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,de)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",we="qDef.qLabel",Me="qDef.qLabelExpression",ke="qDef.base.qLabel",_e="qDef.base.qLabelExpression",Se="qDef.qAggrFunc",qe="qDef.base.qAggrFunc",De={initBase:function(e,t){(t||De.isValid(e))&&(n(e,ve,o(e,ye)),n(e,xe,o(e,be)),n(e,ke,o(e,we)),n(e,_e,o(e,Me)))},restoreBase:function(e){De.isValid(e)&&(n(e,ye,o(e,ve)),n(e,be,o(e,xe)),n(e,we,o(e,ke)),n(e,Me,o(e,_e)),o(e,Se)&&o(e,qe)&&n(e,Se,o(e,qe)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const Ee=De;function Ce(e){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ce(e)}var Ae={accumulation:z,movingAverage:$,difference:ee,normalization:ue,timeSeriesDecomposition:X};const Te={modifiers:Ae,apply:Re,applyModifiers:Oe,cleanUpMeasure:Ie,destroy:function(e){e&&Ne[e.id]&&Ne[e.id].masterItemSubscriber&&(Ne[e.id].masterItemSubscriber&&Ne[e.id].masterItemSubscriber.unsubscribe(),delete Ne[e.id])},hasActiveModifiers:Pe,getActiveModifier:Le,initBase:Ee.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return Ae[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return Ae[e]&&Ae[e].isApplicable({properties:n,layout:r})}))},measureBase:me,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=Fe(e);Ye({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ze({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:je};var Ne={};function Re(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,s=void 0!==i&&i,a=e.masterItem,l=!1;Ne[n.id]=Ne[n.id]||{isFirstTime:!0};var c=Ne[n.id].isFirstTime;if(Ne[n.id].isFirstTime=!1,r&&"object"===Ce(r))return Oe({model:n,properties:r});var u=n?n.layout:void 0,d=o(u,"qSelectionInfo.qInSelections");if(s||d)return Promise.resolve(l);var h=o(u,"qHyperCube.qMeasureInfo"),f=Ne[n.id].lastReloadTime;if(Ne[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Pe({measures:h,layout:u})){var p=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ue({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:h,layout:u,model:n,lastReloadTime:f});return p||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Ye({modifiers:Fe(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:h,layout:u,masterItem:a,isFirstTime:c})?n.getEffectiveProperties().then((function(e){var r=t()(!0,{},e);Be(r);var i=Qe(r);return Ke({model:n}).then((function(t){return Xe({libraryIds:i,model:n}).then((function(i){return p&&function(e){var t=e.properties;ze(t).forEach((function(e){return function(e){var t=e.measure;if(Ue({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===Ce(e)&&!e.disabled){if(n++,"object"!==Ce(Ae[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=Ae[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&$e(t)&&M.simplifyExpression(t.qDef.base.qDef)!==M.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:r}),Oe({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:i,dimensionAndFieldList:t})}))}))})):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===Ce(e.base)}))}(h)?n.getEffectiveProperties().then((function(e){return function(e){var n=e.model,r=e.properties,i=Qe(r);return et({model:n,libraryIds:i}).then((function(){var e=t()(!0,{},r);return ze(r).forEach((function(e){return Ie(e)})),Je({oldProperties:e,newProperties:r,model:n})}))}({model:n,properties:e})})):Promise.resolve(l)}function Oe(e){var n=e.model,r=e.oldProperties,i=e.properties,s=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),Be(i);var h=Qe(i);return et({model:n,libraryIds:h,masterItem:c}).then((function(){return function(e){var n=e.measures,r=e.properties,i=e.model,s=e.libraryItemsProps,a=e.dimensionAndFieldList;if(n||(n=ze(r)),!n.length)return Promise.resolve();if(!Pe({measures:n,properties:r}))return n.forEach((function(e){return Ie(e)})),Promise.resolve();var l=s?void 0:Qe(r);return Ke({model:i,dimensionAndFieldList:a}).then((function(e){return Xe({libraryIds:l,model:i,libraryItemsProps:s}).then((function(i){n.forEach((function(n){Ye({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,s=e.dimensionAndFieldList,a=0;Ee.isValid(n)||Ee.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach((function(e){if("object"===Ce(e)&&!e.disabled){if(a++,"object"!==Ce(Ae[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(a>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Ae[e.type].initModifier(e,n);var l=n.qLibraryId||u&&u.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,s=e.libraryItemsProps[e.libraryId],a=s.qMeasure.qDef,l=""===a?a:Ae[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||s.qMeasure.qLabel)&&(n.qDef.qLabel=s.qMeasure.qLabel),(n.qDef.qLabelExpression||s.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=s.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&s.qMeasure.qNumFormat&&(n.qDef.qNumFormat=s.qMeasure.qNumFormat,n.qDef.isCustomFormatted=s.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=s.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:s}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Ae[r.type].updateModifier&&Ae[r.type].updateModifier(r,i.qHyperCubeDef);var s=me.getExpression(n),a=""===s?s:Ae[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=a,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||s,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:s}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||je(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&je(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}}))}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),Ve(n)):Ie(n)}))}))}))}({measures:s,properties:i,model:n,libraryItemsProps:u,dimensionAndFieldList:d}).then((function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)}))}))}function Ie(e){!function(e){var t=Fe(e);return Array.isArray(t)&&t.some((function(e){return"object"===Ce(e)&&!e.disabled&&!Ae[e.type]}))}(e)?Ee.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Ve(e)}function Pe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ye({modifiers:Fe(e),properties:n,layout:r})}))}function Le(e){var t=Fe(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Ae[r.type]&&!r.disabled)return r}}function je(e){var t=Le(e);return!t||Ae[t.type].enableTotalsFunction(e)}function ze(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function Fe(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function He(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function Be(e){ze(e).forEach((function(e){return function(e){var n=Le(e);n&&(void 0!==n.outputExpression&&He(n)!==e.qDef.qDef?delete e.qDef.base:!Ee.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)}))}function Ve(e){var t=Fe(e);Array.isArray(t)&&t.forEach((function(t){"object"===Ce(t)&&(t.disabled||!Ae[t.type]&&He(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function $e(e){return e.base||e.qDef&&e.qDef.base}function We(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function Ue(e){var t=e.measure,n=e.properties,r=e.layout;return!We(t)&&Ye({modifiers:Fe(t),properties:n,layout:r})}function Ye(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==Ce(e)||e.disabled||!Ae[e.type])&&(void 0===i[e.type]&&(i[e.type]=Ae[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Ke(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));r.push(o);var s=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(s),Promise.all(r).then((function(){return i}))}function Xe(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,s={},a=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){s[e]=t}))}));a.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){s[e]=t}))}));a.push(t)})),Promise.all(a).then((function(){return s}))}function Ge(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Ge)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Ge)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ge)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ge);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):O(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Ze(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===Ce(e)&&!e.disabled&&Ae[e.type]&&Ae[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Qe(e){var t=ze(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=Fe(t);if(Ye({modifiers:r,properties:e})){var o=We(t);o&&n.push(o),i=i||Ze({modifiers:r,properties:e})}})),o(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Ne[t.id].masterItemSubscriber=Ne[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},s={},a={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&a[n]&&a[n].forEach((function(n){t[n]=o(e,n)})),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,a=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),s={},t.forEach((function(e){s[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach((function(e){i[e]||s[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&a.push(u(e,"getMeasure"))})),Object.keys(s).forEach((function(e){s[e]&&!r[e]&&a.push(u(e,"getDimension"))}))),Promise.all(a)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return Re({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),Ne[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(r,{default:()=>Be});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(""!==s){if(void 0===i[s]||null===i[s])return n;i=i[s]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,s=0;s<r.length-1;++s){var a=r[s];void 0!==o[a]&&null!==o[a]||(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function s(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:u};var h=n(8),f=n.n(h);const p=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,s(r.qDimensions));var a,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(a=i.excludedDimensions).push.apply(a,s(l))},g=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var s,a=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");a&&(s=i.excludedMeasures).push.apply(s,l(a))},m=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},v=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},b=function(e){e.forEach((function(e){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))};function x(e,t,n){var r,i,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2&&!s)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=a}var w=n(909),M=n.n(w);function k(e,t){var n=M()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function _(e,t){return M()(!0,{},t,e)}function S(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var q=Math.pow(2,53)-1;function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const C=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},A=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},T=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},N=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},R=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},O=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,s=e.defaultDimension,a=n.data[0];for(t=0;t<a.dimensions.length;++t){var l=k(a.dimensions[t],s);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<a.excludedDimensions.length;++t){var c=k(a.excludedDimensions[t],s);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},I=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,s=e.defaultMeasure,a=n.data[0];for(t=0;t<a.measures.length;++t){var l=_(a.measures[t],s);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<a.excludedMeasures.length;++t){var c=_(a.excludedMeasures[t],s);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},P=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},s=r.measures||{max:0},a=S(s.max,i.dimensions.length,q),l=S(s.min,i.dimensions.length,0);return{maxDimensions:S(o.max,a,q),minDimensions:S(o.min,l,0),maxMeasures:a,minMeasures:l}},L=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},j=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=M()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]})),null===(i=M()(!0,{},n,i)).components&&(i.components=[]),i},z=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=t.data[0];return s.dimensions.length>n&&n>0||s.measures.length>i&&i>0||s.excludedDimensions.length>0&&s.dimensions.length+s.excludedDimensions.length>r||s.excludedMeasures.length>0&&s.measures.length+s.excludedMeasures.length>o||!i&&s.measures.length>0||!n&&s.dimensions.length>0},F=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=e.newHyperCubeDef,a=t.data[0];s.qLayoutExclude||(s.qLayoutExclude={}),s.qLayoutExclude.qHyperCubeDef||(s.qLayoutExclude.qHyperCubeDef={}),(a.dimensions.length>n&&n>0||a.excludedDimensions&&a.excludedDimensions.length&&a.dimensions.length+a.excludedDimensions.length>r)&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(a.measures.length>i&&i>0||a.excludedMeasures&&a.excludedMeasures.length&&a.measures.length+a.excludedMeasures.length>o)&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&a.measures.length&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&a.dimensions.length&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},H=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var s=o.getValue(n,i||"").qHyperCubeDef,a=function(e){if(Array.isArray(e))return D(e)}(t=s.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();s.qDimensions=[],a.forEach((function(e){s.qDimensions.push(e),r.dimensions.added(e,n)}))}},B=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var s=o.getValue(n,i||"").qHyperCubeDef,a=function(e){if(Array.isArray(e))return E(e)}(t=s.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();s.qMeasures=[],a.forEach((function(e){s.qMeasures.push(e),r.measures.added(e,n)}))}},V=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f().isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))};function $(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}const W={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),s=t.qProperty,a=o.getValue(s,n||""),l=a.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:s}),n&&(i.properties.qHyperCubeDef=l,delete a.qHyperCubeDef),v({exportFormat:i,properties:s}),r||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,s=void 0===i?{}:i,a=e.defaultPropertyValues,l=void 0===a?{}:a,c=e.hypercubePath,u=e.extension,d=e.supportedFilters,h=void 0===d||d,f=e.isHCModifierSupported,p=void 0===f||f,g={qChildren:[]},m=j({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,v=o.getValue(m,c||"").qHyperCubeDef,b=P({exportFormat:t,dataDefinition:s}),x=b.maxDimensions,w=b.minDimensions,M=b.maxMeasures,k=b.minMeasures,_=l.defaultDimension,S=void 0===_?N():_,q=l.defaultMeasure,D=void 0===q?R():q;v.qDimensions.length=0,v.qMeasures.length=0,z({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:M,minMeasures:k})&&F({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:M,minMeasures:k,newHyperCubeDef:v}),O({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:S}),I({exportFormat:t,maxMeasures:M,minMeasures:k,newHyperCubeDef:v,defaultMeasure:D}),H({newProperties:m,dataDefinition:s,hypercubePath:c}),B({newProperties:m,dataDefinition:s,hypercubePath:c}),L({exportFormat:t,newHyperCubeDef:v}),A("qMaxStackedCells",y,v),A("qNoOfLeftDims",y,v),T("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),T("qMode",y,v,"S"),T("qReductionMode",y,v,"N"),T("qSortbyYValue",y,v),T("qIndentMode",y,v),T("qShowTotalsAbove",y,v),C(m,t,r),g.qProperty=m;var E=o.getValue(u||{},"support.modifiers");return V({measures:v.qMeasures,modifierTypes:E}),h&&$(g.qProperty,"storedFilters"),"S"===v.qMode&&p&&$(g.qProperty,"dynamicScript"),g}};var U={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function Y(e,t,n,r){t=t||[];var i=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var s=e.splice(i,1);t.push(s[0])}return t}function K(e,t){return e.length!==t}const X={create:function(e,t){if(!e||!U[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var s=e[o][n],a=t.length;if(Y(s,t,r,i),K(t,a))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},G={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>0&&G.getNumMeasures(e)<=1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)>0},expression:function(e){return G.getNumMeasures(e)>=1}}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumMeasures(e)>=1}}};var Q={scatterplot:Z,"sn-scatter-plot":Z,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)<=1},expression:function(e){return G.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>=1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)>=1},expression:function(e){return G.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=X.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})),t.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}))}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,s=e.measures,a=e.label;te(r,i);var l=r[r.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),h=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=X.create(X.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=s)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:h});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:f,measures:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:h})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function ie(e,t,n,r){var i,o,s,a={};switch(e){case"dimension":n.qLibraryId?(a.type="dimension",a.name=n.qLibraryId,a.id=n.qLibraryId):(a.type="field",t?(a.name=n.label||n.qDef,a.id=n.qDef):(a.name=n.qDef.qFieldDefs[0],a.label=(s=n.qDef).qLabelExpression?s.qLabelExpression:s.qFieldLabels&&s.qFieldLabels[0]?s.qFieldLabels[0]:s.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:f().measureBase.getLibraryId(e)}(n,t),i?(a.type="measure",a.name=i,a.id=i,o=function(e,t){return f().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(a.expression=o)):(a.type="expression",t?(a.name=n.label||n.qExpression,a.id=n.qExpression):(a.name=n.qDef.qDef,a.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return a}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function se(e,t,n,r){var i=t.type,o=e.color,s=o.mode,a=G.getItemLabel(t);switch(ne(e,a||""),i){case"field":s="byDimension",o.byDimDef={label:t.label||G.wrapFieldName(t.name),key:G.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":s="byMeasure",o.byMeasureDef={label:a,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":s="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":s="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}o.auto=!1,o.mode=s}function ae(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byDimDef");if(s&&ne(e,s.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,se(e,i)}(e,t);else if(function(e){return!e||!e.key}(s)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),s=Number(i[1]),a=o.getValue(t,"layers.".concat(s,".type"));return 2===e.length&&"map"===r&&"point"===a}(n,e,t)?0:n.length-1],i=X.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return se(e,ie("dimension",!!s,s||r)),!!s}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ce=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ue=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},de=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),s=o.getValue(e,"".concat(t,"qDimensions"),[]),a=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(s,l):!(n={auto:i,colorMode:r,dimensions:s}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?ae(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,s=e.properties,a=o.getValue(s,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==a&&!i.length)}({auto:i,colorMode:r,dimensions:s,measures:a,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byMeasureDef");if(s&&ne(e,s.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,se(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(s,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],s=X.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(i.qAttributeExpressions,"id",s);return se(e,ie("measure",!!a,a||r[0])),!!a}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,s)}(e,t)},he=function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},fe=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},pe=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},ge=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},me=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=W.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],s=o.dimensions.concat(o.excludedDimensions),a=o.measures.concat(o.excludedMeasures),l=X.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return X.moveByIdFromGroup(s,[],"qAttributeDimensions",c),X.moveByIdFromGroup(s,[],"qAttributeExpressions",c),X.moveByIdFromGroup(a,[],"qAttributeExpressions",u),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,s=e.hypercubePath,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=W.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:s,extension:a,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty,h=o.getValue(d,"visualization"),f=o.getValue(d,"qHyperCubeDef.qDimensions",[]),p=o.getValue(d,"color.mode",""),g=o.getValue(d,"color.auto",""),m=ce(d,h),y=ue({canColorBy:m,autoColor:g,colorMode:p,dimensions:f});return m[p]?fe({shouldUpdateColorBy:y,properties:d})&&pe(d):ge(d),y&&de(d,"qHyperCubeDef."),me(d)&&le(d,"color.persistent",!0),he(f),u}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||M()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||M()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,s=i.qHyperCubeDef,a=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ve.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(s);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&M()(a,n.properties.measureAxes[t[0].axis])):M()(a,n.properties.measureAxes[0])}},we=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},Me={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,s=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),a=s.properties;return o?(x(a,"measureAxis.min","supportedAutoMinMax"),x(a,"measureAxis.max","supportedAutoMinMax")):(x(a,"measureAxis.min","unsupportedAutoMinMax"),x(a,"measureAxis.max","unsupportedAutoMinMax")),s},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,s=e.measureType,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:a,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty;return be({initialProperties:n,properties:d}),xe({exportFormat:t,initialProperties:n,properties:d,measureType:s}),we(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],u}};function ke(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function _e(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,s=e.itemPath,a=o.getValue(i,s);if(void 0!==a){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var c=ke(n,r,l);o.setValue(t,c,a),o.setValue(i,s,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})}))}function Se(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,s=e.itemPath,a=o.getValue(i,"qDef.cId");if(a){var l=ke(n,r,a),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,s,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})}))}var qe="qHyperCubeDef.qMeasures",De="conditionalColoring",Ee="measures",Ce="qDef.conditionalColoring";const Ae={quarantine:function(e){_e({properties:e,arrayPath:qe,quarantineName:De,arrayName:Ee,itemPath:Ce})},unquarantine:function(e){Se({properties:e,arrayPath:qe,itemPath:Ce,arrayName:Ee,quarantineName:De})}};var Te="qHyperCubeDef.qMeasures",Ne="measures",Re="qHyperCubeDef.qDimensions",Oe="dimensions",Ie="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Pe="alternativeMeasures",Le="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",je="alternativeDimensions",ze="qCalcCondition",Fe="conditionalShowHide";const He={quarantine:function(e){_e({properties:e,arrayPath:Te,quarantineName:Fe,arrayName:Ne,itemPath:ze}),_e({properties:e,arrayPath:Re,quarantineName:Fe,arrayName:Oe,itemPath:ze})},unquarantine:function(e){Se({properties:e,arrayPath:Te,quarantineName:Fe,arrayName:Ne,itemPath:ze}),Se({properties:e,arrayPath:Re,quarantineName:Fe,arrayName:Oe,itemPath:ze})},quarantineAlternative:function(e){_e({properties:e,arrayPath:Ie,quarantineName:Fe,arrayName:Pe,itemPath:ze}),_e({properties:e,arrayPath:Le,quarantineName:Fe,arrayName:je,itemPath:ze})},unquarantineAlternative:function(e){Se({properties:e,arrayPath:Ie,quarantineName:Fe,arrayName:Pe,itemPath:ze}),Se({properties:e,arrayPath:Le,quarantineName:Fe,arrayName:je,itemPath:ze})}},Be={hypercube:W,colorChart:ye,axisChart:Me,quarantineProperty:x,unquarantineProperty:$,quarantineArrayProp:_e,unquarantineArrayProp:Se,conditionalColoring:Ae,conditionalShow:He}})(),r.default})()}(Mm)),Mm.exports),_m=n(km);const Sm={AUTO:!0,BIN_COUNT:10,BIN_SIZE:10,LABEL:"x",OFFSET:0,COUNT_DISTINCT:!1,BIN_MODE:"maxCount"};Object.freeze(Sm);const qm={version:"1.0.1",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"S",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},bins:{auto:Sm.AUTO,binCount:"",binSize:Sm.BIN_SIZE,offset:Sm.OFFSET,countDistinct:Sm.COUNT_DISTINCT,binMode:Sm.BIN_MODE},color:{bar:{paletteColor:{index:6,color:"#4477aa"}}},dataPoint:{showLabels:!1},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",label:"",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function Dm(e){const{translator:t}=e;return{path:"/qHyperCubeDef",dimensions:{min:1,max:1,description:()=>t.get("Visualization.Histogram.Binning")},measures:{min:0,max:0}}}function Em(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Cm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||Tm(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Am(e){return function(e){if(Array.isArray(e))return Em(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Tm(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tm(e,t){if(e){if("string"==typeof e)return Em(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Em(e,t):void 0}}var Nm=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],Rm=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var Om=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function Im(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],s=t.getStyle("","","fontFamilies");return Array.isArray(s)&&s.length?o.push.apply(o,Am(new Set([r].concat(Am(s.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(Am(o.map((function(e){return Om(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],Am(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?Rm:Nm}(i).map((function(e){return Om(e)}))))}function Pm(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,s=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return s()},getOptions:function(){return Im({theme:t,translator:n,defaultValue:s(),flags:o})}}}var Lm,jm,zm=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Fm=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function Hm(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,Am(new Set([n].concat(Am(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(Am(r.map((function(e){return Fm(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],Am(zm.map((function(e){return Fm(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function Bm(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:Pm({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:Hm({theme:t,translator:n,id:r,path:i})}}function Vm(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,s=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),a=s.id,l=s.paths,c={};l.forEach((function(e){for(var r=e.split("."),i=c,s=0;s<r.length;s++){var l=r[s];s===r.length-1?i[l]=Bm({theme:t,translator:n,id:a,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}}));var u=function(e){for(var t=e.split("."),n=c,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}var $m,Wm=function(){if(jm)return Lm;jm=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return Lm=function e(){var t,n,r,l,c,u,d=arguments[0],h=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h<f;++h)if(null!=(t=arguments[h]))for(n in t)r=a(d,n),d!==(l=a(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},s(d,{name:n,newValue:e(p,u,l)})):void 0!==l&&s(d,{name:n,newValue:l}));return d},Lm}();function Um(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ym(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Km(){}($m=Wm)&&$m.__esModule&&Object.prototype.hasOwnProperty.call($m,"default")&&$m.default;var Xm=1/.7,Gm="\\s*([+-]?\\d+)\\s*",Jm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Zm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Qm=/^#([0-9a-f]{3,8})$/,ey=new RegExp(`^rgb\\(${Gm},${Gm},${Gm}\\)$`),ty=new RegExp(`^rgb\\(${Zm},${Zm},${Zm}\\)$`),ny=new RegExp(`^rgba\\(${Gm},${Gm},${Gm},${Jm}\\)$`),ry=new RegExp(`^rgba\\(${Zm},${Zm},${Zm},${Jm}\\)$`),iy=new RegExp(`^hsl\\(${Jm},${Zm},${Zm}\\)$`),oy=new RegExp(`^hsla\\(${Jm},${Zm},${Zm},${Jm}\\)$`),sy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function ay(){return this.rgb().formatHex()}function ly(){return this.rgb().formatRgb()}function cy(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Qm.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?uy(t):3===n?new py(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?dy(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?dy(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=ey.exec(e))?new py(t[1],t[2],t[3],1):(t=ty.exec(e))?new py(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ny.exec(e))?dy(t[1],t[2],t[3],t[4]):(t=ry.exec(e))?dy(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=iy.exec(e))?xy(t[1],t[2]/100,t[3]/100,1):(t=oy.exec(e))?xy(t[1],t[2]/100,t[3]/100,t[4]):sy.hasOwnProperty(e)?uy(sy[e]):"transparent"===e?new py(NaN,NaN,NaN,0):null}function uy(e){return new py(e>>16&255,e>>8&255,255&e,1)}function dy(e,t,n,r){return r<=0&&(e=t=n=NaN),new py(e,t,n,r)}function hy(e){return e instanceof Km||(e=cy(e)),e?new py((e=e.rgb()).r,e.g,e.b,e.opacity):new py}function fy(e,t,n,r){return 1===arguments.length?hy(e):new py(e,t,n,null==r?1:r)}function py(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function gy(){return`#${by(this.r)}${by(this.g)}${by(this.b)}`}function my(){const e=yy(this.opacity);return`${1===e?"rgb(":"rgba("}${vy(this.r)}, ${vy(this.g)}, ${vy(this.b)}${1===e?")":`, ${e})`}`}function yy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function vy(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function by(e){return((e=vy(e))<16?"0":"")+e.toString(16)}function xy(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new My(e,t,n,r)}function wy(e){if(e instanceof My)return new My(e.h,e.s,e.l,e.opacity);if(e instanceof Km||(e=cy(e)),!e)return new My;if(e instanceof My)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new My(s,a,l,e.opacity)}function My(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function ky(e){return(e=(e||0)%360)<0?e+360:e}function _y(e){return Math.max(0,Math.min(1,e||0))}function Sy(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Um(Km,cy,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ay,formatHex:ay,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return wy(this).formatHsl()},formatRgb:ly,toString:ly}),Um(py,fy,Ym(Km,{brighter(e){return e=null==e?Xm:Math.pow(Xm,e),new py(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new py(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new py(vy(this.r),vy(this.g),vy(this.b),yy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:gy,formatHex:gy,formatHex8:function(){return`#${by(this.r)}${by(this.g)}${by(this.b)}${by(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:my,toString:my})),Um(My,(function(e,t,n,r){return 1===arguments.length?wy(e):new My(e,t,n,null==r?1:r)}),Ym(Km,{brighter(e){return e=null==e?Xm:Math.pow(Xm,e),new My(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new My(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new py(Sy(e>=240?e-240:e+120,i,r),Sy(e,i,r),Sy(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new My(ky(this.h),_y(this.s),_y(this.l),yy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=yy(this.opacity);return`${1===e?"hsl(":"hsla("}${ky(this.h)}, ${100*_y(this.s)}%, ${100*_y(this.l)}%${1===e?")":`, ${e})`}`}}));const qy=Math.PI/180,Dy=180/Math.PI,Ey=4/29,Cy=6/29,Ay=3*Cy*Cy;function Ty(e){if(e instanceof Ny)return new Ny(e.l,e.a,e.b,e.opacity);if(e instanceof Ly)return jy(e);e instanceof py||(e=hy(e));var t,n,r=Py(e.r),i=Py(e.g),o=Py(e.b),s=Ry((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=s:(t=Ry((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Ry((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Ny(116*s-16,500*(t-s),200*(s-n),e.opacity)}function Ny(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Ry(e){return e>.008856451679035631?Math.pow(e,1/3):e/Ay+Ey}function Oy(e){return e>Cy?e*e*e:Ay*(e-Ey)}function Iy(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Py(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ly(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function jy(e){if(isNaN(e.h))return new Ny(e.l,0,0,e.opacity);var t=e.h*qy;return new Ny(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Um(Ny,(function(e,t,n,r){return 1===arguments.length?Ty(e):new Ny(e,t,n,null==r?1:r)}),Ym(Km,{brighter(e){return new Ny(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ny(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new py(Iy(3.1338561*(t=.96422*Oy(t))-1.6168667*(e=1*Oy(e))-.4906146*(n=.82521*Oy(n))),Iy(-.9787684*t+1.9161415*e+.033454*n),Iy(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Um(Ly,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Ly)return new Ly(e.h,e.c,e.l,e.opacity);if(e instanceof Ny||(e=Ty(e)),0===e.a&&0===e.b)return new Ly(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Dy;return new Ly(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Ly(e,t,n,null==r?1:r)}),Ym(Km,{brighter(e){return new Ly(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Ly(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return jy(this).rgb()}}));var zy=e=>()=>e;function Fy(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):zy(isNaN(e)?t:e)}!function e(t){var n=function(e){return 1==(e=+e)?Fy:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):zy(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=fy(e)).r,(t=fy(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=Fy(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1);var Hy="center",By="bottom";function Vy(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(void 0===i[s])return n;i=i[s]}return i}[{key:"NoDataExist",alignment:Hy,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:Hy,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every((function(e){return"NaN"===e.qMin&&"NaN"===e.qMax}))}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:Hy,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:Hy},{key:"DataRangeIncludingZero",alignment:By},{key:"LimitedData",alignment:By},{key:"NegativeOrZeroValues",alignment:By}].reduce((function(e,t){return e[t.key]=t,e}),{});var $y,Wy=["__proto__","constructor"];function Uy(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!Wy.some((function(e){return r.includes(e)}))){for(var o=e,s=0;s<r.length-1;++s){var a=r[s];void 0===o[a]&&(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}}}function Yy(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function Ky(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Gy)):void 0===t&&(t=Xy);for(var n,r,i,o,s,a=new Qy(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new Qy(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(Zy)}function Xy(e){return e.children}function Gy(e){return Array.isArray(e)?e[1]:null}function Jy(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Zy(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Qy(e){this.data=e,this.depth=this.height=0,this.parent=null}Qy.prototype=Ky.prototype={constructor:Qy,count:function(){return this.eachAfter(Yy)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Ky(this).eachBefore(Jy)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},$y=function(e){
25
25
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
26
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),x=m>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=t[0]).length%l,d=h.length,v=0;v<d;v++)g+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},Vy({exports:{}});var Qy="'Source Sans Pro', 'Arial', 'sans-serif'",eb="#333333",tb="#595959",nb="#737373",rb="#cccccc",ib="#e6e6e6";function ob(e){var t={};return[].concat(Em(e),Em([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",tb],["object","axis.label.name","fontFamily",Qy],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",rb],["object","axis.line.minor","color",ib],["object","axis.title","color"],["object","axis.title","fontFamily",Qy],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",ib],["object","grid.line.major","color",rb],["object","grid.line.minor","color",ib],["object","label.value","color",tb],["object","label.value","fontFamily",Qy],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",tb],[!1,"label.value","lightColor",ib],["object","outOfRange","color","#999"],["object","legend.title","color",eb],["object","legend.title","fontFamily",Qy],["object","legend.title","fontSize","15px"],["object","legend.label","color",tb],["object","legend.label","fontFamily",Qy],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",eb],["object","referenceLine.label.name","fontFamily",Qy],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",ib],["object","referenceLine.outOfBounds","fontFamily",Qy],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",nb,function(e){return"transparent"===e?nb:e}]])).reduce((function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var sb,ab,lb=function(e){return e};function cb(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,s={},a=r.reduce((function(e,t){var n=Cm(t,2),r=n[0],i=n[1];return e[r]=i,e}),{});return o.forEach((function(e){var r=Cm(e,5),i=r[0],o=r[1],l=r[2],c=r[3],u=r[4],h=void 0===u?function(e){return e}:u,d=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,s=void 0===o?void 0:o;if(!t||!1===n)return s;var a=t.getStyle(n,r,i);return void 0===a?s:a}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:c}),f=(a["".concat(o,".").concat(l)]||lb)(h(d));Wy(s,[o,l].filter(Boolean).join("."),f)})),i.forEach((function(e){var t=Cm(e,2),n=t[0],r=t[1];Wy(s,n,r)})),s}var ub=function(){if(ab)return sb;ab=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return sb=function e(){var t,n,r,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=a(h,n),h!==(l=a(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},s(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&s(h,{name:n,newValue:l}));return h},sb}(),hb=n(ub);var db=Object.prototype.hasOwnProperty,fb=Object.prototype.toString,pb=Object.defineProperty,gb=Object.getOwnPropertyDescriptor,mb=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===fb.call(e)},yb=function(e){if(!e||"[object Object]"!==fb.call(e))return!1;var t,n=db.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&db.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||db.call(e,t)},bb=function(e,t){pb&&"__proto__"===t.name?pb(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},vb=function(e,t){if("__proto__"===t){if(!db.call(e,t))return;if(gb)return gb(e,t).value}return e[t]};function xb(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function wb(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function kb(){}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}((function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=vb(a,n),a!==(i=vb(t,n))&&(u&&i&&(yb(i)||(o=mb(i)))?(o?(o=!1,s=r&&mb(r)?r:[]):s=r&&yb(r)?r:{},bb(a,{name:n,newValue:e(u,s,i)})):void 0!==i&&bb(a,{name:n,newValue:i}));return a}));var Mb=1/.7,_b="\\s*([+-]?\\d+)\\s*",Sb="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qb="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Db=/^#([0-9a-f]{3,8})$/,Cb=new RegExp(`^rgb\\(${_b},${_b},${_b}\\)$`),Eb=new RegExp(`^rgb\\(${qb},${qb},${qb}\\)$`),Ab=new RegExp(`^rgba\\(${_b},${_b},${_b},${Sb}\\)$`),Tb=new RegExp(`^rgba\\(${qb},${qb},${qb},${Sb}\\)$`),Nb=new RegExp(`^hsl\\(${Sb},${qb},${qb}\\)$`),Rb=new RegExp(`^hsla\\(${Sb},${qb},${qb},${Sb}\\)$`),Ob={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Ib(){return this.rgb().formatHex()}function Pb(){return this.rgb().formatRgb()}function Lb(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Db.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?jb(t):3===n?new Bb(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?zb(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?zb(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Cb.exec(e))?new Bb(t[1],t[2],t[3],1):(t=Eb.exec(e))?new Bb(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ab.exec(e))?zb(t[1],t[2],t[3],t[4]):(t=Tb.exec(e))?zb(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Nb.exec(e))?Kb(t[1],t[2]/100,t[3]/100,1):(t=Rb.exec(e))?Kb(t[1],t[2]/100,t[3]/100,t[4]):Ob.hasOwnProperty(e)?jb(Ob[e]):"transparent"===e?new Bb(NaN,NaN,NaN,0):null}function jb(e){return new Bb(e>>16&255,e>>8&255,255&e,1)}function zb(e,t,n,r){return r<=0&&(e=t=n=NaN),new Bb(e,t,n,r)}function Fb(e){return e instanceof kb||(e=Lb(e)),e?new Bb((e=e.rgb()).r,e.g,e.b,e.opacity):new Bb}function Hb(e,t,n,r){return 1===arguments.length?Fb(e):new Bb(e,t,n,null==r?1:r)}function Bb(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Vb(){return`#${Yb(this.r)}${Yb(this.g)}${Yb(this.b)}`}function $b(){const e=Wb(this.opacity);return`${1===e?"rgb(":"rgba("}${Ub(this.r)}, ${Ub(this.g)}, ${Ub(this.b)}${1===e?")":`, ${e})`}`}function Wb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ub(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Yb(e){return((e=Ub(e))<16?"0":"")+e.toString(16)}function Kb(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Gb(e,t,n,r)}function Xb(e){if(e instanceof Gb)return new Gb(e.h,e.s,e.l,e.opacity);if(e instanceof kb||(e=Lb(e)),!e)return new Gb;if(e instanceof Gb)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new Gb(s,a,l,e.opacity)}function Gb(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Jb(e){return(e=(e||0)%360)<0?e+360:e}function Zb(e){return Math.max(0,Math.min(1,e||0))}function Qb(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}xb(kb,Lb,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ib,formatHex:Ib,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Xb(this).formatHsl()},formatRgb:Pb,toString:Pb}),xb(Bb,Hb,wb(kb,{brighter(e){return e=null==e?Mb:Math.pow(Mb,e),new Bb(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Bb(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Bb(Ub(this.r),Ub(this.g),Ub(this.b),Wb(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Vb,formatHex:Vb,formatHex8:function(){return`#${Yb(this.r)}${Yb(this.g)}${Yb(this.b)}${Yb(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:$b,toString:$b})),xb(Gb,(function(e,t,n,r){return 1===arguments.length?Xb(e):new Gb(e,t,n,null==r?1:r)}),wb(kb,{brighter(e){return e=null==e?Mb:Math.pow(Mb,e),new Gb(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Gb(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Bb(Qb(e>=240?e-240:e+120,i,r),Qb(e,i,r),Qb(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Gb(Jb(this.h),Zb(this.s),Zb(this.l),Wb(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Wb(this.opacity);return`${1===e?"hsl(":"hsla("}${Jb(this.h)}, ${100*Zb(this.s)}%, ${100*Zb(this.l)}%${1===e?")":`, ${e})`}`}}));const ev=Math.PI/180,tv=180/Math.PI,nv=4/29,rv=6/29,iv=3*rv*rv;function ov(e){if(e instanceof sv)return new sv(e.l,e.a,e.b,e.opacity);if(e instanceof hv)return dv(e);e instanceof Bb||(e=Fb(e));var t,n,r=uv(e.r),i=uv(e.g),o=uv(e.b),s=av((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=s:(t=av((.4360747*r+.3850649*i+.1430804*o)/.96422),n=av((.0139322*r+.0971045*i+.7141733*o)/.82521)),new sv(116*s-16,500*(t-s),200*(s-n),e.opacity)}function sv(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function av(e){return e>.008856451679035631?Math.pow(e,1/3):e/iv+nv}function lv(e){return e>rv?e*e*e:iv*(e-nv)}function cv(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function uv(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function hv(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function dv(e){if(isNaN(e.h))return new sv(e.l,0,0,e.opacity);var t=e.h*ev;return new sv(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}xb(sv,(function(e,t,n,r){return 1===arguments.length?ov(e):new sv(e,t,n,null==r?1:r)}),wb(kb,{brighter(e){return new sv(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new sv(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new Bb(cv(3.1338561*(t=.96422*lv(t))-1.6168667*(e=1*lv(e))-.4906146*(n=.82521*lv(n))),cv(-.9787684*t+1.9161415*e+.033454*n),cv(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),xb(hv,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof hv)return new hv(e.h,e.c,e.l,e.opacity);if(e instanceof sv||(e=ov(e)),0===e.a&&0===e.b)return new hv(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*tv;return new hv(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new hv(e,t,n,null==r?1:r)}),wb(kb,{brighter(e){return new hv(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new hv(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return dv(this).rgb()}}));var fv,pv=e=>()=>e;function gv(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):pv(isNaN(e)?t:e)}function mv(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(void 0===i[s])return n;i=i[s]}return i}function yv(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function bv(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=xv)):void 0===t&&(t=vv);for(var n,r,i,o,s,a=new Mv(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new Mv(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(kv)}function vv(e){return e.children}function xv(e){return Array.isArray(e)?e[1]:null}function wv(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function kv(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Mv(e){this.data=e,this.depth=this.height=0,this.parent=null}!function e(t){var n=function(e){return 1==(e=+e)?gv:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):pv(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Hb(e)).r,(t=Hb(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=gv(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1),Mv.prototype=bv.prototype={constructor:Mv,count:function(){return this.eachAfter(yv)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return bv(this).eachBefore(wv)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},fv=function(e){
26
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,d,h=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=h-m,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=m>0?e.substring(b,h):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(d=t[0]).length%l,h=d.length,b=0;b<h;b++)g+=d.charAt(b),!((b-y+1)%l)&&b<h-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},$y({exports:{}});var ev="'Source Sans Pro', 'Arial', 'sans-serif'",tv="#333333",nv="#595959",rv="#737373",iv="#cccccc",ov="#e6e6e6";function sv(e){var t={};return[].concat(Am(e),Am([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",nv],["object","axis.label.name","fontFamily",ev],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",iv],["object","axis.line.minor","color",ov],["object","axis.title","color"],["object","axis.title","fontFamily",ev],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",ov],["object","grid.line.major","color",iv],["object","grid.line.minor","color",ov],["object","label.value","color",nv],["object","label.value","fontFamily",ev],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",nv],[!1,"label.value","lightColor",ov],["object","outOfRange","color","#999"],["object","legend.title","color",tv],["object","legend.title","fontFamily",ev],["object","legend.title","fontSize","15px"],["object","legend.label","color",nv],["object","legend.label","fontFamily",ev],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",tv],["object","referenceLine.label.name","fontFamily",ev],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",ov],["object","referenceLine.outOfBounds","fontFamily",ev],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",rv,function(e){return"transparent"===e?rv:e}]])).reduce((function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var av,lv,cv=function(e){return e};function uv(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,s={},a=r.reduce((function(e,t){var n=Cm(t,2),r=n[0],i=n[1];return e[r]=i,e}),{});return o.forEach((function(e){var r=Cm(e,5),i=r[0],o=r[1],l=r[2],c=r[3],u=r[4],d=void 0===u?function(e){return e}:u,h=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,s=void 0===o?void 0:o;if(!t||!1===n)return s;var a=t.getStyle(n,r,i);return void 0===a?s:a}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:c}),f=(a["".concat(o,".").concat(l)]||cv)(d(h));Uy(s,[o,l].filter(Boolean).join("."),f)})),i.forEach((function(e){var t=Cm(e,2),n=t[0],r=t[1];Uy(s,n,r)})),s}var dv=function(){if(lv)return av;lv=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return av=function e(){var t,n,r,l,c,u,d=arguments[0],h=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h<f;++h)if(null!=(t=arguments[h]))for(n in t)r=a(d,n),d!==(l=a(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},s(d,{name:n,newValue:e(p,u,l)})):void 0!==l&&s(d,{name:n,newValue:l}));return d},av}(),hv=n(dv);const fv=/xyz/.test((()=>{}))?/\b_super\b/:/.*/,pv=function(){};pv.extend=function e(t,n){const r=this.prototype;"string"!=typeof t&&(n=t,t="Class");const i=Object.create(this.prototype);for(const e in n)i[e]="function"==typeof n[e]&&"function"==typeof r[e]&&fv.test(n[e])?function(e,t){return function(){const n=this._super;this._super=r[e];const i=t.apply(this,arguments);return this._super=n,i}}(e,n[e]):n[e];if(!/^[_a-z][_a-z\d]*$/i.test(t))throw new Error("Invalid subclass name. Alphanumericals only.");const o=new Function(`return (function ${t}(){ typeof this.init === 'function' && this.init.apply(this, [].slice.call(arguments)) });`)();return o.prototype=i,o.prototype.constructor=o,o.extend=e,o};const gv={getChar(e){let t,n=e;return n>9?(t=65+n-10,t>90&&(t+=6)):n=`${n}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(t)>-1?this.getChar(n+1):String.fromCharCode(t)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function mv(){return gv.id()}const yv="scrollbar";function vv(e,t,n){return"y"===e?bv(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function bv(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var xv={getAxisDock:vv,getOppositeAxisDock:function(e,t,n){return vv(e,"far"===t?"near":"far",n)},getYAxisDock:bv};const wv=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Mv=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),kv=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function _v(e){return wv.test(e)}function Sv(e){return Mv.test(e)||kv.test(e)}var qv={lrm:String.fromCharCode(8206),detectTextDirection:function(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],_v(r))return"ltr";if(Sv(r))return"rtl"}return"ltr"}};var Dv={lineSettings:function(e,t){var n;const r={value:0,line:{stroke:void 0!==t.paletteColor?t.theme.getColorPickerColor(t.paletteColor):"transparent",strokeDasharray:null==t||null===(n=t.style)||void 0===n?void 0:n.lineType}};return hv(!0,r,e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let r=t.theme.getStyle(n,"referenceLine.label.name","color");const i=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?r=t.theme.getColorPickerColor(t.paletteColor):r||(r="transparent"),hv(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:r,fontFamily:o,fontSize:i,maxWidthPx:135}},e||{})},isVisible:e=>e&&!1!==e.show&&0!==e.show&&"0"!==e.show&&void 0!==e.refLineExpr,getRefLineTitle:function({refLine:e,label:t,valueString:n}){return!1!==e.showValue?!1!==e.showLabel?`${t} ${qv.lrm}(${n})${qv.lrm}`:`${qv.lrm}(${n})${qv.lrm}`:!1!==e.showLabel?t:""}};const Ev={SHOW_AXIS_LABELS_OPTIONS:["all","labels"],SHOW_TITLE_OPTIONS:["all","title"],HORIZONTAL:"horizontal",VERTICAL:"vertical",LAYOUTSETTINGS:{lasso:{displayOrder:1e4},rangeDim:{displayOrder:1e4},rangeMeasure:{displayOrder:1e4},rangeMinor:{displayOrder:1e4},scrollBar:{minimumLayoutMode:"SPARK",prioOrder:-1,displayOrder:100},refLines:{layout:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:1110}},measureAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},dimensionAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},measureAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},dimensionAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},gridLines:{minimumLayoutMode:"XSMALL",displayOrder:-100},refLinesLabels:{minimumLayoutMode:"SMALL",prioOrder:60,displayOrder:0}}};Ev.DEFAULT_CHART_ORIENTATION=Ev.HORIZONTAL;function Cv(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||Ev.DEFAULT_CHART_ORIENTATION,s=o===Ev.HORIZONTAL,a=s?"x":"y",l=s?"y":"x",c=Ev.SHOW_AXIS_LABELS_OPTIONS,u=Ev.SHOW_TITLE_OPTIONS,d=c.includes(r.show),h=!!n.measureTitleText&&u.includes(r.show),f=n.includeDimensionAxis&&c.includes(i.show),p=n.includeDimensionAxis&&!!n.dimensionTitleText&&u.includes(i.show),g=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),m=n.refLines&&n.refLines.some((e=>e.show)),y=[];if(d&&function(e,t,n,r){let i={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:r&&!r.autoMinMax&&r.showBounds};i=hv(i,Ev.LAYOUTSETTINGS.measureAxis);const o=Tv(t,n);e.addComponent(`${n}-axis`,i,o)}(e,n,a,r),h&&function(e,t,n){let r={text:t.measureTitleText,style:t.axisTitleStyle||{}};r=hv(r,Ev.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return Tv(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,a),function(e,t,n,r){let i=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:r};r&&r.spacing>0&&(i=hv(!0,i||{},{component:{ticks:{distance:100*r.spacing}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),f&&function(e,t,n){let r={scale:"dimension",settings:t.axisLabelStyle||{}};r=hv(r,Ev.LAYOUTSETTINGS.dimensionAxis);const i=Nv(t,n);hv(!0,r,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,r,i)}(e,n,l),p&&function(e,t,n){let r={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};r=hv(r,Ev.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return Nv(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const r={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===Ev.HORIZONTAL?Ev.VERTICAL:Ev.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,r)}(e,n,o),g&&function(e,t,n){let r={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};r=hv(r,Ev.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,a),n.hasNavigation&&function(e,t,n,r){const i=e.getSettings();i.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},s=hv({},Ev.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",s,o),Av(t,function(e){function t(t,n){if(!n||!e())return!1;const r={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(r).some((e=>e.settings.key===yv))}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(yv).emit("tap",e)}}},r={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(yv).emit("panStart",e)},pan(e){this.chart.component(yv).emit("panMove",e)},panend(e){this.chart.component(yv).emit("panEnd",e)},pancancel(e){this.chart.component(yv).emit("panCancel",e)}}};return[n,r]}(n.isNavigationEnabledFn))}(e,y,n,s),m&&function(e,t,n,r){const i=xv.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=hv(o,Ev.LAYOUTSETTINGS.refLines);let s={key:`ref-line-labels-${mv()}`,require:["renderer","chart"],dock:xv.getOppositeAxisDock(n,r.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,r=this.chart.formatter({data:e.settings.scales.measure.data}),i=s.lines.y.map((e=>{const n=!1!==e.label.showValue?`(${r(e.value)})`:"",i=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:i,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}})),o=i[0];for(let e=1;e<i.length;e++)i[e].wanted>o.wanted&&(o.wanted=i[e].wanted),i[e].required>o.required&&(o.required=i[e].required);const a=12;return o.required+a>100?o.required+a:Math.min(o.wanted+a,100)},lines:{x:[],y:[]}};s=hv(s,Ev.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach((r=>{if(!r.show)return;const a=r.refLineExpr&&r.refLineExpr.value,l=hv(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),c=Dv.lineSettings({scale:"measure",dir:n,value:a},l);o.lines[n].push(c);const u=Dv.lineLabelSettings({scale:"measure",value:a,label:{text:!1!==r.showLabel?r.label:"",showValue:!1!==r.showValue}},l);"x"===n?u.label.vAlign="near"===i?1:0:u.label.align="near"===i?0:1,s.lines[n].push(u)})),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",s,{})}(e,n,a,r),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",Ev.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=hv(o,Ev.LAYOUTSETTINGS.rangeDim);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.dimRange||{},s,Nv(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=hv(o,Ev.LAYOUTSETTINGS.rangeMeasure);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.measureRange||{},s,Tv(n,a).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=hv(o,Ev.LAYOUTSETTINGS.rangeMinor);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:r,isRtl:i,chartInstance:t.chartInstance};e.addComponent("range-area",o,s)}(e,n.areaRange||{},s,Nv(n,l).dock,n.isRtl)}n.brushActions&&Av(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function Av(e,t){t.forEach((t=>{e.push(t)}))}function Tv(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function Nv(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function Rv(e,t){const n=t||{},r=!n.orientation||"horizontal"===n.orientation,i=!!n.isRtl,o={name:n.name||"scale",component:{invert:r&&i,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return hv(!0,{},o,e||{})}function Ov(e){var t;if(null!=e&&null!==(t=e.isEnabled)&&void 0!==t&&t.call(e,"IM_5791_SVG_LABEL_RENDERING"))return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}function Iv(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.line.major","color"),a=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),c=t.theme.getStyle(n,"axis.label.name","color"),u=t.theme.getStyle(n,"axis.label.name","fontSize"),d=t.theme.getStyle(n,"axis.title","fontFamily"),h=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",renderer:Ov(t.flags),dock:xv.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:a,fontFamily:d,fill:l},line:{show:!0,strokeWidth:1,stroke:s},labels:{fill:c,fontSize:u,fontFamily:h,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:s},minorTicks:{stroke:s}}},p=hv(!0,{},f,e||{});return p.brush.consume.forEach((e=>{e.style.active.strokeWidth=0})),p}function Pv(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.title","fontSize"),a=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),c={key:"text",type:"text",dock:xv.getAxisDock(i,r,o)||"bottom",displayOrder:0,style:{text:{fontSize:s,fontFamily:l,fill:a}}};return hv(!0,{},c,e||{})}Rv.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const r={name:"measure",component:{expand:.1,data:{fields:n.map((e=>({field:e})))}}},i=t&&t.measureAxisProperties;i&&!i.autoMinMax&&(["min","minMax"].includes(i.minMax)&&(r.component.min=i.min),["max","minMax"].includes(i.minMax)&&(r.component.max=i.max));const o=Rv(hv(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},Rv.dimensionScale=function(e,t){const n={name:"dimension",component:{trackBy:"id",type:"band",data:{extract:{field:t&&t.source||"",props:{label:e=>e.qText||""}}},label:e=>e.datum.label.value}};return Rv(hv(!0,n,e||{}),t)},Iv.xAxis=function(e,t){return Iv(hv(!0,{key:"x-axis",scale:"x"},e||{}),t)},Iv.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:xv.getYAxisDock(n,r)};return Iv(hv(!0,i,e||{}),t)},Pv.xAxisTitle=function(e,t){return Pv(hv(!0,{key:"x-axis-title"},e||{}),t)},Pv.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:xv.getYAxisDock(n,r)||"left"};return Pv(hv(!0,i,e||{}),t)};var Lv={getBublesAlign:function(e,t,n){let r=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(r=!r),r?"start":"end"},getDock:function(e,t){const n=[];let r;return e&&n.push(`@${e}`),t&&n.push(`@${t}`),n.length&&(r=n.join(",")),r}};const jv={SPARK:{width:0,height:0},XSMALL:{width:150,height:75},SMALL:{width:300,height:150},MEDIUM:{width:400,height:220},FULL:{width:550,height:450}};function zv(){return jv}function Fv(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}zv.getLayoutModeKeys=function(){const e=[];let t;for(t in jv)e.push(t);return e};const Hv={left:"left",right:"right",up:"top",down:"bottom"};function Bv(e,t,n){switch(e){case"scale":return Rv(t,n);case"measure-scale":return Rv.measureScale(t,n);case"dimension-scale":return Rv.dimensionScale(t,n);case"axis":return Iv(t,n);case"box-marker":return function(e){return hv(!0,{},{key:"box-marker",type:"box-marker",settings:{minor:{scale:"x"},orientation:"horizontal"},brush:{trigger:[],consume:[]}},e||{})}(t);case"point-marker":return function(e){return hv(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,r=t&&t.chartID,i=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:i?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(r,"","backgroundColor"),invert:n&&i}};return hv(!0,{},o,e||{})}(t,n);case"text":return Pv(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushComponents?t.brushComponents:[],i=t&&t.brushData?t.brushData:["elemNo"],o={type:"brush-lasso",key:"lasso",displayOrder:99,settings:{brush:{components:[]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"rgba(102,102,102,1)",strokeWidth:2,opacity:1,strokeDasharray:null},startPoint:{r:10,fill:"rgba(0, 152, 69, 1)",strokeWidth:0,opacity:1}}};return r.forEach((e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:i})})),hv(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushArea,o=t&&t.brushScale,s=t&&t.isHorizontal,a=t&&t.dock,l=t&&t.isRtl,c={type:"brush-range",key:"range",displayOrder:99,dock:Lv.getDock(r,i),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:s?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:Lv.getBublesAlign(s,a,l)}}};return hv(!0,{},c,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],s=t&&t.brushArea,a=t&&t.isHorizontal,l=t&&t.dock,c=t&&t.isRtl,u=t&&t.chartInstance;let d=!0;const h={type:"brush-area-dir",key:"area",displayOrder:99,dock:Lv.getDock(r,s),settings:{brush:{components:[]},direction:a?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:Lv.getBublesAlign(a,l,c),label:e=>d?(d=!1,u.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(d=!0,u.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach((e=>{h.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})})),hv(!0,{},h,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const s=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.title","fontFamily"),d=t.theme.getStyle(n,"legend.label","fontFamily"),h={key:"legend",type:"legend-cat",renderer:Ov(t.flags),dock:i,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:r?"rtl":"ltr",size:"top"===i||"bottom"===i?2:1,vertical:"top"===i||"bottom"===i?16:8},navigation:{button:{class:{"lui-fade-button":!0},content:(e,t)=>e("span",{style:{pointerEvents:"none"},class:["lui-button__icon","lui-icon",`lui-icon--triangle-${Hv[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:c,fontFamily:d,fill:l,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(c,10)/4}},title:{show:t.showTitle,fontSize:a,fontFamily:u,fill:s}}};return hv(!0,{},h,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t.dock||"auto";"auto"===i&&(i=t.chartHeight<t.chartWidth?r?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),a=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.label","fontFamily");function d(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const h={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:d(r?"right":"left"),major:{invert:"left"===i||"right"===i||r},title:{show:t.showTitle,fontSize:s,fontFamily:a,fill:o},tick:{fill:l,fontSize:c,fontFamily:u}}};return hv(!0,{},h,e)}(t,n);case"x-axis":return Iv.xAxis(t,n);case"y-axis":return Iv.yAxis(t,n);case"x-axis-title":return Pv.xAxisTitle(t,n);case"y-axis-title":return Pv.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"grid.line.major","color");return hv(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:r},minorTicks:{stroke:r}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return hv(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),i=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return hv(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:i,text:{fill:r},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return hv(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"label.value","color"),i=t.theme.getStyle(n,"label.value","fontSize"),o=t.theme.getStyle(n,"label.value","fontFamily"),s={key:"labels",type:"labels",renderer:Ov(t.flags),displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:o,fontSize:parseFloat(i),align:.5,labels:[{placements:[{position:"outside",fill:r,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:Fv}]}}}]}};return hv(!0,{},s,e||{})}(t,n);default:return}}function Vv(e){this.options=e||{},this.settings={dockLayout:{layoutModes:zv()},components:[],scales:{}}}Vv.prototype.addComponent=function(e,t,n){const r=Bv(e,t,hv(!0,{},this.options,n||{}));return this.settings.components.push(r),r},Vv.prototype.addInteraction=function(e,t){const n=Bv("interaction",e,hv(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},Vv.prototype.addScale=function(e,t,n){const r=Bv(e,t,hv(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},Vv.prototype.getSettings=function(){return this.settings},Vv.prototype.getComponent=function(e){return this.settings.components.filter((t=>t.key===e))[0]},Vv.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");Cv(t,n)}(e,this,t)},Vv.validateComponentKeys=function(e){const t={};return e.map((e=>{const n=e.key;return n?t[n]?`Duplicate key for component ${e.type}`:(t[n]=!0,null):`Missing key for component ${e.type}`})).filter((e=>!!e))},Vv.create=function(e){return new Vv(e)},Vv.createComponent=Bv;const $v={CENTER:0,BOTTOM:1};var Wv={DISCLAIMERS:[{label:"NoDataExist",alignment:$v.CENTER,default:!0},{label:"RequireNumericDimension",alignment:$v.CENTER,default:!1},{label:"OnlyNanData",alignment:$v.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:$v.CENTER,default:!1},{label:"LimitedData",alignment:$v.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:$v.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:$v.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:$v.BOTTOM,default:!1}],ALIGNMENT:$v};const Uv={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx===0,getLimitedDataAttribute(e,t){let n,r=!1;var i;return e?void 0!==t.explicitLimitedData?r=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?r=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(i=e.qStackedDataPages)&&i[0]&&i[0].qData[0]&&i[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,r=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some((e=>e.qDown>0)):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):r=!0===t.explicitLimitedData,r},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some((e=>e.qMin<=0)),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every((e=>e.qMax<=0&&e.qMax>=e.qMin))||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every((e=>e.qMax<e.qMin||"NaN"===e.qMax)),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let r,i,o,s,a;for(e&&(i=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,r=0;r<n;r++)if(s=Math.min(s,t[r].qMin),a=Math.max(a,t[r].qMax),s<=0&&a>=0)return!0;return s=i?e.min:s,a=o?e.max:a,s<=0&&a>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},r={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,Wv.DISCLAIMERS.forEach((e=>{r[e.label]=!1})),t&&t.qHyperCube?(r.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),r.NoDataExist?r:(r.RequireNumericDimension=n.explicitRequireNumericDimension,r.RequireNumericDimension||(r.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),r.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),r.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),r)):r}};function Yv(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function Kv(e,t){return e&&t&&t[e]}function Xv(e){this.environment=e,this.clear()}Yv.prototype.isValidAndSupported=function(e,t){return Kv(e.label,this.dataAttributes)&&(e.default||Kv(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},Yv.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach((r=>{n.isValidAndSupported(r,e)&&(t=!0)})),t},Yv.prototype.getMessage=function(e,t){let n="";const r=this;return t&&this.disclaimersConfig.forEach((i=>{r.isValidAndSupported(i,e)&&(n+=`${t.get(`Object.Disclaimer.${i.label}`)} `)})),n},Xv.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},Xv._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach((e=>{void 0===n[e.label]&&(n[e.label]=e.default)})),n},Xv.prototype.getComponentSettings=function(){var e;const{translator:t}=this.environment,n=hv(!0,{},this.vizAttributes.supportedDisclaimers),r=new Yv(Wv.DISCLAIMERS,this.dataAttributes,n);let i,o;if(r.isAnyValidDisclaimer(Wv.ALIGNMENT.CENTER))i=r.getMessage(Wv.ALIGNMENT.CENTER,t),o="center";else{if(!r.isAnyValidDisclaimer(Wv.ALIGNMENT.BOTTOM))return;i=r.getMessage(Wv.ALIGNMENT.BOTTOM,t),o="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:o},settings:{label:i,rtl:"rtl"===(null===(e=this.environment)||void 0===e||null===(e=e.options)||void 0===e?void 0:e.direction)}}},Xv.prototype.set=function(e){if(this.clear(),!e)throw new Error(Xv.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=Uv.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},Xv.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const Gv=pv.extend({init(e,t,n,r,i){this.$element=t,this.environment=n,this.backendApi=r,this._selectionsApi=i,this._on=!1,this._disclaimer=new Xv(n),this._dataPaths=["qHyperCube"];const o=this;this.picassoElement=t[0],this.picassoElement.className+=" picasso-chart",this.chartInstance=e.chart({element:this.picassoElement,settings:{components:[Vv.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){var e;return"rtl"===(null===(e=this.environment.options)||void 0===e?void 0:e.direction)},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};r="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([i],null,t).then((e=>{t[r]=e}))}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){var e;this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const t=this._disclaimer.getComponentSettings(),n="center"===(null==t||null===(e=t.layout)||void 0===e?void 0:e.dock),r=this.createChartSettings(this.layout);n?r.components=[t]:t&&r.components.push(t),Vv.validateComponentKeys(r.components).forEach((e=>{console.error(e)})),this.updateChart(this.layout,r),this._painted=!0}return Promise.resolve()},resize(){if(this.layout)return this.paint()},createChartSettings(){throw new Error('Subclass must implement "createChartSettings" function')},addSnapshotChartSettings(e,t){const{freeResize:n}=this.environment.options;!n&&t.snapshotData&&(e.dockLayout.logicalSize={width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h,preserveAspectRatio:!0})},updateData(e){return this._destroyed?Promise.reject():(this.layout=hv(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){var r,i;const o=null!==(r=null===(i=this.environment.appLayout)||void 0===i?void 0:i.qLocaleInfo)&&void 0!==r?r:{},s=this._dataPaths.map((t=>({type:"q",key:t,config:{localeInfo:o},data:Vy(e,t.replace(/\//g,"."))})));this.colorService&&s.push(...this.colorService.getData()),this.chartInstance.update({data:s,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})});var Jv,Zv={exports:{}};var Qv=(Jv||(Jv=1,function(e){e.exports=function(){function e(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function r(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?n(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function i(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function o(e){var t=i(e,"string");return"symbol"==typeof t?t:t+""}var s=Object.prototype.hasOwnProperty,a=Object.prototype.toString,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===a.call(e)},d=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,n=s.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&s.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||s.call(e,t)},h=function(e,t){l&&"__proto__"===t.name?l(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},f=function(e,t){if("__proto__"===t){if(!s.call(e,t))return;if(c)return c(e,t).value}return e[t]},p=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,p=!1;for("boolean"==typeof a&&(p=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=f(a,n),a!==(i=f(t,n))&&(p&&i&&(d(i)||(o=u(i)))?(o?(o=!1,s=r&&u(r)?r:[]):s=r&&d(r)?r:{},h(a,{name:n,newValue:e(p,s,i)})):void 0!==i&&h(a,{name:n,newValue:i}));return a};function g(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=i.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),a=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(r)&&r.some(((e,t)=>e!==t))){const e=r.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function m(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function y(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:s,row:a,sourceKey:l,target:c,targetProp:u,columnOrder:d}=e,h=r;if(i.field&&i.field!==n){const e=g(i.field,o,{cache:t},d);if(-1===e)return;h=p({qRow:s},e(a))}c[u]=m(i,h,{key:l})}function v(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const s=t.raw(),a=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),d=Object.keys(c),h=!!i[e].trackBy,f=typeof i[e].trackBy,v={},b=[],x=[];for(let t=0;t<s.qDataPages.length;t++){const o=g(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let g=0;g<s.qDataPages[t].qMatrix.length;g++){const w=s.qDataPages[t].qArea.qTop+g,M=p({qRow:w},o(s.qDataPages[t].qMatrix[g])),k=m(u,M,{key:a});if(!u.filter||u.filter(M)){for(let e=0;e<d.length;e++){const r=c[d[e]];let i=r.fields||[r];r.fields&&(k[d[e]]=[]);for(let o=0;o<i.length;o++)y({cache:n,f:l,mainCell:M,p:i[o],prop:d[e],page:s.qDataPages[t],rowIdx:w,row:s.qDataPages[t].qMatrix[g],sourceKey:a,target:r.fields?k[d[e]]:k,targetProp:r.fields?o:d[e],columnOrder:s.qColumnOrder});if(r.fields){const t=k[d[e]].map((e=>e.value)),n=k[d[e]].map((e=>e.label));k[d[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(k[d[e]].value)}}}h&&r.track({cfg:i[e],itemData:M,obj:k,target:b,tracker:v,trackType:f}),x.push(k)}}}const w=h?r.collect(b,{main:u,propsArr:d,props:c}):x;o=[...o,...w]}return o}function b(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function x(){return this.eachAfter(b)}function w(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function M(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this}function k(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this}function _(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function S(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))}function q(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))}function D(e){for(var t=this,n=E(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function E(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function C(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function A(){return Array.from(this)}function T(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e}function N(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t}function*R(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}function O(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=L)):void 0===t&&(t=P);for(var n,r,i,o,s,a=new F(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new F(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(z)}function I(){return O(this).eachBefore(j)}function P(e){return e.children}function L(e){return Array.isArray(e)?e[1]:null}function j(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function z(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function F(e){this.data=e,this.depth=this.height=0,this.parent=null}function H(e){return null==e?null:B(e)}function B(e){if("function"!=typeof e)throw new Error;return e}F.prototype=O.prototype={constructor:F,count:x,each:w,eachAfter:k,eachBefore:M,find:_,sum:S,sort:q,path:D,ancestors:C,descendants:A,leaves:T,links:N,copy:I,[Symbol.iterator]:R};var V={depth:-1},$={},W={};function U(e){return e.id}function Y(e){return e.parentId}function K(){var e,t=U,n=Y;function r(r){var i,o,s,a,l,c,u,d,h=Array.from(r),f=t,p=n,g=new Map;if(null!=e){const t=h.map(((t,n)=>X(e(t,n,r)))),n=t.map(G),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(G(e)),h.push(W));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,i=h.length;s<i;++s)o=h[s],c=h[s]=new F(o),null!=(u=f(o,s,r))&&(u+="")&&(d=c.id=u,g.set(d,g.has(d)?$:c)),null!=(u=p(o,s,r))&&(u+="")&&(c.parent=u);for(s=0;s<i;++s)if(u=(c=h[s]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===$)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===W&&1===a.children.length;)a=a.children[0],--i;for(let e=h.length-1;e>=0&&(c=h[e]).data===W;--e)c.data=null}if(a.parent=V,a.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(z),a.parent=null,i>0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=H(e),r):t},r.parentId=function(e){return arguments.length?(n=H(e),r):n},r.path=function(t){return arguments.length?(e=H(t),r):e},r}function X(e){let t=(e=`${e}`).length;return J(e,t-1)&&!J(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}function G(e){let t=e.length;if(t<2)return"";for(;--t>1&&!J(e,t););return e.slice(0,t)}function J(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function Z(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=Z(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=Z(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function Q(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...Q(e[i].children,t-1,n)]);return r}function ee(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>Q(e.children,r-1,n)}return!1}function te(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}const ne=/^qDimensionInfo(?:\/(\d+))?/,re=/^\/?qMeasureInfo\/(\d+)/,ie=/\/qAttrExprInfo\/(\d+)/,oe=/\/qAttrDimInfo\/(\d+)/;function se(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}function ae(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function le(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,d=r;const h=n.qEffectiveInterColumnSortOrder,f=ae(n);return ne.test(d)&&(i=!0,o=+ne.exec(d)[1],d=r.replace(ne,"")),re.test(d)&&("K"===n.qMode?c=+re.exec(d)[1]:h&&-1!==h.indexOf(-1)?(c=+re.exec(d)[1],u=0):u=+re.exec(d)[1],d=d.replace(re,"")),d&&(oe.exec(d)?a=+oe.exec(d)[1]:ie.exec(d)&&(s=+ie.exec(d)[1])),l=i?"S"===n.qMode?f[o]:h?h.indexOf(o):o:h&&-1!==h.indexOf(-1)?h.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function ce(e,t){let n,r,i=ee(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function ue(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function de(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const d=l[n];let h,f,p,g,m,y;if("primitive"===d.type?(p=d.value,y=String(d.value)):("function"==typeof d.value&&(h=e=>d.value(e,r)),"function"==typeof d.label&&(f=e=>d.label(e,r)),d.accessor?(g=d.accessor(r),Array.isArray(g)?(m=g.map(d.valueAccessor),d.attrAccessor&&(m=m.map(d.attrAccessor)),h&&(p=m.map(h),h=null),f&&(y=m.map(f),f=null),p=d.reduce?d.reduce(p):p,y=d.reduceLabel?d.reduceLabel(y,p):String(p)):(p=d.attrAccessor?d.attrAccessor(d.valueAccessor(g)):d.valueAccessor(g),y=p)):(p=i,y=i)),a.fields){const e=h?h(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=h?h(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,r):c,label:"function"==typeof a.label?a.label(u,r):u})}}const he=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Z(r,e);return o&&o[0]?(t.tree=O(o[0],n.children||(e=>e[i])),t.tree):null};function fe(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=se(e),i=e.fields(),o=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),s=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let i="__root",c=!1;for(let e=0;e<o.length;e++){var l;const t=n[o[e]],s="".concat(i,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[s]||(a[s]=r({__id:s,__parent:i,qValues:[]},t),c=!0),i=s}if(c)for(let e=0;e<s.length;e++){const t=n[s[e]];a[i].qValues.push(t)}}const c=Object.keys(a).map((e=>a[e]));return K().id((e=>e.__id)).parentId((e=>e.__parent))(c)}const pe=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],a=i.fields?i.fields:[i];for(let e=0;e<a.length;e++){const t=a[e];if(t.field!==s){const e=ce(o,le(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function ge(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=t.raw(),s=t.key(),a="S"===o.qMode?fe(t):he(o,n,e);if(!a)return null;const l=a.height,c=[];for(let s=0;s<=l;s++){let a=null;if(s>0)if("S"===o.qMode){let e=ae(o)[s-1];a=n.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[s-1];s>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),a=n.fields[e]}const{props:l,main:u}=i.normalizeConfig(r(r({},e),{},{field:a?a.key():void 0}),t),d=Object.keys(l);c[s]={propsArr:d,props:l,main:u};const h=a?le(a,{cube:o}):{fieldDepth:0};pe({propsArr:d,props:l,cube:o,cache:n,itemDepthObject:h,f:a})}const u=a.copy().descendants(),d=a.descendants();for(let e=0;e<d.length;e++){const t=c[d[e].depth].propsArr,n=c[d[e].depth].props,r=c[d[e].depth].main,i=u[e],o=i.data,a=ue(r,o,{key:s});de({propsArr:t,props:n,item:i,itemData:o,ret:a,sourceKey:s}),d[e].data=a}return a}function me(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<i.length;s++)if(void 0!==i[s].field){const a=t.raw(),l=t.key();if(!he(a,n,e))continue;const c="object"==typeof i[s].field?i[s].field:t.field(i[s].field),{props:u,main:d}=r.normalizeConfig(i[s],t),h=Object.keys(u),f=le(c,{cube:a}),{nodeFn:p,attrFn:g,valueFn:m}=ce({fieldDepth:0},f);pe({propsArr:h,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!i[s].trackBy,v=typeof i[s].trackBy,b={},x=[],w=p(n.tree),M=[];for(let e=0;e<w.length;e++){const t=w[e],n=g?g(m(t)):m(t);if(d.filter&&!d.filter(n))continue;const o=ue(d,n,{key:l});de({propsArr:h,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[s],itemData:n,obj:o,target:x,tracker:b,trackType:v}),M.push(o)}const k=y?r.collect(x,{main:d,propsArr:h,props:u}):M;o=[...o,...k]}return o}function ye(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self;var ve=ye((function(e){
27
27
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
28
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),x=m>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=t[0]).length%l,d=h.length,v=0;v<d;v++)g+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},fv({exports:{}});const _v=/xyz/.test((()=>{}))?/\b_super\b/:/.*/,Sv=function(){};Sv.extend=function e(t,n){const r=this.prototype;"string"!=typeof t&&(n=t,t="Class");const i=Object.create(this.prototype);for(const e in n)i[e]="function"==typeof n[e]&&"function"==typeof r[e]&&_v.test(n[e])?function(e,t){return function(){const n=this._super;this._super=r[e];const i=t.apply(this,arguments);return this._super=n,i}}(e,n[e]):n[e];if(!/^[_a-z][_a-z\d]*$/i.test(t))throw new Error("Invalid subclass name. Alphanumericals only.");const o=new Function(`return (function ${t}(){ typeof this.init === 'function' && this.init.apply(this, [].slice.call(arguments)) });`)();return o.prototype=i,o.prototype.constructor=o,o.extend=e,o};const qv={getChar(e){let t,n=e;return n>9?(t=65+n-10,t>90&&(t+=6)):n=`${n}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(t)>-1?this.getChar(n+1):String.fromCharCode(t)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function Dv(){return qv.id()}const Cv="scrollbar";function Ev(e,t,n){return"y"===e?Av(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function Av(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var Tv={getAxisDock:Ev,getOppositeAxisDock:function(e,t,n){return Ev(e,"far"===t?"near":"far",n)},getYAxisDock:Av};const Nv=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Rv=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),Ov=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function Iv(e){return Nv.test(e)}function Pv(e){return Rv.test(e)||Ov.test(e)}var Lv={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),detectTextDirection:function(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],Iv(r))return"ltr";if(Pv(r))return"rtl"}return"ltr"}};var jv={lineSettings:function(e,t){var n;const r={value:0,line:{stroke:void 0!==t.paletteColor?t.theme.getColorPickerColor(t.paletteColor):"transparent",strokeDasharray:null==t||null===(n=t.style)||void 0===n?void 0:n.lineType}};return hb(!0,r,e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let r=t.theme.getStyle(n,"referenceLine.label.name","color");const i=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?r=t.theme.getColorPickerColor(t.paletteColor):r||(r="transparent"),hb(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:r,fontFamily:o,fontSize:i,maxWidthPx:135}},e||{})},isVisible:e=>e&&!1!==e.show&&0!==e.show&&"0"!==e.show&&void 0!==e.refLineExpr,getRefLineTitle:function({refLine:e,label:t,valueString:n}){return!1!==e.showValue?!1!==e.showLabel?`${t} ${Lv.lrm}(${n})${Lv.lrm}`:`${Lv.lrm}(${n})${Lv.lrm}`:!1!==e.showLabel?t:""}};const zv={SHOW_AXIS_LABELS_OPTIONS:["all","labels"],SHOW_TITLE_OPTIONS:["all","title"],HORIZONTAL:"horizontal",VERTICAL:"vertical",LAYOUTSETTINGS:{lasso:{displayOrder:1e4},rangeDim:{displayOrder:1e4},rangeMeasure:{displayOrder:1e4},rangeMinor:{displayOrder:1e4},scrollBar:{minimumLayoutMode:"SPARK",prioOrder:-1,displayOrder:100},refLines:{layout:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:1110}},measureAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},dimensionAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},measureAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},dimensionAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},gridLines:{minimumLayoutMode:"XSMALL",displayOrder:-100},refLinesLabels:{minimumLayoutMode:"SMALL",prioOrder:60,displayOrder:0}}};zv.DEFAULT_CHART_ORIENTATION=zv.HORIZONTAL;function Fv(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||zv.DEFAULT_CHART_ORIENTATION,s=o===zv.HORIZONTAL,a=s?"x":"y",l=s?"y":"x",c=zv.SHOW_AXIS_LABELS_OPTIONS,u=zv.SHOW_TITLE_OPTIONS,h=c.includes(r.show),d=!!n.measureTitleText&&u.includes(r.show),f=n.includeDimensionAxis&&c.includes(i.show),p=n.includeDimensionAxis&&!!n.dimensionTitleText&&u.includes(i.show),g=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),m=n.refLines&&n.refLines.some((e=>e.show)),y=[];if(h&&function(e,t,n,r){let i={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:r&&!r.autoMinMax&&r.showBounds};i=hb(i,zv.LAYOUTSETTINGS.measureAxis);const o=Bv(t,n);e.addComponent(`${n}-axis`,i,o)}(e,n,a,r),d&&function(e,t,n){let r={text:t.measureTitleText,style:t.axisTitleStyle||{}};r=hb(r,zv.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return Bv(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,a),function(e,t,n,r){let i=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:r};r&&r.spacing>0&&(i=hb(!0,i||{},{component:{ticks:{distance:100*r.spacing}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),f&&function(e,t,n){let r={scale:"dimension",settings:t.axisLabelStyle||{}};r=hb(r,zv.LAYOUTSETTINGS.dimensionAxis);const i=Vv(t,n);hb(!0,r,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,r,i)}(e,n,l),p&&function(e,t,n){let r={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};r=hb(r,zv.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return Vv(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const r={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===zv.HORIZONTAL?zv.VERTICAL:zv.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,r)}(e,n,o),g&&function(e,t,n){let r={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};r=hb(r,zv.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,a),n.hasNavigation&&function(e,t,n,r){const i=e.getSettings();i.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},s=hb({},zv.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",s,o),Hv(t,function(e){function t(t,n){if(!n||!e())return!1;const r={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(r).some((e=>e.settings.key===Cv))}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(Cv).emit("tap",e)}}},r={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(Cv).emit("panStart",e)},pan(e){this.chart.component(Cv).emit("panMove",e)},panend(e){this.chart.component(Cv).emit("panEnd",e)},pancancel(e){this.chart.component(Cv).emit("panCancel",e)}}};return[n,r]}(n.isNavigationEnabledFn))}(e,y,n,s),m&&function(e,t,n,r){const i=Tv.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=hb(o,zv.LAYOUTSETTINGS.refLines);let s={key:`ref-line-labels-${Dv()}`,require:["renderer","chart"],dock:Tv.getOppositeAxisDock(n,r.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,r=this.chart.formatter({data:e.settings.scales.measure.data}),i=s.lines.y.map((e=>{const n=!1!==e.label.showValue?`(${r(e.value)})`:"",i=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:i,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}})),o=i[0];for(let e=1;e<i.length;e++)i[e].wanted>o.wanted&&(o.wanted=i[e].wanted),i[e].required>o.required&&(o.required=i[e].required);const a=12;return o.required+a>100?o.required+a:Math.min(o.wanted+a,100)},lines:{x:[],y:[]}};s=hb(s,zv.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach((r=>{if(!r.show)return;const a=r.refLineExpr&&r.refLineExpr.value,l=hb(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),c=jv.lineSettings({scale:"measure",dir:n,value:a},l);o.lines[n].push(c);const u=jv.lineLabelSettings({scale:"measure",value:a,label:{text:!1!==r.showLabel?r.label:"",showValue:!1!==r.showValue}},l);"x"===n?u.label.vAlign="near"===i?1:0:u.label.align="near"===i?0:1,s.lines[n].push(u)})),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",s,{})}(e,n,a,r),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",zv.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=hb(o,zv.LAYOUTSETTINGS.rangeDim);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.dimRange||{},s,Vv(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=hb(o,zv.LAYOUTSETTINGS.rangeMeasure);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.measureRange||{},s,Bv(n,a).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=hb(o,zv.LAYOUTSETTINGS.rangeMinor);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:r,isRtl:i,chartInstance:t.chartInstance};e.addComponent("range-area",o,s)}(e,n.areaRange||{},s,Vv(n,l).dock,n.isRtl)}n.brushActions&&Hv(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function Hv(e,t){t.forEach((t=>{e.push(t)}))}function Bv(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function Vv(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function $v(e,t){const n=t||{},r=!n.orientation||"horizontal"===n.orientation,i=!!n.isRtl,o={name:n.name||"scale",component:{invert:r&&i,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return hb(!0,{},o,e||{})}function Wv(e){var t;if(null!=e&&null!==(t=e.isEnabled)&&void 0!==t&&t.call(e,"IM_5791_SVG_LABEL_RENDERING"))return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}function Uv(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.line.major","color"),a=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),c=t.theme.getStyle(n,"axis.label.name","color"),u=t.theme.getStyle(n,"axis.label.name","fontSize"),h=t.theme.getStyle(n,"axis.title","fontFamily"),d=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",renderer:Wv(t.flags),dock:Tv.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:a,fontFamily:h,fill:l},line:{show:!0,strokeWidth:1,stroke:s},labels:{fill:c,fontSize:u,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:s},minorTicks:{stroke:s}}},p=hb(!0,{},f,e||{});return p.brush.consume.forEach((e=>{e.style.active.strokeWidth=0})),p}function Yv(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.title","fontSize"),a=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),c={key:"text",type:"text",dock:Tv.getAxisDock(i,r,o)||"bottom",displayOrder:0,style:{text:{fontSize:s,fontFamily:l,fill:a}}};return hb(!0,{},c,e||{})}$v.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const r={name:"measure",component:{expand:.1,data:{fields:n.map((e=>({field:e})))}}},i=t&&t.measureAxisProperties;i&&!i.autoMinMax&&(["min","minMax"].includes(i.minMax)&&(r.component.min=i.min),["max","minMax"].includes(i.minMax)&&(r.component.max=i.max));const o=$v(hb(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},$v.dimensionScale=function(e,t){const n={name:"dimension",component:{trackBy:"id",type:"band",data:{extract:{field:t&&t.source||"",props:{label:e=>e.qText||""}}},label:e=>e.datum.label.value}};return $v(hb(!0,n,e||{}),t)},Uv.xAxis=function(e,t){return Uv(hb(!0,{key:"x-axis",scale:"x"},e||{}),t)},Uv.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:Tv.getYAxisDock(n,r)};return Uv(hb(!0,i,e||{}),t)},Yv.xAxisTitle=function(e,t){return Yv(hb(!0,{key:"x-axis-title"},e||{}),t)},Yv.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:Tv.getYAxisDock(n,r)||"left"};return Yv(hb(!0,i,e||{}),t)};var Kv={getBublesAlign:function(e,t,n){let r=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(r=!r),r?"start":"end"},getDock:function(e,t){const n=[];let r;return e&&n.push(`@${e}`),t&&n.push(`@${t}`),n.length&&(r=n.join(",")),r}};const Xv={SPARK:{width:0,height:0},XSMALL:{width:150,height:75},SMALL:{width:300,height:150},MEDIUM:{width:400,height:220},FULL:{width:550,height:450}};function Gv(){return Xv}function Jv(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}Gv.getLayoutModeKeys=function(){const e=[];let t;for(t in Xv)e.push(t);return e};const Zv={left:"left",right:"right",up:"top",down:"bottom"};function Qv(e,t,n){switch(e){case"scale":return $v(t,n);case"measure-scale":return $v.measureScale(t,n);case"dimension-scale":return $v.dimensionScale(t,n);case"axis":return Uv(t,n);case"box-marker":return function(e){return hb(!0,{},{key:"box-marker",type:"box-marker",settings:{minor:{scale:"x"},orientation:"horizontal"},brush:{trigger:[],consume:[]}},e||{})}(t);case"point-marker":return function(e){return hb(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,r=t&&t.chartID,i=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:i?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(r,"","backgroundColor"),invert:n&&i}};return hb(!0,{},o,e||{})}(t,n);case"text":return Yv(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushComponents?t.brushComponents:[],i=t&&t.brushData?t.brushData:["elemNo"],o={type:"brush-lasso",key:"lasso",displayOrder:99,settings:{brush:{components:[]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"rgba(102,102,102,1)",strokeWidth:2,opacity:1,strokeDasharray:null},startPoint:{r:10,fill:"rgba(0, 152, 69, 1)",strokeWidth:0,opacity:1}}};return r.forEach((e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:i})})),hb(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushArea,o=t&&t.brushScale,s=t&&t.isHorizontal,a=t&&t.dock,l=t&&t.isRtl,c={type:"brush-range",key:"range",displayOrder:99,dock:Kv.getDock(r,i),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:s?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:Kv.getBublesAlign(s,a,l)}}};return hb(!0,{},c,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],s=t&&t.brushArea,a=t&&t.isHorizontal,l=t&&t.dock,c=t&&t.isRtl,u=t&&t.chartInstance;let h=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:Kv.getDock(r,s),settings:{brush:{components:[]},direction:a?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:Kv.getBublesAlign(a,l,c),label:e=>h?(h=!1,u.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(h=!0,u.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach((e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})})),hb(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const s=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.title","fontFamily"),h=t.theme.getStyle(n,"legend.label","fontFamily"),d={key:"legend",type:"legend-cat",renderer:Wv(t.flags),dock:i,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:r?"rtl":"ltr",size:"top"===i||"bottom"===i?2:1,vertical:"top"===i||"bottom"===i?16:8},navigation:{button:{class:{"lui-fade-button":!0},content:(e,t)=>e("span",{style:{pointerEvents:"none"},class:["lui-button__icon","lui-icon",`lui-icon--triangle-${Zv[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:c,fontFamily:h,fill:l,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(c,10)/4}},title:{show:t.showTitle,fontSize:a,fontFamily:u,fill:s}}};return hb(!0,{},d,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t.dock||"auto";"auto"===i&&(i=t.chartHeight<t.chartWidth?r?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),a=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.label","fontFamily");function h(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const d={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:h(r?"right":"left"),major:{invert:"left"===i||"right"===i||r},title:{show:t.showTitle,fontSize:s,fontFamily:a,fill:o},tick:{fill:l,fontSize:c,fontFamily:u}}};return hb(!0,{},d,e)}(t,n);case"x-axis":return Uv.xAxis(t,n);case"y-axis":return Uv.yAxis(t,n);case"x-axis-title":return Yv.xAxisTitle(t,n);case"y-axis-title":return Yv.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"grid.line.major","color");return hb(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:r},minorTicks:{stroke:r}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return hb(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),i=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return hb(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:i,text:{fill:r},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return hb(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"label.value","color"),i=t.theme.getStyle(n,"label.value","fontSize"),o=t.theme.getStyle(n,"label.value","fontFamily"),s={key:"labels",type:"labels",renderer:Wv(t.flags),displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:o,fontSize:parseFloat(i),align:.5,labels:[{placements:[{position:"outside",fill:r,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:Jv}]}}}]}};return hb(!0,{},s,e||{})}(t,n);default:return}}function ex(e){this.options=e||{},this.settings={dockLayout:{layoutModes:Gv()},components:[],scales:{}}}ex.prototype.addComponent=function(e,t,n){const r=Qv(e,t,hb(!0,{},this.options,n||{}));return this.settings.components.push(r),r},ex.prototype.addInteraction=function(e,t){const n=Qv("interaction",e,hb(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},ex.prototype.addScale=function(e,t,n){const r=Qv(e,t,hb(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},ex.prototype.getSettings=function(){return this.settings},ex.prototype.getComponent=function(e){return this.settings.components.filter((t=>t.key===e))[0]},ex.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");Fv(t,n)}(e,this,t)},ex.validateComponentKeys=function(e){const t={};return e.map((e=>{const n=e.key;return n?t[n]?`Duplicate key for component ${e.type}`:(t[n]=!0,null):`Missing key for component ${e.type}`})).filter((e=>!!e))},ex.create=function(e){return new ex(e)},ex.createComponent=Qv;const tx={CENTER:0,BOTTOM:1};var nx={DISCLAIMERS:[{label:"NoDataExist",alignment:tx.CENTER,default:!0},{label:"RequireNumericDimension",alignment:tx.CENTER,default:!1},{label:"OnlyNanData",alignment:tx.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:tx.CENTER,default:!1},{label:"LimitedData",alignment:tx.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:tx.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:tx.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:tx.BOTTOM,default:!1}],ALIGNMENT:tx};const rx={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx==0,getLimitedDataAttribute(e,t){let n,r=!1;var i;return e?void 0!==t.explicitLimitedData?r=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?r=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(i=e.qStackedDataPages)&&i[0]&&i[0].qData[0]&&i[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,r=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some((e=>e.qDown>0)):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):r=!0===t.explicitLimitedData,r},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some((e=>e.qMin<=0)),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every((e=>e.qMax<=0&&e.qMax>=e.qMin))||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every((e=>e.qMax<e.qMin||"NaN"===e.qMax)),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let r,i,o,s,a;for(e&&(i=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,r=0;r<n;r++)if(s=Math.min(s,t[r].qMin),a=Math.max(a,t[r].qMax),s<=0&&a>=0)return!0;return s=i?e.min:s,a=o?e.max:a,s<=0&&a>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},r={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,nx.DISCLAIMERS.forEach((e=>{r[e.label]=!1})),t&&t.qHyperCube?(r.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),r.NoDataExist?r:(r.RequireNumericDimension=n.explicitRequireNumericDimension,r.RequireNumericDimension||(r.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),r.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),r.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),r)):r}};function ix(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function ox(e,t){return e&&t&&t[e]}function sx(e){this.environment=e,this.clear()}ix.prototype.isValidAndSupported=function(e,t){return ox(e.label,this.dataAttributes)&&(e.default||ox(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},ix.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach((r=>{n.isValidAndSupported(r,e)&&(t=!0)})),t},ix.prototype.getMessage=function(e,t){let n="";const r=this;return t&&this.disclaimersConfig.forEach((i=>{r.isValidAndSupported(i,e)&&(n+=`${t.get(`Object.Disclaimer.${i.label}`)} `)})),n},sx.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},sx._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach((e=>{void 0===n[e.label]&&(n[e.label]=e.default)})),n},sx.prototype.getComponentSettings=function(){var e;const{translator:t}=this.environment,n=hb(!0,{},this.vizAttributes.supportedDisclaimers),r=new ix(nx.DISCLAIMERS,this.dataAttributes,n);let i,o;if(r.isAnyValidDisclaimer(nx.ALIGNMENT.CENTER))i=r.getMessage(nx.ALIGNMENT.CENTER,t),o="center";else{if(!r.isAnyValidDisclaimer(nx.ALIGNMENT.BOTTOM))return;i=r.getMessage(nx.ALIGNMENT.BOTTOM,t),o="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:o},settings:{label:i,rtl:"rtl"===(null===(e=this.environment)||void 0===e||null===(e=e.options)||void 0===e?void 0:e.direction)}}},sx.prototype.set=function(e){if(this.clear(),!e)throw new Error(sx.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=rx.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},sx.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const ax=Sv.extend({init(e,t,n,r,i){this.$element=t,this.environment=n,this.backendApi=r,this._selectionsApi=i,this._on=!1,this._disclaimer=new sx(n),this._dataPaths=["qHyperCube"];const o=this;this.picassoElement=t[0],this.picassoElement.className+=" picasso-chart",this.chartInstance=e.chart({element:this.picassoElement,settings:{components:[ex.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){var e;return"rtl"===(null===(e=this.environment.options)||void 0===e?void 0:e.direction)},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};r="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([i],null,t).then((e=>{t[r]=e}))}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){var e;this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const t=this._disclaimer.getComponentSettings(),n="center"===(null==t||null===(e=t.layout)||void 0===e?void 0:e.dock),r=this.createChartSettings(this.layout);n?r.components=[t]:t&&r.components.push(t),ex.validateComponentKeys(r.components).forEach((e=>{console.error(e)})),this.updateChart(this.layout,r),this._painted=!0}return Promise.resolve()},resize(){if(this.layout)return this.paint()},createChartSettings(){throw new Error('Subclass must implement "createChartSettings" function')},addSnapshotChartSettings(e,t){const{freeResize:n}=this.environment.options;!n&&t.snapshotData&&(e.dockLayout.logicalSize={width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h,preserveAspectRatio:!0})},updateData(e){return this._destroyed?Promise.reject():(this.layout=hb(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){var r,i;const o=null!==(r=null===(i=this.environment.appLayout)||void 0===i?void 0:i.qLocaleInfo)&&void 0!==r?r:{},s=this._dataPaths.map((t=>({type:"q",key:t,config:{localeInfo:o},data:mv(e,t.replace(/\//g,"."))})));this.colorService&&s.push(...this.colorService.getData()),this.chartInstance.update({data:s,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})});var lx,cx={exports:{}};var ux=(lx||(lx=1,function(e){e.exports=function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach((function(e){r(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function r(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function o(e){var t=i(e,"string");return"symbol"==typeof t?t:String(t)}var s=Object.prototype.hasOwnProperty,a=Object.prototype.toString,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===a.call(e)},h=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,n=s.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&s.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||s.call(e,t)},d=function(e,t){l&&"__proto__"===t.name?l(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},f=function(e,t){if("__proto__"===t){if(!s.call(e,t))return;if(c)return c(e,t).value}return e[t]},p=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,p=!1;for("boolean"==typeof a&&(p=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=f(a,n),a!==(i=f(t,n))&&(p&&i&&(h(i)||(o=u(i)))?(o?(o=!1,s=r&&u(r)?r:[]):s=r&&h(r)?r:{},d(a,{name:n,newValue:e(p,s,i)})):void 0!==i&&d(a,{name:n,newValue:i}));return a};function g(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=i.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),a=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(r)&&r.some(((e,t)=>e!==t))){const e=r.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function m(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function y(e){let{cache:t,f:n,mainCell:r,p:i,prop:o,page:s,rowIdx:a,row:l,sourceKey:c,target:u,targetProp:h,columnOrder:d}=e,f=r;if(i.field&&i.field!==n){const e=g(i.field,s,{cache:t},d);if(-1===e)return;f=p({qRow:a},e(l))}u[h]=m(i,f,{key:c})}function b(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const s=t.raw(),a=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),h=Object.keys(c),d=!!i[e].trackBy,f=typeof i[e].trackBy,b={},v=[],x=[];for(let t=0;t<s.qDataPages.length;t++){const o=g(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let g=0;g<s.qDataPages[t].qMatrix.length;g++){const w=s.qDataPages[t].qArea.qTop+g,k=p({qRow:w},o(s.qDataPages[t].qMatrix[g])),M=m(u,k,{key:a});if(!u.filter||u.filter(k)){for(let e=0;e<h.length;e++){const r=c[h[e]];let i=r.fields||[r];r.fields&&(M[h[e]]=[]);for(let o=0;o<i.length;o++)y({cache:n,f:l,mainCell:k,p:i[o],prop:h[e],props:c,page:s.qDataPages[t],rowIdx:w,row:s.qDataPages[t].qMatrix[g],sourceKey:a,target:r.fields?M[h[e]]:M,targetProp:r.fields?o:h[e],columnOrder:s.qColumnOrder});if(r.fields){const t=M[h[e]].map((e=>e.value)),n=M[h[e]].map((e=>e.label));M[h[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(M[h[e]].value)}}}d&&r.track({cfg:i[e],itemData:k,obj:M,target:v,tracker:b,trackType:f}),x.push(M)}}}const w=d?r.collect(v,{main:u,propsArr:h,props:c}):x;o=[...o,...w]}return o}function v(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function x(){return this.eachAfter(v)}function w(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function k(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this}function M(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this}function _(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function S(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))}function q(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))}function D(e){for(var t=this,n=C(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function C(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function E(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function A(){return Array.from(this)}function T(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e}function N(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t}function*R(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}function O(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=L)):void 0===t&&(t=P);for(var n,r,i,o,s,a=new F(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new F(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(z)}function I(){return O(this).eachBefore(j)}function P(e){return e.children}function L(e){return Array.isArray(e)?e[1]:null}function j(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function z(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function F(e){this.data=e,this.depth=this.height=0,this.parent=null}function H(e){return null==e?null:B(e)}function B(e){if("function"!=typeof e)throw new Error;return e}F.prototype=O.prototype={constructor:F,count:x,each:w,eachAfter:M,eachBefore:k,find:_,sum:S,sort:q,path:D,ancestors:E,descendants:A,leaves:T,links:N,copy:I,[Symbol.iterator]:R};var V={depth:-1},$={},W={};function U(e){return e.id}function Y(e){return e.parentId}function K(){var e,t=U,n=Y;function r(r){var i,o,s,a,l,c,u,h,d=Array.from(r),f=t,p=n,g=new Map;if(null!=e){const t=d.map(((t,n)=>X(e(t,n,r)))),n=t.map(G),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(G(e)),d.push(W));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,i=d.length;s<i;++s)o=d[s],c=d[s]=new F(o),null!=(u=f(o,s,r))&&(u+="")&&(h=c.id=u,g.set(h,g.has(h)?$:c)),null!=(u=p(o,s,r))&&(u+="")&&(c.parent=u);for(s=0;s<i;++s)if(u=(c=d[s]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===$)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===W&&1===a.children.length;)a=a.children[0],--i;for(let e=d.length-1;e>=0&&(c=d[e]).data===W;--e)c.data=null}if(a.parent=V,a.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(z),a.parent=null,i>0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=H(e),r):t},r.parentId=function(e){return arguments.length?(n=H(e),r):n},r.path=function(t){return arguments.length?(e=H(t),r):e},r}function X(e){let t=(e=`${e}`).length;return J(e,t-1)&&!J(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}function G(e){let t=e.length;if(t<2)return"";for(;--t>1&&!J(e,t););return e.slice(0,t)}function J(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function Z(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=Z(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=Z(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function Q(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...Q(e[i].children,t-1,n)]);return r}function ee(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>Q(e.children,r-1,n)}return!1}function te(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}const ne=/^qDimensionInfo(?:\/(\d+))?/,re=/^\/?qMeasureInfo\/(\d+)/,ie=/\/qAttrExprInfo\/(\d+)/,oe=/\/qAttrDimInfo\/(\d+)/;function se(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}function ae(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function le(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,h=r;const d=n.qEffectiveInterColumnSortOrder,f=ae(n);return ne.test(h)&&(i=!0,o=+ne.exec(h)[1],h=r.replace(ne,"")),re.test(h)&&("K"===n.qMode?c=+re.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+re.exec(h)[1],u=0):u=+re.exec(h)[1],h=h.replace(re,"")),h&&(oe.exec(h)?a=+oe.exec(h)[1]:ie.exec(h)&&(s=+ie.exec(h)[1])),l=i?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function ce(e,t){let n,r,i=ee(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function ue(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function he(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,g,m,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,r)),"function"==typeof h.label&&(f=e=>h.label(e,r)),h.accessor?(g=h.accessor(r),Array.isArray(g)?(m=g.map(h.valueAccessor),h.attrAccessor&&(m=m.map(h.attrAccessor)),d&&(p=m.map(d),d=null),f&&(y=m.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(g)):h.valueAccessor(g),y=p)):(p=i,y=i)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,r):c,label:"function"==typeof a.label?a.label(u,r):u})}}const de=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Z(r,e);return o&&o[0]?(t.tree=O(o[0],n.children||(e=>e[i])),t.tree):null};function fe(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=se(e),i=e.fields(),o=e.fields().filter((e=>"dimension"===e.type())).map((e=>r.indexOf(i.indexOf(e)))),s=e.fields().filter((e=>"measure"===e.type())).map((e=>r.indexOf(i.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const r=t[e];let i="__root",c=!1;for(let e=0;e<o.length;e++){var l;const t=r[o[e]],s="".concat(i,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[s]||(a[s]=n({__id:s,__parent:i,qValues:[]},t),c=!0),i=s}if(c)for(let e=0;e<s.length;e++){const t=r[s[e]];a[i].qValues.push(t)}}const c=Object.keys(a).map((e=>a[e]));return K().id((e=>e.__id)).parentId((e=>e.__parent))(c)}const pe=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields?a.fields:[a];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==s){const e=ce(o,le(t.field,{cube:r,cache:i}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function ge(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=t.raw(),s=t.key(),a="S"===o.qMode?fe(t):de(o,r,e);if(!a)return null;const l=a.height,c=[];for(let s=0;s<=l;s++){let a=null;if(s>0)if("S"===o.qMode){let e=ae(o)[s-1];a=r.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[s-1];s>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),a=r.fields[e]}const{props:l,main:u}=i.normalizeConfig(n(n({},e),{},{field:a?a.key():void 0}),t),h=Object.keys(l);c[s]={propsArr:h,props:l,main:u};const d=a?le(a,{cube:o,cache:r}):{fieldDepth:0};pe({propsArr:h,props:l,cube:o,cache:r,itemDepthObject:d,f:a})}const u=a.copy().descendants(),h=a.descendants();for(let e=0;e<h.length;e++){const t=c[h[e].depth].propsArr,n=c[h[e].depth].props,r=c[h[e].depth].main,i=u[e],o=i.data,a=ue(r,o,{key:s});he({propsArr:t,props:n,item:i,itemData:o,ret:a,sourceKey:s,isTree:!0}),h[e].data=a}return a}function me(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<i.length;s++)if(void 0!==i[s].field){const a=t.raw(),l=t.key();if(!de(a,n,e))continue;const c="object"==typeof i[s].field?i[s].field:t.field(i[s].field),{props:u,main:h}=r.normalizeConfig(i[s],t),d=Object.keys(u),f=le(c,{cube:a,cache:n}),{nodeFn:p,attrFn:g,valueFn:m}=ce({fieldDepth:0},f);pe({propsArr:d,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!i[s].trackBy,b=typeof i[s].trackBy,v={},x=[],w=p(n.tree),k=[];for(let e=0;e<w.length;e++){const t=w[e],n=g?g(m(t)):m(t);if(h.filter&&!h.filter(n))continue;const o=ue(h,n,{key:l});he({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[s],itemData:n,obj:o,target:x,tracker:v,trackType:b}),k.push(o)}const M=y?r.collect(x,{main:h,propsArr:d,props:u}):k;o=[...o,...M]}return o}function ye(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self;var be=ye((function(e){
29
- /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
30
- !function(t,n){e.exports=n()}(0,(function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),x=m>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=t[0]).length%l,d=h.length,v=0;v<d;v++)g+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}}))}));const ve=1e-15;function xe(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const we={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},ke=/%\)?$/,Me=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,_e=/^\(oct\)/i,Se=/^\(dec\)/i,qe=/^\(hex\)/i,De=/^\(bin\)/i,Ce=/^\(rom\)/i,Ee=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ae=/#|0/g;function Te(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function Ne(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<s.length;n++)if(s[n]<=i){r+=a[n],i-=s[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}function Re(e,t,n){let r;return Me.test(t)?e=Te(e,Number(/\d{2}/.exec(t)[0]),t,n):_e.test(t)?e=Te(e,8,t,n):Se.test(t)?e=Te(e,10,t,n):qe.test(t)?e=Te(e,16,t,n):De.test(t)?e=Te(e,2,t,n):Ce.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=Ne(e,t)):t+r+e.toExponential(0)),e}function Oe(e,t,n){const r=xe(e);return n?r:new RegExp(r||"",t)}function Ie(e,t){return t&&(t=xe(t)),e&&(e=xe(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Pe(e,t){if(!e||!e.qNumericalAbbreviation)return we;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}function Le(e,t,n,r){let i,o,s,a,l,c,u,h,d,f=e.pattern;r&&(e.abbreviate=!0),d=Ie(t,n),s=f.match(d),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(i=s.split(n),o=i.pop(),s=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(Oe(c,"g"),t)),u=n,n=".",u&&(s=s.replace(Oe(u,"g"),n)),h=s.match(/#/g),h=h?h.length:0;const p=f.split(u);let g;p[1]&&(g=p[1].match(Ae)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=g?g.length:2,e.percentage=ke.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(Oe(t,null,!0),"|").concat(Oe(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class je{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=Pe(e,this.patternSeparator),this.prepare()}clone(){const e=new je(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Ee.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Ee.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Ee.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Le(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Le(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Le(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=Re(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let r,i,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(r=t[a-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(h=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number(e.toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=be(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+ve).toFixed(t).slice(2).replace(/0+$/,"");for(a=i.length;a<n;a++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),a=0;a<t;a++)l+="#";e=be(l,e)}e=e.replace(u.numericRegex,(e=>e===s?u.groupTemp:e===o?u.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function ze(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new je(...t)}function Fe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return s=i(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=i(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function He(e,t,n,r,i){const o=ze(i,e,t,n,r),s=Fe(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,r){return s.clear(),o.format(t,e,n,r)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const Be={AUTO:"U",INTEGER:"I",NUMBER:"R",FIXED_TO:"F",MONEY:"M",DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Ve=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$e=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],We=["January","February","March","April","May","June","July","August","September","October","November","December"],Ue=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ye=86400;function Ke(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Xe(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}function Ge(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Je(e){const t=e,n=24*Ge(t),r=60*Ge(n),i=60*Ge(r),o=1e3*Ge(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}function Ze(e,t){let n,r=Je(e),i=r.d,o=r.h,s=r.m,a=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(Ye*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:s,s:a,f:l,t:u}}function Qe(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Ke("".concat(t.year).slice(-2),2),YYY:Ke("".concat(t.year).slice(-3),3),def:e=>Ke("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Ke("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Ke("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Ke("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Ke("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Ke("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Ke("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}class et{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:Ve,qDayNames:$e,qLongMonthNames:We,qMonthNames:Ue}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={[Be.TIME]:r.qTimeFmt||"hh:mm:ss",[Be.DATE]:r.qDateFmt||"YYYY-MM-DD",[Be.DATE_TIME]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new et(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=Xe(e,n):(e<0&&(e=-e,t="-".concat(t)),r=Ze(e,t));const i=Qe(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,(e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}));return a}}function tt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new et(...t)}const nt=864e5;function rt(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(nt*(e-Math.floor(e)))))}function it(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=tt(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=Fe(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==Be.INTERVAL?rt(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=tt(i,e,t),r=Fe(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function ot(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return it(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(i,"##"),o="U"),He(n,r,i,o,t)}function st(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u=e=>(null==e?void 0:e.qText)||"",h="dimension"===a?"first":"avg",d=ot(t,i),f="dimension"===a?"first":(e,t)=>d(t),p={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(p)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:u,reduce:h,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return p}function at(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const s="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),a={instance:st(p({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},i))};return a.attrDims=at("qAttrDimInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=at("qAttrExprInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=at("qMeasureInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a}))}function lt(){let{key:e,data:t,config:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=lt.util,a={cache:i,cube:o,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},l={key:()=>e,raw:()=>o,field:e=>te(e,a),fields:()=>i.fields.slice(),extract:e=>a.extractor(e,l,i,s),hierarchy:e=>a.hierarchy(e,l,i,s),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(a.extractor=me,a.hierarchy=ge,a.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(a.extractor=b,a.pages=o.qDataPages,a.hierarchy=ge):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,i,s);const c="S"===o.qMode?e=>e.qElemNumber:void 0,u="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...at("qDimensionInfo",o,e,"",p({},a,{value:c,type:"dimension"}))),i.wrappedFields.push(...at("qMeasureInfo",o,e,"",p({},a,{value:u,type:"measure"}))),i.fields=i.wrappedFields.map((e=>e.instance));const h=e=>{e.forEach((e=>{i.allFields.push(e.instance),h(e.measures),h(e.attrDims),h(e.attrExps)}))};return h(i.wrappedFields),(r.virtualFields||[]).forEach((t=>{const r=l.field(t.from),o=st(n({meta:r.raw(),id:"".concat(e,"/").concat(t.key),sourceField:r,fieldExtractor:e=>a.extractor({field:e},l,i,s),key:t.key,type:r.type(),localeInfo:a.localeInfo,value:r.value},t.override||{}));i.virtualFields.push(o)})),i.allFields.push(...i.virtualFields),l}const ct=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ut=/\/qDimensionInfo(?:\/(\d+))?/,ht=/\/qMeasureInfo\/(\d+)/,dt=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,ft=/\/qAttrExprInfo\/(\d+)/,pt=/\/?qHyperCube/,gt=/\/?qTreeData/,mt=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),yt=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function bt(e,t){let n=e,r=-1,i=-1,o="",s=e=>e;pt.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=mt):gt.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=yt);let a=!0;if(ut.test(e)&&(r=+ut.exec(e)[1]),ht.test(e)&&(i=+ht.exec(e)[1]),dt.test(e)){i=-1,r=0;const e=+dt.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),a=!1}if(ft.test(e)){const e=i;if(t){i=0;const s=Z(o,t);i+=(s.qMeasureInfo||[]).length,r>-1?(i=s.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=s.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=s.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+ft.exec(n)[1]}else r>-1?(r=-1,i=+ft.exec(n)[1]):i+=+ft.exec(n)[1]+1}return ct.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function vt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach((e=>{const t=bt(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,a=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||a>=o)&&o>-1?n.forEach((e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})})):n.forEach((e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!s.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&a?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o);var c}function xt(e){lt.util=e.data("matrix").util,e.data("q",lt),e.formatter("q-number",He),e.formatter("q-time",it)}return xt.qBrushHelper=vt,xt.selections=vt,xt}()}(cx)),cx.exports),hx=n(ux);const dx={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter((e=>"value"===e.type));let r=[];n.length&&n.forEach((e=>{r=r.concat(e.brush.values().map((t=>({key:e.id,value:t}))))}));return r.concat(t)},filterValues:function(e,t){const n=this;let r,i;const o=[];let s=0;const a=[];return t.forEach((t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(i=function(e,t){const n=t.key.indexOf("qHyperCube")+10,r=t.key.substr(0,n),i=t.key.substr(n+1);return e.dataset(r).field(i)}(e,t),r=i&&i.raw(),r.qLocked?(o.push(r),s++):a.push({key:t.key,value:t.value}))})),{items:a,itemsAreLocked:s>0&&s===t.length,lockedFields:o}}}};const fx={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function px(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,r=e.dataPaths||[""],i=e.selectPaths,o=e.lasso;let s=[];const a={propertiesToRestore:{}};let l=!1;const c=function(e,t,n){function r(){}return r.update=function(e,r,i){t.isActive()||t.begin(n),hx.qBrushHelper(i).forEach((e=>{t.select(e)}))},r.toggleValues=function(r,i,o){const s=dx.brushInterceptors.filterValues(e,r),a=s.items;return t.isActive()||s.itemsAreLocked||!(o||a.length>0)||(t.begin(n),i.start(),i.emit("update",[],[])),a},r}(t,n,i),u={};let h=!1;function d(e){16===e.keyCode&&e.shiftKey!==h&&(h=e.shiftKey,o.toggle())}function f(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function p(){s.forEach((e=>{e.listeners.update=function(t,n){e.sleep||c.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)}))}function g(){s.forEach((e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)}))}return n.on("cleared",(()=>{s.forEach((e=>{e.brush.clear(),e.dependentComponents.forEach((e=>{const n=t.component(e.id);n&&n.emit(e.clear)}))}))})),u.setUp=function(e){u.tearDown();const t=this.setUpBrush(e);return l&&p(),t},u.setUpBrush=function(e){const n=hb(!0,{},fx,e),i={on:"tap",action:t=>t.ctrlKey||e.isSingleSelect?"set":"toggle",contexts:n.contexts,data:n.data,globalPropagation:"stop"},o={context:n.contexts[0],data:n.data,style:n.style},a=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return a.listeners.toggle=function(e){if(!l)return[];const i=function(){const e=[];let n=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));n=[].concat.apply([],n);for(let t=0;t<n.length;t++)n[t].raw().qLocked&&e.push(n[t].raw());return{fields:e,areAllFieldsLocked:e.length&&e.length===n.length}}();return n.startOnEmptySelection&&0===e.length&&i.areAllFieldsLocked?[]:c.toggleValues(e,a.brush,n.startOnEmptySelection)},a.brush.intercept("toggle-values",a.listeners.toggle),a.brush.intercept("add-values",a.listeners.toggle),a.brush.intercept("remove-values",a.listeners.toggle),a.brush.intercept("set-values",a.listeners.toggle),a.listeners.start=function(){s.length>1&&s.forEach((e=>{e!==a&&e.brush.end()}))},s.push(a),{trigger:i,consume:o}},u.setUpStart=function(){u.tearDown()},u.setUpDone=function(){l&&p()},u.tearDown=function(){l&&g(),s.forEach((e=>{e.brush.removeInterceptor("toggle-values",e.listeners.toggle),e.brush.removeInterceptor("add-values",e.listeners.toggle),e.brush.removeInterceptor("remove-values",e.listeners.toggle),e.brush.removeInterceptor("set-values",e.listeners.toggle)})),s=[]},u.pauseEngineCalls=function(e){s.forEach((t=>{t.id===e&&(t.sleep=!0)}))},u.resumeEngineCalls=function(e,t){s.forEach((n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))}))},u.addComponent=function(e,t){s.forEach((n=>{n.id===e&&n.dependentComponents.push(t)}))},u.on=function(){if(l)return;l=!0,p(),document.addEventListener("keydown",d),document.addEventListener("keyup",d);const e=()=>{s.forEach((e=>{e.brush.end()})),document.removeEventListener("keyup",f),o.active()&&o.toggle()};n.on("deactivated",e),a.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",f)};n.on("activated",t),a.unbindActivated=()=>{n.removeListener("activated",t)}},u.isOn=()=>l,u.off=function(){l&&(l=!1,g(),document.removeEventListener("keydown",d),document.removeEventListener("keyup",d),document.removeEventListener("keyup",f),a.unbindActivated(),a.unbindDeactivated())},u.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},u.allFieldsLocked=function(){return function(){let e=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));return e=[].concat.apply([],e),e.length&&e.every((e=>e.raw().qLocked))}()},u}class gx{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var mx={create:e=>e.selectionsApi?px(e):new gx};function yx(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const s=e.brush(r),a={};function l(){if(o){e.component(i).emit("hide")}o=!1}return a.isOpen=function(){return o},a.closeTooltip=l,a.update=function(){const a=s.brushes(),c=e.getAffectedShapes(r,"and",n,t);a.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(c)):l()},a.toggleInterceptor=function(e){if(n.length>1){const t={},n=[];return e.forEach((e=>{t[e.key]||(t[e.key]={}),t[e.key][e.value]||(t[e.key][e.value]=!0,n.push(e))})),n}return e},a}var bx={create:(...e)=>yx(...e)},vx={formatMeasureValue:function(e,t){if(e.raw().isCustomFormatted)return e.formatter()(t.value.qText);const n=void 0!==t.value.qNum?t.value.qNum:t.value.qValue;return e.formatter()(n)}};const xx=e=>({h:t,data:n,style:r})=>{const i=function(e,t){const n=e.chartInstance.dataset(e.dataPath),r=[],i=t.length-5,o=Math.min(5,t.length);for(let i=0;i<o;i++){const o=t[i],s={rows:[]};if(e.labelData){const t=[],i=e.labelData;let a=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){a=!0;break}t.push(o.data[i[e]].value.qText)}if(a)return;s.header=e.headerResolver(t),s.rows=e.measureRows.map((t=>{const r=o.data;return e.rowResolver(n.field(r[t].source.field),r[t],r)})).filter((e=>!!e));const l=wx(e,o);l&&s.rows.unshift(l),r.push(s)}}i>0&&(r.numberInExcess=i);return r.rowCount=r[0]?r.length*r[0].rows.length:0,r}(e,n),o={h:t,style:r,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,i)};function wx(e,t){var n,r,i;const o=t.data.color,s=null===(n=e.colorService)||void 0===n||null===(r=n.getSettings)||void 0===r?void 0:r.call(n);if(!s||"color"===s.type||!o||!s.fieldType)return;const a=[];e.data.forEach((e=>{const n=t.data[e];n&&a.push(n.value)}));const l=function(e){let t=-1;for(let n=0;n<e.length;n++)-3===e[n]&&(t=n);return t}(a),{translator:c}=e,u=s.label;return{color:null===(i=t.attrs)||void 0===i?void 0:i.fill,label:u,value:-1!==l?c.get("properties.dimensionLimits.others"):o.label}}const kx="dist-flow-tooltip",Mx=`#${kx}`;function _x(){if(!document.querySelector(Mx)){const e=document.createElement("div");e.id=kx,e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function Sx({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){_x()},beforeUpdate(){_x()},destroyed(){!function(){const e=document.querySelector(Mx);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(Mx),content:i,filter:r,extract:e=>e.node,direction:t?"rtl":"ltr",placement:"bounds"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:n,"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const{detectTextDirection:qx}=Lv;const Dx={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:vx.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,s=[],a=o?"right":"left";if(t.forEach((e=>{if(e.header){const t={...r.cell,textAlign:a,fontWeight:"bold",direction:qx(e.header)};s.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach((e=>{let t=e.value;if(e.color){const r={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},i=n("div",{style:r});t=o?[e.value,i]:[i,e.value]}const i=o?[":",e.label]:[e.label,":"],l={...r.cell,textAlign:a,direction:qx(e.label)},c={...r.cell,textAlign:o?"left":"right",direction:qx(e.value)};s.push(n("tr",null,n("td",{style:l},i),n("td",{style:c},t)))}))})),t.numberInExcess){const e=i.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...r.cell,textAlign:a,direction:qx(e)};s.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return s}};function Cx(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!1;const o={};function s(e){e.listeners.update=function(t,n){e.action.update(t,n,e)},e.listeners.end=function(){e.action.closeTooltip()},e.brush.on(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.on("end",e.listeners.end),e.brush.intercept("set-values",e.action.toggleInterceptor)}function a(){Object.keys(r).forEach((e=>{l(r[e])}))}function l(e){e.brush.removeListener(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.removeListener("end",e.listeners.end),e.brush.removeInterceptor("set-values",e.action.toggleInterceptor)}function c(){Object.keys(r).forEach((e=>{r[e].action.closeTooltip()}))}function u(){c();for(const e in r)r[e].brush.clear()}return o.setUp=function(t){const o=hb(!0,{},Dx,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&l(r[o.contexts[0]]);const a=function(e,t){return{brush:t.brush(e.contexts[0]),action:bx.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);r[o.contexts[0]]=a,i&&s(a);const c=Sx({key:o.tooltipKey,rtl:"rtl"===a.direction,fontFamily:a.theme.getStyle(n,"tooltip","fontFamily"),filter:(u=a.filterShapes,e=>u?u(e):function(e){const t=[];return e.forEach((e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)})),t}(e)),content:xx(a,o.dataPath)});var u;return o.chartBuilder.getSettings().components.push(c),{trigger:{on:a.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map((e=>({context:e}))),component:c}},o.tearDown=function(){i&&a(),r=[]},o.closeTooltip=c,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach((e=>{s(r[e])})),t&&t.on("mouseleave",u))},o.off=function(){i&&(i=!1,a(),t&&t.off("mouseleave",u),c())},o}var Ex={create:(e,t,n)=>Cx(e,t,n)};const Ax={generateHash:function(e){return function(e){let t=0;if(!e||!e.length)return t;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t}(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=Ax.generateHash(t)}};const Tx={getDefaultHashDataForHyperCube:function(e,t,n){return function(e,t){const n=[];if(!e.qMeasures)return Promise.resolve(n);return e.qMeasures.forEach((e=>{e.qLibraryId?n.push(function(e,t){return t.getMeasure(e).then((e=>e.getProperties().then((e=>e.qMeasure.qDef))))}(e.qLibraryId,t)):n.push(Promise.resolve())})),Promise.all(n)}(e,n).then((e=>({drillLevel:Rx(t),dimensionExpressions:Nx(t),measureExpressions:e})))}};function Nx(e){return e.qDimensionInfo.map((e=>e.qGroupFieldDefs))}function Rx(e){const t=function(e){return mv(e,"qDimensionInfo",[])}(e);return t.map((e=>e.qGroupPos))}const Ox={},Ix=hb.bind(null,!0);function Px(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const Lx=Array.isArray,jx=function(e){return void 0===e};function zx(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Fx(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach(((t,i)=>{i!==n.length&&(r=+t,e[r||t]=jx(e[r||t])?Number.isNaN(+r)?{}:[]:e[t],e=e[r||t])})),e}function Hx(e,t){if(Px(e)&&Px(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!Hx(e[n],t[n]))return!1;return!0}if(Lx(e)&&Lx(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!Hx(e[n],t[n]))return!1;return!0}return e===t}Ox.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach((i=>{const o=function(e){return e&&(e=Ix({},{val:e}).val),e}(t[i]),s=e[i],a=`${n}/${i}`;Hx(o,s)||zx(t,i)||(jx(s)?r.push({op:"add",path:a,value:o}):Px(o)&&Px(s)?r=r.concat(Ox.generate(s,o,a)):Lx(o)&&Lx(s)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o,s,a=-1;function l(e,t,n){if(e[n]&&jx(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(Hx(t,i))return r;if(null===t[0]||!jx(t[0])&&jx(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(o=i.length-1;o>=0;--o)a=l(t,i[o]&&i[o].qInfo&&i[o].qInfo.qId,o),-1===a?(r.push({op:"remove",path:`${n}/${o}`}),i.splice(o,1)):r=r.concat(Ox.generate(i[o],t[a],`${n}/${o}`));for(o=0,s=t.length;o<s;++o)a=l(i,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===a?(r.push({op:"add",path:`${n}/${o}`,value:t[o]}),i.splice(o,0,t[o])):a!==o&&(r.push({op:"move",path:`${n}/${o}`,from:`${n}/${a}`}),i.splice(o,0,i.splice(a,1)[0]));return r}(s,o,a)):r.push({op:"replace",path:`${n}/${i}`,value:o}))})),Object.keys(e).forEach((i=>{jx(t[i])&&!zx(e,i)&&r.push({op:"remove",path:`${n}/${i}`})})),r},Ox.apply=function(e,t){t.forEach((t=>{const n=Fx(e,t.path);let r=t.path.split("/").splice(-1)[0];const i=r&&Number.isNaN(+r)?n[r]:n[+r]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(Lx(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(Lx(i)&&Lx(t.value)){const e=t.value.slice();i.length=0,i.push.apply(i,e)}else Px(i)&&Px(t.value)?(s=i,Object.keys(s).forEach((e=>{Object.getOwnPropertyDescriptor(s,e).configurable&&!zx(s,e)&&delete s[e]})),Ix(i,t.value)):n[r]=t.value;else if("move"===t.op){const i=Fx(e,t.from);Lx(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(Lx(n)?n.splice(+r,1):delete n[r]);var s}))},Ox.clone=function(e){return Ix({},e)},Ox.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},Ox.updateObject=function(e,t){Object.keys(e).length?Ox.apply(e,Ox.generate(e,t)):Ix(e,t)};class Bx{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=Ox.generate(e,t);return hb(!0,e,t),n&&n.length?(n=n.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),this._model.applyPatches(n,!0).then((()=>!0))):Promise.resolve(!1)}async mergeSoftPatches(){if(!this._model)return;const e=this._model.getProperties(),t=this._model.getEffectiveProperties(),n=await e,r=await t;if(n.qExtendsId)return;const i=Ox.generate(n,r);Ox.apply(n,i);const o=this;o._model.setProperties(n).then((()=>{o._model.clearSoftPatches()}))}}var Vx={canModifyHardProperties:function(e){if(e.qHasSoftPatches||e.qExtendsId)return!1;if(e.permissions)return e.permissions.update;return-1!==e.qMeta.privileges.indexOf("update")}};var $x={saveDerivedProperties:function(e,t,n,r){if(Vx.canModifyHardProperties(t))return e.setProperties(n);return new Bx(e).saveSoftProperties(r,n)}};var Wx={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function Ux(){this._generationInProgress=!1}function Yx(e){Wx.validate(e);const t=e.properties,n=Ax.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}Ux.prototype.isDerivedUpToDate=Yx,Ux.prototype.updateDerivedProperties=function(e){if(Wx.validate(e),this._generationInProgress)return Promise.resolve(!0);if(Yx(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,r=e.layout,i=hb(!0,{},e.properties),o=hb(!0,{},i);return this._generationInProgress=!0,Ax.updateHash(i,e.hashData),e.generateDerivedProperties(r,i).then((()=>$x.saveDerivedProperties(n,r,i,o).then((()=>(t._generationInProgress=!1,Promise.resolve(!0))))))},Ux.prototype.addDefaultHyperCubeHash=function(e,t,n,r){return Tx.getDefaultHashDataForHyperCube(e,t,n).then((e=>hb(!0,r,e)))};const Kx={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const Xx={replaceExpressionTokens:function(e,t,n){const r={start:n&&n.start||"{{",end:n&&n.end||"}}"};let i,o,s=e;for(const e in t)i=t[e],o=r.start+e+r.end,s=s.replace(Gx(o,!0),i);return s},createRegExp:Gx};function Gx(e,t,n){const r=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const i=n?`(${r})`:r;return t?new RegExp(i,"g"):new RegExp(i)}const Jx={generateExpression:function(e,t){const n={};if(t)for(const e in t){const r=t[e],i=r.wrap?Kx.wrapExpression(r.value):r.value;n[e]=i;(r.variations||[]).forEach((t=>{const r=Zx(t,i,e);n[t]=r}))}return Xx.replaceExpressionTokens(e,n)}};function Zx(e,t,n){if(""===t)return"";const r=Xx.createRegExp(n,!0,!0),i=e.split(r);let o="";return i.forEach((e=>{o+=e!==n?e:t})),o}const Qx={generateHyperCubeDef:function(e,t,n,r,i){return function(e,t,n,r){const i={};let o,s;const a=[];let l;e.forEach((e=>{o=iw(e.match(rw("Dim"))),o.forEach((e=>{a.push(ew(t.qDimensions[e],r,e,n).then((t=>{i[`Dim[${e}]`]={value:t,wrap:!0}})))})),s=iw(e.match(rw("Mea"))),s.forEach((e=>{a.push(tw(t.qMeasures[e],r).then((t=>{i[`Mea[${e}]`]={value:t}})))}))})),l=a.length?Promise.all(a).then((()=>Promise.resolve(i))):Promise.resolve(i);return l}(e.dimensions.concat(e.measures),t,n,r).then((n=>{const r=hb({},n,i),o=hb(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach((e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${Jx.generateExpression(e,r)}`]}})})),e.measures.forEach((e=>{o.qMeasures.push({qDef:{qDef:Jx.generateExpression(e,r)}})})),o}))},getAllHyperCubeExpressions:async function(e,t,n){const r=e.qDimensions.map(((e,r)=>ew(e,n,r,t))),i=e.qMeasures.map((e=>tw(e,n)));return{dimensions:await Promise.all(r),measures:await Promise.all(i)}}};function ew(e,t,n,r){if(e.qLibraryId)return nw(e.qLibraryId,"dimension",t,n,r);const i=r.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[i])}function tw(e,t){return e.qLibraryId?nw(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function nw(e,t,n,r,i){if(!n)return console.warn("No app provided, returning library id"),e;return n["dimension"===t?"getDimension":"getMeasure"](e).then((e=>e.getProperties().then((e=>"dimension"===t?e.qDim.qFieldDefs[i.qDimensionInfo[r].qGroupPos]:e.qMeasure.qDef))))}function rw(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function iw(e){return e?e.map((e=>e.substr(6,1))):[]}function ow(e){return!Number.isNaN(parseFloat(e))&&Number.isFinite(+e)}function sw(e){return!Number.isNaN(parseInt(e,10))&&parseFloat(e,10)===parseInt(e,10)}const aw={getBinSize:function(e){return By(e,"bins.binSize",_m.BIN_SIZE)},getDerivedBinSize:function(e){return By(e,"qUndoExclude.bins.binSize",_m.BIN_SIZE)},getDerivedBinOffset:function(e){return By(e,"qUndoExclude.bins.offset",_m.OFFSET)},getDerivedBinCount:function(e){const t=By(e,"qUndoExclude.bins.binCount",_m.BIN_COUNT);return ow(t)?t<1?1:sw(t)?t:Math.ceil(t):_m.BIN_COUNT},getBinCount:function(e){return By(e,"bins.binCount",void 0)},getBinOffset:function(e){return By(e,"bins.offset",_m.OFFSET)},isAutoBin:function(e){return By(e,"bins.auto",_m.AUTO)},isCountDistinct:function(e){return By(e,"bins.countDistinct",_m.COUNT_DISTINCT)},getBinMode:function(e){return By(e,"bins.binMode",_m.BIN_MODE)},isEmpty:function(e){return null==e||""===e}},lw=Math.log(10),cw=[1,1.5,2,3,4,5,6,10],uw=[1,2,4,5,6,8,10],hw=[2,4,5,10];function dw(e,t){if(0===e)return 0;let n;const r=Math.floor(Math.log(Math.abs(e))/lw),i=e/10**r;for(let e=0;e<t.length;e++)if(i<=t[e]){n=t[e];break}return(r>=0?n*10**r:n/10**-r)*(e<0?-1:1)}function fw(e,t,n,r,i,o){return Math.floor(Math.abs(e-i)/r)+Math.floor(Math.abs(o-t)/r)}const pw={calculateBinSize:function(e,t,n){return function(e,t,n){if(!ow(e)||!ow(t)||!ow(n))throw Error("binSizeCalculator: One of the inputs is NOT numeric");if(e>t)throw Error("binSizeCalculator: The 'min' parameter is bigger than the 'max' parameter")}(e,t,n),function(e,t,n){let r,i,o,s,a,l,c,u,h,d,f,p,g=-1,m=cw;if(n=Math.max(1,n),t===e)if(0===t){if(s=1,1===n)return{min:e,max:t,nbrOfBins:n,rawBinSize:o/n,offset:-.5,newMax:.5,binSize:1,numEmptyBins:0}}else 1===n?(s=t+1e-9,m=uw):s=Math.abs(t/n);else o=(t+=1e-9)-e,s=o/n;do{if(u=1,f=0,g>=0)for(h=1/hw[g],d=1,m=[];d<=10;)m.push(Math.round(1e3*d)/1e3),d+=h;a=s;do{a=dw(a*u,m),l=Math.floor(Math.log(a)/lw),c=10**l,i=t===e?(Math.ceil(t/a)+Math.floor(n/2))*a:Math.ceil(t/a)*a,r=i-n*a;let o=0;for(p=c;(r>e||i<t)&&o<hw.length;)r=Math.floor(e/p)*p,i=r+n*a,p=c/hw[o++];l<1&&(c=10**(Math.abs(l)+1),i=Math.round(i*c)/c,r=Math.round(r*c)/c),u=1.1,f++}while((r>e||i<t)&&f<10);g++}while(fw(e,t,0,s,r,i)>0&&g<hw.length);return{binCount:n,offset:r,binSize:a}}(e,t,n=function(e){return e<1?1:sw(e)?e:Math.ceil(e)}(n))}};const gw={getMappingValues:function(e){const t=aw.isAutoBin(e),n=aw.getBinMode(e);let r,i,o,s;const a=aw.isCountDistinct(e);return t||"maxCount"===n?(s=function(e){const t=By(e,"qHyperCube.qDimensionInfo.0",{});let n=t.qMin,r=t.qMax;n=ow(n)?n:1,r=ow(r)?r:1;const i=aw.getDerivedBinCount(e);return pw.calculateBinSize(n,r,i)}(e),r=s.binSize,i=s.offset,o=s.binCount):(r=aw.getBinSize(e),i=aw.getBinOffset(e)),{binSize:r,binOffset:i,binCount:o,distinct:a}},getMappings:function(e){const t={};return t.BinSize={value:`,${e.binSize}`},t.Label={value:0===e.binOffset?"":",'x'"},t.Offset={value:0===e.binOffset?"":`,${e.binOffset}`},t.Distinct={value:e.distinct?"Distinct ":""},t}};const mw={generateHyperCubes:async function(e,t,n){const{app:r,translator:i}=n,o=gw.getMappingValues(e),s=gw.getMappings(o),a=Qx.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,r),l=Qx.generateHyperCubeDef({dimensions:["Class(aggr({{Dim[0]}},{{Dim[0]}}){{BinSize}}{{Label}}{{Offset}})"],measures:["Count({{Distinct}}{{Dim[0]}})"]},t.qHyperCubeDef,e.qHyperCube,r,s),c=await a,u=await l;let h;h=aw.isAutoBin(e)?{qValueExpression:{qExpr:Jx.generateExpression("=Ceil(Log10(Count({{Dim[0]}})) / Log10(2)) + 1",{"Dim[0]":{value:c.dimensions[0],wrap:!0}})}}:"maxCount"===aw.getBinMode(e)&&aw.isEmpty(t.bins.binCount)?aw.getDerivedBinCount(e):t.bins.binCount,Wy(u,"qDimensions.0.qDef.qSortCriterias",[{qSortByNumeric:1}]),Wy(u,"qDimensions.0.qDef.qFieldLabels",[e.qHyperCube.qDimensionInfo[0].qFallbackTitle]),Wy(u,"qMeasures.0.qDef.qLabel",e.measureAxis.label||i.get("Visualization.Histogram.MeasureAxisLabel")),Wy(t,"qUndoExclude.box.qHyperCubeDef",u),Wy(t,"qUndoExclude.bins.binSize",o.binSize),Wy(t,"qUndoExclude.bins.offset",o.binOffset),Wy(t,"qUndoExclude.bins.binCount",h)}};var yw={isOnComponentForRange:function(e,t,n){return!!e&&!!n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter((e=>-1!==t.indexOf(e.settings.key)))[0]},isOnComponentForLasso:function(e,t,n){return e&&n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter((e=>e.settings.key===t.keys.componentKey))[0]},isOnComponentForNavBtn:function(e,t,n){return n.chart.componentsFromPoint(e.center).some((e=>e.settings.key===t))}};var bw={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:gm.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=yw.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((s=n.handlers).selectionHandler.lassoState()&&!s.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var s},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){yw.isOnComponentForLasso(r,n,this)&&(t.switchTo("lasso",this.chart,r),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",r))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(r){e.lassoing&&(r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(r){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var vw={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?gm.DIRECTION_HORIZONTAL:gm.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const s="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=yw.isOnComponentForRange(o,s,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!a,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(i){const o="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r];yw.isOnComponentForRange(i,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,i),t.doEmit(this.chart,"rangeMeasure","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(r){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",r),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function xw(e,t){let n;return n="x-axis"===e?"horizontal"===t?gm.DIRECTION_VERTICAL:gm.DIRECTION_HORIZONTAL:"horizontal"===t?gm.DIRECTION_HORIZONTAL:gm.DIRECTION_VERTICAL,n}var ww={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:xw(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const s="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=yw.isOnComponentForRange(o,s,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!a,e.minoring}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(i){const o="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r];yw.isOnComponentForRange(i,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,i),t.doEmit(this.chart,"rangeMinor","areaStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(r){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",r))},arearangeend(r){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",r),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var kw={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?gm.DIRECTION_VERTICAL:gm.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const s="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=yw.isOnComponentForRange(o,s,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!a,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(i){const o="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r];yw.isOnComponentForRange(i,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,i),t.doEmit(this.chart,"rangeDim","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(r){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",r),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var Mw={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?gm.DIRECTION_VERTICAL:gm.DIRECTION_HORIZONTAL,event:"drag",enable(r,i){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!i&&!!this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter((e=>e.settings.key===n.keys.componentKey))[0],e.dragging)}},requireFailure:r?`lasso ${t.getBrushConfig()}`:"",events:{dragstart(e){o={x:e.deltaX,y:e.deltaY};let t=-(n.isHorizontal?e.deltaY:e.deltaX)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let r=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(r=-r),n.handlers.scrollHandler.getScrollApi().move(r),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var _w={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&yw.isOnComponentForNavBtn(r,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach((t=>{const n=e.target,r=n?n.getAttribute("data-action"):"";if(r)return t.emit(r)}))}}}}};var Sw={create:function(e,t,n,r,i){const o={};t=t||"vertical";const s=r.lassoBrushKey||"select",a=r.dimRangeBrushKey||null,l=r.measureRangeBrushKey||null,c=r.areaBrushKey||null,u=r.legendBrushKey||null,h=!!e.selectionHandler&&e.selectionHandler.isOn(),d={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},p="horizontal"===t,g=p?"y-axis":"x-axis",m=p?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let r=s;const i=t||f.chart;switch(f.gesture){case"majorrange":b(i,"rangeDim","rangeClear",n),r=a;break;case"measurerange":b(i,"rangeMeasure","rangeClear",n),r=l;break;case"arearange":b(i,"rangeMinor","areaClear",n),r=c}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&i.brush(r).clear(),f.chart=t,f.type=o}function b(e,t,n,r){if(e){const i=e.component(t);i&&i.emit(n,r)}}let v=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:b,switchTo:y,getBrushConfig:function(){return a?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:r,isHorizontal:p,active:f,rangeSelStatus:i};function k(){y("none"),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}return h&&(v=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}}}],v.unshift(_w.callNavBtnGesture(x.isNavigationEnabled,u)),v.push(bw.callLassoGesture(d,x,w)),a?l?(v.push(kw.callDimensionRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),v.push(vw.callMeasureRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(v.push(kw.callDimensionRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),v.push(ww.callAreaRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"})):(v.push(vw.callMeasureRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),v.push(ww.callAreaRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(v.push(Mw.callDragGesture(d,x,w,h,n)),e.scrollHandler.getScrollApi().on("update",k)),o.gestures=v,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",k)},o}};const qw=(e,t)=>(t.components||[]).find((t=>t.key===e)),Dw=(e,t,n)=>{var r,i,o,s;const a=null===(r=qw("axis",n))||void 0===r?void 0:r.axis;return{text:{fontFamily:(null==a||null===(i=a.title)||void 0===i?void 0:i.fontFamily)||t.getStyle(e,"axis.title","fontFamily"),fontSize:(null==a||null===(o=a.title)||void 0===o?void 0:o.fontSize)||t.getStyle(e,"axis.title","fontSize"),fill:(null==a||null===(s=a.title)||void 0===s||null===(s=s.fontColor)||void 0===s?void 0:s.color)||t.getStyle(e,"axis.title","color")}}},Cw=(e,t,n)=>{var r,i,o,s;const a=null===(r=qw("axis",n))||void 0===r?void 0:r.axis;return{labels:{fontFamily:(null==a||null===(i=a.label)||void 0===i||null===(i=i.name)||void 0===i?void 0:i.fontFamily)||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:(null==a||null===(o=a.label)||void 0===o||null===(o=o.name)||void 0===o?void 0:o.fontSize)||t.getStyle(e,"axis.label.name","fontSize"),fill:(null==a||null===(s=a.label)||void 0===s||null===(s=s.name)||void 0===s||null===(s=s.fontColor)||void 0===s?void 0:s.color)||t.getStyle(e,"axis.label.name","color")}}};function Ew(e){const t=By(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0.qApprMaxGlyphCount",0);return Math.min(20,t)}const Aw={createSettings:function(e){return{settings:{labels:{maxGlyphCount:Ew(e)}}}}};const Tw={createSettings:function(e){const t=aw.isAutoBin(e),n=aw.getBinMode(e),r=aw.getDerivedBinSize(e);let i,o;if(t||"maxCount"===n){const t=aw.getDerivedBinOffset(e);i=t,o=t+aw.getDerivedBinCount(e)*r}else{const t=By(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0",{});i=t.qMin||0,o=(t.qMax||0)+r}return{component:{type:"linear",min:i,max:o}}}},Nw={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},Rw=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,Ow=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,Iw=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,Pw=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,Lw=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,jw=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,zw=Math.floor,Fw=Math.round,Hw=Sv.extend({init(){let e,t,n,r,i,o,s,a,l,c,u,h,d=0,f=0,p=0,g=1;if(this._invalid=!1,arguments[0]instanceof Hw)d=arguments[0]._r,f=arguments[0]._g,p=arguments[0]._b,g=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(h=arguments[0],u=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10);else if(u=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10),g=parseFloat(u[4]);else if(u=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(h))d=parseInt(u[1],16),f=parseInt(u[2],16),p=parseInt(u[3],16),g=1;else if(u=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(h))d=parseInt(u[1]+u[1],16),f=parseInt(u[2]+u[2],16),p=parseInt(u[3]+u[3],16),g=1;else if(u=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=Fw(255*d),f=Fw(255*f),p=Fw(255*p),g=1}else if(u=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),g=parseFloat(u[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=Fw(255*d),f=Fw(255*f),p=Fw(255*p)}else if(u=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),i=parseFloat(u[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=i-o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=Fw(255*d),f=Fw(255*f),p=Fw(255*p),g=1}else Nw[h.toLowerCase()]?(n=h.toLowerCase(),d=Nw[n].r,f=Nw[n].g,p=Nw[n].b,g="number"==typeof Nw[n].a?Nw[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(g=(4278190080&arguments[0])>>>24,g/=255,d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(d=arguments[0],f=arguments[1],p=arguments[2],g=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+d+f+p+g)&&(this._invalid=!0),this._r=zw(d),this._g=zw(f),this._b=zw(p),this._a=g,this._spaces={}},isInvalid(){return this._invalid},setAlpha(e){this._a=e,this._spaces={}},getAlpha(){return this._a},toRGB:function(){return this._spaces.rgb||(this._spaces.rgb=Hw.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=Hw.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=Hw.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=Hw.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=Hw.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=Hw.toHSLA(this,e)),this._spaces.hsla},toHSV(){const e=this.toHSVComponents();return`hsv(${e.h},${e.s},${e.v})`},toHSVComponents:function(){return this._spaces.hsvComp||(this._spaces.hsvComp=Hw.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=Hw.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),r=parseFloat(n[1]),i=parseFloat(n[3]);let o=parseFloat(n[5]);const s=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${s})`},isEqual(e){return e instanceof Hw||(e=new Hw(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[zw(this._r+(e._r-this._r)*t),zw(this._g+(e._g-this._g)*t),zw(this._b+(e._b-this._b)*t),zw(this._a+(e._a-this._a)*t)].join(",")})`},createShiftedColor(e){(void 0===e||Number.isNaN(+e))&&(e=1);const t=this.getLuminance(),n=this._g<126?1:1+this._g/512,r=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new Hw(r)}});Hw.toRGB=function(e){if(e instanceof Hw)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=Hw.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},Hw.toRGBA=function(e,t){if(e instanceof Hw)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=Hw.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},Hw.toHex=function(e){let t,n,r;return e instanceof Hw?(t=e._r.toString(16),n=e._g.toString(16),r=e._b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${[t,n,r].join("")}`):("string"==typeof e&&(e=Hw.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),r=(255&e).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${t}${n}${r}`)},Hw.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new Hw(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=Math.max(s,a,l),u=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(c+u)/2,c===u)n=0,o=0;else{switch(i=c-u,n=r>.5?i/(2-c-u):i/(c+u),c){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},Hw.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new Hw(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=e._a,u=Math.max(s,a,l),h=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(u+h)/2,u===h)n=0,o=0;else{switch(i=u-h,n=r>.5?i/(2-u-h):i/(u+h),u){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${c})`},Hw.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new Hw(e));const i=e._r/255,o=e._g/255,s=e._b/255,a=Math.max(i,o,s),l=Math.min(i,o,s),c=a;if(a===l)t=0,r=0;else{switch(n=a-l,t=0===n?0:n/c,a){case i:r=(o-s)/n+(o<s?6:0);break;case o:r=(s-i)/n+2;break;case s:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*c}},Hw.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof Hw)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,r=0,i=0;return 1===arguments.length&&"string"==typeof arguments[0]&&(t=arguments[0],(e=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(t))?(n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10)):(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))?(n=parseInt(e[1],16),r=parseInt(e[2],16),i=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16))),(n<<16)+(r<<8)+i},Hw.blend=function(e,t,n){const r=(16711680&(e=Hw.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=Hw.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},Hw.getBlend=function(e,t,n){const r=e._r+(t._r-e._r)*n,i=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,s=e._a+(t._a-e._a)*n;return new Hw(r,i,o,s)},Hw.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(Rw.test(e)||Ow.test(e)||Iw.test(e)||Pw.test(e)||Lw.test(e)||jw.test(e)||Nw[e.toLowerCase()])},Hw.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},Hw.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,r=t.getLuminance()/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},Hw.isDark=function(){const e={getLuminance:Hw.prototype.getLuminance,isInvalid:Hw.prototype.isInvalid};return Hw.prototype.init.apply(e,[].slice.call(arguments)),Hw.prototype.isDark.call(e)},Hw.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const Bw={TRANSPARENT_BLACK:"rgba( 0,0,0,0.2 )",TRANSPARENT_WHITE:"rgba( 255,255,255,0.7 )",LIGHT_GREY:"#ccc",DARK_GREY:"#666",BLACK:"#000",WHITE:"#fff",getInverse(e){const t=new Hw(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new Hw(e);return 0===t.getAlpha()?this.DARK_GREY:Hw.getBestContrast(t,new Hw(Bw.LIGHT_GREY),new Hw(Bw.DARK_GREY))},getBestContrast:(e,t,n)=>Hw.getBestContrast(new Hw(e),new Hw(t),new Hw(n)),getContrastingTransparent(e){const t=new Hw(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};const Vw={createSettings:function(e,t,n,r,i,o){const{theme:s}=e.environment,a=s.getColorPickerColor(t.color.bar.paletteColor),l=aw.getDerivedBinSize(t),c=[],u=[n.consume,r.consume,i.consume];return e._tooltipHandler.isOn()&&(c.push(o.box.trigger),u.push.apply(u,o.box.consume)),c.push(n.trigger),{key:"box-marker",settings:{box:{fill:a,stroke:Bw.getContrastingGrey(a).toHex(),strokeWidth:1,maxWidthPx:1/0,minWidthPx:NaN,minWidth:0},major:{scale:"dimension",ref:{start:"binStart",end:"binEnd"}},minor:{scale:"measure"},whiskers:!1,orientation:"vertical"},brush:{trigger:c,consume:u},data:{extract:{field:"qDimensionInfo/0",props:{start:0,end:{field:"qMeasureInfo/0"},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},binStart:{field:"qDimensionInfo/0",value:e=>e.qNum},binEnd:{field:"qDimensionInfo/0",value:e=>e.qNum+l},elemNo:{field:"qDimensionInfo/0"},bin:{field:"qDimensionInfo/0",value:e=>e}}}}}}};const $w={createSettings:function(e,t,n){const r=t.getStyles(),i=((e,t,n)=>{var r,i,o,s;const a=null===(r=qw("value",n))||void 0===r?void 0:r.label,l=(null==a||null===(i=a.value)||void 0===i?void 0:i.fontFamily)||t.label.value.fontFamily;let c=(null==a||null===(o=a.value)||void 0===o?void 0:o.fontSize)||t.label.value.fontSize;return c=parseFloat(c),{fontFamily:l,fontSize:c,fill:null==a||null===(s=a.value)||void 0===s||null===(s=s.fontColor)||void 0===s?void 0:s.color}})(0,r,e),o=i.fill||r.label.value.color;return{settings:{sources:[{strategy:{settings:{...i,labels:[{placements:[{fill:o},{fill:i.fill?o:e=>Hw.isDark(e.node.attrs.fill)?r.label.value.lightColor:r.label.value.darkColor}]}]}}}]}}}},Ww="object.histogram";function Uw(e){return By(e,"qHyperCube.qDimensionInfo.0.qIsOneAndOnlyOne",!1)}const Yw={createChartSettings:function(e,t){const n=e.isRtl(),r=By(t,"qHyperCube.qDimensionInfo.0",{}).qFallbackTitle||"",{theme:i,translator:o}=e.environment,s=ex.create({chartID:Ww,theme:i,isRtl:n,flags:e.flags}),a=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,s=void 0===o?[]:o,a=r.transform,l=void 0===a?[]:a,c=r.extend,u=void 0===c?[]:c,h={theme:t,matrix:ob(s),styles:void 0};return h.styles=cb({theme:t,id:i,transform:l,extend:u,matrix:h.matrix}),{getStyles:function(){return h.styles},getTheme:function(){return h.theme},setTheme:function(e){h.theme=e,h.styles=cb({theme:e,id:i,transform:l,extend:u,matrix:h.matrix})}}}({theme:i,config:{id:"histogram"}});let l={},c={},u={};e._selectionHandler.isOn()&&(e._selectionHandler.setUpStart(),l=e._selectionHandler.setUpBrush({contexts:["select"],data:["elemNo"],dataPath:"qUndoExclude/box"}),c=e._selectionHandler.setUpBrush({contexts:["select-dimension"],data:["elemNo"],dataPath:"qUndoExclude/box",isSingleSelect:Uw(t)}),u=e._selectionHandler.setUpBrush({dataPath:"qUndoExclude/box",contexts:["select-measure"],data:["end"]}),e._selectionHandler.setUpDone());const h={box:{}};e._tooltipHandler.isOn()&&(h.box=e._tooltipHandler.setUp({chartBuilder:s,environment:e.environment,data:[""],contexts:["boxTip"],componentKey:"box-marker",measureRows:["measure"],labelData:["bin"]}));const d=function(e){const t=e.qUndoExclude&&e.qUndoExclude.box&&e.qUndoExclude.box.qHyperCube&&e.qUndoExclude.box.qHyperCube.qDimensionInfo?e.qUndoExclude.box.qHyperCube.qDimensionInfo:void 0;return!!t&&!!t[0].qLocked}(t),f=function(e){const t={};return e?(t.isOpenDim=!1,t.isOpenMea=!1):(t.isOpenDim=!0,t.isOpenMea=!0),t}(d),p={scrollHandler:null,selectionHandler:e._selectionHandler};this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=Sw.create(p,"vertical",n,{componentKey:"box-marker",lassoBrushKey:"select",dimRangeBrushKey:null,measureRangeBrushKey:"select-measure",areaBrushKey:"select-dimension"},f),s.addPreset("dimension-measure-chart",{isRtl:n,includeDimensionAxis:!0,orientation:"vertical",selectionsEnabled:e._selectionHandler.isOn(),theme:i,measureSource:"qMeasureInfo/0",measureScaleSettings:{component:{expand:0,include:[0]}},enableLasso:!0,lasso:{brushKey:"select",brushComponents:["box-marker"]},enableMeasureRange:!0,measureRange:{brushKey:"select-measure",brushAxis:"y-axis",brushArea:"box-marker",brushScale:"measure"},enableAreaRange:!0,areaRange:{brushKey:"select-dimension",brushAxis:"x-axis",brushData:["elemNo"],brushArea:"box-marker",brushScale:"rangeSelSettings",brushComponents:["box-marker"],multiple:!0,chartInstance:e.chartInstance},brushActions:this._dependentActions.gestures,dimensionSource:"qDimensionInfo/0",dimensionScaleSettings:Tw.createSettings(t),measureAxisProperties:t.measureAxis,measureTitleText:t.measureAxis.label||o.get("Visualization.Histogram.MeasureAxisLabel"),dimensionAxisProperties:t.dimensionAxis,dimensionAxisSettings:Aw.createSettings(t),dimensionTitleText:r,gridlines:t.gridlines,hasNavigation:!1,isNavigationEnabledFn:()=>!1,refLines:t.refLine&&t.refLine.refLines,axisTitleStyle:Dw(Ww,i,t),axisLabelStyle:Cw(Ww,i,t)});const g=s.getSettings(),m=Vw.createSettings(e,t,l,c,u,h);if(s.addComponent("box-marker",m),t.dataPoint&&t.dataPoint.showLabels){const e=$w.createSettings(t,a,Ww);s.addComponent("labels",e)}return e.addSnapshotChartSettings(g,t),g.scales.rangeSelSettings={type:"linear",min:g.scales.dimension.min,max:g.scales.dimension.max,source:"qDimensionInfo/0"},g}};const Kw=ax.extend("Histogram",{namespace:".histogram",init:function({environment:e,flags:t,lasso:n,picasso:r,$element:i,backendApi:o,selectionsApi:s,renderState:a}){this._super(r,i,e,o,s),this.flags=t,this.renderState=a,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new Ux,this._selectionHandler=mx.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:s,selectPaths:["/qUndoExclude/box/qHyperCubeDef"],lasso:n}),this._tooltipHandler=Ex.create(this.chartInstance,i,"object.histogram"),this.setDataPaths(["qUndoExclude/box/qHyperCube"])},updateConstraints:function(e){const t=!e.passive,n=!e.select&&!e.active;this._tooltipHandler[t?"on":"off"](),this._selectionHandler[n?"on":"off"]()},off:function(){this._tooltipHandler.off(),this._selectionHandler.off()},createChartSettings:function(e){return Yw.createChartSettings(this,e)},setSnapshotData:function(e){return this._super(e),e.qUndoExclude.box.qHyperCube.qDataPages=this.layout.qUndoExclude.box.qHyperCube.qDataPages,Promise.resolve(e)},getDisclaimerAttributes:function(e){const t=function(){const t=By(e,"qUndoExclude.box.qHyperCube.qDataPages.0.qMatrix",[]);return 1===t.length&&t[0][0]&&t[0][0].qIsNull}();return{data:e.qUndoExclude&&e.qUndoExclude.box,supportedDisclaimers:{LimitedData:!0,OnlyNanData:!0,OnlyNegativeOrZeroValues:!t,RequireNumericDimension:!0},options:{bottom:!0,supportNegative:!1,explicitOnlyNanData:t,explicitRequireNumericDimension:(n=e.qHyperCube,n.qDimensionInfo.length>0&&-1===n.qDimensionInfo[0].qTags.indexOf("$numeric"))}};var n},updateChart:function(e,t){if(!e.qUndoExclude)return Promise.resolve();this._super(e,t)},updateData:function(e){const t=this;return t._super(e).then((()=>{if(t._destroyed)return Promise.reject();e=t.layout;const n={height:Math.min(e.qHyperCube.qSize.qcy,1e3),width:2},r=t.backendApi.model;return!!this.layout.snapshotData?Promise.resolve():r.getEffectiveProperties().then((i=>t._destroyed?Promise.reject():t._derivedProperties.addDefaultHyperCubeHash(i.qHyperCubeDef,e.qHyperCube,t.environment.app,function(e,t){return{box:t.qHyperCubeDef,binMappings:gw.getMappingValues(e),binProperties:t.bins,measureAxis:t.measureAxis,version:"2.0"}}(e,i)).then((o=>{if(t._destroyed)return Promise.reject();const s={layout:e,properties:i,model:r,hashData:o,generateDerivedProperties:(e,n)=>mw.generateHyperCubes(e,n,t.environment)};return t._derivedProperties.isDerivedUpToDate(s)?e.qUndoExclude?(t.renderState.restore(),t.backendApi.updateCache(e.qUndoExclude.box),t.getData(t.backendApi,e.qUndoExclude.box.qHyperCube,n)):Promise.resolve():(t.renderState.pending(),t._derivedProperties.updateDerivedProperties(s))}))))}))},paint:function(){const e=this.layout.qUndoExclude;return e&&e.box&&e.box.qHyperCube.qDataPages.length?this._super():Promise.resolve(!1)},isLassoDisabled:function(){return!1}});class Xw{constructor(e){this.model=e,this.path="/qUndoExclude/box/qHyperCubeDef"}setCacheOptions({maxStackedValues:e}){}updateCache(e){}getData(e){return this.model.getHyperCubeData(this.path,e)}}var Gw={onChangeCalcCond:function(e){var t;const n=null==e?void 0:e.qHyperCubeDef,r=null==e||null===(t=e.qUndoExclude)||void 0===t||null===(t=t.box)||void 0===t?void 0:t.qHyperCubeDef;n&&r&&(r.qCalcCond=n.qCalcCond,r.qCalcCondition=n.qCalcCondition)}};const Jw=(e,t)=>({component:"styling-panel",chartTitle:"Object.Histogram",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:{axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:t.getOptions("axis","axis.title")},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")},valueLabelSection:{translation:"properties.value.label",component:"panel-section",items:t.getOptions("value","label.value")}}}),Zw="maxCount",Qw="size";function ek(e){return!(e.bins&&e.bins.auto)}function tk(e){return ek(e)&&e.bins.binMode===Zw}function nk(e){var t,n;const{translator:r,flags:i}=e,o=null==e||null===(t=e.flags)||void 0===t?void 0:t.isEnabled("SENSECLIENT_IM_2021_STYLINGPANEL_HISTOGRAM"),s=null==e||null===(n=e.flags)||void 0===n?void 0:n.isEnabled("SENSECLIENT_IM_2021_HISTOGRAM_BG"),a=e.anything.sense.theme,l={translation:"properties.colors",type:"items",items:{colors:{classification:{section:"color",tags:["simple"]},type:"items",items:{barColor:{ref:"color.bar.paletteColor",translation:"properties.histogram.barColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue:()=>{const{primary:e}=a.getDataColorSpecials(),t=a.getDataColorPickerPalettes()[0].colors,n=t.indexOf(e);return{index:-1===n?Math.min(6,t.length-1):n}}}}}}},c="object.histogram",u=((e,t,n,r,i)=>r({theme:e,translator:t,flags:i,config:{id:n,paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}}))(a,r,c,Bm,i),h=((e,t,n)=>{const r={getOptions:(r,i)=>{const o=(e,t)=>({ref:`${i}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${i}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:r,items:{fontFamily:{ref:`${i}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${i}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${i}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${i}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${i}.fontSize`),defaultValue:()=>e.getDefaultValue(`${i}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return r})(u,a,c),d={type:"items",translation:"properties.presentation",items:{stylingPanel:o&&Jw(s,h),gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridlines.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridlines.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridlines&&!e.gridlines.auto}}},showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],snapshot:{tid:"property-dataPoints"}}}},f={items:{labels:{items:{header:{show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length}},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.XAxis.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length},convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.YAxis.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length},convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},p={uses:"settings",items:{simpleLabels:f,presentation:d,colors:l,measureAxis:{uses:"axis.picasso.measureAxis",items:{label:{type:"string",expression:"optional",expressionType:"StringExpression",ref:"measureAxis.label",defaultValue:"",translation:"Common.Label",placeholderTranslation:"Visualization.Histogram.MeasureAxisLabel"}}},dimensionAxis:{uses:"axis.picasso.dimensionAxis",items:{othersGroup:{items:{label:{show:!1}}}}}}},g={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:Gw.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},m={uses:"data",items:{dimensions:{translation:"Common.Fields",alternativeTranslation:"properties.alternative.fields",items:{dimensionLimits:{show:!1,items:{otherMode:{readOnly:!1},otherSortMode:{show:e=>"OTHER_COUNTED"===By(e,"qOtherTotalSpec.qOtherMode")},otherCounted:{show:e=>"OTHER_COUNTED"===By(e,"qOtherTotalSpec.qOtherMode")},otherLimitMode:{show(e){const t=By(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},otherLimit:{show(e){const t=By(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},calculatedAgainstMessage:{show:!0,label(){const e=r.get("properties.histogram.staticMeasureName");return r.get("Properties.DimensionLimits.CalculatedAgainst",e)}}}},others:{show:!1,items:{suppressOther:{defaultValue:!0}}}}}}},y={ref:"bins.binMode",type:"string",component:"dropdown",options:[{value:Zw,translation:"Visualization.Histogram.Binning.NumberOfBinsOption"},{value:Qw,translation:"Visualization.Histogram.Binning.BarWidthOption"}],defaultValue:Zw,show:e=>ek(e)},b={translation:"Visualization.Histogram.Bins",type:"items",component:"items",items:{auto:{ref:"bins.auto",translation:"Visualization.Histogram.Binning",component:"switch",type:"boolean",defaultValue:!0,undefinedValue:!1,options:[{value:!0,translation:"Visualization.Histogram.Binning.Auto"},{value:!1,translation:"Visualization.Histogram.Binning.Custom"}]},autoMessage:{component:"text",translation:"Visualization.Histogram.Binning.AutoDescription",show:e=>!ek(e)},mode:y,binCount:{ref:"bins.binCount",type:"number",expression:"optional",expressionType:"ValueExpression",translation:"Visualization.Histogram.Binning.BinCount",defaultValue:"",convertFunctions:{get(e,t,n){const r=n.properties.bins.binCount;return aw.isEmpty(r)?aw.getDerivedBinCount(n.layout):e(null)||""},set(e,t,n){t(n.type,e,void 0)}},show:tk},binMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountRounding",show(e){const t=By(e,"bins.binCount"),n="object"==typeof t;return tk(e)&&!aw.isEmpty(t)&&!n&&!sw(t)&&t>0}},minBinMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountMin",show(e){const t=By(e,"bins.binCount");return!!(tk(e)&&!aw.isEmpty(t)&&t<=0)}},binSize:{ref:"bins.binSize",type:"number",expression:"optional",expressionType:"ValueExpression",defaultValue:10,show:e=>ek(e)&&e.bins.binMode===Qw,translation:"Visualization.Histogram.Binning.BinSize"},offset:{ref:"bins.offset",type:"number",expression:"optional",expressionType:"ValueExpression",show:e=>ek(e)&&e.bins.binMode===Qw,translation:"Visualization.Histogram.Binning.Offset"},distinct:{ref:"bins.countDistinct",type:"boolean",defaultValue:!1,component:"checkbox",translation:"Visualization.Histogram.CountDistinct"}}};return{type:"items",component:"accordion",items:{data:m,bins:b,addons:g,settings:p}}}var rk={type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{translation:"Common.Fields"}}}}};var ik={getExportRawDataOptions:function(e,t,n){return e.addItem({translation:"contextMenu.export",tid:"export",select(){n.show(t.model,"/qUndoExclude/box/qHyperCubeDef")}}),Promise.resolve()}};const ok="qUndoExclude.box";function sk(e){var t;if(null!==(t=e.anything)&&void 0!==t&&t.sense)return{definition:nk(e),softDefinition:rk,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},importProperties:(t,n,r,i)=>{const o=qm(e);r.mapProperties();const s={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()};return Mm.hypercube.importProperties({exportFormat:t,initialProperties:n,dataDefinition:o,defaultPropertyValues:s,hypercubePath:i})},exportProperties:(e,t,n)=>Mm.hypercube.exportProperties({propertyTree:e,hyperCubePath:n?ok:t,viewDataMode:n}),requireNumericDimension:!0,exportTableProperties(e){const t=ok;return Mm.hypercube.exportProperties({propertyTree:e,hypercubePath:t,viewData:!0})},getExportRawDataOptions:ik.getExportRawDataOptions}}return function(t){!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(l).forEach((t=>{e.add(l[t])}))}}(t.translator);const n=qm(t);return{qae:{properties:Sm,data:{targets:[n]},exportProperties:({propertyTree:e,hypercubePath:t,viewDataMode:n})=>Mm.hypercube.exportProperties({propertyTree:e,hypercubePath:n?"qUndoExclude.box":t})},ext:sk(t),component(){const n=e.useConstraints(),r=e.useElement(),i=function(){const t=e.useApp(),n=e.useAppLayout(),r=e.useDeviceType(),i=e.useOptions(),o=e.useTheme(),s=e.useTranslator();return e.useMemo((()=>({app:t,appLayout:n,deviceType:r,options:i,theme:o,translator:s})),[t,n,i.direction,i.freeResize,s.language(),o.name(),r])}(),o=i.options.renderer,s=e.useMemo((()=>bm(o)),[o]),l=function(){const t=e.useConstraints(),[n,r]=e.useState(!1),[i,o]=e.useState(!1),s=!!e.useLayout().qSelectionInfo.qInSelections,[a]=e.useState((()=>({toggle(){o((e=>!e))}})));return e.useEffect((()=>{t&&r(!t.select&&!t.active)}),[t]),e.useAction((()=>({key:"lasso",label:"Lasso",icon:vm,hidden:!n||!s,active:i,action(){o((e=>!e))}})),[s,i,n]),a.enabled=()=>n,a.active=()=>i,a}(),c=e.useModel(),u=e.useSelections(),h=e.useStaleLayout(),d=e.useRenderState(),[f,p]=e.useState();e.useEffect((()=>{const e=a(r),n=new Xw(c),o=u,h=new Kw({$element:e,backendApi:n,environment:i,flags:t.flags,lasso:l,picasso:s,selectionsApi:o,renderState:d});return p(h),()=>{h.destroy()}}),[]);const[,g]=e.usePromise((async()=>{f&&(f.updateEnvironment(i),f.updateConstraints(n),await f.updateData(h),await f.paint())}),[h,f,i]);if(g)throw g;var m;!function(t){const n=e.useRect(),r=e.useOptions(),i=e.useConstraints(),[,o]=e.usePromise((async()=>{t&&(t.updateConstraints(i),t.options=r,await t.resize())}),[n.width,n.height]);if(o)throw o}(f),m=f,e.onTakeSnapshot((e=>{if(m)return m.setSnapshotData(e)})),e.useImperativeHandle((()=>({getViewState(){if(m)return m.getViewState()}})),[m])}}}}));
28
+ !function(t,n){e.exports=n()}(0,(function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,d,h=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=h-m,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=m>0?e.substring(b,h):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0===+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(d=t[0]).length%l,h=d.length,b=0;b<h;b++)g+=d.charAt(b),!((b-y+1)%l)&&b<h-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}}))}));const be=1e-15;function xe(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const we={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},Me=/%\)?$/,ke=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,_e=/^\(oct\)/i,Se=/^\(dec\)/i,qe=/^\(hex\)/i,De=/^\(bin\)/i,Ee=/^\(rom\)/i,Ce=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ae=/#|0/g;function Te(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function Ne(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<s.length;n++)if(s[n]<=i){r+=a[n],i-=s[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}function Re(e,t,n){let r;return ke.test(t)?e=Te(e,Number(/\d{2}/.exec(t)[0]),t,n):_e.test(t)?e=Te(e,8,t,n):Se.test(t)?e=Te(e,10,t,n):qe.test(t)?e=Te(e,16,t,n):De.test(t)?e=Te(e,2,t,n):Ee.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=Ne(e,t)):t+r+e.toExponential(0)),e}function Oe(e,t,n){const r=xe(e);return n?r:new RegExp(r||"",t)}function Ie(e,t){return t&&(t=xe(t)),e&&(e=xe(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Pe(e,t){if(!e||!e.qNumericalAbbreviation)return we;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}function Le(e,t,n,r){let i,o,s,a,l,c,u,d,h,f=e.pattern;r&&(e.abbreviate=!0),h=Ie(t,n),s=f.match(h),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(i=s.split(n),o=i.pop(),s=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(Oe(c,"g"),t)),u=n,n=".",u&&(s=s.replace(Oe(u,"g"),n)),d=s.match(/#/g),d=d?d.length:0;const p=f.split(u);let g;p[1]&&(g=p[1].match(Ae)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=g?g.length:2,e.percentage=Me.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(Oe(t,null,!0),"|").concat(Oe(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class je{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=Pe(e,this.patternSeparator),this.prepare()}clone(){const e=new je(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Ce.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Ce.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Ce.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Le(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Le(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Le(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,s,a,l,c,u=this._prepared,d="",h="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=Re(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let r,i,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(r=t[a-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+be*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=ve(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+be).toFixed(t).slice(2).replace(/0+$/,"");for(a=i.length;a<n;a++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),h=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),a=0;a<t;a++)l+="#";e=ve(l,e)}e=e.replace(u.numericRegex,(e=>e===s?u.groupTemp:e===o?u.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+h+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function ze(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new je(...t)}function Fe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return s=i(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=i(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function He(e,t,n,r,i){const o=ze(i,e,t,n,r),s=Fe(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,r){return s.clear(),o.format(t,e,n,r)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const Be={DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Ve=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$e=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],We=["January","February","March","April","May","June","July","August","September","October","November","December"],Ue=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ye=86400;function Ke(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Xe(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}function Ge(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Je(e){const t=e,n=24*Ge(t),r=60*Ge(n),i=60*Ge(r),o=1e3*Ge(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}function Ze(e,t){let n,r=Je(e),i=r.d,o=r.h,s=r.m,a=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(Ye*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:s,s:a,f:l,t:u}}function Qe(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Ke("".concat(t.year).slice(-2),2),YYY:Ke("".concat(t.year).slice(-3),3),def:e=>Ke("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Ke("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Ke("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Ke("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Ke("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Ke("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Ke("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}class et{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:Ve,qDayNames:$e,qLongMonthNames:We,qMonthNames:Ue}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={[Be.TIME]:r.qTimeFmt||"hh:mm:ss",[Be.DATE]:r.qDateFmt||"YYYY-MM-DD",[Be.DATE_TIME]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new et(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=Xe(e,n):(e<0&&(e=-e,t="-".concat(t)),r=Ze(e,t));const i=Qe(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,(e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}));return a}}function tt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new et(...t)}const nt=864e5;function rt(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(nt*(e-Math.floor(e)))))}function it(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=tt(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=Fe(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==Be.INTERVAL?rt(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=tt(i,e,t),r=Fe(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function ot(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return it(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(i,"##"),o="U"),He(n,r,i,o,t)}function st(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u=e=>(null==e?void 0:e.qText)||"",d="dimension"===a?"first":"avg",h=ot(t,i),f="dimension"===a?"first":(e,t)=>h(t),p={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(p)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:u,reduce:d,reduceLabel:f,formatter:()=>h,tags:()=>t.qTags};return p}function at(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const s="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),a={instance:st(p({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},i))};return a.attrDims=at("qAttrDimInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=at("qAttrExprInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=at("qMeasureInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a}))}function lt(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=lt.util,a={cache:i,cube:o,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},l={key:()=>e,raw:()=>o,field:e=>te(e,a),fields:()=>i.fields.slice(),extract:e=>a.extractor(e,l,i,s),hierarchy:e=>a.hierarchy(e,l,i,s),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(a.extractor=me,a.hierarchy=ge,a.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(a.extractor=v,a.pages=o.qDataPages,a.hierarchy=ge):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,i,s);const c="S"===o.qMode?e=>e.qElemNumber:void 0,u="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...at("qDimensionInfo",o,e,"",p({},a,{value:c,type:"dimension"}))),i.wrappedFields.push(...at("qMeasureInfo",o,e,"",p({},a,{value:u,type:"measure"}))),i.fields=i.wrappedFields.map((e=>e.instance));const d=e=>{e.forEach((e=>{i.allFields.push(e.instance),d(e.measures),d(e.attrDims),d(e.attrExps)}))};return d(i.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=l.field(t.from),o=st(r({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},l,i,s),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));i.virtualFields.push(o)})),i.allFields.push(...i.virtualFields),l}const ct=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ut=/\/qDimensionInfo(?:\/(\d+))?/,dt=/\/qMeasureInfo\/(\d+)/,ht=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,ft=/\/qAttrExprInfo\/(\d+)/,pt=/\/?qHyperCube/,gt=/\/?qTreeData/,mt=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),yt=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function vt(e,t){let n=e,r=-1,i=-1,o="",s=e=>e;pt.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=mt):gt.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=yt);let a=!0;if(ut.test(e)&&(r=+ut.exec(e)[1]),dt.test(e)&&(i=+dt.exec(e)[1]),ht.test(e)){i=-1,r=0;const e=+ht.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),a=!1}if(ft.test(e)){const e=i;if(t){i=0;const s=Z(o,t);i+=(s.qMeasureInfo||[]).length,r>-1?(i=s.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=s.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=s.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+ft.exec(n)[1]}else r>-1?(r=-1,i=+ft.exec(n)[1]):i+=+ft.exec(n)[1]+1}return ct.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function bt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach((e=>{const t=vt(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,a=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||a>=o)&&o>-1?n.forEach((e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})})):n.forEach((e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!s.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&a?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o);var c}function xt(e){lt.util=e.data("matrix").util,e.data("q",lt),e.formatter("q-number",He),e.formatter("q-time",it)}return xt.qBrushHelper=bt,xt.selections=bt,xt}()}(Zv)),Zv.exports),eb=n(Qv);const tb={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter((e=>"value"===e.type));let r=[];n.length&&n.forEach((e=>{r=r.concat(e.brush.values().map((t=>({key:e.id,value:t}))))}));return r.concat(t)},filterValues:function(e,t){const n=this;let r,i;const o=[];let s=0;const a=[];return t.forEach((t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(i=function(e,t){const n=t.key.indexOf("qHyperCube")+10,r=t.key.substr(0,n),i=t.key.substr(n+1);return e.dataset(r).field(i)}(e,t),r=i&&i.raw(),r.qLocked?(o.push(r),s++):a.push({key:t.key,value:t.value}))})),{items:a,itemsAreLocked:s>0&&s===t.length,lockedFields:o}}}};const nb={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function rb(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,r=e.dataPaths||[""],i=e.selectPaths,o=e.lasso;let s=[];const a={propertiesToRestore:{}};let l=!1;const c=function(e,t,n){function r(){}return r.update=function(e,r,i){t.isActive()||t.begin(n),eb.qBrushHelper(i).forEach((e=>{t.select(e)}))},r.toggleValues=function(r,i,o){const s=tb.brushInterceptors.filterValues(e,r),a=s.items;return t.isActive()||s.itemsAreLocked||!(o||a.length>0)||(t.begin(n),i.start(),i.emit("update",[],[])),a},r}(t,n,i),u={};let d=!1;function h(e){16===e.keyCode&&e.shiftKey!==d&&(d=e.shiftKey,o.toggle())}function f(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function p(){s.forEach((e=>{e.listeners.update=function(t,n){e.sleep||c.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)}))}function g(){s.forEach((e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)}))}return n.on("cleared",(()=>{s.forEach((e=>{e.brush.clear(),e.dependentComponents.forEach((e=>{const n=t.component(e.id);n&&n.emit(e.clear)}))}))})),u.setUp=function(e){u.tearDown();const t=this.setUpBrush(e);return l&&p(),t},u.setUpBrush=function(e){const n=hv(!0,{},nb,e),i={on:"tap",action:t=>t.ctrlKey||e.isSingleSelect?"set":"toggle",contexts:n.contexts,data:n.data,globalPropagation:"stop"},o={context:n.contexts[0],data:n.data,style:n.style},a=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return a.listeners.toggle=function(e){if(!l)return[];const i=function(){const e=[];let n=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));n=[].concat.apply([],n);for(let t=0;t<n.length;t++)n[t].raw().qLocked&&e.push(n[t].raw());return{fields:e,areAllFieldsLocked:e.length&&e.length===n.length}}();return n.startOnEmptySelection&&0===e.length&&i.areAllFieldsLocked?[]:c.toggleValues(e,a.brush,n.startOnEmptySelection)},a.brush.intercept("toggle-values",a.listeners.toggle),a.brush.intercept("add-values",a.listeners.toggle),a.brush.intercept("remove-values",a.listeners.toggle),a.brush.intercept("set-values",a.listeners.toggle),a.listeners.start=function(){s.length>1&&s.forEach((e=>{e!==a&&e.brush.end()}))},s.push(a),{trigger:i,consume:o}},u.setUpStart=function(){u.tearDown()},u.setUpDone=function(){l&&p()},u.tearDown=function(){l&&g(),s.forEach((e=>{e.brush.removeInterceptor("toggle-values",e.listeners.toggle),e.brush.removeInterceptor("add-values",e.listeners.toggle),e.brush.removeInterceptor("remove-values",e.listeners.toggle),e.brush.removeInterceptor("set-values",e.listeners.toggle)})),s=[]},u.pauseEngineCalls=function(e){s.forEach((t=>{t.id===e&&(t.sleep=!0)}))},u.resumeEngineCalls=function(e,t){s.forEach((n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))}))},u.addComponent=function(e,t){s.forEach((n=>{n.id===e&&n.dependentComponents.push(t)}))},u.on=function(){if(l)return;l=!0,p(),document.addEventListener("keydown",h),document.addEventListener("keyup",h);const e=()=>{s.forEach((e=>{e.brush.end()})),document.removeEventListener("keyup",f),o.active()&&o.toggle()};n.on("deactivated",e),a.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",f)};n.on("activated",t),a.unbindActivated=()=>{n.removeListener("activated",t)}},u.isOn=()=>l,u.off=function(){l&&(l=!1,g(),document.removeEventListener("keydown",h),document.removeEventListener("keyup",h),document.removeEventListener("keyup",f),a.unbindActivated(),a.unbindDeactivated())},u.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},u.allFieldsLocked=function(){return function(){let e=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));return e=[].concat.apply([],e),e.length&&e.every((e=>e.raw().qLocked))}()},u}class ib{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var ob={create:e=>e.selectionsApi?rb(e):new ib};function sb(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const s=e.brush(r),a={};function l(){if(o){e.component(i).emit("hide")}o=!1}return a.isOpen=function(){return o},a.closeTooltip=l,a.update=function(){const a=s.brushes(),c=e.getAffectedShapes(r,"and",n,t);a.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(c)):l()},a.toggleInterceptor=function(e){if(n.length>1){const t={},n=[];return e.forEach((e=>{t[e.key]||(t[e.key]={}),t[e.key][e.value]||(t[e.key][e.value]=!0,n.push(e))})),n}return e},a}var ab={create:(...e)=>sb(...e)},lb={formatMeasureValue:function(e,t){if(e.raw().isCustomFormatted)return e.formatter()(t.value.qText);const n=void 0!==t.value.qNum?t.value.qNum:t.value.qValue;return e.formatter()(n)}};const cb=e=>({h:t,data:n,style:r})=>{const i=function(e,t){const n=e.chartInstance.dataset(e.dataPath),r=[],i=t.length-5,o=Math.min(5,t.length);for(let i=0;i<o;i++){const o=t[i],s={rows:[]};if(e.labelData){const t=[],i=e.labelData;let a=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){a=!0;break}t.push(o.data[i[e]].value.qText)}if(a)return;s.header=e.headerResolver(t),s.rows=e.measureRows.map((t=>{const r=o.data;return e.rowResolver(n.field(r[t].source.field),r[t],r)})).filter((e=>!!e));const l=ub(e,o);l&&s.rows.unshift(l),r.push(s)}}i>0&&(r.numberInExcess=i);return r.rowCount=r[0]?r.length*r[0].rows.length:0,r}(e,n),o={h:t,style:r,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,i)};function ub(e,t){var n,r,i;const o=t.data.color,s=null===(n=e.colorService)||void 0===n||null===(r=n.getSettings)||void 0===r?void 0:r.call(n);if(!s||"color"===s.type||!o||!s.fieldType)return;const a=[];e.data.forEach((e=>{const n=t.data[e];n&&a.push(n.value)}));const l=function(e){let t=-1;for(let n=0;n<e.length;n++)-3===e[n]&&(t=n);return t}(a),{translator:c}=e,u=s.label;return{color:null===(i=t.attrs)||void 0===i?void 0:i.fill,label:u,value:-1!==l?c.get("properties.dimensionLimits.others"):o.label}}const db="dist-flow-tooltip",hb=`#${db}`;function fb(){if(!document.querySelector(hb)){const e=document.createElement("div");e.id=db,e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function pb({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){fb()},beforeUpdate(){fb()},destroyed(){!function(){const e=document.querySelector(hb);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(hb),content:i,filter:r,extract:e=>e.node,direction:t?"rtl":"ltr",placement:"bounds"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:n,"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const{detectTextDirection:gb}=qv;const mb={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:lb.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,s=[],a=o?"right":"left";if(t.forEach((e=>{if(e.header){const t={...r.cell,textAlign:a,fontWeight:"bold",direction:gb(e.header)};s.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach((e=>{let t=e.value;if(e.color){const r={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},i=n("div",{style:r});t=o?[e.value,i]:[i,e.value]}const i=o?[":",e.label]:[e.label,":"],l={...r.cell,textAlign:a,direction:gb(e.label)},c={...r.cell,textAlign:o?"left":"right",direction:gb(e.value)};s.push(n("tr",null,n("td",{style:l},i),n("td",{style:c},t)))}))})),t.numberInExcess){const e=i.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...r.cell,textAlign:a,direction:gb(e)};s.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return s}};function yb(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!1;const o={};function s(e){e.listeners.update=function(t,n){e.action.update(t,n,e)},e.listeners.end=function(){e.action.closeTooltip()},e.brush.on(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.on("end",e.listeners.end),e.brush.intercept("set-values",e.action.toggleInterceptor)}function a(){Object.keys(r).forEach((e=>{l(r[e])}))}function l(e){e.brush.removeListener(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.removeListener("end",e.listeners.end),e.brush.removeInterceptor("set-values",e.action.toggleInterceptor)}function c(){Object.keys(r).forEach((e=>{r[e].action.closeTooltip()}))}function u(){c();for(const e in r)r[e].brush.clear()}return o.setUp=function(t){const o=hv(!0,{},mb,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&l(r[o.contexts[0]]);const a=function(e,t){return{brush:t.brush(e.contexts[0]),action:ab.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);r[o.contexts[0]]=a,i&&s(a);const c=pb({key:o.tooltipKey,rtl:"rtl"===a.direction,fontFamily:a.theme.getStyle(n,"tooltip","fontFamily"),filter:(u=a.filterShapes,e=>u?u(e):function(e){const t=[];return e.forEach((e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)})),t}(e)),content:cb(a,o.dataPath)});var u;return o.chartBuilder.getSettings().components.push(c),{trigger:{on:a.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map((e=>({context:e}))),component:c}},o.tearDown=function(){i&&a(),r=[]},o.closeTooltip=c,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach((e=>{s(r[e])})),t&&t.on("mouseleave",u))},o.off=function(){i&&(i=!1,a(),t&&t.off("mouseleave",u),c())},o}var vb={create:(e,t,n)=>yb(e,t,n)};const bb={generateHash:function(e){return function(e){let t=0;if(!e||!e.length)return t;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t}(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=bb.generateHash(t)}};const xb={getDefaultHashDataForHyperCube:function(e,t,n){return function(e,t){const n=[];if(!e.qMeasures)return Promise.resolve(n);return e.qMeasures.forEach((e=>{e.qLibraryId?n.push(function(e,t){return t.getMeasure(e).then((e=>e.getProperties().then((e=>e.qMeasure.qDef))))}(e.qLibraryId,t)):n.push(Promise.resolve())})),Promise.all(n)}(e,n).then((e=>({drillLevel:Mb(t),dimensionExpressions:wb(t),measureExpressions:e})))}};function wb(e){return e.qDimensionInfo.map((e=>e.qGroupFieldDefs))}function Mb(e){const t=function(e){return Vy(e,"qDimensionInfo",[])}(e);return t.map((e=>e.qGroupPos))}const kb={},_b=hv.bind(null,!0);function Sb(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const qb=Array.isArray,Db=function(e){return void 0===e};function Eb(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Cb(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach(((t,i)=>{i!==n.length&&(r=+t,e[r||t]=Db(e[r||t])?Number.isNaN(+r)?{}:[]:e[t],e=e[r||t])})),e}function Ab(e,t){if(Sb(e)&&Sb(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!Ab(e[n],t[n]))return!1;return!0}if(qb(e)&&qb(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!Ab(e[n],t[n]))return!1;return!0}return e===t}kb.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach((i=>{const o=function(e){return e&&(e=_b({},{val:e}).val),e}(t[i]),s=e[i],a=`${n}/${i}`;Ab(o,s)||Eb(t,i)||(Db(s)?r.push({op:"add",path:a,value:o}):Sb(o)&&Sb(s)?r=r.concat(kb.generate(s,o,a)):qb(o)&&qb(s)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o,s,a=-1;function l(e,t,n){if(e[n]&&Db(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(Ab(t,i))return r;if(null===t[0]||!Db(t[0])&&Db(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(o=i.length-1;o>=0;--o)a=l(t,i[o]&&i[o].qInfo&&i[o].qInfo.qId,o),-1===a?(r.push({op:"remove",path:`${n}/${o}`}),i.splice(o,1)):r=r.concat(kb.generate(i[o],t[a],`${n}/${o}`));for(o=0,s=t.length;o<s;++o)a=l(i,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===a?(r.push({op:"add",path:`${n}/${o}`,value:t[o]}),i.splice(o,0,t[o])):a!==o&&(r.push({op:"move",path:`${n}/${o}`,from:`${n}/${a}`}),i.splice(o,0,i.splice(a,1)[0]));return r}(s,o,a)):r.push({op:"replace",path:`${n}/${i}`,value:o}))})),Object.keys(e).forEach((i=>{Db(t[i])&&!Eb(e,i)&&r.push({op:"remove",path:`${n}/${i}`})})),r},kb.apply=function(e,t){t.forEach((t=>{const n=Cb(e,t.path);let r=t.path.split("/").splice(-1)[0];const i=r&&Number.isNaN(+r)?n[r]:n[+r]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(qb(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(qb(i)&&qb(t.value)){const e=t.value.slice();i.length=0,i.push.apply(i,e)}else Sb(i)&&Sb(t.value)?(s=i,Object.keys(s).forEach((e=>{Object.getOwnPropertyDescriptor(s,e).configurable&&!Eb(s,e)&&delete s[e]})),_b(i,t.value)):n[r]=t.value;else if("move"===t.op){const i=Cb(e,t.from);qb(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(qb(n)?n.splice(+r,1):delete n[r]);var s}))},kb.clone=function(e){return _b({},e)},kb.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},kb.updateObject=function(e,t){Object.keys(e).length?kb.apply(e,kb.generate(e,t)):_b(e,t)};class Tb{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=kb.generate(e,t);return hv(!0,e,t),n&&n.length?(n=n.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),this._model.applyPatches(n,!0).then((()=>!0))):Promise.resolve(!1)}async mergeSoftPatches(){if(!this._model)return;const e=this._model.getProperties(),t=this._model.getEffectiveProperties(),n=await e,r=await t;if(n.qExtendsId)return;const i=kb.generate(n,r);kb.apply(n,i);const o=this;o._model.setProperties(n).then((()=>{o._model.clearSoftPatches()}))}}var Nb={canModifyHardProperties:function(e){if(e.qHasSoftPatches||e.qExtendsId)return!1;if(e.permissions)return e.permissions.update;return-1!==e.qMeta.privileges.indexOf("update")}};var Rb={saveDerivedProperties:function(e,t,n,r){if(Nb.canModifyHardProperties(t))return e.setProperties(n);return new Tb(e).saveSoftProperties(r,n)}};var Ob={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function Ib(){this._generationInProgress=!1}function Pb(e){Ob.validate(e);const t=e.properties,n=bb.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}Ib.prototype.isDerivedUpToDate=Pb,Ib.prototype.updateDerivedProperties=function(e){if(Ob.validate(e),this._generationInProgress)return Promise.resolve(!0);if(Pb(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,r=e.layout,i=hv(!0,{},e.properties),o=hv(!0,{},i);return this._generationInProgress=!0,bb.updateHash(i,e.hashData),e.generateDerivedProperties(r,i).then((()=>Rb.saveDerivedProperties(n,r,i,o).then((()=>(t._generationInProgress=!1,Promise.resolve(!0))))))},Ib.prototype.addDefaultHyperCubeHash=function(e,t,n,r){return xb.getDefaultHashDataForHyperCube(e,t,n).then((e=>hv(!0,r,e)))};const Lb={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const jb={replaceExpressionTokens:function(e,t,n){const r={start:n&&n.start||"{{",end:n&&n.end||"}}"};let i,o,s=e;for(const e in t)i=t[e],o=r.start+e+r.end,s=s.replace(zb(o,!0),i);return s},createRegExp:zb};function zb(e,t,n){const r=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const i=n?`(${r})`:r;return t?new RegExp(i,"g"):new RegExp(i)}const Fb={generateExpression:function(e,t){const n={};if(t)for(const e in t){const r=t[e],i=r.wrap?Lb.wrapExpression(r.value):r.value;n[e]=i;(r.variations||[]).forEach((t=>{const r=Hb(t,i,e);n[t]=r}))}return jb.replaceExpressionTokens(e,n)}};function Hb(e,t,n){if(""===t)return"";const r=jb.createRegExp(n,!0,!0),i=e.split(r);let o="";return i.forEach((e=>{o+=e!==n?e:t})),o}const Bb={generateHyperCubeDef:function(e,t,n,r,i){return function(e,t,n,r){const i={};let o,s;const a=[];let l;e.forEach((e=>{o=Yb(e.match(Ub("Dim"))),o.forEach((e=>{a.push(Vb(t.qDimensions[e],r,e,n).then((t=>{i[`Dim[${e}]`]={value:t,wrap:!0}})))})),s=Yb(e.match(Ub("Mea"))),s.forEach((e=>{a.push($b(t.qMeasures[e],r).then((t=>{i[`Mea[${e}]`]={value:t}})))}))})),l=a.length?Promise.all(a).then((()=>Promise.resolve(i))):Promise.resolve(i);return l}(e.dimensions.concat(e.measures),t,n,r).then((n=>{const r=hv({},n,i),o=hv(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach((e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${Fb.generateExpression(e,r)}`]}})})),e.measures.forEach((e=>{o.qMeasures.push({qDef:{qDef:Fb.generateExpression(e,r)}})})),o}))},getAllHyperCubeExpressions:async function(e,t,n){const r=e.qDimensions.map(((e,r)=>Vb(e,n,r,t))),i=e.qMeasures.map((e=>$b(e,n)));return{dimensions:await Promise.all(r),measures:await Promise.all(i)}}};function Vb(e,t,n,r){if(e.qLibraryId)return Wb(e.qLibraryId,"dimension",t,n,r);const i=r.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[i])}function $b(e,t){return e.qLibraryId?Wb(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function Wb(e,t,n,r,i){if(!n)return console.warn("No app provided, returning library id"),e;return n["dimension"===t?"getDimension":"getMeasure"](e).then((e=>e.getProperties().then((e=>"dimension"===t?e.qDim.qFieldDefs[i.qDimensionInfo[r].qGroupPos]:e.qMeasure.qDef))))}function Ub(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function Yb(e){return e?e.map((e=>e.substr(6,1))):[]}function Kb(e){return!Number.isNaN(parseFloat(e))&&Number.isFinite(+e)}function Xb(e){return!Number.isNaN(parseInt(e,10))&&parseFloat(e,10)===parseInt(e,10)}const Gb={getBinSize:function(e){return Vy(e,"bins.binSize",Sm.BIN_SIZE)},getDerivedBinSize:function(e){return Vy(e,"qUndoExclude.bins.binSize",Sm.BIN_SIZE)},getDerivedBinOffset:function(e){return Vy(e,"qUndoExclude.bins.offset",Sm.OFFSET)},getDerivedBinCount:function(e){const t=Vy(e,"qUndoExclude.bins.binCount",Sm.BIN_COUNT);return Kb(t)?t<1?1:Xb(t)?t:Math.ceil(t):Sm.BIN_COUNT},getBinCount:function(e){return Vy(e,"bins.binCount",void 0)},getBinOffset:function(e){return Vy(e,"bins.offset",Sm.OFFSET)},isAutoBin:function(e){return Vy(e,"bins.auto",Sm.AUTO)},isCountDistinct:function(e){return Vy(e,"bins.countDistinct",Sm.COUNT_DISTINCT)},getBinMode:function(e){return Vy(e,"bins.binMode",Sm.BIN_MODE)},isEmpty:function(e){return null==e||""===e}},Jb=Math.log(10),Zb=[1,1.5,2,3,4,5,6,10],Qb=[1,2,4,5,6,8,10],ex=[2,4,5,10];function tx(e,t){if(0===e)return 0;let n;const r=Math.floor(Math.log(Math.abs(e))/Jb),i=e/10**r;for(let e=0;e<t.length;e++)if(i<=t[e]){n=t[e];break}return(r>=0?n*10**r:n/10**-r)*(e<0?-1:1)}function nx(e,t,n,r,i,o){return Math.floor(Math.abs(e-i)/r)+Math.floor(Math.abs(o-t)/r)}const rx={calculateBinSize:function(e,t,n){return function(e,t,n){if(!Kb(e)||!Kb(t)||!Kb(n))throw Error("binSizeCalculator: One of the inputs is NOT numeric");if(e>t)throw Error("binSizeCalculator: The 'min' parameter is bigger than the 'max' parameter")}(e,t,n),function(e,t,n){let r,i,o,s,a,l,c,u,d,h,f,p,g=-1,m=Zb;if(n=Math.max(1,n),t===e)if(0===t){if(s=1,1===n)return{min:e,max:t,nbrOfBins:n,rawBinSize:o/n,offset:-.5,newMax:.5,binSize:1,numEmptyBins:0}}else 1===n?(s=t+1e-9,m=Qb):s=Math.abs(t/n);else o=(t+=1e-9)-e,s=o/n;do{if(u=1,f=0,g>=0)for(d=1/ex[g],h=1,m=[];h<=10;)m.push(Math.round(1e3*h)/1e3),h+=d;a=s;do{a=tx(a*u,m),l=Math.floor(Math.log(a)/Jb),c=10**l,i=t===e?(Math.ceil(t/a)+Math.floor(n/2))*a:Math.ceil(t/a)*a,r=i-n*a;let o=0;for(p=c;(r>e||i<t)&&o<ex.length;)r=Math.floor(e/p)*p,i=r+n*a,p=c/ex[o++];l<1&&(c=10**(Math.abs(l)+1),i=Math.round(i*c)/c,r=Math.round(r*c)/c),u=1.1,f++}while((r>e||i<t)&&f<10);g++}while(nx(e,t,0,s,r,i)>0&&g<ex.length);return{binCount:n,offset:r,binSize:a}}(e,t,n=function(e){return e<1?1:Xb(e)?e:Math.ceil(e)}(n))}};const ix={getMappingValues:function(e){const t=Gb.isAutoBin(e),n=Gb.getBinMode(e);let r,i,o,s;const a=Gb.isCountDistinct(e);return t||"maxCount"===n?(s=function(e){const t=Vy(e,"qHyperCube.qDimensionInfo.0",{});let n=t.qMin,r=t.qMax;n=Kb(n)?n:1,r=Kb(r)?r:1;const i=Gb.getDerivedBinCount(e);return rx.calculateBinSize(n,r,i)}(e),r=s.binSize,i=s.offset,o=s.binCount):(r=Gb.getBinSize(e),i=Gb.getBinOffset(e)),{binSize:r,binOffset:i,binCount:o,distinct:a}},getMappings:function(e){const t={};return t.BinSize={value:`,${e.binSize}`},t.Label={value:0===e.binOffset?"":",'x'"},t.Offset={value:0===e.binOffset?"":`,${e.binOffset}`},t.Distinct={value:e.distinct?"Distinct ":""},t}};const ox={generateHyperCubes:async function(e,t,n){const{app:r,translator:i}=n,o=ix.getMappingValues(e),s=ix.getMappings(o),a=Bb.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,r),l=Bb.generateHyperCubeDef({dimensions:["Class(aggr({{Dim[0]}},{{Dim[0]}}){{BinSize}}{{Label}}{{Offset}})"],measures:["Count({{Distinct}}{{Dim[0]}})"]},t.qHyperCubeDef,e.qHyperCube,r,s),c=await a,u=await l;let d;d=Gb.isAutoBin(e)?{qValueExpression:{qExpr:Fb.generateExpression("=Ceil(Log10(Count({{Dim[0]}})) / Log10(2)) + 1",{"Dim[0]":{value:c.dimensions[0],wrap:!0}})}}:"maxCount"===Gb.getBinMode(e)&&Gb.isEmpty(t.bins.binCount)?Gb.getDerivedBinCount(e):t.bins.binCount,Uy(u,"qDimensions.0.qDef.qSortCriterias",[{qSortByNumeric:1}]),Uy(u,"qDimensions.0.qDef.qFieldLabels",[e.qHyperCube.qDimensionInfo[0].qFallbackTitle]),Uy(u,"qMeasures.0.qDef.qLabel",e.measureAxis.label||i.get("Visualization.Histogram.MeasureAxisLabel")),Uy(t,"qUndoExclude.box.qHyperCubeDef",u),Uy(t,"qUndoExclude.bins.binSize",o.binSize),Uy(t,"qUndoExclude.bins.offset",o.binOffset),Uy(t,"qUndoExclude.bins.binCount",d)}};var sx={isOnComponentForRange:function(e,t,n){return!!e&&!!n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter((e=>-1!==t.indexOf(e.settings.key)))[0]},isOnComponentForLasso:function(e,t,n){return e&&n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter((e=>e.settings.key===t.keys.componentKey))[0]},isOnComponentForNavBtn:function(e,t,n){return n.chart.componentsFromPoint(e.center).some((e=>e.settings.key===t))}};var ax={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:mm.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=sx.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((s=n.handlers).selectionHandler.lassoState()&&!s.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var s},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){sx.isOnComponentForLasso(r,n,this)&&(t.switchTo("lasso",this.chart,r),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",r))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(r){e.lassoing&&(r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(r){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var lx={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?mm.DIRECTION_HORIZONTAL:mm.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const s="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=sx.isOnComponentForRange(o,s,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!a,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(i){const o="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r];sx.isOnComponentForRange(i,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,i),t.doEmit(this.chart,"rangeMeasure","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(r){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",r),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function cx(e,t){let n;return n="x-axis"===e?"horizontal"===t?mm.DIRECTION_VERTICAL:mm.DIRECTION_HORIZONTAL:"horizontal"===t?mm.DIRECTION_HORIZONTAL:mm.DIRECTION_VERTICAL,n}var ux={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:cx(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const s="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=sx.isOnComponentForRange(o,s,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!a,e.minoring}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(i){const o="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r];sx.isOnComponentForRange(i,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,i),t.doEmit(this.chart,"rangeMinor","areaStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(r){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",r))},arearangeend(r){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",r),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var dx={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?mm.DIRECTION_VERTICAL:mm.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const s="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=sx.isOnComponentForRange(o,s,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!a,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(i){const o="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r];sx.isOnComponentForRange(i,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,i),t.doEmit(this.chart,"rangeDim","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(r){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",r),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var hx={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?mm.DIRECTION_VERTICAL:mm.DIRECTION_HORIZONTAL,event:"drag",enable(r,i){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!i&&!!this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter((e=>e.settings.key===n.keys.componentKey))[0],e.dragging)}},requireFailure:r?`lasso ${t.getBrushConfig()}`:"",events:{dragstart(e){o={x:e.deltaX,y:e.deltaY};let t=-(n.isHorizontal?e.deltaY:e.deltaX)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let r=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(r=-r),n.handlers.scrollHandler.getScrollApi().move(r),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var fx={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&sx.isOnComponentForNavBtn(r,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach((t=>{const n=e.target,r=n?n.getAttribute("data-action"):"";if(r)return t.emit(r)}))}}}}};var px={create:function(e,t,n,r,i){const o={};t=t||"vertical";const s=r.lassoBrushKey||"select",a=r.dimRangeBrushKey||null,l=r.measureRangeBrushKey||null,c=r.areaBrushKey||null,u=r.legendBrushKey||null,d=!!e.selectionHandler&&e.selectionHandler.isOn(),h={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},p="horizontal"===t,g=p?"y-axis":"x-axis",m=p?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let r=s;const i=t||f.chart;switch(f.gesture){case"majorrange":v(i,"rangeDim","rangeClear",n),r=a;break;case"measurerange":v(i,"rangeMeasure","rangeClear",n),r=l;break;case"arearange":v(i,"rangeMinor","areaClear",n),r=c}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&i.brush(r).clear(),f.chart=t,f.type=o}function v(e,t,n,r){if(e){const i=e.component(t);i&&i.emit(n,r)}}let b=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:v,switchTo:y,getBrushConfig:function(){return a?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:r,isHorizontal:p,active:f,rangeSelStatus:i};function M(){y("none"),h.majoring=!1,h.measureSelecting=!1,h.minoring=!1}return d&&(b=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),h.majoring=!1,h.measureSelecting=!1,h.minoring=!1}}}],b.unshift(fx.callNavBtnGesture(x.isNavigationEnabled,u)),b.push(ax.callLassoGesture(h,x,w)),a?l?(b.push(dx.callDimensionRangeGesture(h,x,w,g)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(lx.callMeasureRangeGesture(h,x,w,m)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(b.push(dx.callDimensionRangeGesture(h,x,w,g)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(ux.callAreaRangeGesture(h,x,w,m)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"})):(b.push(lx.callMeasureRangeGesture(h,x,w,m)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),b.push(ux.callAreaRangeGesture(h,x,w,g)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(b.push(hx.callDragGesture(h,x,w,d,n)),e.scrollHandler.getScrollApi().on("update",M)),o.gestures=b,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",M)},o}};const gx=(e,t)=>(t.components||[]).find((t=>t.key===e)),mx=(e,t,n)=>{var r,i,o,s;const a=null===(r=gx("axis",n))||void 0===r?void 0:r.axis;return{text:{fontFamily:(null==a||null===(i=a.title)||void 0===i?void 0:i.fontFamily)||t.getStyle(e,"axis.title","fontFamily"),fontSize:(null==a||null===(o=a.title)||void 0===o?void 0:o.fontSize)||t.getStyle(e,"axis.title","fontSize"),fill:(null==a||null===(s=a.title)||void 0===s||null===(s=s.fontColor)||void 0===s?void 0:s.color)||t.getStyle(e,"axis.title","color")}}},yx=(e,t,n)=>{var r,i,o,s;const a=null===(r=gx("axis",n))||void 0===r?void 0:r.axis;return{labels:{fontFamily:(null==a||null===(i=a.label)||void 0===i||null===(i=i.name)||void 0===i?void 0:i.fontFamily)||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:(null==a||null===(o=a.label)||void 0===o||null===(o=o.name)||void 0===o?void 0:o.fontSize)||t.getStyle(e,"axis.label.name","fontSize"),fill:(null==a||null===(s=a.label)||void 0===s||null===(s=s.name)||void 0===s||null===(s=s.fontColor)||void 0===s?void 0:s.color)||t.getStyle(e,"axis.label.name","color")}}};function vx(e){const t=Vy(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0.qApprMaxGlyphCount",0);return Math.min(20,t)}const bx={createSettings:function(e){return{settings:{labels:{maxGlyphCount:vx(e)}}}}};const xx={createSettings:function(e){const t=Gb.isAutoBin(e),n=Gb.getBinMode(e),r=Gb.getDerivedBinSize(e);let i,o;if(t||"maxCount"===n){const t=Gb.getDerivedBinOffset(e);i=t,o=t+Gb.getDerivedBinCount(e)*r}else{const t=Vy(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0",{});i=t.qMin||0,o=(t.qMax||0)+r}return{component:{type:"linear",min:i,max:o}}}},wx={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},Mx=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,kx=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,_x=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,Sx=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,qx=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,Dx=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,Ex=Math.floor,Cx=Math.round,Ax=pv.extend({init(){let e,t,n,r,i,o,s,a,l,c,u,d,h=0,f=0,p=0,g=1;if(this._invalid=!1,arguments[0]instanceof Ax)h=arguments[0]._r,f=arguments[0]._g,p=arguments[0]._b,g=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(d=arguments[0],u=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(d))h=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10);else if(u=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(d))h=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10),g=parseFloat(u[4]);else if(u=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(d))h=parseInt(u[1],16),f=parseInt(u[2],16),p=parseInt(u[3],16),g=1;else if(u=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(d))h=parseInt(u[1]+u[1],16),f=parseInt(u[2]+u[2],16),p=parseInt(u[3]+u[3],16),g=1;else if(u=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(d)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,h=l[0]+c,f=l[1]+c,p=l[2]+c,h=Cx(255*h),f=Cx(255*f),p=Cx(255*p),g=1}else if(u=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(d)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),g=parseFloat(u[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,h=l[0]+c,f=l[1]+c,p=l[2]+c,h=Cx(255*h),f=Cx(255*f),p=Cx(255*p)}else if(u=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(d)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),i=parseFloat(u[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=i-o,h=l[0]+c,f=l[1]+c,p=l[2]+c,h=Cx(255*h),f=Cx(255*f),p=Cx(255*p),g=1}else wx[d.toLowerCase()]?(n=d.toLowerCase(),h=wx[n].r,f=wx[n].g,p=wx[n].b,g="number"==typeof wx[n].a?wx[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(g=(4278190080&arguments[0])>>>24,g/=255,h=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(h=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(h=arguments[0],f=arguments[1],p=arguments[2],g=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+h+f+p+g)&&(this._invalid=!0),this._r=Ex(h),this._g=Ex(f),this._b=Ex(p),this._a=g,this._spaces={}},isInvalid(){return this._invalid},setAlpha(e){this._a=e,this._spaces={}},getAlpha(){return this._a},toRGB:function(){return this._spaces.rgb||(this._spaces.rgb=Ax.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=Ax.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=Ax.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=Ax.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=Ax.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=Ax.toHSLA(this,e)),this._spaces.hsla},toHSV(){const e=this.toHSVComponents();return`hsv(${e.h},${e.s},${e.v})`},toHSVComponents:function(){return this._spaces.hsvComp||(this._spaces.hsvComp=Ax.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=Ax.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),r=parseFloat(n[1]),i=parseFloat(n[3]);let o=parseFloat(n[5]);const s=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${s})`},isEqual(e){return e instanceof Ax||(e=new Ax(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[Ex(this._r+(e._r-this._r)*t),Ex(this._g+(e._g-this._g)*t),Ex(this._b+(e._b-this._b)*t),Ex(this._a+(e._a-this._a)*t)].join(",")})`},createShiftedColor(e){(void 0===e||Number.isNaN(+e))&&(e=1);const t=this.getLuminance(),n=this._g<126?1:1+this._g/512,r=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new Ax(r)}});Ax.toRGB=function(e){if(e instanceof Ax)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=Ax.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},Ax.toRGBA=function(e,t){if(e instanceof Ax)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=Ax.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},Ax.toHex=function(e){let t,n,r;return e instanceof Ax?(t=e._r.toString(16),n=e._g.toString(16),r=e._b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${[t,n,r].join("")}`):("string"==typeof e&&(e=Ax.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),r=(255&e).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${t}${n}${r}`)},Ax.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new Ax(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=Math.max(s,a,l),u=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(c+u)/2,c===u)n=0,o=0;else{switch(i=c-u,n=r>.5?i/(2-c-u):i/(c+u),c){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},Ax.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new Ax(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=e._a,u=Math.max(s,a,l),d=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(u+d)/2,u===d)n=0,o=0;else{switch(i=u-d,n=r>.5?i/(2-u-d):i/(u+d),u){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${c})`},Ax.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new Ax(e));const i=e._r/255,o=e._g/255,s=e._b/255,a=Math.max(i,o,s),l=Math.min(i,o,s),c=a;if(a===l)t=0,r=0;else{switch(n=a-l,t=0===n?0:n/c,a){case i:r=(o-s)/n+(o<s?6:0);break;case o:r=(s-i)/n+2;break;case s:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*c}},Ax.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof Ax)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,r=0,i=0;return 1===arguments.length&&"string"==typeof arguments[0]&&(t=arguments[0],(e=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(t))?(n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10)):(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))?(n=parseInt(e[1],16),r=parseInt(e[2],16),i=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16))),(n<<16)+(r<<8)+i},Ax.blend=function(e,t,n){const r=(16711680&(e=Ax.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=Ax.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},Ax.getBlend=function(e,t,n){const r=e._r+(t._r-e._r)*n,i=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,s=e._a+(t._a-e._a)*n;return new Ax(r,i,o,s)},Ax.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(Mx.test(e)||kx.test(e)||_x.test(e)||Sx.test(e)||qx.test(e)||Dx.test(e)||wx[e.toLowerCase()])},Ax.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},Ax.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,r=t.getLuminance()/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},Ax.isDark=function(){const e={getLuminance:Ax.prototype.getLuminance,isInvalid:Ax.prototype.isInvalid};return Ax.prototype.init.apply(e,[].slice.call(arguments)),Ax.prototype.isDark.call(e)},Ax.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const Tx={TRANSPARENT_BLACK:"rgba( 0,0,0,0.2 )",TRANSPARENT_WHITE:"rgba( 255,255,255,0.7 )",LIGHT_GREY:"#ccc",DARK_GREY:"#666",BLACK:"#000",WHITE:"#fff",getInverse(e){const t=new Ax(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new Ax(e);return 0===t.getAlpha()?this.DARK_GREY:Ax.getBestContrast(t,new Ax(Tx.LIGHT_GREY),new Ax(Tx.DARK_GREY))},getBestContrast:(e,t,n)=>Ax.getBestContrast(new Ax(e),new Ax(t),new Ax(n)),getContrastingTransparent(e){const t=new Ax(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};const Nx={createSettings:function(e,t,n,r,i,o){const{theme:s}=e.environment,a=s.getColorPickerColor(t.color.bar.paletteColor),l=Gb.getDerivedBinSize(t),c=[],u=[n.consume,r.consume,i.consume];return e._tooltipHandler.isOn()&&(c.push(o.box.trigger),u.push.apply(u,o.box.consume)),c.push(n.trigger),{key:"box-marker",settings:{box:{fill:a,stroke:Tx.getContrastingGrey(a).toHex(),strokeWidth:1,maxWidthPx:1/0,minWidthPx:NaN,minWidth:0},major:{scale:"dimension",ref:{start:"binStart",end:"binEnd"}},minor:{scale:"measure"},whiskers:!1,orientation:"vertical"},brush:{trigger:c,consume:u},data:{extract:{field:"qDimensionInfo/0",props:{start:0,end:{field:"qMeasureInfo/0"},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},binStart:{field:"qDimensionInfo/0",value:e=>e.qNum},binEnd:{field:"qDimensionInfo/0",value:e=>e.qNum+l},elemNo:{field:"qDimensionInfo/0"},bin:{field:"qDimensionInfo/0",value:e=>e}}}}}}};const Rx={createSettings:function(e,t,n){const r=t.getStyles(),i=((e,t,n)=>{var r,i,o,s;const a=null===(r=gx("value",n))||void 0===r?void 0:r.label,l=(null==a||null===(i=a.value)||void 0===i?void 0:i.fontFamily)||t.label.value.fontFamily;let c=(null==a||null===(o=a.value)||void 0===o?void 0:o.fontSize)||t.label.value.fontSize;return c=parseFloat(c),{fontFamily:l,fontSize:c,fill:null==a||null===(s=a.value)||void 0===s||null===(s=s.fontColor)||void 0===s?void 0:s.color}})(0,r,e),o=i.fill||r.label.value.color;return{settings:{sources:[{strategy:{settings:{...i,labels:[{placements:[{fill:o},{fill:i.fill?o:e=>Ax.isDark(e.node.attrs.fill)?r.label.value.lightColor:r.label.value.darkColor}]}]}}}]}}}},Ox="object.histogram";function Ix(e){return Vy(e,"qHyperCube.qDimensionInfo.0.qIsOneAndOnlyOne",!1)}const Px={createChartSettings:function(e,t){const n=e.isRtl(),r=Vy(t,"qHyperCube.qDimensionInfo.0",{}).qFallbackTitle||"",{theme:i,translator:o}=e.environment,s=Vv.create({chartID:Ox,theme:i,isRtl:n,flags:e.flags}),a=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,s=void 0===o?[]:o,a=r.transform,l=void 0===a?[]:a,c=r.extend,u=void 0===c?[]:c,d={theme:t,matrix:sv(s),styles:void 0};return d.styles=uv({theme:t,id:i,transform:l,extend:u,matrix:d.matrix}),{getStyles:function(){return d.styles},getTheme:function(){return d.theme},setTheme:function(e){d.theme=e,d.styles=uv({theme:e,id:i,transform:l,extend:u,matrix:d.matrix})}}}({theme:i,config:{id:"histogram"}});let l={},c={},u={};e._selectionHandler.isOn()&&(e._selectionHandler.setUpStart(),l=e._selectionHandler.setUpBrush({contexts:["select"],data:["elemNo"],dataPath:"qUndoExclude/box"}),c=e._selectionHandler.setUpBrush({contexts:["select-dimension"],data:["elemNo"],dataPath:"qUndoExclude/box",isSingleSelect:Ix(t)}),u=e._selectionHandler.setUpBrush({dataPath:"qUndoExclude/box",contexts:["select-measure"],data:["end"]}),e._selectionHandler.setUpDone());const d={box:{}};e._tooltipHandler.isOn()&&(d.box=e._tooltipHandler.setUp({chartBuilder:s,environment:e.environment,data:[""],contexts:["boxTip"],componentKey:"box-marker",measureRows:["measure"],labelData:["bin"]}));const h=function(e){const t=e.qUndoExclude&&e.qUndoExclude.box&&e.qUndoExclude.box.qHyperCube&&e.qUndoExclude.box.qHyperCube.qDimensionInfo?e.qUndoExclude.box.qHyperCube.qDimensionInfo:void 0;return!!t&&!!t[0].qLocked}(t),f=function(e){const t={};return e?(t.isOpenDim=!1,t.isOpenMea=!1):(t.isOpenDim=!0,t.isOpenMea=!0),t}(h),p={scrollHandler:null,selectionHandler:e._selectionHandler};this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=px.create(p,"vertical",n,{componentKey:"box-marker",lassoBrushKey:"select",dimRangeBrushKey:null,measureRangeBrushKey:"select-measure",areaBrushKey:"select-dimension"},f),s.addPreset("dimension-measure-chart",{isRtl:n,includeDimensionAxis:!0,orientation:"vertical",selectionsEnabled:e._selectionHandler.isOn(),theme:i,measureSource:"qMeasureInfo/0",measureScaleSettings:{component:{expand:0,include:[0]}},enableLasso:!0,lasso:{brushKey:"select",brushComponents:["box-marker"]},enableMeasureRange:!0,measureRange:{brushKey:"select-measure",brushAxis:"y-axis",brushArea:"box-marker",brushScale:"measure"},enableAreaRange:!0,areaRange:{brushKey:"select-dimension",brushAxis:"x-axis",brushData:["elemNo"],brushArea:"box-marker",brushScale:"rangeSelSettings",brushComponents:["box-marker"],multiple:!0,chartInstance:e.chartInstance},brushActions:this._dependentActions.gestures,dimensionSource:"qDimensionInfo/0",dimensionScaleSettings:xx.createSettings(t),measureAxisProperties:t.measureAxis,measureTitleText:t.measureAxis.label||o.get("Visualization.Histogram.MeasureAxisLabel"),dimensionAxisProperties:t.dimensionAxis,dimensionAxisSettings:bx.createSettings(t),dimensionTitleText:r,gridlines:t.gridlines,hasNavigation:!1,isNavigationEnabledFn:()=>!1,refLines:t.refLine&&t.refLine.refLines,axisTitleStyle:mx(Ox,i,t),axisLabelStyle:yx(Ox,i,t)});const g=s.getSettings(),m=Nx.createSettings(e,t,l,c,u,d);if(s.addComponent("box-marker",m),t.dataPoint&&t.dataPoint.showLabels){const e=Rx.createSettings(t,a,Ox);s.addComponent("labels",e)}return e.addSnapshotChartSettings(g,t),g.scales.rangeSelSettings={type:"linear",min:g.scales.dimension.min,max:g.scales.dimension.max,source:"qDimensionInfo/0"},g}};const Lx=Gv.extend("Histogram",{namespace:".histogram",init:function({environment:e,flags:t,lasso:n,picasso:r,$element:i,backendApi:o,selectionsApi:s,renderState:a}){this._super(r,i,e,o,s),this.flags=t,this.renderState=a,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new Ib,this._selectionHandler=ob.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:s,selectPaths:["/qUndoExclude/box/qHyperCubeDef"],lasso:n}),this._tooltipHandler=vb.create(this.chartInstance,i,"object.histogram"),this.setDataPaths(["qUndoExclude/box/qHyperCube"])},updateConstraints:function(e){const t=!e.passive,n=!e.select&&!e.active;this._tooltipHandler[t?"on":"off"](),this._selectionHandler[n?"on":"off"]()},off:function(){this._tooltipHandler.off(),this._selectionHandler.off()},createChartSettings:function(e){return Px.createChartSettings(this,e)},setSnapshotData:function(e){return this._super(e),e.qUndoExclude.box.qHyperCube.qDataPages=this.layout.qUndoExclude.box.qHyperCube.qDataPages,Promise.resolve(e)},getDisclaimerAttributes:function(e){const t=function(){const t=Vy(e,"qUndoExclude.box.qHyperCube.qDataPages.0.qMatrix",[]);return 1===t.length&&t[0][0]&&t[0][0].qIsNull}();return{data:e.qUndoExclude&&e.qUndoExclude.box,supportedDisclaimers:{LimitedData:!0,OnlyNanData:!0,OnlyNegativeOrZeroValues:!t,RequireNumericDimension:!0},options:{bottom:!0,supportNegative:!1,explicitOnlyNanData:t,explicitRequireNumericDimension:(n=e.qHyperCube,n.qDimensionInfo.length>0&&-1===n.qDimensionInfo[0].qTags.indexOf("$numeric"))}};var n},updateChart:function(e,t){if(!e.qUndoExclude)return Promise.resolve();this._super(e,t)},updateData:function(e){const t=this;return t._super(e).then((()=>{if(t._destroyed)return Promise.reject();e=t.layout;const n={height:Math.min(e.qHyperCube.qSize.qcy,1e3),width:2},r=t.backendApi.model;return!!this.layout.snapshotData?Promise.resolve():r.getEffectiveProperties().then((i=>t._destroyed?Promise.reject():t._derivedProperties.addDefaultHyperCubeHash(i.qHyperCubeDef,e.qHyperCube,t.environment.app,function(e,t){return{box:t.qHyperCubeDef,binMappings:ix.getMappingValues(e),binProperties:t.bins,measureAxis:t.measureAxis,version:"2.0"}}(e,i)).then((o=>{if(t._destroyed)return Promise.reject();const s={layout:e,properties:i,model:r,hashData:o,generateDerivedProperties:(e,n)=>ox.generateHyperCubes(e,n,t.environment)};return t._derivedProperties.isDerivedUpToDate(s)?e.qUndoExclude?(t.renderState.restore(),t.backendApi.updateCache(e.qUndoExclude.box),t.getData(t.backendApi,e.qUndoExclude.box.qHyperCube,n)):Promise.resolve():(t.renderState.pending(),t._derivedProperties.updateDerivedProperties(s))}))))}))},paint:function(){const e=this.layout.qUndoExclude;return e&&e.box&&e.box.qHyperCube.qDataPages.length?this._super():Promise.resolve(!1)},isLassoDisabled:function(){return!1}});class jx{constructor(e){this.model=e,this.path="/qUndoExclude/box/qHyperCubeDef"}setCacheOptions({maxStackedValues:e}){}updateCache(e){}getData(e){return this.model.getHyperCubeData(this.path,e)}}var zx={onChangeCalcCond:function(e){var t;const n=null==e?void 0:e.qHyperCubeDef,r=null==e||null===(t=e.qUndoExclude)||void 0===t||null===(t=t.box)||void 0===t?void 0:t.qHyperCubeDef;n&&r&&(r.qCalcCond=n.qCalcCond,r.qCalcCondition=n.qCalcCondition)}};const Fx=(e,t)=>({component:"styling-panel",chartTitle:"Object.Histogram",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:{axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:t.getOptions("axis","axis.title")},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")},valueLabelSection:{translation:"properties.value.label",component:"panel-section",items:t.getOptions("value","label.value")}}}),Hx="maxCount",Bx="size";function Vx(e){return!(e.bins&&e.bins.auto)}function $x(e){return Vx(e)&&e.bins.binMode===Hx}function Wx(e){var t,n;const{translator:r,flags:i}=e,o=null==e||null===(t=e.flags)||void 0===t?void 0:t.isEnabled("SENSECLIENT_IM_2021_STYLINGPANEL_HISTOGRAM"),s=null==e||null===(n=e.flags)||void 0===n?void 0:n.isEnabled("SENSECLIENT_IM_2021_HISTOGRAM_BG"),a=e.theme,l={translation:"properties.colors",type:"items",items:{colors:{classification:{section:"color",tags:["simple"]},type:"items",items:{barColor:{ref:"color.bar.paletteColor",translation:"properties.histogram.barColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue:()=>{const{primary:e}=a.getDataColorSpecials(),t=a.getDataColorPickerPalettes()[0].colors,n=t.indexOf(e);return{index:-1===n?Math.min(6,t.length-1):n}}}}}}},c="object.histogram",u=((e,t,n,r,i)=>r({theme:e,translator:t,flags:i,config:{id:n,paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}}))(a,r,c,Vm,i),d=((e,t,n)=>{const r={getOptions:(r,i)=>{const o=(e,t)=>({ref:`${i}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${i}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:r,items:{fontFamily:{ref:`${i}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${i}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${i}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${i}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${i}.fontSize`),defaultValue:()=>e.getDefaultValue(`${i}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return r})(u,a,c),h={type:"items",translation:"properties.presentation",items:{stylingPanel:o&&Fx(s,d),gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridlines.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridlines.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridlines&&!e.gridlines.auto}}},showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],snapshot:{tid:"property-dataPoints"}}}},f={items:{labels:{items:{header:{show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length}},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.XAxis.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length},convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.YAxis.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length},convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},p={uses:"settings",items:{simpleLabels:f,presentation:h,colors:l,measureAxis:{uses:"axis.picasso.measureAxis",items:{label:{type:"string",expression:"optional",expressionType:"StringExpression",ref:"measureAxis.label",defaultValue:"",translation:"Common.Label",placeholderTranslation:"Visualization.Histogram.MeasureAxisLabel"}}},dimensionAxis:{uses:"axis.picasso.dimensionAxis",items:{othersGroup:{items:{label:{show:!1}}}}}}},g={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:zx.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},m={uses:"data",items:{dimensions:{translation:"Common.Fields",alternativeTranslation:"properties.alternative.fields",items:{dimensionLimits:{show:!1,items:{otherMode:{readOnly:!1},otherSortMode:{show:e=>"OTHER_COUNTED"===Vy(e,"qOtherTotalSpec.qOtherMode")},otherCounted:{show:e=>"OTHER_COUNTED"===Vy(e,"qOtherTotalSpec.qOtherMode")},otherLimitMode:{show(e){const t=Vy(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},otherLimit:{show(e){const t=Vy(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},calculatedAgainstMessage:{show:!0,label(){const e=r.get("properties.histogram.staticMeasureName");return r.get("Properties.DimensionLimits.CalculatedAgainst",e)}}}},others:{show:!1,items:{suppressOther:{defaultValue:!0}}}}}}},y={ref:"bins.binMode",type:"string",component:"dropdown",options:[{value:Hx,translation:"Visualization.Histogram.Binning.NumberOfBinsOption"},{value:Bx,translation:"Visualization.Histogram.Binning.BarWidthOption"}],defaultValue:Hx,show:e=>Vx(e)},v={translation:"Visualization.Histogram.Bins",type:"items",component:"items",items:{auto:{ref:"bins.auto",translation:"Visualization.Histogram.Binning",component:"switch",type:"boolean",defaultValue:!0,undefinedValue:!1,options:[{value:!0,translation:"Visualization.Histogram.Binning.Auto"},{value:!1,translation:"Visualization.Histogram.Binning.Custom"}]},autoMessage:{component:"text",translation:"Visualization.Histogram.Binning.AutoDescription",show:e=>!Vx(e)},mode:y,binCount:{ref:"bins.binCount",type:"number",expression:"optional",expressionType:"ValueExpression",translation:"Visualization.Histogram.Binning.BinCount",defaultValue:"",convertFunctions:{get(e,t,n){const r=n.properties.bins.binCount;return Gb.isEmpty(r)?Gb.getDerivedBinCount(n.layout):e(null)||""},set(e,t,n){t(n.type,e,void 0)}},show:$x},binMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountRounding",show(e){const t=Vy(e,"bins.binCount"),n="object"==typeof t;return $x(e)&&!Gb.isEmpty(t)&&!n&&!Xb(t)&&t>0}},minBinMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountMin",show(e){const t=Vy(e,"bins.binCount");return!!($x(e)&&!Gb.isEmpty(t)&&t<=0)}},binSize:{ref:"bins.binSize",type:"number",expression:"optional",expressionType:"ValueExpression",defaultValue:10,show:e=>Vx(e)&&e.bins.binMode===Bx,translation:"Visualization.Histogram.Binning.BinSize"},offset:{ref:"bins.offset",type:"number",expression:"optional",expressionType:"ValueExpression",show:e=>Vx(e)&&e.bins.binMode===Bx,translation:"Visualization.Histogram.Binning.Offset"},distinct:{ref:"bins.countDistinct",type:"boolean",defaultValue:!1,component:"checkbox",translation:"Visualization.Histogram.CountDistinct"}}};return{type:"items",component:"accordion",items:{data:m,bins:v,addons:g,settings:p}}}var Ux={type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{translation:"Common.Fields"}}}}};var Yx={getExportRawDataOptions:function(e,t,n){return e.addItem({translation:"contextMenu.export",tid:"export",select(){n.show(t.model,"/qUndoExclude/box/qHyperCubeDef")}}),Promise.resolve()}};const Kx="qUndoExclude.box";function Xx(e){return{definition:Wx(e),softDefinition:Ux,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},importProperties:(t,n,r,i)=>{const o=Dm(e);r.mapProperties();const s={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()};return _m.hypercube.importProperties({exportFormat:t,initialProperties:n,dataDefinition:o,defaultPropertyValues:s,hypercubePath:i})},exportProperties:(e,t,n)=>_m.hypercube.exportProperties({propertyTree:e,hyperCubePath:n?Kx:t,viewDataMode:n}),requireNumericDimension:!0,exportTableProperties(e){const t=Kx;return _m.hypercube.exportProperties({propertyTree:e,hypercubePath:t,viewData:!0})},getExportRawDataOptions:Yx.getExportRawDataOptions}}return function(t){!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(l).forEach((t=>{e.add(l[t])}))}}(t.translator);const n=Dm(t);return{qae:{properties:qm,data:{targets:[n]},exportProperties:({propertyTree:e,hypercubePath:t,viewDataMode:n})=>_m.hypercube.exportProperties({propertyTree:e,hypercubePath:n?"qUndoExclude.box":t})},ext:Xx(t),component(){const n=e.useConstraints(),r=e.useElement(),i=function(){const t=e.useApp(),n=e.useAppLayout(),r=e.useDeviceType(),i=e.useOptions(),o=e.useTheme(),s=e.useTranslator();return e.useMemo((()=>({app:t,appLayout:n,deviceType:r,options:i,theme:o,translator:s})),[t,n,i.direction,i.freeResize,s.language(),o.name(),r])}(),o=i.options.renderer,s=e.useMemo((()=>bm(o)),[o]),l=function(){const t=e.useConstraints(),[n,r]=e.useState(!1),[i,o]=e.useState(!1),s=!!e.useLayout().qSelectionInfo.qInSelections,[a]=e.useState((()=>({toggle(){o((e=>!e))}})));return e.useEffect((()=>{t&&r(!t.select&&!t.active)}),[t]),e.useAction((()=>({key:"lasso",label:"Lasso",icon:xm,hidden:!n||!s,active:i,action(){o((e=>!e))}})),[s,i,n]),a.enabled=()=>n,a.active=()=>i,a}(),c=e.useModel(),u=e.useSelections(),d=e.useStaleLayout(),h=e.useRenderState(),[f,p]=e.useState();e.useEffect((()=>{const e=a(r),n=new jx(c),o=u,d=new Lx({$element:e,backendApi:n,environment:i,flags:t.flags,lasso:l,picasso:s,selectionsApi:o,renderState:h});return p(d),()=>{d.destroy()}}),[]);const[,g]=e.usePromise((async()=>{f&&(f.updateEnvironment(i),f.updateConstraints(n),await f.updateData(d),await f.paint())}),[d,f,i]);if(g)throw g;var m;!function(t){const n=e.useRect(),r=e.useOptions(),i=e.useConstraints(),[,o]=e.usePromise((async()=>{t&&(t.updateConstraints(i),t.options=r,await t.resize())}),[n.width,n.height]);if(o)throw o}(f),m=f,e.onTakeSnapshot((e=>{if(m)return m.setSnapshotData(e)})),e.useImperativeHandle((()=>({getViewState(){if(m)return m.getViewState()}})),[m])}}}}));
31
29
  //# sourceMappingURL=sn-histogram.js.map