@pie-element/charting 11.0.0-next.42 → 11.1.0-next.0

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.
package/module/element.js DELETED
@@ -1 +0,0 @@
1
- import{_dll_pie_lib__math_rendering as e}from"../../../@pie-lib/math-rendering-module@^4.0.5/module/index.js";import{_dll_react_dom as t,_dll_prop_types as n,_dll_lodash as r,_dll_pie_lib__render_ui as i,_dll_mui__material_styles as o,_dll_react as a,_dll_debug as s,_dll_classnames as l,_dll_mui__icons_material as c,_dll_mui__material as u,_dll_pie_lib__correct_answer_toggle as h}from"../../../@pie-lib/shared-module@^3.0.5/module/index.js";import{_dll_pie_lib__config_ui as p}from"../../../@pie-lib/config-module@^3.0.0/module/index.js";import{_dll_pie_lib__editable_html_tip_tap as d}from"../../../@pie-lib/editable-html-module@^6.0.5/module/index.js";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var f={exports:{}},g={},m=Symbol.for("react.element"),y=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),w=Symbol.for("react.provider"),C=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),S=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),O=Symbol.iterator;var L={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,A={};function T(e,t,n){this.props=e,this.context=t,this.refs=A,this.updater=n||L}function P(){}function R(e,t,n){this.props=e,this.context=t,this.refs=A,this.updater=n||L}T.prototype.isReactComponent={},T.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},T.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},P.prototype=T.prototype;var N=R.prototype=new P;N.constructor=R,M(N,T.prototype),N.isPureReactComponent=!0;var D=Array.isArray,j=Object.prototype.hasOwnProperty,I={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function F(e,t,n){var r,i={},o=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(o=""+t.key),t)j.call(t,r)&&!$.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(1===s)i.children=n;else if(1<s){for(var l=Array(s),c=0;c<s;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===i[r]&&(i[r]=s[r]);return{$$typeof:m,type:e,key:o,ref:a,props:i,_owner:I.current}}function z(e){return"object"==typeof e&&null!==e&&e.$$typeof===m}var V=/\/+/g;function H(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function W(e,t,n,r,i){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var a=!1;if(null===e)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case m:case y:a=!0}}if(a)return i=i(a=e),e=""===r?"."+H(a,0):r,D(i)?(n="",null!=e&&(n=e.replace(V,"$&/")+"/"),W(i,t,n,"",function(e){return e})):null!=i&&(z(i)&&(i=function(e,t){return{$$typeof:m,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(V,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=""===r?".":r+":",D(e))for(var s=0;s<e.length;s++){var l=r+H(o=e[s],s);a+=W(o,t,n,l,i)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=O&&e[O]||e["@@iterator"])?e:null}(e),"function"==typeof l)for(e=l.call(e),s=0;!(o=e.next()).done;)a+=W(o=o.value,t,n,l=r+H(o,s++),i);else if("object"===o)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function B(e,t,n){if(null==e)return e;var r=[],i=0;return W(e,r,"","",function(e){return t.call(n,e,i++)}),r}function U(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var q={current:null},Y={transition:null},X={ReactCurrentDispatcher:q,ReactCurrentBatchConfig:Y,ReactCurrentOwner:I};function K(){throw Error("act(...) is not supported in production builds of React.")}g.Children={map:B,forEach:function(e,t,n){B(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return B(e,function(){t++}),t},toArray:function(e){return B(e,function(e){return e})||[]},only:function(e){if(!z(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},g.Component=T,g.Fragment=v,g.Profiler=x,g.PureComponent=R,g.StrictMode=b,g.Suspense=k,g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X,g.act=K,g.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=M({},e.props),i=e.key,o=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(o=t.ref,a=I.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(l in t)j.call(t,l)&&!$.hasOwnProperty(l)&&(r[l]=void 0===t[l]&&void 0!==s?s[l]:t[l])}var l=arguments.length-2;if(1===l)r.children=n;else if(1<l){s=Array(l);for(var c=0;c<l;c++)s[c]=arguments[c+2];r.children=s}return{$$typeof:m,type:e.type,key:i,ref:o,props:r,_owner:a}},g.createContext=function(e){return(e={$$typeof:C,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:w,_context:e},e.Consumer=e},g.createElement=F,g.createFactory=function(e){var t=F.bind(null,e);return t.type=e,t},g.createRef=function(){return{current:null}},g.forwardRef=function(e){return{$$typeof:_,render:e}},g.isValidElement=z,g.lazy=function(e){return{$$typeof:E,_payload:{_status:-1,_result:e},_init:U}},g.memo=function(e,t){return{$$typeof:S,type:e,compare:void 0===t?null:t}},g.startTransition=function(e){var t=Y.transition;Y.transition={};try{e()}finally{Y.transition=t}},g.unstable_act=K,g.useCallback=function(e,t){return q.current.useCallback(e,t)},g.useContext=function(e){return q.current.useContext(e)},g.useDebugValue=function(){},g.useDeferredValue=function(e){return q.current.useDeferredValue(e)},g.useEffect=function(e,t){return q.current.useEffect(e,t)},g.useId=function(){return q.current.useId()},g.useImperativeHandle=function(e,t,n){return q.current.useImperativeHandle(e,t,n)},g.useInsertionEffect=function(e,t){return q.current.useInsertionEffect(e,t)},g.useLayoutEffect=function(e,t){return q.current.useLayoutEffect(e,t)},g.useMemo=function(e,t){return q.current.useMemo(e,t)},g.useReducer=function(e,t,n){return q.current.useReducer(e,t,n)},g.useRef=function(e){return q.current.useRef(e)},g.useState=function(e){return q.current.useState(e)},g.useSyncExternalStore=function(e,t,n){return q.current.useSyncExternalStore(e,t,n)},g.useTransition=function(){return q.current.useTransition()},g.version="18.3.1",f.exports=g;var Z=f.exports;var G,J=t;G=J.createRoot,J.hydrateRoot;var Q="http://www.w3.org/1999/xhtml",ee={svg:"http://www.w3.org/2000/svg",xhtml:Q,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function te(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),ee.hasOwnProperty(t)?{space:ee[t],local:e}:e}function ne(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Q&&t.documentElement.namespaceURI===Q?t.createElement(e):t.createElementNS(n,e)}}function re(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ie(e){var t=te(e);return(t.local?re:ne)(t)}function oe(){}function ae(e){return null==e?oe:function(){return this.querySelector(e)}}function se(){return[]}function le(e){return function(){return function(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}(e.apply(this,arguments))}}function ce(e){return function(t){return t.matches(e)}}var ue=Array.prototype.find;function he(){return this.firstElementChild}var pe=Array.prototype.filter;function de(){return Array.from(this.children)}function fe(e){return new Array(e.length)}function ge(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function me(e,t,n,r,i,o){for(var a,s=0,l=t.length,c=o.length;s<c;++s)(a=t[s])?(a.__data__=o[s],r[s]=a):n[s]=new ge(e,o[s]);for(;s<l;++s)(a=t[s])&&(i[s]=a)}function ye(e,t,n,r,i,o,a){var s,l,c,u=new Map,h=t.length,p=o.length,d=new Array(h);for(s=0;s<h;++s)(l=t[s])&&(d[s]=c=a.call(l,l.__data__,s,t)+"",u.has(c)?i[s]=l:u.set(c,l));for(s=0;s<p;++s)c=a.call(e,o[s],s,o)+"",(l=u.get(c))?(r[s]=l,l.__data__=o[s],u.delete(c)):n[s]=new ge(e,o[s]);for(s=0;s<h;++s)(l=t[s])&&u.get(d[s])===l&&(i[s]=l)}function ve(e){return e.__data__}function be(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function xe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function we(e){return function(){this.removeAttribute(e)}}function Ce(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _e(e,t){return function(){this.setAttribute(e,t)}}function ke(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Se(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function Ee(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Oe(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Le(e){return function(){this.style.removeProperty(e)}}function Me(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ae(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Te(e){return function(){delete this[e]}}function Pe(e,t){return function(){this[e]=t}}function Re(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function Ne(e){return e.trim().split(/^|\s+/)}function De(e){return e.classList||new je(e)}function je(e){this._node=e,this._names=Ne(e.getAttribute("class")||"")}function Ie(e,t){for(var n=De(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function $e(e,t){for(var n=De(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Fe(e){return function(){Ie(this,e)}}function ze(e){return function(){$e(this,e)}}function Ve(e,t){return function(){(t.apply(this,arguments)?Ie:$e)(this,e)}}function He(){this.textContent=""}function We(e){return function(){this.textContent=e}}function Be(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function Ue(){this.innerHTML=""}function qe(e){return function(){this.innerHTML=e}}function Ye(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Xe(){this.nextSibling&&this.parentNode.appendChild(this)}function Ke(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ze(){return null}function Ge(){var e=this.parentNode;e&&e.removeChild(this)}function Je(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Qe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function et(e){return function(){var t=this.__on;if(t){for(var n,r=0,i=-1,o=t.length;r<o;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++i]=n:this.removeEventListener(n.type,n.listener,n.options);++i?t.length=i:delete this.__on}}}function tt(e,t,n){return function(){var r,i=this.__on,o=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(i)for(var a=0,s=i.length;a<s;++a)if((r=i[a]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),void(r.value=t);this.addEventListener(e.type,o,n),r={type:e.type,name:e.name,value:t,listener:o,options:n},i?i.push(r):this.__on=[r]}}function nt(e,t,n){var r=Oe(e),i=r.CustomEvent;"function"==typeof i?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function rt(e,t){return function(){return nt(this,e,t)}}function it(e,t){return function(){return nt(this,e,t.apply(this,arguments))}}ge.prototype={constructor:ge,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}},je.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var ot=[null];function at(e,t){this._groups=e,this._parents=t}function st(e){return"string"==typeof e?new at([[document.querySelector(e)]],[document.documentElement]):new at([[e]],ot)}function lt(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}at.prototype={constructor:at,select:function(e){"function"!=typeof e&&(e=ae(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o,a,s=t[i],l=s.length,c=r[i]=new Array(l),u=0;u<l;++u)(o=s[u])&&(a=e.call(o,o.__data__,u,s))&&("__data__"in o&&(a.__data__=o.__data__),c[u]=a);return new at(r,this._parents)},selectAll:function(e){e="function"==typeof e?le(e):function(e){return null==e?se:function(){return this.querySelectorAll(e)}}(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var a,s=t[o],l=s.length,c=0;c<l;++c)(a=s[c])&&(r.push(e.call(a,a.__data__,c,s)),i.push(a));return new at(r,i)},selectChild:function(e){return this.select(null==e?he:function(e){return function(){return ue.call(this.children,e)}}("function"==typeof e?e:ce(e)))},selectChildren:function(e){return this.selectAll(null==e?de:function(e){return function(){return pe.call(this.children,e)}}("function"==typeof e?e:ce(e)))},filter:function(e){"function"!=typeof e&&(e=function(e){return function(){return this.matches(e)}}(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o,a=t[i],s=a.length,l=r[i]=[],c=0;c<s;++c)(o=a[c])&&e.call(o,o.__data__,c,a)&&l.push(o);return new at(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,ve);var n=t?ye:me,r=this._parents,i=this._groups;"function"!=typeof e&&(e=function(e){return function(){return e}}(e));for(var o=i.length,a=new Array(o),s=new Array(o),l=new Array(o),c=0;c<o;++c){var u=r[c],h=i[c],p=h.length,d=be(e.call(u,u&&u.__data__,c,r)),f=d.length,g=s[c]=new Array(f),m=a[c]=new Array(f);n(u,h,g,m,l[c]=new Array(p),d,t);for(var y,v,b=0,x=0;b<f;++b)if(y=g[b]){for(b>=x&&(x=b+1);!(v=m[x])&&++x<f;);y._next=v||null}}return(a=new at(a,r))._enter=s,a._exit=l,a},enter:function(){return new at(this._enter||this._groups.map(fe),this._parents)},exit:function(){return new at(this._exit||this._groups.map(fe),this._parents)},join:function(e,t,n){var r=this.enter(),i=this,o=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(i=t(i))&&(i=i.selection()),null==n?o.remove():n(o),r&&i?r.merge(i).order():i},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),l=0;l<a;++l)for(var c,u=n[l],h=r[l],p=u.length,d=s[l]=new Array(p),f=0;f<p;++f)(c=u[f]||h[f])&&(d[f]=c);for(;l<i;++l)s[l]=n[l];return new at(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,i=e[t],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=xe);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a,s=n[o],l=s.length,c=i[o]=new Array(l),u=0;u<l;++u)(a=s[u])&&(c[u]=a);c.sort(t)}return new at(i,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i,o=t[n],a=0,s=o.length;a<s;++a)(i=o[a])&&e.call(i,i.__data__,a,o);return this},attr:function(e,t){var n=te(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?Ce:we:"function"==typeof t?n.local?Ee:Se:n.local?ke:_e)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?Le:"function"==typeof t?Ae:Me)(e,t,null==n?"":n)):function(e,t){return e.style.getPropertyValue(t)||Oe(e).getComputedStyle(e,null).getPropertyValue(t)}(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?Te:"function"==typeof t?Re:Pe)(e,t)):this.node()[e]},classed:function(e,t){var n=Ne(e+"");if(arguments.length<2){for(var r=De(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof t?Ve:t?Fe:ze)(n,t))},text:function(e){return arguments.length?this.each(null==e?He:("function"==typeof e?Be:We)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?Ue:("function"==typeof e?Ye:qe)(e)):this.node().innerHTML},raise:function(){return this.each(Xe)},lower:function(){return this.each(Ke)},append:function(e){var t="function"==typeof e?e:ie(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:ie(e),r=null==t?Ze:"function"==typeof t?t:ae(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(Ge)},clone:function(e){return this.select(e?Qe:Je)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,i,o=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),a=o.length;if(!(arguments.length<2)){for(s=t?tt:et,r=0;r<a;++r)this.each(s(o[r],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(r=0,l=s[c];r<a;++r)if((i=o[r]).type===l.type&&i.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?it:rt)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,i=e[t],o=0,a=i.length;o<a;++o)(r=i[o])&&(yield r)}};const ct=n,ut={min:ct.number.isRequired,max:ct.number.isRequired,step:ct.number},ht=ct.shape(ut),pt=ct.shape(ut),dt=ct.shape({width:ct.number.isRequired,height:ct.number.isRequired});ct.shape({x:ct.number.isRequired,y:ct.number.isRequired});const ft=ct.oneOfType([ct.arrayOf(ct.node),ct.node]).isRequired,gt=ct.shape({x:ct.func.isRequired,y:ct.func.isRequired}),mt=ct.shape({x:ct.func.isRequired,y:ct.func.isRequired}),yt=ct.shape({scale:gt.isRequired,snap:mt.isRequired,domain:ht.isRequired,range:pt.isRequired,size:dt.isRequired});var vt=function(e,t,n,r,i,o,a,s){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,a,s],u=0;(l=new Error(t.replace(/%s/g,function(){return c[u++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}};function bt(e,t){this.x=e,this.y=t}bt.prototype={clone(){return new bt(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){const t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){const t=e[0]*this.x+e[1]*this.y,n=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=n,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){const e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){const t=Math.cos(e),n=Math.sin(e),r=t*this.x-n*this.y,i=n*this.x+t*this.y;return this.x=r,this.y=i,this},_rotateAround(e,t){const n=Math.cos(e),r=Math.sin(e),i=t.x+n*(this.x-t.x)-r*(this.y-t.y),o=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=i,this.y=o,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:bt},bt.convert=function(e){if(e instanceof bt)return e;if(Array.isArray(e))return new bt(+e[0],+e[1]);if(void 0!==e.x&&void 0!==e.y)return new bt(+e.x,+e.y);throw new Error("Expected [x, y] or {x, y} point format")};const{range:xt}=r;function wt(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}function Ct(e,t,n,r){if(r>=t)return t;if(r<=e)return e;let i=((e,t,n)=>{const r=xt(e,t,n);return r.splice(r.length,1,t),r})(e,t,n);return i=i.filter(e=>Math.abs(r-e)<=n),i.length&&i.reduce((e,t)=>Math.abs(t-r)<=Math.abs(e-r)?t:e)}const _t=(e,t,n)=>({left:t.min-e.left,right:Math.abs(e.right-t.max),top:Math.abs(e.top-n.max),bottom:n.min-e.bottom}),kt=e=>new bt(e.x,e.y),St=e=>{const t=wt([new DOMParser,"optionalAccess",e=>e.parseFromString,"call",t=>t(e,"text/html")]);return wt([t,"optionalAccess",e=>e.body,"optionalAccess",e=>e.textContent])||""},Et=e=>e&&0===Object.keys(e).length&&e.constructor===Object,Ot=e=>"string"==typeof e&&""===e.trim(),{Readable:Lt}=i,Mt=n,At=d;const Tt={axisLabel:{fontSize:12,textAlign:"center",margin:4,padding:"4px 0"},chartLabel:{fontSize:16,textAlign:"center",margin:4,padding:"4px 0"},disabledLabel:{pointerEvents:"none",width:"100%"},editLabel:{position:"absolute",backgroundColor:"white",borderRadius:4,boxShadow:"0px 5px 8px rgba(0,0,0,0.15)",zIndex:10},rotateLeftLabel:{transform:"rotate(-90deg)",transformOrigin:"0 0",position:"absolute"},rotateRightLabel:{transform:"rotate(90deg)",transformOrigin:"0 0",position:"absolute"},customBottom:{position:"absolute"},displayNone:{display:"none"}},Pt=e=>{const{disabledLabel:t,graphHeight:n,graphWidth:r,isChartBottomLabel:i,isDefineChartBottomLabel:o,isChartLeftLabel:a,isDefineChartLeftLabel:s,placeholder:l,text:c,side:u,onChange:h,mathMlOptions:p={},charactersLimit:d,titleHeight:g}=e,[m,y]=f.exports.useState(!1),v=i||a||o||s,b="left"===u&&s&&n-220,x={width:b||("left"===u||"right"===u?n-8:r-8),top:b||a&&n-70+"px"||"left"===u&&n-8+"px"||i&&`${n-60+g}px`||"bottom"===u&&`${n-120+g}px`||0,left:"right"===u&&r-8+"px"||(s||o)&&"40px"||i&&"-10px"||0},w={width:r-8,top:"right"===u?n-22+"px":0,left:0};return Z.createElement(Lt,{false:!0},Z.createElement("div",{onClick:()=>{t||"left"!==u&&"right"!==u||y(!0)},style:{...m?w:x,...v?Tt.chartLabel:Tt.axisLabel,..."left"!==u||m?{}:Tt.rotateLeftLabel,..."right"!==u||m?{}:Tt.rotateRightLabel,...m?Tt.editLabel:{},...i||o?Tt.customBottom:{},...t&&!v&&Ot(St(c))&&Tt.displayNone}},t?Z.createElement("div",{style:Tt.disabledLabel,dangerouslySetInnerHTML:{__html:c||""}}):Z.createElement(At,{markup:c||"",onChange:h,placeholder:!t&&l,toolbarOpts:{position:"bottom"===u?"top":"bottom",noPadding:!0,noBorder:!0},disableScrollbar:!0,activePlugins:["bold","italic","underline","strikethrough","math"],onDone:()=>{y(!1),requestAnimationFrame(()=>{!function(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((...e)=>n.call(t,...e)),t=void 0)}}([document,"access",e=>e.activeElement,"optionalAccess",e=>e.blur,"optionalCall",e=>e()])})},mathMlOptions:p,charactersLimit:d})))};Pt.propTypes={disabledLabel:Mt.bool,graphHeight:Mt.number,graphWidth:Mt.number,isChartBottomLabel:Mt.bool,isDefineChartBottomLabel:Mt.bool,isChartLeftLabel:Mt.bool,isDefineChartLeftLabel:Mt.bool,placeholder:Mt.string,text:Mt.string,side:Mt.string,onChange:Mt.func,mathMlOptions:Mt.object,charactersLimit:Mt.number,titleHeight:Mt.number};const{styled:Rt}=o,Nt=n,{color:Dt}=i,{Readable:jt}=i,It=d;function $t(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}const Ft=Rt("div")(({theme:e})=>({border:`solid 1px ${Dt.primaryLight()}`,color:Dt.defaults.TEXT,backgroundColor:e.palette.common.white,touchAction:"none",position:"relative",boxSizing:"unset"})),zt=Rt("div")({display:"flex",position:"relative"}),Vt=Rt("svg")({paddingLeft:"50px",overflow:"visible"}),Ht=Rt("svg")({overflow:"visible"}),Wt=Rt("g")({cursor:"pointer",userSelect:"none"}),Bt=Rt("div")(({theme:e})=>({color:Dt.defaults.TEXT,fontSize:e.typography.fontSize+2,padding:`${e.spacing(1.5)} ${e.spacing(.5)} 0`,textAlign:"center","&.disabled":{pointerEvents:"none"},"&.rightMargin":{marginRight:"74px"}})),Ut=Rt("div")(({theme:e})=>({color:Dt.defaults.TEXT,fontSize:e.typography.fontSize+4,padding:`${e.spacing(1.5)} ${e.spacing(.5)} 0`,textAlign:"center","&.disabled":{pointerEvents:"none"},"&.rightMargin":{marginRight:"74px"}})),qt=Rt("div")({display:"flex",paddingTop:"6px"}),Yt=Rt("div")({display:"flex",flexDirection:"column",alignItems:"center",width:"100px",pointerEvents:"none",userSelect:"none"}),Xt=Rt("div")({width:"70px",display:"flex",flexDirection:"column",marginRight:"6px"}),Kt=Rt("div")({textAlign:"right",height:"20px",pointerEvents:"none",userSelect:"none","&:not(:last-child)":{marginBottom:"80px"}});class Zt extends Z.Component{constructor(e){super(e),Zt.prototype.__init.call(this),Zt.prototype.__init2.call(this),Zt.prototype.__init3.call(this),Zt.prototype.__init4.call(this),Zt.prototype.__init5.call(this),Zt.prototype.__init6.call(this),this.state={titleHeight:0},this.resizeObserver=null}static __initStatic(){this.propTypes={title:Nt.string,children:ft,defineChart:Nt.bool,disabledLabels:Nt.bool,disabledTitle:Nt.bool,graphProps:yt.isRequired,isChart:Nt.bool,labels:Nt.object,labelsPlaceholders:Nt.object,onChangeTitle:Nt.func,onMouseMove:Nt.func,showLabels:Nt.bool,showTitle:Nt.bool,showPixelGuides:Nt.bool,rootRef:Nt.func,onChangeLabels:Nt.func,titlePlaceholder:Nt.string,mathMlOptions:Nt.object,labelsCharactersLimit:Nt.number}}__init(){this.mouseMove=(e,t)=>{const{graphProps:n,onMouseMove:r}=this.props;if(!r)return;const{scale:i,snap:o}=n,a=lt(t,e.node()),s=i.x.invert(a[0]),l=i.y.invert(a[1]);r({x:o.x(s),y:o.y(l)})}}componentDidMount(){const e=st(this.g);e.on("mousemove",this.mouseMove.bind(this,e)),this.measureTitleHeight(),this.setupVisibilityObserver()}componentWillUnmount(){st(this.g).on("mousemove",null),this.cleanupVisibilityObserver()}componentDidUpdate(e){e.title!==this.props.title&&this.measureTitleHeight()}__init2(){this.onChangeLabel=(e,t)=>{const{labels:n,onChangeLabels:r,isChart:i}=this.props;r&&(i?r("left"===t?"range":"domain",e):r({...n,[t]:e}))}}__init3(){this.measureTitleHeight=()=>{const e=this.titleRef;if(e){const t=e.clientHeight;this.setState({titleHeight:t,prevTitle:this.props.title}),this.resizeObserver||"undefined"==typeof ResizeObserver||this.setupVisibilityObserver()}}}__init4(){this.handleKeyDown=()=>{setTimeout(()=>{this.measureTitleHeight()},0)}}__init5(){this.setupVisibilityObserver=()=>{"undefined"!=typeof ResizeObserver&&this.titleRef&&(this.resizeObserver=new ResizeObserver(e=>{for(let t of e){const{width:e,height:n}=t.contentRect;if(e>0&&n>0){setTimeout(()=>{this.measureTitleHeight()},10);break}}}),this.resizeObserver.observe(this.titleRef))}}__init6(){this.cleanupVisibilityObserver=()=>{this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}}render(){const{disabledTitle:e,disabledLabels:t,labels:n,labelsPlaceholders:r,titlePlaceholder:i,graphProps:o,children:a,defineChart:s,onChangeTitle:l,isChart:c,showLabels:u,showPixelGuides:h,showTitle:p,title:d,rootRef:f,mathMlOptions:g={},labelsCharactersLimit:m}=this.props,{size:{width:y=500,height:v=500},domain:b,range:x}=o,w=Ot(St($t([n,"optionalAccess",e=>e.left])))&&Et(r)?48:70,C=y+w+(Ot(St($t([n,"optionalAccess",e=>e.right])))&&Et(r)?48:70)+2*(b.padding||0),_=v+80+2*(x.padding||0),k=["bold","italic","underline","superscript","subscript","strikethrough","math"],S=s&&h?v-160:v,E=parseInt(y/100),O=parseInt(S/100),L=parseInt(S%100),{titleHeight:M}=this.state;return Z.createElement(Ft,null,h&&Z.createElement(qt,{style:{marginLeft:c?80:u?30:10}},[...Array(E+1).keys()].map(e=>Z.createElement(jt,{false:!0,key:`top-guide-${e}`},Z.createElement(Yt,null,Z.createElement("div",null,100*e,"px"),Z.createElement("div",null,"|"))))),p&&(e?Z.createElement("div",{ref:e=>this.titleRef=e,style:{...c&&{width:C},...Ot(St(d))&&{display:"none"}}},c?Z.createElement(Ut,{className:"disabled",dangerouslySetInnerHTML:{__html:d||""}}):Z.createElement(Bt,{className:"disabled",dangerouslySetInnerHTML:{__html:d||""}})):Z.createElement("div",{ref:e=>this.titleRef=e},c?Z.createElement(Ut,{className:h?"rightMargin":""},Z.createElement(It,{style:c&&{width:C},markup:d||"",onChange:l,placeholder:s&&i||!e&&"Click here to add a title for this graph",toolbarOpts:{noPadding:!0,noBorder:!0},activePlugins:k,disableScrollbar:!0,onKeyDown:this.handleKeyDown})):Z.createElement(Bt,{className:h?"rightMargin":""},Z.createElement(It,{style:c&&{width:C},markup:d||"",onChange:l,placeholder:s&&i||!e&&"Click here to add a title for this graph",toolbarOpts:{noPadding:!0,noBorder:!0},activePlugins:k,disableScrollbar:!0,onKeyDown:this.handleKeyDown})))),u&&!c&&Z.createElement(Pt,{side:"top",text:n.top,disabledLabel:t,placeholder:$t([r,"optionalAccess",e=>e.top]),graphHeight:_,graphWidth:C,onChange:e=>this.onChangeLabel(e,"top"),mathMlOptions:g,charactersLimit:m}),Z.createElement(zt,null,u&&Z.createElement(Pt,{side:"left",text:n.left,disabledLabel:t,placeholder:$t([r,"optionalAccess",e=>e.left]),graphHeight:_,graphWidth:C,isChartLeftLabel:c&&!s,isDefineChartLeftLabel:c&&s,onChange:e=>this.onChangeLabel(e,"left"),mathMlOptions:g,charactersLimit:m}),s?Z.createElement(Vt,{width:C,height:_},Z.createElement(Wt,{ref:e=>{this.g=e,f&&f(e)},transform:`translate(${w+(b.padding||0)}, ${40+(x.padding||0)})`},a)):Z.createElement(Ht,{width:C,height:_},Z.createElement(Wt,{ref:e=>{this.g=e,f&&f(e)},transform:`translate(${w+(b.padding||0)}, ${40+(x.padding||0)})`},a)),u&&!c&&Z.createElement(Pt,{side:"right",text:n.right,disabledLabel:t,placeholder:$t([r,"optionalAccess",e=>e.right]),graphHeight:_,graphWidth:C,onChange:e=>this.onChangeLabel(e,"right"),mathMlOptions:g,charactersLimit:m}),h&&Z.createElement(Xt,{style:{paddingTop:L,marginTop:31}},[...Array(O+1).keys()].reverse().map(e=>Z.createElement(jt,{false:!0,key:`top-guide-${e}`},Z.createElement(Kt,null,"━ ",100*e,"px"))))),u&&Z.createElement(Pt,{side:"bottom",text:n.bottom,disabledLabel:t,placeholder:$t([r,"optionalAccess",e=>e.bottom]),graphHeight:_,graphWidth:C,titleHeight:M,isChartBottomLabel:c&&!s,isDefineChartBottomLabel:c&&s,onChange:e=>this.onChangeLabel(e,"bottom"),mathMlOptions:g,charactersLimit:m}))}}Zt.__initStatic();var Gt={exports:{}};Gt.exports=function(e,t){function n(e,t){return e(t={exports:{}},t.exports),t.exports}function r(e){return function(){return e}}e=e&&e.hasOwnProperty("default")?e.default:e,t=t&&t.hasOwnProperty("default")?t.default:t;var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e};var o=i,a=function(e){};function s(e,t,n,r,i,o,s,l){if(a(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,s,l],h=0;(c=new Error(t.replace(/%s/g,function(){return u[h++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}a=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")};var l=s,c=o,u=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=0,o="Warning: "+e.replace(/%s/g,function(){return n[i++]});"undefined"!=typeof console&&console.error(o);try{throw new Error(o)}catch(e){}};c=function(e,t){if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==t.indexOf("Failed Composite propType: ")&&!e){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];u.apply(void 0,[t].concat(r))}};var h=c,p=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;function g(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function m(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}var y=m()?Object.assign:function(e,t){for(var n,r,i=g(e),o=1;o<arguments.length;o++){for(var a in n=Object(arguments[o]))d.call(n,a)&&(i[a]=n[a]);if(p){r=p(n);for(var s=0;s<r.length;s++)f.call(n,r[s])&&(i[r[s]]=n[r[s]])}}return i},v="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",b=l,x=h,w=v,C={};function _(e,t,n,r,i){for(var o in e)if(e.hasOwnProperty(o)){var a;try{b("function"==typeof e[o],"%s: %s type `%s` is invalid; it must be a function, usually from the `prop-types` package, but received `%s`.",r||"React class",n,o,typeof e[o]),a=e[o](t,o,r,n,null,w)}catch(e){a=e}if(x(!a||a instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,o,typeof a),a instanceof Error&&!(a.message in C)){C[a.message]=!0;var s=i?i():"";x(!1,"Failed %s type: %s%s",n,a.message,null!=s?s:"")}}}var k=_,S=function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,r="@@iterator";function i(e){var t=e&&(n&&e[n]||e[r]);if("function"==typeof t)return t}var a="<<anonymous>>",s={array:d("array"),bool:d("boolean"),func:d("function"),number:d("number"),object:d("object"),string:d("string"),symbol:d("symbol"),any:f(),arrayOf:g,element:m(),instanceOf:b,node:_(),objectOf:w,oneOf:x,oneOfType:C,shape:S,exact:E};function c(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function u(e){this.message=e,this.stack=""}function p(e){var n={},r=0;function i(i,o,s,c,p,d,f){if(c=c||a,d=d||s,f!==v)if(t)l(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else if("undefined"!=typeof console){var g=c+":"+s;!n[g]&&r<3&&(h(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",d,c),n[g]=!0,r++)}return null==o[s]?i?null===o[s]?new u("The "+p+" `"+d+"` is marked as required in `"+c+"`, but its value is `null`."):new u("The "+p+" `"+d+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(o,s,c,p,d)}var o=i.bind(null,!1);return o.isRequired=i.bind(null,!0),o}function d(e){function t(t,n,r,i,o,a){var s=t[n];return M(s)!==e?new u("Invalid "+i+" `"+o+"` of type `"+A(s)+"` supplied to `"+r+"`, expected `"+e+"`."):null}return p(t)}function f(){return p(o.thatReturnsNull)}function g(e){function t(t,n,r,i,o){if("function"!=typeof e)return new u("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new u("Invalid "+i+" `"+o+"` of type `"+M(a)+"` supplied to `"+r+"`, expected an array.");for(var s=0;s<a.length;s++){var l=e(a,s,r,i,o+"["+s+"]",v);if(l instanceof Error)return l}return null}return p(t)}function m(){function t(t,n,r,i,o){var a=t[n];return e(a)?null:new u("Invalid "+i+" `"+o+"` of type `"+M(a)+"` supplied to `"+r+"`, expected a single ReactElement.")}return p(t)}function b(e){function t(t,n,r,i,o){if(!(t[n]instanceof e)){var s=e.name||a;return new u("Invalid "+i+" `"+o+"` of type `"+P(t[n])+"` supplied to `"+r+"`, expected instance of `"+s+"`.")}return null}return p(t)}function x(e){if(!Array.isArray(e))return h(!1,"Invalid argument supplied to oneOf, expected an instance of array."),o.thatReturnsNull;function t(t,n,r,i,o){for(var a=t[n],s=0;s<e.length;s++)if(c(a,e[s]))return null;return new u("Invalid "+i+" `"+o+"` of value `"+a+"` supplied to `"+r+"`, expected one of "+JSON.stringify(e)+".")}return p(t)}function w(e){function t(t,n,r,i,o){if("function"!=typeof e)return new u("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=t[n],s=M(a);if("object"!==s)return new u("Invalid "+i+" `"+o+"` of type `"+s+"` supplied to `"+r+"`, expected an object.");for(var l in a)if(a.hasOwnProperty(l)){var c=e(a,l,r,i,o+"."+l,v);if(c instanceof Error)return c}return null}return p(t)}function C(e){if(!Array.isArray(e))return h(!1,"Invalid argument supplied to oneOfType, expected an instance of array."),o.thatReturnsNull;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return h(!1,"Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.",T(n),t),o.thatReturnsNull}function r(t,n,r,i,o){for(var a=0;a<e.length;a++)if(null==(0,e[a])(t,n,r,i,o,v))return null;return new u("Invalid "+i+" `"+o+"` supplied to `"+r+"`.")}return p(r)}function _(){function e(e,t,n,r,i){return O(e[t])?null:new u("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}return p(e)}function S(e){function t(t,n,r,i,o){var a=t[n],s=M(a);if("object"!==s)return new u("Invalid "+i+" `"+o+"` of type `"+s+"` supplied to `"+r+"`, expected `object`.");for(var l in e){var c=e[l];if(c){var h=c(a,l,r,i,o+"."+l,v);if(h)return h}}return null}return p(t)}function E(e){function t(t,n,r,i,o){var a=t[n],s=M(a);if("object"!==s)return new u("Invalid "+i+" `"+o+"` of type `"+s+"` supplied to `"+r+"`, expected `object`.");var l=y({},t[n],e);for(var c in l){var h=e[c];if(!h)return new u("Invalid "+i+" `"+o+"` key `"+c+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var p=h(a,c,r,i,o+"."+c,v);if(p)return p}return null}return p(t)}function O(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(O);if(null===t||e(t))return!0;var n=i(t);if(!n)return!1;var r,o=n.call(t);if(n!==t.entries){for(;!(r=o.next()).done;)if(!O(r.value))return!1}else for(;!(r=o.next()).done;){var a=r.value;if(a&&!O(a[1]))return!1}return!0;default:return!1}}function L(e,t){return"symbol"===e||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol}function M(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":L(t,e)?"symbol":t}function A(e){if(null==e)return""+e;var t=M(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function T(e){var t=A(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function P(e){return e.constructor&&e.constructor.name?e.constructor.name:a}return u.prototype=Error.prototype,s.checkPropTypes=k,s.PropTypes=s,s},E=n(function(e){var t="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,n=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},r=!0;e.exports=S(n,r)}),O=n(function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var i=arguments[r];if(i){var o=typeof i;if("string"===o||"number"===o)e.push(i);else if(Array.isArray(i))e.push(n.apply(null,i));else if("object"===o)for(var a in i)t.call(i,a)&&i[a]&&e.push(a)}}return e.join(" ")}e.exports?e.exports=n:window.classNames=n}()});function L(e,t){for(var n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function M(e){return"function"==typeof e||"[object Function]"===Object.prototype.toString.call(e)}function A(e){return"number"==typeof e&&!isNaN(e)}function T(e){return parseInt(e,10)}function P(e,t,n){if(e[t])return new Error("Invalid prop "+t+" passed to "+n+" - do not set this, set it on the child.")}var R=["Moz","Webkit","O","ms"];function N(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window||void 0===window.document)return"";var t=window.document.documentElement.style;if(e in t)return"";for(var n=0;n<R.length;n++)if(D(e,R[n])in t)return R[n];return""}function D(e,t){return t?""+t+j(e):e}function j(e){for(var t="",n=!0,r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):"-"===e[r]?n=!0:t+=e[r];return t}var I=N(),$=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},F=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),z=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},W=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},B=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),U="";function q(e,t){return U||(U=L(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(t){return M(e[t])})),!!M(e[U])&&e[U](t)}function Y(e,t,n){var r=e;do{if(q(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function X(e,t,n){e&&(e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener?e.addEventListener(t,n,!0):e["on"+t]=n)}function K(e,t,n){e&&(e.detachEvent?e.detachEvent("on"+t,n):e.removeEventListener?e.removeEventListener(t,n,!0):e["on"+t]=null)}function Z(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=T(n.borderTopWidth),t+=T(n.borderBottomWidth)}function G(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=T(n.borderLeftWidth),t+=T(n.borderRightWidth)}function J(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=T(n.paddingTop),t-=T(n.paddingBottom)}function Q(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=T(n.paddingLeft),t-=T(n.paddingRight)}function ee(e,t){var n=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect();return{x:e.clientX+t.scrollLeft-n.left,y:e.clientY+t.scrollTop-n.top}}function te(e,t){var n=re(e,t,"px");return z({},D("transform",I),n)}function ne(e,t){return re(e,t,"")}function re(e,t,n){var r="translate("+e.x+n+","+e.y+n+")";return t&&(r="translate("+("string"==typeof t.x?t.x:t.x+n)+", "+("string"==typeof t.y?t.y:t.y+n)+")"+r),r}function ie(e,t){return e.targetTouches&&L(e.targetTouches,function(e){return t===e.identifier})||e.changedTouches&&L(e.changedTouches,function(e){return t===e.identifier})}function oe(e){return e.targetTouches&&e.targetTouches[0]?e.targetTouches[0].identifier:e.changedTouches&&e.changedTouches[0]?e.changedTouches[0].identifier:void 0}function ae(e){if(e){var t=e.getElementById("react-draggable-style-el");t||((t=e.createElement("style")).type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t)),e.body&&ce(e.body,"react-draggable-transparent-selection")}}function se(e){try{e&&e.body&&ue(e.body,"react-draggable-transparent-selection"),e.selection?e.selection.empty():window.getSelection().removeAllRanges()}catch(e){}}function le(){return V({touchAction:"none"},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}function ce(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)"+t+"(?!\\S)"))||(e.className+=" "+t)}function ue(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)"+t+"(?!\\S)","g"),"")}function he(e,t,n){if(!e.props.bounds)return[t,n];var r=e.props.bounds;r="string"==typeof r?r:ve(r);var i=be(e);if("string"==typeof r){var o=i.ownerDocument,a=o.defaultView,s=void 0;if(!((s="parent"===r?i.parentNode:o.querySelector(r))instanceof a.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');var l=a.getComputedStyle(i),c=a.getComputedStyle(s);r={left:-i.offsetLeft+T(c.paddingLeft)+T(l.marginLeft),top:-i.offsetTop+T(c.paddingTop)+T(l.marginTop),right:Q(s)-G(i)-i.offsetLeft+T(c.paddingRight)-T(l.marginRight),bottom:J(s)-Z(i)-i.offsetTop+T(c.paddingBottom)-T(l.marginBottom)}}return A(r.right)&&(t=Math.min(t,r.right)),A(r.bottom)&&(n=Math.min(n,r.bottom)),A(r.left)&&(t=Math.max(t,r.left)),A(r.top)&&(n=Math.max(n,r.top)),[t,n]}function pe(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function de(e){return"both"===e.props.axis||"x"===e.props.axis}function fe(e){return"both"===e.props.axis||"y"===e.props.axis}function ge(e,t,n){var r="number"==typeof t?ie(e,t):null;if("number"==typeof t&&!r)return null;var i=be(n);return ee(r||e,n.props.offsetParent||i.offsetParent||i.ownerDocument.body)}function me(e,t,n){var r=e.state,i=!A(r.lastX),o=be(e);return i?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-r.lastX,deltaY:n-r.lastY,lastX:r.lastX,lastY:r.lastY,x:t,y:n}}function ye(e,t){var n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function ve(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function be(t){var n=e.findDOMNode(t);if(!n)throw new Error("<DraggableCore>: Unmounted during event!");return n}function xe(){}var we={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},Ce=we.mouse,_e=function(n){function r(){var t,n,i;$(this,r);for(var o=arguments.length,a=Array(o),s=0;s<o;s++)a[s]=arguments[s];return n=i=W(this,(t=r.__proto__||Object.getPrototypeOf(r)).call.apply(t,[this].concat(a))),i.state={dragging:!1,lastX:NaN,lastY:NaN,touchIdentifier:null},i.handleDragStart=function(t){if(i.props.onMouseDown(t),!i.props.allowAnyClick&&"number"==typeof t.button&&0!==t.button)return!1;var n=e.findDOMNode(i);if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");var r=n.ownerDocument;if(!(i.props.disabled||!(t.target instanceof r.defaultView.Node)||i.props.handle&&!Y(t.target,i.props.handle,n)||i.props.cancel&&Y(t.target,i.props.cancel,n))){var o=oe(t);i.setState({touchIdentifier:o});var a=ge(t,o,i);if(null!=a){var s=a.x,l=a.y,c=me(i,s,l);xe("calling",i.props.onStart),!1!==i.props.onStart(t,c)&&(i.props.enableUserSelectHack&&ae(r),i.setState({dragging:!0,lastX:s,lastY:l}),X(r,Ce.move,i.handleDrag),X(r,Ce.stop,i.handleDragStop))}}},i.handleDrag=function(e){"touchmove"===e.type&&e.preventDefault();var t=ge(e,i.state.touchIdentifier,i);if(null!=t){var n=t.x,r=t.y;if(Array.isArray(i.props.grid)){var o=n-i.state.lastX,a=r-i.state.lastY,s=pe(i.props.grid,o,a),l=B(s,2);if(o=l[0],a=l[1],!o&&!a)return;n=i.state.lastX+o,r=i.state.lastY+a}var c=me(i,n,r);if(!1!==i.props.onDrag(e,c))i.setState({lastX:n,lastY:r});else try{i.handleDragStop(new MouseEvent("mouseup"))}catch(e){var u=document.createEvent("MouseEvents");u.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),i.handleDragStop(u)}}},i.handleDragStop=function(t){if(i.state.dragging){var n=ge(t,i.state.touchIdentifier,i);if(null!=n){var r=n.x,o=n.y,a=me(i,r,o),s=e.findDOMNode(i);s&&i.props.enableUserSelectHack&&se(s.ownerDocument),i.setState({dragging:!1,lastX:NaN,lastY:NaN}),i.props.onStop(t,a),s&&(K(s.ownerDocument,Ce.move,i.handleDrag),K(s.ownerDocument,Ce.stop,i.handleDragStop))}}},i.onMouseDown=function(e){return Ce=we.mouse,i.handleDragStart(e)},i.onMouseUp=function(e){return Ce=we.mouse,i.handleDragStop(e)},i.onTouchStart=function(e){return Ce=we.touch,i.handleDragStart(e)},i.onTouchEnd=function(e){return Ce=we.touch,i.handleDragStop(e)},W(i,n)}return H(r,n),F(r,[{key:"componentWillUnmount",value:function(){var t=e.findDOMNode(this);if(t){var n=t.ownerDocument;K(n,we.mouse.move,this.handleDrag),K(n,we.touch.move,this.handleDrag),K(n,we.mouse.stop,this.handleDragStop),K(n,we.touch.stop,this.handleDragStop),this.props.enableUserSelectHack&&se(n)}}},{key:"render",value:function(){return t.cloneElement(t.Children.only(this.props.children),{style:le(this.props.children.props.style),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}]),r}(t.Component);_e.displayName="DraggableCore",_e.propTypes={allowAnyClick:E.bool,disabled:E.bool,enableUserSelectHack:E.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:E.arrayOf(E.number),scale:E.number,handle:E.string,cancel:E.string,onStart:E.func,onDrag:E.func,onStop:E.func,onMouseDown:E.func,className:P,style:P,transform:P},_e.defaultProps={allowAnyClick:!1,cancel:null,disabled:!1,enableUserSelectHack:!0,offsetParent:null,handle:null,grid:null,transform:null,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){}};var ke=function(n){function r(e){$(this,r);var t=W(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.onDragStart=function(e,n){if(!1===t.props.onStart(e,ye(t,n)))return!1;t.setState({dragging:!0,dragged:!0})},t.onDrag=function(e,n){if(!t.state.dragging)return!1;var r=ye(t,n),i={x:r.x,y:r.y};if(t.props.bounds){var o=i.x,a=i.y;i.x+=t.state.slackX,i.y+=t.state.slackY;var s=he(t,i.x,i.y),l=B(s,2),c=l[0],u=l[1];i.x=c,i.y=u,i.slackX=t.state.slackX+(o-i.x),i.slackY=t.state.slackY+(a-i.y),r.x=i.x,r.y=i.y,r.deltaX=i.x-t.state.x,r.deltaY=i.y-t.state.y}if(!1===t.props.onDrag(e,r))return!1;t.setState(i)},t.onDragStop=function(e,n){if(!t.state.dragging)return!1;if(!1===t.props.onStop(e,ye(t,n)))return!1;var r={dragging:!1,slackX:0,slackY:0};if(Boolean(t.props.position)){var i=t.props.position,o=i.x,a=i.y;r.x=o,r.y=a}t.setState(r)},t.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,slackX:0,slackY:0,isElementSVG:!1},!e.position||e.onDrag||e.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element."),t}return H(r,n),F(r,[{key:"componentDidMount",value:function(){void 0!==window.SVGElement&&e.findDOMNode(this)instanceof window.SVGElement&&this.setState({isElementSVG:!0})}},{key:"componentWillReceiveProps",value:function(e){!e.position||this.props.position&&e.position.x===this.props.position.x&&e.position.y===this.props.position.y||this.setState({x:e.position.x,y:e.position.y})}},{key:"componentWillUnmount",value:function(){this.setState({dragging:!1})}},{key:"render",value:function(){var e,n={},r=null,i=!Boolean(this.props.position)||this.state.dragging,o=this.props.position||this.props.defaultPosition,a={x:de(this)&&i?this.state.x:o.x,y:fe(this)&&i?this.state.y:o.y};this.state.isElementSVG?r=ne(a,this.props.positionOffset):n=te(a,this.props.positionOffset);var s=this.props,l=s.defaultClassName,c=s.defaultClassNameDragging,u=s.defaultClassNameDragged,h=t.Children.only(this.props.children),p=O(h.props.className||"",l,(z(e={},c,this.state.dragging),z(e,u,this.state.dragged),e));return t.createElement(_e,V({},this.props,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(h,{className:p,style:V({},h.props.style,n),transform:r}))}}]),r}(t.Component);return ke.displayName="Draggable",ke.propTypes=V({},_e.propTypes,{axis:E.oneOf(["both","x","y","none"]),bounds:E.oneOfType([E.shape({left:E.number,right:E.number,top:E.number,bottom:E.number}),E.string,E.oneOf([!1])]),defaultClassName:E.string,defaultClassNameDragging:E.string,defaultClassNameDragged:E.string,defaultPosition:E.shape({x:E.number,y:E.number}),positionOffset:E.shape({x:E.oneOfType([E.number,E.string]),y:E.oneOfType([E.number,E.string])}),position:E.shape({x:E.number,y:E.number}),className:P,style:P,transform:P}),ke.defaultProps=V({},_e.defaultProps,{axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},position:null,scale:1}),ke.default=ke,ke.DraggableCore=_e,ke}(t,a);const Jt=n,Qt=s,{isFunction:en}=r;var tn;const nn=Qt("pie-lib:plot:grid-draggable"),rn=(e,t,n)=>r=>{const i=r+e(0),o=e.invert(i);return 1e3*t(n+o).toFixed(4)/1e3},on=e=>t=>(vt(!!e&&en(e.fromDelta)&&en(e.bounds)&&en(e.anchorPoint),"You must supply an object with: { anchorPoint: Function, fromDelta: Function, bounds: Function }"),tn=class extends Z.Component{static __initStatic(){this.propTypes={disabled:Jt.bool,onDragStart:Jt.func,onDrag:Jt.func,onDragStop:Jt.func,onClick:Jt.func,onMove:Jt.func,graphProps:yt.isRequired}}constructor(e){super(e),tn.prototype.__init.call(this),tn.prototype.__init2.call(this),tn.prototype.__init3.call(this),tn.prototype.__init4.call(this),tn.prototype.__init5.call(this),tn.prototype.__init6.call(this),tn.prototype.__init7.call(this),tn.prototype.__init8.call(this),tn.prototype.__init9.call(this),tn.prototype.__init10.call(this),tn.prototype.__init11.call(this),this.state={startX:null,startY:null}}__init(){this.grid=()=>{const{graphProps:e}=this.props,{scale:t,domain:n,range:r}=e;return{x:t.x(n.step)-t.x(0),y:t.y(r.step)-t.y(0)}}}__init2(){this.onStart=e=>{const{onDragStart:t}=this.props;document.activeElement&&document.activeElement.blur(),this.setState({startX:e.clientX,startY:e.clientY}),t&&t()}}__init3(){this.position=()=>{const{x:t,y:n}=e.anchorPoint(this.props),{graphProps:r}=this.props,{scale:i,snap:o}=r;return{anchorPoint:{x:t,y:n},x:rn(i.x,o.x,t),y:rn(i.y,o.y,n)}}}__init4(){this.tiny=(e,t)=>{const n=e.toUpperCase(),r=t[`client${n}`],i=this.state[`start${n}`],o=Math.abs(r-i),a=o<Math.abs(this.grid()[e])/10;return nn("[tiny] key: ",e,"delta: ",o,"out: ",a),a}}__init5(){this.getScaledBounds=()=>{const t=e.bounds(this.props,this.props.graphProps);nn("bounds: ",t);const n=this.grid(),r={left:t.left*n.x,right:t.right*n.x,top:t.top*n.y,bottom:t.bottom*n.y};return nn("[getScaledBounds]: ",r),r}}__init6(){this.getClientPoint=(e,t)=>{if(!e||!t)return null;const n=e.ownerSVGElement||e;if(n&&n.createSVGPoint){let r=n.createSVGPoint();if(t.touches&&t.touches.length>0){const e=t.touches[0];r.x=e.clientX,r.y=e.clientY}else r.x=t.clientX,r.y=t.clientY;return e.getScreenCTM?(r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]):null}const r=e.getBoundingClientRect();return r?[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]:null}}__init7(){this.skipDragOutsideOfBounds=(e,t,n)=>{const r=n.getRootNode(),i=this.getClientPoint(r,t);if(null===i)return!0;const[o,a]=i,{scale:s,domain:l,range:c}=n;let u=s.x.invert(o),h=s.y.invert(a);const p=e.deltaX>0&&u<l.min||e.deltaX<0&&u>l.max,d=e.deltaY>0&&h>c.max||e.deltaY<0&&h<c.min;return p||d}}__init8(){this.onDrag=(e,t)=>{const{onDrag:n,graphProps:r}=this.props;if(!n)return;const i=this.getScaledBounds();if(t.deltaX<0&&t.deltaX<i.left)return;if(t.deltaX>0&&t.deltaX>i.right)return;if(t.deltaY<0&&t.deltaY<i.top)return;if(t.deltaY>0&&t.deltaY>i.bottom)return;if(this.skipDragOutsideOfBounds(t,e,r))return;const o=this.applyDelta({x:t.deltaX,y:t.deltaY});void 0===o&&null===o||n(o)}}__init9(){this.getDelta=e=>{const t=this.position(),n={x:t.x(e.x),y:t.y(e.y)};return r=t.anchorPoint,kt(n).sub(kt(r));var r}}__init10(){this.applyDelta=t=>{const n=this.getDelta(t);return nn("[applyDelta] delta:",n),e.fromDelta(this.props,n)}}__init11(){this.onStop=(e,t)=>{nn("[onStop] dd:",t);const{onDragStop:n,onClick:r}=this.props;n&&n(),nn("[onStop] lastX/Y: ",t.lastX,t.lastY);if(this.tiny("x",e)&&this.tiny("y",e)&&r){nn("call onClick"),this.setState({startX:null});const{graphProps:t}=this.props,{scale:n,snap:i}=t,[o,a]=lt(e,e.target);let s=n.x.invert(o),l=n.y.invert(a);return s=i.x(s),l=i.y(l),r({x:s,y:l}),!1}return this.setState({startX:null,startY:null}),!1}}render(){const{disabled:n,...r}=this.props,i=this.grid(),o=!!this.state&&!!this.state.startX;return Z.createElement(Gt.exports.DraggableCore,{disabled:n,onMouseDown:e=>e.nativeEvent.preventDefault(),onStart:this.onStart,onDrag:this.onDrag,onStop:this.onStop,axis:e.axis||"both",grid:[i.x,i.y]},Z.createElement(t,{...r,disabled:n,isDragging:o}))}},tn.__initStatic(),tn);function an(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function sn(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ln(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=an,n=(t,n)=>an(e(t),n),r=(t,n)=>e(t)-n):(t=e===an||e===sn?e:cn,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},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 cn(){return 0}s("pie-lib:plot:trig");const un=ln(an).right;ln(function(e){return null===e?NaN:+e}).center;var hn=un;class pn extends Map{constructor(e,t=fn){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(dn(this,e))}has(e){return super.has(dn(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 dn({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function fn(e){return null!==e&&"object"==typeof e?e.valueOf():e}const gn=Math.sqrt(50),mn=Math.sqrt(10),yn=Math.sqrt(2);function vn(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=gn?10:o>=mn?5:o>=yn?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?vn(e,t,2*n):[s,l,c]}function bn(e,t,n){return vn(e=+e,t=+t,n=+n)[2]}function xn(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const wn=Symbol("implicit");function Cn(){var e=new pn,t=[],n=[],r=wn;function i(i){let o=e.get(i);if(void 0===o){if(r!==wn)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 pn;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 Cn(t,n).unknown(r)},xn.apply(i,arguments),i}function _n(){var e,t,n=Cn().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,s=!1,l=0,c=0,u=.5;function h(){var n=r().length,h=a<o,p=h?a:o,d=h?o:a;e=(d-p)/Math.max(1,n-l+2*c),s&&(e=Math.floor(e)),p+=(d-p-e*(n-l))*u,t=e*(1-l),s&&(p=Math.round(p),t=Math.round(t));var f=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 p+e*t});return i(h?f.reverse():f)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),h()):r()},n.range=function(e){return arguments.length?([o,a]=e,o=+o,a=+a,h()):[o,a]},n.rangeRound=function(e){return[o,a]=e,o=+o,a=+a,s=!0,h()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(s=!!e,h()):s},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 _n(r(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},xn.apply(h(),arguments)}function kn(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return kn(t())},e}function Sn(){return kn(_n.apply(null,arguments).paddingInner(1))}function En(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function On(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ln(){}var Mn=.7,An=1/Mn,Tn="\\s*([+-]?\\d+)\\s*",Pn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Rn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Nn=/^#([0-9a-f]{3,8})$/,Dn=new RegExp(`^rgb\\(${Tn},${Tn},${Tn}\\)$`),jn=new RegExp(`^rgb\\(${Rn},${Rn},${Rn}\\)$`),In=new RegExp(`^rgba\\(${Tn},${Tn},${Tn},${Pn}\\)$`),$n=new RegExp(`^rgba\\(${Rn},${Rn},${Rn},${Pn}\\)$`),Fn=new RegExp(`^hsl\\(${Pn},${Rn},${Rn}\\)$`),zn=new RegExp(`^hsla\\(${Pn},${Rn},${Rn},${Pn}\\)$`),Vn={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 Hn(){return this.rgb().formatHex()}function Wn(){return this.rgb().formatRgb()}function Bn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Nn.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Un(t):3===n?new Kn(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?qn(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?qn(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=Dn.exec(e))?new Kn(t[1],t[2],t[3],1):(t=jn.exec(e))?new Kn(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=In.exec(e))?qn(t[1],t[2],t[3],t[4]):(t=$n.exec(e))?qn(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Fn.exec(e))?tr(t[1],t[2]/100,t[3]/100,1):(t=zn.exec(e))?tr(t[1],t[2]/100,t[3]/100,t[4]):Vn.hasOwnProperty(e)?Un(Vn[e]):"transparent"===e?new Kn(NaN,NaN,NaN,0):null}function Un(e){return new Kn(e>>16&255,e>>8&255,255&e,1)}function qn(e,t,n,r){return r<=0&&(e=t=n=NaN),new Kn(e,t,n,r)}function Yn(e){return e instanceof Ln||(e=Bn(e)),e?new Kn((e=e.rgb()).r,e.g,e.b,e.opacity):new Kn}function Xn(e,t,n,r){return 1===arguments.length?Yn(e):new Kn(e,t,n,null==r?1:r)}function Kn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Zn(){return`#${er(this.r)}${er(this.g)}${er(this.b)}`}function Gn(){const e=Jn(this.opacity);return`${1===e?"rgb(":"rgba("}${Qn(this.r)}, ${Qn(this.g)}, ${Qn(this.b)}${1===e?")":`, ${e})`}`}function Jn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Qn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function er(e){return((e=Qn(e))<16?"0":"")+e.toString(16)}function tr(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ir(e,t,n,r)}function nr(e){if(e instanceof ir)return new ir(e.h,e.s,e.l,e.opacity);if(e instanceof Ln||(e=Bn(e)),!e)return new ir;if(e instanceof ir)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),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new ir(a,s,l,e.opacity)}function rr(e,t,n,r){return 1===arguments.length?nr(e):new ir(e,t,n,null==r?1:r)}function ir(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function or(e){return(e=(e||0)%360)<0?e+360:e}function ar(e){return Math.max(0,Math.min(1,e||0))}function sr(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}En(Ln,Bn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Hn,formatHex:Hn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return nr(this).formatHsl()},formatRgb:Wn,toString:Wn}),En(Kn,Xn,On(Ln,{brighter(e){return e=null==e?An:Math.pow(An,e),new Kn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Mn:Math.pow(Mn,e),new Kn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Kn(Qn(this.r),Qn(this.g),Qn(this.b),Jn(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:Zn,formatHex:Zn,formatHex8:function(){return`#${er(this.r)}${er(this.g)}${er(this.b)}${er(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Gn,toString:Gn})),En(ir,rr,On(Ln,{brighter(e){return e=null==e?An:Math.pow(An,e),new ir(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Mn:Math.pow(Mn,e),new ir(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 Kn(sr(e>=240?e-240:e+120,i,r),sr(e,i,r),sr(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ir(or(this.h),ar(this.s),ar(this.l),Jn(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=Jn(this.opacity);return`${1===e?"hsl(":"hsla("}${or(this.h)}, ${100*ar(this.s)}%, ${100*ar(this.l)}%${1===e?")":`, ${e})`}`}}));const lr=Math.PI/180,cr=180/Math.PI,ur=.96422,hr=.82521,pr=4/29,dr=6/29,fr=3*dr*dr,gr=dr*dr*dr;function mr(e){if(e instanceof vr)return new vr(e.l,e.a,e.b,e.opacity);if(e instanceof kr)return Sr(e);e instanceof Kn||(e=Yn(e));var t,n,r=Cr(e.r),i=Cr(e.g),o=Cr(e.b),a=br((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=br((.4360747*r+.3850649*i+.1430804*o)/ur),n=br((.0139322*r+.0971045*i+.7141733*o)/hr)),new vr(116*a-16,500*(t-a),200*(a-n),e.opacity)}function yr(e,t,n,r){return 1===arguments.length?mr(e):new vr(e,t,n,null==r?1:r)}function vr(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function br(e){return e>gr?Math.pow(e,1/3):e/fr+pr}function xr(e){return e>dr?e*e*e:fr*(e-pr)}function wr(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Cr(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function _r(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof kr)return new kr(e.h,e.c,e.l,e.opacity);if(e instanceof vr||(e=mr(e)),0===e.a&&0===e.b)return new kr(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*cr;return new kr(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new kr(e,t,n,null==r?1:r)}function kr(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Sr(e){if(isNaN(e.h))return new vr(e.l,0,0,e.opacity);var t=e.h*lr;return new vr(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}En(vr,yr,On(Ln,{brighter(e){return new vr(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new vr(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 Kn(wr(3.1338561*(t=ur*xr(t))-1.6168667*(e=1*xr(e))-.4906146*(n=hr*xr(n))),wr(-.9787684*t+1.9161415*e+.033454*n),wr(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),En(kr,_r,On(Ln,{brighter(e){return new kr(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new kr(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Sr(this).rgb()}}));var Er=-.14861,Or=1.78277,Lr=-.29227,Mr=-.90649,Ar=1.97294,Tr=Ar*Mr,Pr=Ar*Or,Rr=Or*Lr-Mr*Er;function Nr(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Dr)return new Dr(e.h,e.s,e.l,e.opacity);e instanceof Kn||(e=Yn(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Rr*r+Tr*t-Pr*n)/(Rr+Tr-Pr),o=r-i,a=(Ar*(n-i)-Lr*o)/Mr,s=Math.sqrt(a*a+o*o)/(Ar*i*(1-i)),l=s?Math.atan2(a,o)*cr-120:NaN;return new Dr(l<0?l+360:l,s,i,e.opacity)}(e):new Dr(e,t,n,null==r?1:r)}function Dr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}En(Dr,Nr,On(Ln,{brighter(e){return e=null==e?An:Math.pow(An,e),new Dr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Mn:Math.pow(Mn,e),new Dr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*lr,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Kn(255*(t+n*(Er*r+Or*i)),255*(t+n*(Lr*r+Mr*i)),255*(t+n*(Ar*r)),this.opacity)}}));var jr=e=>()=>e;function Ir(e,t){return function(n){return e+n*t}}function $r(e,t){var n=t-e;return n?Ir(e,n>180||n<-180?n-360*Math.round(n/360):n):jr(isNaN(e)?t:e)}function Fr(e){return 1===(e=+e)?zr: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):jr(isNaN(t)?n:t)}}function zr(e,t){var n=t-e;return n?Ir(e,n):jr(isNaN(e)?t:e)}var Vr=function e(t){var n=Fr(t);function r(e,t){var r=n((e=Xn(e)).r,(t=Xn(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=zr(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function Hr(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 Wr(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Zr(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function Br(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ur(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function qr(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]=Zr(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var Yr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xr=new RegExp(Yr.source,"g");function Kr(e,t){var n,r,i,o=Yr.lastIndex=Xr.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Yr.exec(e))&&(r=Xr.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:Ur(n,r)})),o=Xr.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.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)s[(n=l[r]).i]=n.x(e);return s.join("")})}function Zr(e,t){var n,r=typeof t;return null==t||"boolean"===r?jr(t):("number"===r?Ur:"string"===r?(n=Bn(t))?(t=n,Vr):Kr:t instanceof Bn?Vr:t instanceof Date?Br:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Hr:Array.isArray(t)?Wr:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?qr:Ur)(e,t)}function Gr(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Jr(e){return function(t,n){var r=e((t=rr(t)).h,(n=rr(n)).h),i=zr(t.s,n.s),o=zr(t.l,n.l),a=zr(t.opacity,n.opacity);return function(e){return t.h=r(e),t.s=i(e),t.l=o(e),t.opacity=a(e),t+""}}}var Qr=Jr($r),ei=Jr(zr);function ti(e){return function(t,n){var r=e((t=_r(t)).h,(n=_r(n)).h),i=zr(t.c,n.c),o=zr(t.l,n.l),a=zr(t.opacity,n.opacity);return function(e){return t.h=r(e),t.c=i(e),t.l=o(e),t.opacity=a(e),t+""}}}var ni=ti($r),ri=ti(zr);function ii(e){return function t(n){function r(t,r){var i=e((t=Nr(t)).h,(r=Nr(r)).h),o=zr(t.s,r.s),a=zr(t.l,r.l),s=zr(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=o(e),t.l=a(Math.pow(e,n)),t.opacity=s(e),t+""}}return n=+n,r.gamma=t,r}(1)}var oi=ii($r),ai=ii(zr);function si(e){return+e}var li=[0,1];function ci(e){return e}function ui(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function hi(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=ui(i,r),o=n(a,o)):(r=ui(r,i),o=n(o,a)),function(e){return o(r(e))}}function pi(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=ui(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=hn(e,t,1,r)-1;return o[n](i[n](t))}}function di(){var e,t,n,r,i,o,a=li,s=li,l=Zr,c=ci;function u(){var e=Math.min(a.length,s.length);return c!==ci&&(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))}}(a[0],a[e-1])),r=e>2?pi:hi,i=o=null,h}function h(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(c(t)))}return h.invert=function(n){return c(t((o||(o=r(s,a.map(e),Ur)))(n)))},h.domain=function(e){return arguments.length?(a=Array.from(e,si),u()):a.slice()},h.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},h.rangeRound=function(e){return s=Array.from(e),l=Gr,u()},h.clamp=function(e){return arguments.length?(c=!!e||ci,u()):c!==ci},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 fi(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 gi(e){return(e=fi(Math.abs(e)))?e[1]:NaN}var mi,yi=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function vi(e){if(!(t=yi.exec(e)))throw new Error("invalid format: "+e);var t;return new bi({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 bi(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 xi(e,t){var n=fi(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")}vi.prototype=bi.prototype,bi.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 wi={"%":(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)=>xi(100*e,t),r:xi,s:function(e,t){var n=fi(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(mi=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+fi(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Ci(e){return e}var _i,ki,Si,Ei=Array.prototype.map,Oi=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Li(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?Ci:(t=Ei.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?Ci:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(Ei.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=vi(e)).fill,n=e.align,h=e.sign,p=e.symbol,d=e.zero,f=e.width,g=e.comma,m=e.precision,y=e.trim,v=e.type;"n"===v?(g=!0,v="g"):wi[v]||(void 0===m&&(m=12),y=!0,v="g"),(d||"0"===t&&"="===n)&&(d=!0,t="0",n="=");var b="$"===p?i:"#"===p&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===p?o:/[%p]/.test(v)?l:"",w=wi[v],C=/[defgprs%]/.test(v);function _(e){var i,o,l,p=b,_=x;if("c"===v)_=w(e)+_,e="";else{var k=(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)),k&&0===+e&&"+"!==h&&(k=!1),p=(k?"("===h?h:c:"-"===h||"("===h?"":h)+p,_=("s"===v?Oi[8+mi/3]:"")+_+(k&&"("===h?")":""),C)for(i=-1,o=e.length;++i<o;)if(48>(l=e.charCodeAt(i))||l>57){_=(46===l?a+e.slice(i+1):e.slice(i))+_,e=e.slice(0,i);break}}g&&!d&&(e=r(e,1/0));var S=p.length+e.length+_.length,E=S<f?new Array(f-S+1).join(t):"";switch(g&&d&&(e=r(E+e,E.length?f-_.length:1/0),E=""),n){case"<":e=p+e+_+E;break;case"=":e=p+E+e+_;break;case"^":e=E.slice(0,S=E.length>>1)+p+e+_+E.slice(S);break;default:e=E+p+e+_}return s(e)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),_.toString=function(){return e+""},_}return{format:h,formatPrefix:function(e,t){var n=h(((e=vi(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(gi(t)/3))),i=Math.pow(10,-r),o=Oi[8+r/3];return function(e){return n(i*e)+o}}}}function Mi(e,t,n,r){var i,o=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?bn(t,e,n):bn(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=vi(null==r?",f":r)).type){case"s":var a=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(gi(t)/3)))-gi(Math.abs(e)))}(o,a))||(r.precision=i),Si(r,a);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,gi(t)-gi(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,-gi(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return ki(r)}function Ai(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,a]=r?vn(t,e,n):vn(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let e=0;e<s;++e)l[e]=(o-e)/-a;else for(let e=0;e<s;++e)l[e]=(o-e)*a;else if(a<0)for(let e=0;e<s;++e)l[e]=(i+e)/-a;else for(let e=0;e<s;++e)l[e]=(i+e)*a;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return Mi(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,s=o.length-1,l=o[a],c=o[s],u=10;for(c<l&&(i=l,l=c,c=i,i=a,a=s,s=i);u-- >0;){if((i=bn(l,c,n))===r)return o[a]=l,o[s]=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 Ti(){var e=di()(ci,ci);return e.copy=function(){return t=e,Ti().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},xn.apply(e,arguments),Ai(e)}_i=Li({thousands:",",grouping:[3],currency:["$",""]}),ki=_i.format,Si=_i.formatPrefix;const Pi=new Date,Ri=new Date;function Ni(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 a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<r);return a},i.filter=n=>Ni(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)=>(Pi.setTime(+t),Ri.setTime(+r),e(Pi),e(Ri),Math.floor(n(Pi,Ri))),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 Di=1e3,ji=6e4,Ii=36e5,$i=864e5,Fi=6048e5,zi=Ni(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Di)},(e,t)=>(t-e)/Di,e=>e.getUTCSeconds());zi.range;const Vi=Ni(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Di)},(e,t)=>{e.setTime(+e+t*ji)},(e,t)=>(t-e)/ji,e=>e.getMinutes());Vi.range;const Hi=Ni(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ji)},(e,t)=>(t-e)/ji,e=>e.getUTCMinutes());Hi.range;const Wi=Ni(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Di-e.getMinutes()*ji)},(e,t)=>{e.setTime(+e+t*Ii)},(e,t)=>(t-e)/Ii,e=>e.getHours());Wi.range;const Bi=Ni(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ii)},(e,t)=>(t-e)/Ii,e=>e.getUTCHours());Bi.range;const Ui=Ni(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ji)/$i,e=>e.getDate()-1);Ui.range;const qi=Ni(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$i,e=>e.getUTCDate()-1);qi.range;const Yi=Ni(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$i,e=>Math.floor(e/$i));function Xi(e){return Ni(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())*ji)/Fi)}Yi.range;const Ki=Xi(0),Zi=Xi(1),Gi=Xi(2),Ji=Xi(3),Qi=Xi(4),eo=Xi(5),to=Xi(6);function no(e){return Ni(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)/Fi)}Ki.range,Zi.range,Gi.range,Ji.range,Qi.range,eo.range,to.range;const ro=no(0),io=no(1),oo=no(2),ao=no(3),so=no(4),lo=no(5),co=no(6);ro.range,io.range,oo.range,ao.range,so.range,lo.range,co.range;const uo=Ni(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth());uo.range;const ho=Ni(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth());ho.range;const po=Ni(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());po.every=e=>isFinite(e=Math.floor(e))&&e>0?Ni(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,po.range;const fo=Ni(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());fo.every=e=>isFinite(e=Math.floor(e))&&e>0?Ni(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,fo.range;const go=({min:e,max:t,step:n})=>({step:n,min:parseInt(e/n)*n,max:parseInt(t/n)*n}),mo=(e,t,n,r)=>{vt(e.min<e.max,"domain: min must be less than max"),vt(t.min<t.max,"range: min must be less than max");const i=go(e),o=go(t);return{scale:{x:Ti().domain([e.min,e.max]).range([0,n.width]),y:Ti().domain([t.max,t.min]).range([0,n.height])},snap:{x:Ct.bind(null,i.min,i.max,i.step),y:Ct.bind(null,o.min,o.max,o.step)},domain:e,range:t,size:n,getRootNode:r}},yo=l;var vo=function(e){var t=e.from,n=void 0===t?{x:0,y:0}:t,r=e.to,i=void 0===r?{x:1,y:1}:r,o=e.fill,a=void 0===o?"transparent":o,s=e.className,l=e.innerRef,c=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,wo),u=n.x===i.x||n.y===i.y;return bo.default.createElement("line",_o({ref:l,className:(0,xo.default)("visx-line",s),x1:n.x,y1:n.y,x2:i.x,y2:i.y,fill:a,shapeRendering:u?"crispEdges":"auto"},c))},bo=Co(a),xo=Co(yo),wo=["from","to","fill","className","innerRef"];function Co(e){return e&&e.__esModule?e:{default:e}}function _o(){return _o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_o.apply(this,arguments)}const ko=n,So=l;var Eo=["top","left","transform","className","children","innerRef"];function Oo(){return Oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oo.apply(this,arguments)}function Lo(e){var t=e.top,n=void 0===t?0:t,r=e.left,i=void 0===r?0:r,o=e.transform,a=e.className,s=e.children,l=e.innerRef,c=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,Eo);return Z.createElement("g",Oo({ref:l,className:So("visx-group",a),transform:o||"translate("+i+", "+n+")"},c),s)}Lo.propTypes={top:ko.number,left:ko.number,transform:ko.string,className:ko.string,children:ko.node,innerRef:ko.oneOfType([ko.string,ko.func,ko.object])};var Mo=function(){function e(e){var t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r;this.x=0,this.y=0,this.x=n,this.y=i}var t=e.prototype;return t.value=function(){return{x:this.x,y:this.y}},t.toArray=function(){return[this.x,this.y]},e}();var Ao={lab:function(e,t){var n=zr((e=yr(e)).l,(t=yr(t)).l),r=zr(e.a,t.a),i=zr(e.b,t.b),o=zr(e.opacity,t.opacity);return function(t){return e.l=n(t),e.a=r(t),e.b=i(t),e.opacity=o(t),e+""}},hcl:ni,"hcl-long":ri,hsl:Qr,"hsl-long":ei,cubehelix:oi,"cubehelix-long":ai,rgb:Vr};var To=new Date(Date.UTC(2020,1,2,3,4,5));var Po={day:Ui,hour:Wi,minute:Vi,month:uo,second:zi,week:Ki,year:po},Ro={day:qi,hour:Bi,minute:Hi,month:ho,second:zi,week:ro,year:fo};var No=["domain","nice","zero","interpolate","round","range","reverse","align","base","clamp","constant","exponent","padding","unknown"],Do={domain:function(e,t){t.domain&&e.domain(t.domain)},nice:function(e,t){if("nice"in t&&void 0!==t.nice&&"nice"in e){var n=t.nice;if("boolean"==typeof n)n&&e.nice();else if("number"==typeof n)e.nice(n);else{var r=e,i=function(e){return"2020-02-02 03:04"===e.tickFormat(1,"%Y-%m-%d %H:%M")(To)}(r);if("string"==typeof n)r.nice(i?Ro[n]:Po[n]);else{var o=n.interval,a=n.step,s=(i?Ro[o]:Po[o]).every(a);null!=s&&r.nice(s)}}}},zero:function(e,t){if("zero"in t&&!0===t.zero){var n=e.domain(),r=n[0],i=n[1],o=i<r,a=o?[i,r]:[r,i],s=a[0],l=a[1],c=[Math.min(0,s),Math.max(0,l)];e.domain(o?c.reverse():c)}},interpolate:function(e,t){if("interpolate"in t&&"interpolate"in e&&void 0!==t.interpolate){var n=function(e){switch(e){case"lab":case"hcl":case"hcl-long":case"hsl":case"hsl-long":case"cubehelix":case"cubehelix-long":case"rgb":return Ao[e]}var t=e.type,n=e.gamma,r=Ao[t];return void 0===n?r:r.gamma(n)}(t.interpolate);e.interpolate(n)}},round:function(e,t){"round"in t&&void 0!==t.round&&(t.round&&"interpolate"in t&&void 0!==t.interpolate?console.warn("[visx/scale/applyRound] ignoring round: scale config contains round and interpolate. only applying interpolate. config:",t):"round"in e?e.round(t.round):"interpolate"in e&&t.round&&e.interpolate(Gr))},align:function(e,t){"align"in e&&"align"in t&&void 0!==t.align&&e.align(t.align)},base:function(e,t){"base"in e&&"base"in t&&void 0!==t.base&&e.base(t.base)},clamp:function(e,t){"clamp"in e&&"clamp"in t&&void 0!==t.clamp&&e.clamp(t.clamp)},constant:function(e,t){"constant"in e&&"constant"in t&&void 0!==t.constant&&e.constant(t.constant)},exponent:function(e,t){"exponent"in e&&"exponent"in t&&void 0!==t.exponent&&e.exponent(t.exponent)},padding:function(e,t){"padding"in e&&"padding"in t&&void 0!==t.padding&&e.padding(t.padding),"paddingInner"in e&&"paddingInner"in t&&void 0!==t.paddingInner&&e.paddingInner(t.paddingInner),"paddingOuter"in e&&"paddingOuter"in t&&void 0!==t.paddingOuter&&e.paddingOuter(t.paddingOuter)},range:function(e,t){t.range&&e.range(t.range)},reverse:function(e,t){if(t.reverse){var n=e.range().slice().reverse();e.range(n)}},unknown:function(e,t){"unknown"in e&&"unknown"in t&&void 0!==t.unknown&&e.unknown(t.unknown)}};function jo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=new Set(t),i=No.filter(function(e){return r.has(e)});return function(e,t){return void 0!==t&&i.forEach(function(n){Do[n](e,t)}),e}}var Io=jo("domain","range","reverse","align","padding","round");function $o(e){return Io(_n(),e)}var Fo=jo("domain","range","reverse","align","padding","round");function zo(e){if(("function"==typeof e||"object"==typeof e&&e)&&"valueOf"in e){var t=e.valueOf();if("number"==typeof t)return t}return e}function Vo(e,t){var n=e;return"ticks"in n?n.ticks(t):n.domain().filter(function(e,n,r){return null==t||r.length<=t||n%Math.round((r.length-1)/t)===0})}function Ho(e){return null==e?void 0:e.toString()}function Wo(e){return"bandwidth"in e?e.bandwidth():0}const Bo=n,Uo=l;var qo=["top","left","scale","width","stroke","strokeWidth","strokeDasharray","className","children","numTicks","lineStyle","offset","tickValues"];function Yo(){return Yo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yo.apply(this,arguments)}function Xo(e){var t=e.top,n=void 0===t?0:t,r=e.left,i=void 0===r?0:r,o=e.scale,a=e.width,s=e.stroke,l=void 0===s?"#eaf0f6":s,c=e.strokeWidth,u=void 0===c?1:c,h=e.strokeDasharray,p=e.className,d=e.children,f=e.numTicks,g=void 0===f?10:f,m=e.lineStyle,y=e.offset,v=e.tickValues,b=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,qo),x=null!=v?v:Vo(o,g),w=(null!=y?y:0)+Wo(o)/2,C=x.map(function(e,t){var n,r=(null!=(n=zo(o(e)))?n:0)+w;return{index:t,from:new Mo({x:0,y:r}),to:new Mo({x:a,y:r})}});return Z.createElement(Lo,{className:Uo("visx-rows",p),top:n,left:i},d?d({lines:C}):C.map(function(e){var t=e.from,n=e.to,r=e.index;return Z.createElement(vo,Yo({key:"row-line-"+r,from:t,to:n,stroke:l,strokeWidth:u,strokeDasharray:h,style:m},b))}))}Xo.propTypes={tickValues:Bo.array,width:Bo.number.isRequired};const Ko=n,Zo=l;var Go=["top","left","scale","height","stroke","strokeWidth","strokeDasharray","className","numTicks","lineStyle","offset","tickValues","children"];function Jo(){return Jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jo.apply(this,arguments)}function Qo(e){var t=e.top,n=void 0===t?0:t,r=e.left,i=void 0===r?0:r,o=e.scale,a=e.height,s=e.stroke,l=void 0===s?"#eaf0f6":s,c=e.strokeWidth,u=void 0===c?1:c,h=e.strokeDasharray,p=e.className,d=e.numTicks,f=void 0===d?10:d,g=e.lineStyle,m=e.offset,y=e.tickValues,v=e.children,b=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,Go),x=null!=y?y:Vo(o,f),w=(null!=m?m:0)+Wo(o)/2,C=x.map(function(e,t){var n,r=(null!=(n=zo(o(e)))?n:0)+w;return{index:t,from:new Mo({x:r,y:0}),to:new Mo({x:r,y:a})}});return Z.createElement(Lo,{className:Zo("visx-columns",p),top:n,left:i},v?v({lines:C}):C.map(function(e){var t=e.from,n=e.to,r=e.index;return Z.createElement(vo,Jo({key:"column-line-"+r,from:t,to:n,stroke:l,strokeWidth:u,strokeDasharray:h,style:g},b))}))}Qo.propTypes={tickValues:Ko.array,height:Ko.number.isRequired};var ea=Math.PI,ta=2*ea,na=1e-6,ra=ta-na;function ia(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function oa(){return new ia}function aa(e){return function(){return e}}function sa(e){this._context=e}function la(e){return new sa(e)}function ca(e){return e[0]}function ua(e){return e[1]}function ha(){var e=ca,t=ua,n=aa(!0),r=null,i=la,o=null;function a(a){var s,l,c,u=a.length,h=!1;for(null==r&&(o=i(c=oa())),s=0;s<=u;++s)!(s<u&&n(l=a[s],s,a))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(l,s,a),+t(l,s,a));if(c)return o=null,c+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:aa(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:aa(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:aa(!!e),a):n},a.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),a):i},a.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),a):r},a}ia.prototype=oa.prototype={constructor:ia,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,a=this._y1,s=n-e,l=r-t,c=o-e,u=a-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>na)if(Math.abs(u*s-l*c)>na&&i){var p=n-o,d=r-a,f=s*s+l*l,g=p*p+d*d,m=Math.sqrt(f),y=Math.sqrt(h),v=i*Math.tan((ea-Math.acos((f+h-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>na&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*p>c*d)+","+(this._x1=e+x*s)+","+(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 a=(n=+n)*Math.cos(r),s=n*Math.sin(r),l=e+a,c=t+s,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)>na||Math.abs(this._y1-c)>na)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%ta+ta),h>ra?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>na&&(this._+="A"+n+","+n+",0,"+ +(h>=ea)+","+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._}},sa.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)}}};const pa=n,{styled:da}=o,{color:fa}=i,ga=da("g")(()=>({stroke:fa.primaryLight()}));class ma extends Z.Component{static __initStatic(){this.propTypes={className:pa.string,graphProps:yt.isRequired,xBand:pa.func,columnTickValues:pa.array,rowTickValues:pa.array}}static __initStatic2(){this.defaultProps={}}render(){const{graphProps:e,xBand:t,rowTickValues:n,columnTickValues:r}=this.props,{scale:i={},size:o={},range:a={}}=e||{},{step:s=0,labelStep:l=0}=a,c=s&&l&&s<l,{unlabeledLines:u,labeledLines:h}=(n||[]).reduce((e,t)=>(c&&t%l!==0?e.unlabeledLines.push(t):e.labeledLines.push(t),e),{unlabeledLines:[],labeledLines:[]});return Z.createElement(ga,null,Z.createElement(Xo,{scale:i.y,width:o.width,tickValues:u,lineStyle:{stroke:fa.fadedPrimary(),strokeWidth:1}}),Z.createElement(Xo,{scale:i.y,width:o.width,tickValues:h,lineStyle:{stroke:fa.visualElementsColors.GRIDLINES_COLOR,strokeWidth:1}}),Z.createElement(Qo,{scale:t,height:o.height,offset:t.bandwidth()/2,tickValues:r}))}}function ya(e,t){e(t)}ma.__initStatic(),ma.__initStatic2();const va=l;var ba=["from","to","fill","className","innerRef"];function xa(){return xa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xa.apply(this,arguments)}function wa(e){var t=e.from,n=void 0===t?{x:0,y:0}:t,r=e.to,i=void 0===r?{x:1,y:1}:r,o=e.fill,a=void 0===o?"transparent":o,s=e.className,l=e.innerRef,c=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,ba),u=n.x===i.x||n.y===i.y;return Z.createElement("line",xa({ref:l,className:va("visx-line",s),x1:n.x,y1:n.y,x2:i.x,y2:i.y,fill:a,shapeRendering:u?"crispEdges":"auto"},c))}const Ca=l;var _a=["children","data","x","y","fill","className","curve","innerRef","defined"];function ka(){return ka=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ka.apply(this,arguments)}function Sa(e){var t=e.children,n=e.data,r=void 0===n?[]:n,i=e.x,o=e.y,a=e.fill,s=void 0===a?"transparent":a,l=e.className,c=e.curve,u=e.innerRef,h=e.defined,p=void 0===h?function(){return!0}:h,d=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,_a),f=function(e){var t=void 0===e?{}:e,n=t.x,r=t.y,i=t.defined,o=t.curve,a=ha();return n&&ya(a.x,n),r&&ya(a.y,r),i&&a.defined(i),o&&a.curve(o),a}({x:i,y:o,defined:p,curve:c});return t?Z.createElement(Z.Fragment,null,t({path:f})):Z.createElement("path",ka({ref:u,className:Ca("visx-linepath",l),d:f(r)||"",fill:s,strokeLinecap:"round"},d))}const Ea=l;var Oa=["className","innerRef"];function La(){return La=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},La.apply(this,arguments)}const Ma=l;var Aa=["className","innerRef"];function Ta(){return Ta=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ta.apply(this,arguments)}function Pa(e){var t=e.className,n=e.innerRef,r=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,Aa);return Z.createElement("circle",Ta({ref:n,className:Ma("visx-circle",t)},r))}var Ra=Na;function Na(e,t,n){e instanceof RegExp&&(e=Da(e,n)),t instanceof RegExp&&(t=Da(t,n));var r=ja(e,t,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+e.length,r[1]),post:n.slice(r[1]+t.length)}}function Da(e,t){var n=t.match(e);return n?n[0]:null}function ja(e,t,n){var r,i,o,a,s,l=n.indexOf(e),c=n.indexOf(t,l+1),u=l;if(l>=0&&c>0){for(r=[],o=n.length;u>=0&&!s;)u==l?(r.push(u),l=n.indexOf(e,u+1)):1==r.length?s=[r.pop(),c]:((i=r.pop())<o&&(o=i,a=c),c=n.indexOf(t,u+1)),u=l<c&&l>=0?l:c;r.length&&(s=[o,a])}return s}Na.range=ja;var Ia=$a;function $a(e,t,n){e instanceof RegExp&&(e=Fa(e,n)),t instanceof RegExp&&(t=Fa(t,n));var r=za(e,t,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+e.length,r[1]),post:n.slice(r[1]+t.length)}}function Fa(e,t){var n=t.match(e);return n?n[0]:null}function za(e,t,n){var r,i,o,a,s,l=n.indexOf(e),c=n.indexOf(t,l+1),u=l;if(l>=0&&c>0){if(e===t)return[l,c];for(r=[],o=n.length;u>=0&&!s;)u==l?(r.push(u),l=n.indexOf(e,u+1)):1==r.length?s=[r.pop(),c]:((i=r.pop())<o&&(o=i,a=c),c=n.indexOf(t,u+1)),u=l<c&&l>=0?l:c;r.length&&(s=[o,a])}return s}$a.range=za;var Va=Ia,Ha=Wa;function Wa(e,t,n){var r=e;return function(e,t){var n=[],r="string"==typeof t?new RegExp("\\b("+t+")\\("):t;do{var i=r.exec(e);if(!i)return n;if(void 0===i[1])throw new Error("Missing the first couple of parenthesis to get the function identifier in "+t);var o=i[1],a=i.index,s=Va("(",")",e.substring(a));if(!s||s.start!==i[0].length-1)throw new SyntaxError(o+"(): missing closing ')' in the value '"+e+"'");n.push({matches:s,functionIdentifier:o}),e=s.post}while(r.test(e));return n}(e,t).reduce(function(e,i){return e.replace(i.functionIdentifier+"("+i.matches.body+")",function(e,t,n,r,i){return n(Wa(e,i,n),t,r)}(i.matches.body,i.functionIdentifier,n,r,t))},e)}var Ba=function(e){this.value=e};Ba.math={isDegree:!0,acos:function(e){return Ba.math.isDegree?180/Math.PI*Math.acos(e):Math.acos(e)},add:function(e,t){return e+t},asin:function(e){return Ba.math.isDegree?180/Math.PI*Math.asin(e):Math.asin(e)},atan:function(e){return Ba.math.isDegree?180/Math.PI*Math.atan(e):Math.atan(e)},acosh:function(e){return Math.log(e+Math.sqrt(e*e-1))},asinh:function(e){return Math.log(e+Math.sqrt(e*e+1))},atanh:function(e){return Math.log((1+e)/(1-e))},C:function(e,t){var n=1,r=e-t,i=t;i<r&&(i=r,r=t);for(var o=i+1;o<=e;o++)n*=o;return n/Ba.math.fact(r)},changeSign:function(e){return-e},cos:function(e){return Ba.math.isDegree&&(e=Ba.math.toRadian(e)),Math.cos(e)},cosh:function(e){return(Math.pow(Math.E,e)+Math.pow(Math.E,-1*e))/2},div:function(e,t){return e/t},fact:function(e){if(e%1!=0)return"NaN";for(var t=1,n=2;n<=e;n++)t*=n;return t},inverse:function(e){return 1/e},log:function(e){return Math.log(e)/Math.log(10)},mod:function(e,t){return e%t},mul:function(e,t){return e*t},P:function(e,t){for(var n=1,r=Math.floor(e)-Math.floor(t)+1;r<=Math.floor(e);r++)n*=r;return n},Pi:function(e,t,n){for(var r=1,i=e;i<=t;i++)r*=Number(n.postfixEval({n:i}));return r},pow10x:function(e){for(var t=1;e--;)t*=10;return t},sigma:function(e,t,n){for(var r=0,i=e;i<=t;i++)r+=Number(n.postfixEval({n:i}));return r},sin:function(e){return Ba.math.isDegree&&(e=Ba.math.toRadian(e)),Math.sin(e)},sinh:function(e){return(Math.pow(Math.E,e)-Math.pow(Math.E,-1*e))/2},sub:function(e,t){return e-t},tan:function(e){return Ba.math.isDegree&&(e=Ba.math.toRadian(e)),Math.tan(e)},tanh:function(e){return Ba.sinha(e)/Ba.cosha(e)},toRadian:function(e){return e*Math.PI/180},and:function(e,t){return e&t}},Ba.Exception=function(e){this.message=e};var Ua=Ba;function qa(e,t){for(var n=0;n<e.length;n++)e[n]+=t;return e}for(var Ya=[{token:"sin",show:"sin",type:0,value:Ua.math.sin},{token:"cos",show:"cos",type:0,value:Ua.math.cos},{token:"tan",show:"tan",type:0,value:Ua.math.tan},{token:"pi",show:"&pi;",type:3,value:"PI"},{token:"(",show:"(",type:4,value:"("},{token:")",show:")",type:5,value:")"},{token:"P",show:"P",type:10,value:Ua.math.P},{token:"C",show:"C",type:10,value:Ua.math.C},{token:" ",show:" ",type:14,value:" ".anchor},{token:"asin",show:"asin",type:0,value:Ua.math.asin},{token:"acos",show:"acos",type:0,value:Ua.math.acos},{token:"atan",show:"atan",type:0,value:Ua.math.atan},{token:"7",show:"7",type:1,value:"7"},{token:"8",show:"8",type:1,value:"8"},{token:"9",show:"9",type:1,value:"9"},{token:"int",show:"Int",type:0,value:Math.floor},{token:"cosh",show:"cosh",type:0,value:Ua.math.cosh},{token:"acosh",show:"acosh",type:0,value:Ua.math.acosh},{token:"ln",show:" ln",type:0,value:Math.log},{token:"^",show:"^",type:10,value:Math.pow},{token:"root",show:"root",type:0,value:Math.sqrt},{token:"4",show:"4",type:1,value:"4"},{token:"5",show:"5",type:1,value:"5"},{token:"6",show:"6",type:1,value:"6"},{token:"/",show:"&divide;",type:2,value:Ua.math.div},{token:"!",show:"!",type:7,value:Ua.math.fact},{token:"tanh",show:"tanh",type:0,value:Ua.math.tanh},{token:"atanh",show:"atanh",type:0,value:Ua.math.atanh},{token:"Mod",show:" Mod ",type:2,value:Ua.math.mod},{token:"1",show:"1",type:1,value:"1"},{token:"2",show:"2",type:1,value:"2"},{token:"3",show:"3",type:1,value:"3"},{token:"*",show:"&times;",type:2,value:Ua.math.mul},{token:"sinh",show:"sinh",type:0,value:Ua.math.sinh},{token:"asinh",show:"asinh",type:0,value:Ua.math.asinh},{token:"e",show:"e",type:3,value:"E"},{token:"log",show:" log",type:0,value:Ua.math.log},{token:"0",show:"0",type:1,value:"0"},{token:".",show:".",type:6,value:"."},{token:"+",show:"+",type:9,value:Ua.math.add},{token:"-",show:"-",type:9,value:Ua.math.sub},{token:",",show:",",type:11,value:","},{token:"Sigma",show:"&Sigma;",type:12,value:Ua.math.sigma},{token:"n",show:"n",type:13,value:"n"},{token:"Pi",show:"&Pi;",type:12,value:Ua.math.Pi},{token:"pow",show:"pow",type:8,value:Math.pow,numberOfArguments:2},{token:"&",show:"&",type:9,value:Ua.math.and}],Xa={0:11,1:0,2:3,3:0,4:0,5:0,6:0,7:11,8:11,9:1,10:10,11:0,12:11,13:0,14:-1,15:11},Ka=0;Ka<Ya.length;Ka++)Ya[Ka].precedence=Xa[Ya[Ka].type];var Za={0:!0,1:!0,3:!0,4:!0,6:!0,8:!0,9:!0,12:!0,13:!0,14:!0,15:!0},Ga={0:!0,1:!0,2:!0,3:!0,4:!0,5:!0,6:!0,7:!0,8:!0,9:!0,10:!0,11:!0,12:!0,13:!0,15:!0},Ja={0:!0,3:!0,4:!0,8:!0,12:!0,13:!0,15:!0},Qa={},es={0:!0,1:!0,3:!0,4:!0,6:!0,8:!0,12:!0,13:!0,15:!0},ts={1:!0},ns=[[],["1","2","3","7","8","9","4","5","6","+","-","*","/","(",")","^","!","P","C","e","0",".",",","n"," ","&"],["pi","ln","Pi"],["sin","cos","tan","Del","int","Mod","log","pow"],["asin","acos","atan","cosh","root","tanh","sinh"],["acosh","atanh","asinh","Sigma"]];function rs(e,t,n,r){for(var i=0;i<r;i++)if(e[n+i]!==t[i])return!1;return!0}function is(e,t){for(var n=0;n<t.length;n++)if(t[n].token===e)return n;return-1}function os(e){for(var t,n,r,i=[],o=e.length,a=0;a<o;a++)if(!(a<o-1&&" "===e[a]&&" "===e[a+1])){for(t="",n=e.length-a>ns.length-2?ns.length-1:e.length-a;n>0;n--)if(void 0!==ns[n])for(r=0;r<ns[n].length;r++)rs(e,ns[n][r],a,n)&&(t=ns[n][r],r=ns[n].length,n=0);if(a+=t.length-1,""===t)throw new Ua.Exception("Can't understand after "+e.slice(a));i.push(Ya[is(t,Ya)])}return i}Ua.tokenTypes={FUNCTION_WITH_ONE_ARG:0,NUMBER:1,BINARY_OPERATOR_HIGH_PRECENDENCE:2,CONSTANT:3,OPENING_PARENTHESIS:4,CLOSING_PARENTHESIS:5,DECIMAL:6,POSTFIX_FUNCTION_WITH_ONE_ARG:7,FUNCTION_WITH_N_ARGS:8,BINARY_OPERATOR_LOW_PRECENDENCE:9,BINARY_OPERATOR_PERMUTATION:10,COMMA:11,EVALUATED_FUNCTION:12,EVALUATED_FUNCTION_PARAMETER:13,SPACE:14},Ua.addToken=function(e){for(var t=0;t<e.length;t++){var n=e[t].token.length,r=-1;e[t].type===Ua.tokenTypes.FUNCTION_WITH_N_ARGS&&void 0===e[t].numberOfArguments&&(e[t].numberOfArguments=2),ns[n]=ns[n]||[];for(var i=0;i<ns[n].length;i++)if(e[t].token===ns[n][i]){r=is(ns[n][i],Ya);break}-1===r?(Ya.push(e[t]),e[t].precedence=Xa[e[t].type],ns.length<=e[t].token.length&&(ns[e[t].token.length]=[]),ns[e[t].token.length].push(e[t].token)):(Ya[r]=e[t],e[t].precedence=Xa[e[t].type])}};var as={value:Ua.math.changeSign,type:0,pre:21,show:"-"},ss={value:")",show:")",type:5,pre:0},ls={value:"(",type:4,pre:0,show:"("};Ua.lex=function(e,t){var n,r=[ls],i=[],o=e,a=Za,s=0,l=Qa,c="";void 0!==t&&Ua.addToken(t);var u={},h=os(o);for(n=0;n<h.length;n++){var p=h[n];if(14!==p.type){var d,f=p.token,g=p.type,m=p.value,y=p.precedence,v=p.show,b=r[r.length-1];for(d=i.length;d--&&0===i[d];)if(-1!==[0,2,3,4,5,9,11,12,13].indexOf(g)){if(!0!==a[g])throw new Ua.Exception(f+" is not allowed after "+c);r.push(ss),a=Ga,l=es,i.pop()}if(!0!==a[g])throw new Ua.Exception(f+" is not allowed after "+c);if(!0===l[g]&&(g=2,m=Ua.math.mul,v="&times;",y=3,n-=1),u={value:m,type:g,pre:y,show:v,numberOfArguments:p.numberOfArguments},0===g)a=Za,l=Qa,qa(i,2),r.push(u),4!==h[n+1].type&&(r.push(ls),i.push(2));else if(1===g)1===b.type?(b.value+=m,qa(i,1)):r.push(u),a=Ga,l=Ja;else if(2===g)a=Za,l=Qa,qa(i,2),r.push(u);else if(3===g)r.push(u),a=Ga,l=es;else if(4===g)qa(i,1),s++,a=Za,l=Qa,r.push(u);else if(5===g){if(!s)throw new Ua.Exception("Closing parenthesis are more than opening one, wait What!!!");s--,a=Ga,l=es,r.push(u),qa(i,1)}else if(6===g){if(b.hasDec)throw new Ua.Exception("Two decimals are not allowed in one number");1!==b.type&&(b={value:0,type:1,pre:0},r.push(b)),a=ts,qa(i,1),l=Qa,b.value+=m,b.hasDec=!0}else 7===g&&(a=Ga,l=es,qa(i,1),r.push(u));8===g?(a=Za,l=Qa,qa(i,p.numberOfArguments+2),r.push(u),4!==h[n+1].type&&(r.push(ls),i.push(p.numberOfArguments+2))):9===g?(9===b.type?b.value===Ua.math.add?(b.value=m,b.show=v,qa(i,1)):b.value===Ua.math.sub&&"-"===v&&(b.value=Ua.math.add,b.show="+",qa(i,1)):5!==b.type&&7!==b.type&&1!==b.type&&3!==b.type&&13!==b.type?"-"===f&&(a=Za,l=Qa,qa(i,2).push(2),r.push(as),r.push(ls)):(r.push(u),qa(i,2)),a=Za,l=Qa):10===g?(a=Za,l=Qa,qa(i,2),r.push(u)):11===g?(a=Za,l=Qa,r.push(u)):12===g?(a=Za,l=Qa,qa(i,6),r.push(u),4!==h[n+1].type&&(r.push(ls),i.push(6))):13===g&&(a=Ga,l=es,r.push(u)),qa(i,-1),c=f}else if(n>0&&n<h.length-1&&1===h[n+1].type&&(1===h[n-1].type||6===h[n-1].type))throw new Ua.Exception("Unexpected Space")}for(d=i.length;d--;)r.push(ss);if(!0!==a[5])throw new Ua.Exception("complete the expression");for(;s--;)r.push(ss);return r.push(ss),new Ua(r)};var cs=Ua;cs.prototype.toPostfix=function(){for(var e,t,n,r,i,o=[],a=[{value:"(",type:4,pre:0}],s=this.value,l=1;l<s.length;l++)if(1===s[l].type||3===s[l].type||13===s[l].type)1===s[l].type&&(s[l].value=Number(s[l].value)),o.push(s[l]);else if(4===s[l].type)a.push(s[l]);else if(5===s[l].type)for(;4!==(t=a.pop()).type;)o.push(t);else if(11===s[l].type){for(;4!==(t=a.pop()).type;)o.push(t);a.push(t)}else{r=(e=s[l]).pre,n=(i=a[a.length-1]).pre;var c="Math.pow"==i.value&&"Math.pow"==e.value;if(r>n)a.push(e);else{for(;n>=r&&!c||c&&r<n;)t=a.pop(),i=a[a.length-1],o.push(t),n=i.pre,c="Math.pow"==e.value&&"Math.pow"==i.value;a.push(e)}}return new cs(o)};var us=cs;us.prototype.postfixEval=function(e){(e=e||{}).PI=Math.PI,e.E=Math.E;for(var t,n,r,i=[],o=this.value,a=void 0!==e.n,s=0;s<o.length;s++)if(1===o[s].type)i.push({value:o[s].value,type:1});else if(3===o[s].type)i.push({value:e[o[s].value],type:1});else if(0===o[s].type)void 0===i[i.length-1].type?i[i.length-1].value.push(o[s]):i[i.length-1].value=o[s].value(i[i.length-1].value);else if(7===o[s].type)void 0===i[i.length-1].type?i[i.length-1].value.push(o[s]):i[i.length-1].value=o[s].value(i[i.length-1].value);else if(8===o[s].type){for(var l=[],c=0;c<o[s].numberOfArguments;c++)l.push(i.pop().value);i.push({type:1,value:o[s].value.apply(o[s],l.reverse())})}else 10===o[s].type?(t=i.pop(),void 0===(n=i.pop()).type?(n.value=n.concat(t),n.value.push(o[s]),i.push(n)):void 0===t.type?(t.unshift(n),t.push(o[s]),i.push(t)):i.push({type:1,value:o[s].value(n.value,t.value)})):2===o[s].type||9===o[s].type?(t=i.pop(),void 0===(n=i.pop()).type?((n=n.concat(t)).push(o[s]),i.push(n)):void 0===t.type?(t.unshift(n),t.push(o[s]),i.push(t)):i.push({type:1,value:o[s].value(n.value,t.value)})):12===o[s].type?(void 0!==(t=i.pop()).type&&(t=[t]),n=i.pop(),r=i.pop(),i.push({type:1,value:o[s].value(r.value,n.value,new us(t))})):13===o[s].type&&(a?i.push({value:e[o[s].value],type:3}):i.push([o[s]]));if(i.length>1)throw new us.Exception("Uncaught Syntax error");return i[0].value>1e15?"Infinity":parseFloat(i[0].value.toFixed(15))},us.eval=function(e,t,n){return void 0===t?this.lex(e).toPostfix().postfixEval():void 0===n?void 0!==t.length?this.lex(e,t).toPostfix().postfixEval():this.lex(e).toPostfix().postfixEval(t):this.lex(e,t).toPostfix().postfixEval(n)};var hs=us;hs.prototype.formulaEval=function(){for(var e,t,n,r=[],i=this.value,o=0;o<i.length;o++)1===i[o].type||3===i[o].type?r.push({value:3===i[o].type?i[o].show:i[o].value,type:1}):13===i[o].type?r.push({value:i[o].show,type:1}):0===i[o].type?r[r.length-1]={value:i[o].show+("-"!=i[o].show?"(":"")+r[r.length-1].value+("-"!=i[o].show?")":""),type:0}:7===i[o].type?r[r.length-1]={value:(1!=r[r.length-1].type?"(":"")+r[r.length-1].value+(1!=r[r.length-1].type?")":"")+i[o].show,type:7}:10===i[o].type?(e=r.pop(),t=r.pop(),"P"===i[o].show||"C"===i[o].show?r.push({value:"<sup>"+t.value+"</sup>"+i[o].show+"<sub>"+e.value+"</sub>",type:10}):r.push({value:(1!=t.type?"(":"")+t.value+(1!=t.type?")":"")+"<sup>"+e.value+"</sup>",type:1})):2===i[o].type||9===i[o].type?(e=r.pop(),t=r.pop(),r.push({value:(1!=t.type?"(":"")+t.value+(1!=t.type?")":"")+i[o].show+(1!=e.type?"(":"")+e.value+(1!=e.type?")":""),type:i[o].type})):12===i[o].type&&(e=r.pop(),t=r.pop(),n=r.pop(),r.push({value:i[o].show+"("+n.value+","+t.value+","+e.value+")",type:12}));return r[0].value};var ps,ds=Ra,fs=Ha,gs=hs,ms=/(\+|\-|\*|\\|[^a-z]|)(\s*)(\()/g,ys=function(e,t){function n(e,r,i){if(ps++>100)throw ps=0,new Error("Call stack overflow for "+i);if(""===e)throw new Error(r+"(): '"+i+"' must contain a non-whitespace string");e=function(e,t){e=e.replace(/((?:\-[a-z]+\-)?calc)/g,"");var r,i="",o=e;for(;r=ms.exec(o);){r[0].index>0&&(i+=o.substring(0,r[0].index));var a=ds("(",")",o.substring([0].index));if(""===a.body)throw new Error("'"+e+"' must contain a non-whitespace string");var s=n(a.body,"",t);i+=a.pre+s,o=a.post}return i+o}(e,i);var o=function(e){var t=[],n=[],r=/[\.0-9]([%a-z]+)/gi,i=r.exec(e);for(;i;)i&&i[1]&&(-1===n.indexOf(i[1].toLowerCase())&&(t.push(i[1]),n.push(i[1].toLowerCase())),i=r.exec(e));return t}(e);if(o.length>1||e.indexOf("var(")>-1)return r+"("+e+")";var a=o[0]||"";"%"===a&&(e=e.replace(/\b[0-9\.]+%/g,function(e){return.01*parseFloat(e.slice(0,-1))}));var s,l=e.replace(new RegExp(a,"gi"),"");try{s=gs.eval(l)}catch(t){return r+"("+e+")"}return"%"===a&&(s*=100),(r.length||"%"===a)&&(s=Math.round(s*t)/t),s+=a}return ps=0,t=Math.pow(10,void 0===t?5:t),e=e.replace(/\n+/g," "),fs(e,/((?:\-[a-z]+\-)?calc)\(/,n)};var vs=ys;const{memoize:bs}=r;var xs="__react_svg_text_measurement_id";var ws=bs(function(e,t){try{var n=document.getElementById(xs);if(!n){var r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("aria-hidden","true"),r.style.width="0",r.style.height="0",r.style.position="absolute",r.style.top="-100%",r.style.left="-100%",(n=document.createElementNS("http://www.w3.org/2000/svg","text")).setAttribute("id",xs),r.appendChild(n),document.body.appendChild(r)}return Object.assign(n.style,t),n.textContent=e,n.getComputedTextLength()}catch(e){return null}},function(e,t){return e+"_"+JSON.stringify(t)}),Cs=["verticalAnchor","scaleToFit","angle","width","lineHeight","capHeight","children","style"];function _s(e){return"number"==typeof e}function ks(e){return"number"==typeof e&&Number.isFinite(e)||"string"==typeof e}function Ss(e){var t=e.verticalAnchor,n=void 0===t?"end":t,r=e.scaleToFit,i=void 0!==r&&r,o=e.angle,a=e.width,s=e.lineHeight,l=void 0===s?"1em":s,c=e.capHeight,u=void 0===c?"0.71em":c,h=e.children,p=e.style,d=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,Cs),g=d.x,m=void 0===g?0:g,y=d.y,v=void 0===y?0:y,b=!ks(m)||!ks(v),x=f.exports.useMemo(function(){return{wordsWithWidth:(null==h?[]:h.toString().split(/(?:(?!\u00A0+)\s+)/)).map(function(e){return{word:e,wordWidth:ws(e,p)||0}}),spaceWidth:ws(" ",p)||0}},[h,p]),w=x.wordsWithWidth,C=x.spaceWidth,_=f.exports.useMemo(function(){return b?[]:a||i?w.reduce(function(e,t){var n=t.word,r=t.wordWidth,o=e[e.length-1];if(o&&(null==a||i||(o.width||0)+r+C<a))o.words.push(n),o.width=o.width||0,o.width+=r+C;else{var s={words:[n],width:r};e.push(s)}return e},[]):[{words:null==h?[]:h.toString().split(/(?:(?!\u00A0+)\s+)/)}]},[b,a,i,h,w,C]),k=f.exports.useMemo(function(){return b?"":vs("start"===n?"calc("+u+")":"middle"===n?"calc("+(_.length-1)/2+" * -"+l+" + ("+u+" / 2))":"calc("+(_.length-1)+" * -"+l+")")},[b,n,u,_.length,l]),S=f.exports.useMemo(function(){var e=[];if(b)return"";if(_s(m)&&_s(v)&&_s(a)&&i&&_.length>0){var t=_[0].width||1,n="shrink-only"===i?Math.min(a/t,1):a/t,r=n,s=m-n*m,l=v-r*v;e.push("matrix("+n+", 0, 0, "+r+", "+s+", "+l+")")}return o&&e.push("rotate("+o+", "+m+", "+v+")"),e.length>0?e.join(" "):""},[b,m,v,a,i,_,o]);return{wordsByLines:_,startDy:k,transform:S}}var Es=["dx","dy","textAnchor","innerRef","innerTextRef","verticalAnchor","angle","lineHeight","scaleToFit","capHeight","width"];function Os(){return Os=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Os.apply(this,arguments)}var Ls={overflow:"visible"};function Ms(e){var t=e.dx,n=void 0===t?0:t,r=e.dy,i=void 0===r?0:r,o=e.textAnchor,a=void 0===o?"start":o,s=e.innerRef,l=e.innerTextRef;e.verticalAnchor,e.angle;var c=e.lineHeight,u=void 0===c?"1em":c;e.scaleToFit,e.capHeight,e.width;var h=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,Es),p=h.x,d=void 0===p?0:p,f=h.fontSize,g=Ss(e),m=g.wordsByLines,y=g.startDy,v=g.transform;return Z.createElement("svg",{ref:s,x:n,y:i,fontSize:f,style:Ls},m.length>0?Z.createElement("text",Os({ref:l,transform:v},h,{textAnchor:a}),m.map(function(e,t){return Z.createElement("tspan",{key:t,x:d,dy:0===t?y:u},e.words.join(" "))})):null)}var As={top:"top",left:"left",right:"right",bottom:"bottom"};const Ts=l;function Ps(){return Ps=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ps.apply(this,arguments)}function Rs(e){var t=e.hideTicks,n=e.horizontal,r=e.orientation,i=e.tickClassName,o=e.tickComponent,a=e.tickLabelProps,s=e.tickStroke,l=void 0===s?"#222":s,c=e.tickTransform,u=e.ticks,h=e.strokeWidth,p=e.tickLineProps;return u.map(function(e){var s,u=e.value,d=e.index,f=e.from,g=e.to,m=e.formattedValue,y=null!=(s=a[d])?s:{},v=Math.max(10,"number"==typeof y.fontSize&&y.fontSize||0),b=g.y+(n&&r!==As.top?v:0);return Z.createElement(Lo,{key:"visx-tick-"+u+"-"+d,className:Ts("visx-axis-tick",i),transform:c},!t&&Z.createElement(wa,Ps({from:f,to:g,stroke:l,strokeWidth:h,strokeLinecap:"square"},p)),o?o(Ps({},y,{x:g.x,y:b,formattedValue:m})):Z.createElement(Ms,Ps({x:g.x,y:b},y),m))})}const Ns=l;function Ds(){return Ds=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ds.apply(this,arguments)}var js={textAnchor:"middle",fontFamily:"Arial",fontSize:10,fill:"#222"};function Is(e){var t=e.axisFromPoint,n=e.axisLineClassName,r=e.axisToPoint,i=e.hideAxisLine,o=e.hideTicks,a=e.horizontal,s=e.label,l=void 0===s?"":s,c=e.labelClassName,u=e.labelOffset,h=void 0===u?14:u,p=e.labelProps,d=e.orientation,f=void 0===d?As.bottom:d,g=e.scale,m=e.stroke,y=void 0===m?"#222":m,v=e.strokeDasharray,b=e.strokeWidth,x=void 0===b?1:b,w=e.tickClassName,C=e.tickComponent,_=e.tickLineProps,k=e.tickLabelProps,S=e.tickLength,E=void 0===S?8:S,O=e.tickStroke,L=void 0===O?"#222":O,M=e.tickTransform,A=e.ticks,T=e.ticksComponent,P=void 0===T?Rs:T,R=Ds({},js,p),N=Ds({},js,"object"==typeof k?k:null),D=A.map(function(e){var t=e.value,n=e.index;return"function"==typeof k?k(t,n,A):N}),j=Math.max.apply(Math,[10].concat(D.map(function(e){return"number"==typeof e.fontSize?e.fontSize:0})));return Z.createElement(Z.Fragment,null,P({hideTicks:o,horizontal:a,orientation:f,scale:g,tickClassName:w,tickComponent:C,tickLabelProps:D,tickStroke:L,tickTransform:M,ticks:A,strokeWidth:x,tickLineProps:_}),!i&&Z.createElement(wa,{className:Ns("visx-axis-line",n),from:t,to:r,stroke:y,strokeWidth:x,strokeDasharray:v}),l&&Z.createElement(Ms,Ds({className:Ns("visx-axis-label",c)},function(e){var t,n,r,i=e.labelOffset,o=e.labelProps,a=e.orientation,s=e.range,l=e.tickLabelFontSize,c=e.tickLength,u=a===As.left||a===As.top?-1:1;if(a===As.top||a===As.bottom){var h=a===As.bottom&&"number"==typeof o.fontSize?o.fontSize:0;t=(Number(s[0])+Number(s[s.length-1]))/2,n=u*(c+i+l+h)}else t=u*((Number(s[0])+Number(s[s.length-1]))/2),n=-(c+i),r="rotate("+90*u+")";return{x:t,y:n,transform:r}}({labelOffset:h,labelProps:R,orientation:f,range:g.range(),tickLabelFontSize:j,tickLength:E}),R),l))}function $s(e,t){var n=e.x,r=e.y;return new Mo(t?{x:n,y:r}:{x:r,y:n})}function Fs(){return Fs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fs.apply(this,arguments)}const zs=l;var Vs=["children","axisClassName","hideAxisLine","hideTicks","hideZero","innerRef","left","numTicks","orientation","rangePadding","scale","tickFormat","tickLength","tickValues","top"];function Hs(){return Hs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hs.apply(this,arguments)}function Ws(e){var t,n=e.children,r=void 0===n?Is:n,i=e.axisClassName,o=e.hideAxisLine,a=void 0!==o&&o,s=e.hideTicks,l=void 0!==s&&s,c=e.hideZero,u=void 0!==c&&c,h=e.innerRef,p=e.left,d=void 0===p?0:p,f=e.numTicks,g=void 0===f?10:f,m=e.orientation,y=void 0===m?As.bottom:m,v=e.rangePadding,b=void 0===v?0:v,x=e.scale,w=e.tickFormat,C=e.tickLength,_=void 0===C?8:C,k=e.tickValues,S=e.top,E=void 0===S?0:S,O=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,Vs),L=null!=w?w:function(e){return"tickFormat"in e?e.tickFormat():Ho}(x),M=y===As.left,A=y===As.top,T=A||y===As.bottom,P=function(e,t){void 0===t&&(t="center");var n=e;if("start"!==t&&"bandwidth"in n){var r=n.bandwidth();return"center"===t&&(r/=2),n.round()&&(r=Math.round(r)),function(e){var t=n(e);return"number"==typeof t?t+r:t}}return e}(x),R=M||A?-1:1,N=x.range(),D=(void 0===(t=b)&&(t=0),"number"==typeof t?{start:t,end:t}:Fs({start:0,end:0},t)),j=$s({x:Number(N[0])+.5-D.start,y:0},T),I=$s({x:Number(N[N.length-1])+.5+D.end,y:0},T),$=(null!=k?k:Vo(x,g)).filter(function(e){return!u||0!==e&&"0"!==e}).map(function(e,t){return{value:e,index:t}}),F=$.map(function(e){var t=e.value,n=e.index,r=zo(P(t));return{value:t,index:n,from:$s({x:r,y:0},T),to:$s({x:r,y:_*R},T),formattedValue:L(t,n,$)}});return Z.createElement(Lo,{className:zs("visx-axis",i),innerRef:h,top:E,left:d},r(Hs({},O,{axisFromPoint:j,axisToPoint:I,hideAxisLine:a,hideTicks:l,hideZero:u,horizontal:T,numTicks:g,orientation:y,rangePadding:b,scale:x,tickFormat:L,tickLength:_,tickPosition:P,tickSign:R,ticks:F})))}const Bs=l;var Us=["axisClassName","labelOffset","tickLength","tickLabelProps"];function qs(){return qs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qs.apply(this,arguments)}var Ys={dx:"-0.25em",dy:"0.25em",fill:"#222",fontFamily:"Arial",fontSize:10,textAnchor:"end"};function Xs(e){var t=e.axisClassName,n=e.labelOffset,r=void 0===n?36:n,i=e.tickLength,o=void 0===i?8:i,a=e.tickLabelProps,s=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,Us),l="function"==typeof a?a:qs({},Ys,a);return Z.createElement(Ws,qs({axisClassName:Bs("visx-axis-left",t),labelOffset:r,orientation:As.left,tickLabelProps:l,tickLength:o},s))}const Ks=l;var Zs=["axisClassName","labelOffset","tickLength","tickLabelProps"];function Gs(){return Gs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gs.apply(this,arguments)}var Js={dy:"0.25em",fill:"#222",fontFamily:"Arial",fontSize:10,textAnchor:"middle"};function Qs(e){var t=e.axisClassName,n=e.labelOffset,r=void 0===n?8:n,i=e.tickLength,o=void 0===i?8:i,a=e.tickLabelProps,s=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,Zs),l="function"==typeof a?a:Gs({},Js,a);return Z.createElement(Ws,Gs({axisClassName:Ks("visx-axis-bottom",t),labelOffset:r,orientation:As.bottom,tickLabelProps:l,tickLength:o},s))}const el=n,{styled:tl}=o,{Check:nl}=c,{Close:rl}=c,{color:il}=i;const ol=tl(nl)(({theme:e})=>({borderRadius:e.spacing(2),color:il.defaults.WHITE,fontSize:"16px",width:"16px",height:"16px",padding:"2px",border:`1px solid ${il.defaults.WHITE}`,stroke:"initial",boxSizing:"unset",backgroundColor:il.correct(),display:"block","&.small":{fontSize:"10px",width:"10px",height:"10px"}})),al=tl(rl)(({theme:e})=>({borderRadius:e.spacing(2),color:il.defaults.WHITE,fontSize:"16px",width:"16px",height:"16px",padding:"2px",border:`1px solid ${il.defaults.WHITE}`,stroke:"initial",boxSizing:"unset",backgroundColor:il.incorrectWithIcon(),display:"block","&.small":{fontSize:"10px",width:"10px",height:"10px"}})),sl=({scale:e,x:t,y:n,correctness:r,interactive:i})=>{if(!r||!i)return null;const o=e?e.x(t):t,a=e?e.y(n):n,s="correct"===r.value;return Z.createElement("foreignObject",{x:o-11,y:a-11,width:22,height:22},s?Z.createElement(ol,{title:r.label}):Z.createElement(al,{title:r.label}))},ll=({scale:e,x:t,correctness:n,correctData:r,label:i})=>{if(n&&"incorrect"===n.value){const o=parseFloat(function(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}([r,"access",e=>e.find,"call",e=>e(e=>e.label===i),"optionalAccess",e=>e.value]));if(isNaN(o))return null;const a=e.y(o)-7.5,s=e.x(t)-7.5;return Z.createElement("foreignObject",{x:s,y:a,width:15,height:15},Z.createElement(ol,{className:"small",title:n.label}))}return null},cl=({correctness:e,interactive:t})=>e&&t?"correct"===e.value?Z.createElement(ol,{title:e.label}):Z.createElement(al,{title:e.label}):null;sl.propTypes={scale:el.shape({x:el.func,y:el.func}),x:el.number.isRequired,y:el.number.isRequired,correctness:el.shape({value:el.string,label:el.string}),interactive:el.bool},ll.propTypes={scale:el.shape({x:el.func,y:el.func}).isRequired,x:el.number.isRequired,correctness:el.shape({value:el.string,label:el.string}),correctData:el.arrayOf(el.shape({label:el.string,value:el.oneOfType([el.string,el.number])})),label:el.string},cl.propTypes={correctness:el.shape({value:el.string,label:el.string}),interactive:el.bool};const ul=(e,t)=>`${t}-${e.label||"-"}`,hl=(e,t,n,r)=>{const i=n||400,o=t&&t.length?t.map(ul):["default"];switch(r){case"bar":case"dotPlot":case"linePlot":return $o({range:[0,i],domain:o,padding:.2});case"histogram":default:return $o({range:[0,i],domain:o,padding:0});case"lineCross":case"lineDot":return a={domain:o,range:[0,i]},Fo(Sn(),a)}var a},pl=(e={})=>{const t=[];let n=e.min;for(;n<=e.max;)t.push(n),n=Math.round(1e4*(n+e.step))/1e4;return t},dl=e=>{let t,n;return e>91?(t=1.3,n=-55):e>45?(t=1.1,n=-45):e>40?(t=.5+.02*(e-34),n=-25):e>30?(t=.5+.02*(e-34),n=-20):(t=.5*Math.pow(.98,34-e),n=-15),{scale:t,deltay:n}},fl=(e,t)=>(e-57*t)/2;var gl={};const ml=a,yl=n;Object.defineProperty(gl,"__esModule",{value:!0});var vl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bl=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),xl=ml,wl=_l(xl),Cl=_l(yl);function _l(e){return e&&e.__esModule?e:{default:e}}var kl={position:"absolute",top:0,left:0,visibility:"hidden",height:0,overflow:"scroll",whiteSpace:"pre"},Sl=["extraWidth","injectStyles","inputClassName","inputRef","inputStyle","minWidth","onAutosize","placeholderIsMinWidth"],El=function(e,t){t.style.fontSize=e.fontSize,t.style.fontFamily=e.fontFamily,t.style.fontWeight=e.fontWeight,t.style.fontStyle=e.fontStyle,t.style.letterSpacing=e.letterSpacing,t.style.textTransform=e.textTransform},Ol=!("undefined"==typeof window||!window.navigator)&&/MSIE |Trident\/|Edge\//.test(window.navigator.userAgent),Ll=function(){return Ol?"_"+Math.random().toString(36).substr(2,12):void 0},Ml=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.inputRef=function(e){n.input=e,"function"==typeof n.props.inputRef&&n.props.inputRef(e)},n.placeHolderSizerRef=function(e){n.placeHolderSizer=e},n.sizerRef=function(e){n.sizer=e},n.state={inputWidth:t.minWidth,inputId:t.id||Ll()},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(e,xl.Component),bl(e,[{key:"componentDidMount",value:function(){this.mounted=!0,this.copyInputStyles(),this.updateInputWidth()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=e.id;t!==this.props.id&&this.setState({inputId:t||Ll()})}},{key:"componentDidUpdate",value:function(e,t){t.inputWidth!==this.state.inputWidth&&"function"==typeof this.props.onAutosize&&this.props.onAutosize(this.state.inputWidth),this.updateInputWidth()}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"copyInputStyles",value:function(){if(this.mounted&&window.getComputedStyle){var e=this.input&&window.getComputedStyle(this.input);e&&(El(e,this.sizer),this.placeHolderSizer&&El(e,this.placeHolderSizer))}}},{key:"updateInputWidth",value:function(){if(this.mounted&&this.sizer&&void 0!==this.sizer.scrollWidth){var e=void 0;e=this.props.placeholder&&(!this.props.value||this.props.value&&this.props.placeholderIsMinWidth)?Math.max(this.sizer.scrollWidth,this.placeHolderSizer.scrollWidth)+2:this.sizer.scrollWidth+2,(e+="number"===this.props.type&&void 0===this.props.extraWidth?16:parseInt(this.props.extraWidth)||0)<this.props.minWidth&&(e=this.props.minWidth),e!==this.state.inputWidth&&this.setState({inputWidth:e})}}},{key:"getInput",value:function(){return this.input}},{key:"focus",value:function(){this.input.focus()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"renderStyles",value:function(){var e=this.props.injectStyles;return Ol&&e?wl.default.createElement("style",{dangerouslySetInnerHTML:{__html:"input#"+this.state.inputId+"::-ms-clear {display: none;}"}}):null}},{key:"render",value:function(){var e=[this.props.defaultValue,this.props.value,""].reduce(function(e,t){return null!=e?e:t}),t=vl({},this.props.style);t.display||(t.display="inline-block");var n=vl({boxSizing:"content-box",width:this.state.inputWidth+"px"},this.props.inputStyle),r=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(this.props,[]);return function(e){Sl.forEach(function(t){return delete e[t]})}(r),r.className=this.props.inputClassName,r.id=this.state.inputId,r.style=n,wl.default.createElement("div",{className:this.props.className,style:t},this.renderStyles(),wl.default.createElement("input",vl({},r,{ref:this.inputRef})),wl.default.createElement("div",{ref:this.sizerRef,style:kl},e),this.props.placeholder?wl.default.createElement("div",{ref:this.placeHolderSizerRef,style:kl},this.props.placeholder):null)}}]),e}();Ml.propTypes={className:Cl.default.string,defaultValue:Cl.default.any,extraWidth:Cl.default.oneOfType([Cl.default.number,Cl.default.string]),id:Cl.default.string,injectStyles:Cl.default.bool,inputClassName:Cl.default.string,inputRef:Cl.default.func,inputStyle:Cl.default.object,minWidth:Cl.default.oneOfType([Cl.default.number,Cl.default.string]),onAutosize:Cl.default.func,onChange:Cl.default.func,placeholder:Cl.default.string,placeholderIsMinWidth:Cl.default.bool,style:Cl.default.object,value:Cl.default.any},Ml.defaultProps={minWidth:1,injectStyles:!0};var Al=gl.default=Ml;const{color:Tl}=i,Pl=(e="fill")=>({[e]:`var(--graph-disabled, ${Tl.disabled()})`,pointerEvents:"none",border:"none"}),Rl=(e="fill")=>({[e]:Tl.correct(),pointerEvents:"none",border:`solid 1px ${Tl.correct()}`}),Nl=(e="fill")=>({[e]:Tl.incorrect(),pointerEvents:"none",border:`solid 1px ${Tl.incorrect()}`}),Dl=l,{styled:jl}=o,Il=n,{color:$l}=i,{renderMath:Fl}=e;function zl(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}const Vl=jl("div")({display:"flex",flexDirection:"column",alignItems:"center"});jl("input")(({theme:e})=>({float:"right",fontFamily:e.typography.fontFamily,fontSize:e.typography.fontSize,border:"none","&.correct":Rl("color"),"&.incorrect":Nl("color"),"&.disabled":{backgroundColor:"transparent !important"},"&.error":{border:`2px solid ${e.palette.error.main}`}}));const Hl=jl("div")(({theme:e})=>({pointerEvents:"auto",textAlign:"center",fontSize:e.typography.fontSize+2,fontFamily:e.typography.fontFamily,color:$l.primaryDark(),paddingTop:e.typography.fontSize/2,"&.disabled":{...Pl("color"),backgroundColor:"transparent !important"},"&.error":{border:`2px solid ${e.palette.error.main}`},"&.correct":{...Rl("color")},"&.incorrect":{...Nl("color")}}));function Wl(e){const t=zl([e,"optionalAccess",e=>e.trim,"call",e=>e()])||"";let n,r,i="",o=t.split(" ");if(n=o[1]&&o[1].includes("/")?o[1].split("/")||"":zl([t,"optionalAccess",e=>e.split,"call",e=>e("/")])||"",function(e){const t=zl([e,"optionalAccess",e=>e.trim,"call",e=>e()])||"";return new RegExp(/^[1-9]*[0-9]*\s?[1-9][0-9]*\/[1-9][0-9]*$/).test(t)}(e))return o[0]&&o[1]&&(i=o[0]),r=`\\(${i}\\frac{${n[0]}}{${n[1]}}\\)`,r}const Bl=e=>{const[t,n]=f.exports.useState(null),r=f.exports.useCallback(e=>n(e),null),{mark:i={},disabled:o,inputRef:a,barWidth:s,rotate:l,correctness:c,autoFocus:u,error:h,isHiddenLabel:p,limitCharacters:d,correctnessIndicator:g}=e,[m,y]=f.exports.useState(i.label),[v,b]=f.exports.useState(Wl(i.label)),[x,w]=f.exports.useState(!1);let C=f.exports.useRef(null);let _={};return l&&(_={width:"unset",textAlign:"left"}),f.exports.useEffect(()=>{y(i.label)},[i.label]),f.exports.useEffect(()=>{Fl(C)},[]),Z.createElement(Vl,null,g,!1===x&&void 0!==v?Z.createElement(Hl,{ref:e=>{C=e,"function"==typeof a&&a(e)},dangerouslySetInnerHTML:{__html:Wl(m)},className:Dl({disabled:o,error:h,correct:i.editable&&"correct"===zl([c,"optionalAccess",e=>e.label]),incorrect:i.editable&&"incorrect"===zl([c,"optionalAccess",e=>e.label])}),onClick:()=>w(!0),style:{minWidth:s,position:"fixed",transformOrigin:"left",transform:`rotate(${l}deg)`,visibility:p?"hidden":"unset",marginTop:g?"24px":"0"}}):Z.createElement(Al,{inputRef:e=>{r(e),"function"==typeof a&&a(e)},name:"mark-label-input",autoFocus:x||u,disabled:o,inputClassName:Dl(c&&i.editable?c.label:null,o&&"disabled",h&&"error"),inputStyle:{minWidth:s,textAlign:"center",background:"transparent",boxSizing:"border-box",paddingLeft:0,paddingRight:0,border:"none",..._},value:m,style:{position:"fixed",pointerEvents:"auto",top:0,left:0,minWidth:s,transformOrigin:"left",transform:`rotate(${l}deg)`,visibility:p?"hidden":"unset",marginTop:g?"24px":"0"},onChange:e=>{d&&e.target.value&&e.target.value.length>20||y(e.target.value)},onBlur:t=>{b(Wl(i.label)),w(!1),e.onChange(t.target.value)}}))};Bl.propTypes={autoFocus:Il.bool,disabled:Il.bool,error:Il.any,onChange:Il.func,graphProps:yt,inputRef:Il.func,mark:Il.object,barWidth:Il.number,rotate:Il.number,correctness:Il.shape({value:Il.string,label:Il.string}),isHiddenLabel:Il.bool,limitCharacters:Il.bool,correctnessIndicator:Il.node};const Ul=n,{styled:ql}=o,{Checkbox:Yl}=u,{color:Xl}=i,{AlertDialog:Kl}=p,{renderMath:Zl}=e;function Gl(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}const Jl=ql("text")(({theme:e})=>({fontSize:e.typography.fontSize-2,fill:e.palette.error.main})),Ql=ql(Yl)(()=>({color:`${Xl.tertiary()} !important`})),ec=ql("g")(({theme:e})=>({"& .vx-axis-line":{stroke:Xl.visualElementsColors.AXIS_LINE_COLOR,strokeWidth:2},"& .vx-axis-tick":{fill:Xl.visualElementsColors.AXIS_TICK_COLOR,"& line":{stroke:Xl.visualElementsColors.AXIS_TICK_COLOR,strokeWidth:2},fontFamily:Gl([e,"access",e=>e.typography,"access",e=>e.body1,"optionalAccess",e=>e.fontFamily]),fontSize:e.typography.fontSize,textAnchor:"middle"}})),tc=e=>({borderRadius:e.spacing(2),color:Xl.defaults.WHITE,fontSize:"16px",width:"16px",height:"16px",padding:"2px",border:`1px solid ${Xl.defaults.WHITE}`,boxSizing:"unset"}),nc={backgroundColor:Xl.incorrectWithIcon()},rc={backgroundColor:Xl.correct()};class ic extends Z.Component{static __initStatic(){this.propTypes={defineChart:Ul.bool,error:Ul.any}}constructor(e){super(e),ic.prototype.__init.call(this),ic.prototype.__init2.call(this),ic.prototype.__init3.call(this),ic.prototype.__init4.call(this),ic.prototype.__init5.call(this),this.state={dialog:{open:!1}}}componentDidUpdate(e){this.props.autoFocus&&!e.autoFocus&&this.props.onAutoFocusUsed()}__init(){this.handleAlertDialog=(e,t)=>this.setState({dialog:{open:e}},t)}__init2(){this.changeCategory=(e,t)=>{const{categories:n,onChangeCategory:r}=this.props;r(e,{...n[e],label:t})}}__init3(){this.changeInteractive=(e,t)=>{const{categories:n,onChangeCategory:r}=this.props,i=n[e];t?r(e,{...i,interactive:!i.interactive}):this.setState({dialog:{open:!0,title:"Warning",text:"This will remove the correct answer value that has been defined for this category.",onConfirm:()=>this.handleAlertDialog(!1,r(e,{...i,interactive:!i.interactive})),onClose:()=>this.handleAlertDialog(!1)}})}}__init4(){this.changeEditable=(e,t)=>{const{categories:n,onChangeCategory:r}=this.props,i=n[e];t?r(e,{...i,editable:!i.editable||!1}):this.setState({dialog:{open:!0,title:"Warning",text:"This will remove the correct answer category name that has been defined for this category.",onConfirm:()=>this.handleAlertDialog(!1,r(e,{...i,editable:!i.editable||!1})),onClose:()=>this.handleAlertDialog(!1)}})}}__init5(){this.splitText=(e,t)=>{let n=[];for(;(e||"").length>0;){let r;e.length>t?(r=e.lastIndexOf(" ",t),-1===r&&(r=t)):r=e.length,n.push(e.substring(0,r)),e=e.substring(r).trim()}return n}}render(){const{categories:e,xBand:t,bandWidth:n,barWidth:r,rotate:i,top:o,graphProps:a,defineChart:s,chartingOptions:l,x:c,y:u,formattedValue:h,changeInteractiveEnabled:p,changeEditableEnabled:d,error:f,autoFocus:g,hiddenLabelRef:m,showCorrectness:y}=this.props;if(!h)return null;const v={correctnessIcon:tc,incorrectIcon:nc,correctIcon:rc},{dialog:b}=this.state,{changeEditable:x,changeInteractive:w}=l||{},C=parseInt(h.split("-")[0],10),_=e[C],{editable:k,interactive:S,label:E,correctness:O}=_||{},L=t(ul({label:E},C)),M=(e||[]).reduce((e,t)=>(e&&e.label?e.label.length:0)>(t&&t.label?t.label.length:0)?e:t,{label:""}),A=f?[...new Set(Object.values(f))].join(" "):"";return Z.createElement("g",null,Z.createElement("foreignObject",{x:n?L:c-r/2,y:18,width:r,height:4,style:{pointerEvents:"none",overflow:"visible"}},0===C&&Z.createElement(Bl,{isHiddenLabel:!0,inputRef:m,disabled:!0,mark:M,graphProps:a,barWidth:r}),Z.createElement(Bl,{autoFocus:s&&g,inputRef:e=>this.input=e,disabled:!s&&!k,mark:_,graphProps:a,onChange:e=>this.changeCategory(C,e),barWidth:r,rotate:i,correctness:O,error:f&&f[C],limitCharacters:!0,correctnessIndicator:y&&O&&Z.createElement(cl,{correctness:O,interactive:S,classes:v})})),f&&0===C&&Z.createElement(Jl,{y:u+23,height:6,textAnchor:"start"},A),s&&0===C&&Z.createElement("svg",{x:-55,style:{overflow:"visible"}},p&&Z.createElement("text",{y:u+90+o,width:r,height:4,style:{position:"absolute",pointerEvents:"none",wordBreak:"break-word",maxWidth:r,display:"inline-block"}},this.splitText(Gl([w,"optionalAccess",e=>e.authoringLabel]),20).map((e,t)=>Z.createElement("tspan",{key:t,x:"0",dy:""+(t>0?"1.2em":".6em")},e))),d&&Z.createElement("text",{y:u+145+o,width:r,height:4,style:{position:"absolute",pointerEvents:"none",wordBreak:"break-word",maxWidth:r,display:"inline-block"}},this.splitText(Gl([x,"optionalAccess",e=>e.authoringLabel]),20).map((e,t)=>Z.createElement("tspan",{key:t,x:"0",dy:""+(t>0?"1.2em":".6em")},e)))),s&&p&&Z.createElement("foreignObject",{x:c-24,y:u+80+o,width:r,height:4,style:{pointerEvents:"visible",overflow:"visible"}},Z.createElement(Ql,{style:{position:"fixed"},checked:S,onChange:e=>this.changeInteractive(C,e.target.checked)})),s&&d&&Z.createElement("foreignObject",{x:c-24,y:u+130+o,width:r,height:4,style:{pointerEvents:"visible",overflow:"visible"}},Z.createElement(Ql,{style:{position:"fixed"},checked:k,onChange:e=>this.changeEditable(C,e.target.checked)})),Z.createElement("foreignObject",{x:c-24,y:u+100+o,width:r,height:4,style:{pointerEvents:"visible",overflow:"visible"}},Z.createElement(Kl,{open:b.open,title:b.title,text:b.text,onClose:b.onClose,onConfirm:b.onConfirm})))}}ic.__initStatic(),ic.propTypes={categories:Ul.array,xBand:Ul.func,bandWidth:Ul.number,barWidth:Ul.number,rotate:Ul.number,top:Ul.number,x:Ul.number,y:Ul.number,graphProps:Ul.object,formattedValue:Ul.string,onChangeCategory:Ul.func,onChange:Ul.func,error:Ul.object,defineChart:Ul.bool,chartingOptions:Ul.object,changeInteractiveEnabled:Ul.bool,changeEditableEnabled:Ul.bool,autoFocus:Ul.bool,onAutoFocusUsed:Ul.func,showCorrectness:Ul.bool,hiddenLabelRef:Ul.oneOfType([Ul.func,Ul.shape({current:Ul.instanceOf(Element)})])};class oc extends Z.Component{constructor(...e){super(...e),oc.prototype.__init6.call(this)}static __initStatic2(){this.propTypes={bottomScale:Ul.func,categories:Ul.array,defineChart:Ul.bool,error:Ul.any,graphProps:yt.isRequired,xBand:Ul.func,leftAxis:Ul.bool,onChange:Ul.func,onChangeCategory:Ul.func,top:Ul.number,theme:Ul.object,chartingOptions:Ul.object,changeInteractiveEnabled:Ul.bool,changeEditableEnabled:Ul.bool,autoFocus:Ul.bool,onAutoFocusUsed:Ul.func,showCorrectness:Ul.bool,hiddenLabelRef:Ul.oneOfType([Ul.func,Ul.shape({current:Ul.instanceOf(Element)})])}}__init6(){this.state={height:0,width:0}}componentDidMount(){if(this.hiddenLabelRef){const e=this.hiddenLabelRef.getBoundingClientRect(),t=this.hiddenLabelRef;if(t){const n=t.querySelector("[data-latex], [data-raw]"),r=t.querySelector("mjx-container"),i=t.querySelector('[data-math-handled="true"]');!n||i&&r||Zl(this.hiddenLabelRef),this.setState({height:Math.floor(e.height),width:Math.floor(e.width)})}}}componentDidUpdate(){if(this.hiddenLabelRef){const e=Math.floor(this.hiddenLabelRef.getBoundingClientRect().width);e!==this.state.width&&this.setState({width:e})}}render(){const{graphProps:e,xBand:t,leftAxis:n,onChange:r,onChangeCategory:i,categories:o=[],top:a,defineChart:s,chartingOptions:l,changeInteractiveEnabled:c,changeEditableEnabled:u,theme:h,autoFocus:p,onAutoFocusUsed:d,error:f,showCorrectness:g}=this.props,{scale:m={},range:y={},domain:v={},size:b={}}=e||{},{height:x,width:w}=this.state,C=t&&"function"==typeof t.rangeRound&&t.rangeRound([0,b.width]),_=t&&"function"==typeof t.bandwidth&&t.bandwidth(),k=_||m.x&&m.x(v.max)/o.length,S=pl({...y,step:y.labelStep}),E=((e,t)=>t>=2*e?25:0)(h&&h.typography?h.typography.fontSize:14,x),O=w>k?25:0;return Z.createElement(ec,null,n&&Z.createElement(Xs,{scale:m.y,tickLength:10,tickFormat:e=>e,tickValues:S,tickLabelProps:e=>({dy:4,dx:-10-5*(e.toLocaleString().length||1)})}),Z.createElement(Qs,{scale:C,labelProps:{y:60+a},top:m.y&&m.y(y.min),textLabelProps:()=>({textAnchor:"middle"}),tickFormat:e=>e,tickComponent:n=>{const h={hiddenLabelRef:e=>{this.hiddenLabelRef=e},categories:o,xBand:t,bandWidth:_,barWidth:k,rotate:E||O,top:a,defineChart:s,chartingOptions:l,autoFocus:p,onAutoFocusUsed:d,error:f,onChangeCategory:i,changeInteractiveEnabled:c,changeEditableEnabled:u,onChange:r,graphProps:e,x:n.x,y:n.y,formattedValue:n.formattedValue,showCorrectness:g};return Z.createElement(ic,{...h})},autoFocus:p,onAutoFocusUsed:d}))}}oc.__initStatic2();const ac=n;function sc(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}const lc=({width:e,scaleValue:t,color:n})=>Z.createElement("svg",{x:fl(e,t),y:sc([dl,"call",t=>t(e),"optionalAccess",e=>e.deltay]),color:n,width:e,height:e,overflow:"visible",viewBox:`0 0 ${e} ${e}`,style:{overflow:"visible !important"}},Z.createElement("g",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",stroke:"currentColor",transform:`scale(${t})`},Z.createElement("circle",{cx:"28.5",cy:"23.5",r:"22",fill:"white",stroke:"currentColor"}),Z.createElement("path",{d:"M33.5 21.25H23.4609C22.7578 21.25 22.4062 20.4297 22.9141 19.9219L27.9141 14.9219C28.2266 14.6094 28.7344 14.6094 29.0469 14.9219L34.0469 19.9219C34.5547 20.4297 34.2031 21.25 33.5 21.25Z",fill:"currentColor"}),Z.createElement("path",{d:"M23.5 25.75L33.5391 25.75C34.2422 25.75 34.5938 26.5703 34.0859 27.0781L29.0859 32.0781C28.7734 32.3906 28.2656 32.3906 27.9531 32.0781L22.9531 27.0781C22.4453 26.5703 22.7969 25.75 23.5 25.75Z",fill:"currentColor"})));lc.propTypes={width:ac.number.isRequired,scaleValue:ac.number.isRequired,color:ac.string};const cc=n,{styled:uc}=o,{Check:hc}=c,{Close:pc}=c,{color:dc}=i;const fc=uc("svg")(()=>({overflow:"visible !important"})),gc=uc("ellipse")(()=>({fill:"transparent",clipPath:"polygon(50% 0%, 100% 0%, 100% 50%, 0% 50%, 0% 0%)"})),mc=uc(hc)(()=>({backgroundColor:dc.correct(),borderRadius:"16px",color:dc.defaults.WHITE,fontSize:"16px",padding:"2px",border:`4px solid ${dc.defaults.WHITE}`,width:"16px",height:"16px",boxSizing:"unset"})),yc=uc(pc)(()=>({backgroundColor:dc.incorrectWithIcon(),borderRadius:"16px",color:dc.defaults.WHITE,fontSize:"16px",padding:"2px",border:`4px solid ${dc.defaults.WHITE}`,width:"16px",height:"16px",boxSizing:"unset"})),vc=({x:e,y:t,width:n,graphProps:r,interactive:i,isHovered:o,correctness:a,isPlot:s,...l})=>{const{scale:c}=r,u=function(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}([dl,"call",e=>e(n),"optionalAccess",e=>e.scale]);return Z.createElement(fc,{x:e,y:c.y(t)-10,width:n,overflow:"visible"},o&&!a&&i&&Z.createElement(lc,{width:n,scaleValue:u,color:dc.defaults.BORDER_GRAY}),i&&!a&&Z.createElement(gc,{cx:n/2,cy:10,rx:n/2,ry:66,...l}),Z.createElement("defs",null,Z.createElement("filter",{id:"bottomShadow",x:"0",y:"0",width:"140%",height:"140%"},Z.createElement("feGaussianBlur",{in:"SourceAlpha",stdDeviation:"3"}),Z.createElement("feOffset",{dx:"0",dy:"5",result:"offsetblur"}),Z.createElement("feFlood",{floodColor:"#00000033"}),Z.createElement("feComposite",{in2:"offsetblur",operator:"in"}),Z.createElement("feMerge",null,Z.createElement("feMergeNode",null),Z.createElement("feMergeNode",{in:"SourceGraphic"})))),a&&i&&!s&&Z.createElement("foreignObject",{x:n/2-14,y:0,width:40,height:40},"correct"===a.value?Z.createElement(mc,{title:a.label}):Z.createElement(yc,{title:a.label})))};vc.propTypes={x:cc.number.isRequired,y:cc.number.isRequired,width:cc.number,graphProps:yt.isRequired,interactive:cc.bool,isHovered:cc.bool,correctness:cc.shape({value:cc.string,label:cc.string}),isPlot:cc.bool};const bc=vc,xc=on({axis:"y",fromDelta:(e,t)=>{t.x=0;return kt(e).add(kt(t)).y},bounds:(e,{domain:t,range:n})=>{const r={left:0,top:e.y,bottom:e.y,right:0};return _t(r,t,n)},anchorPoint:e=>({x:e.x,y:e.y})})(bc),wc=({dashColor:e})=>Z.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Z.createElement("circle",{cx:"12",cy:"12",r:"11",fill:"white",stroke:e||"#7E8494",strokeWidth:"2",strokeDasharray:"5 5"}),Z.createElement("mask",{id:"path-2-outside-1_3089_3799",maskUnits:"userSpaceOnUse",x:"2",y:"3",width:"19",height:"18",fill:"black"},Z.createElement("rect",{fill:"white",x:"2",y:"3",width:"19",height:"18"}),Z.createElement("path",{d:"M12 20C9.125 20 6.5 18.5 5.0625 16C3.625 13.5312 3.625 10.5 5.0625 8C6.5 5.53125 9.125 4 12 4C14.8438 4 17.4688 5.53125 18.9062 8C20.3438 10.5 20.3438 13.5312 18.9062 16C17.4688 18.5 14.8438 20 12 20ZM15.5312 10.5312H15.5C15.8125 10.25 15.8125 9.78125 15.5 9.46875C15.2188 9.1875 14.75 9.1875 14.4688 9.46875L11 12.9688L9.53125 11.5C9.21875 11.1875 8.75 11.1875 8.46875 11.5C8.15625 11.7812 8.15625 12.25 8.46875 12.5312L10.4688 14.5312C10.75 14.8438 11.2188 14.8438 11.5312 14.5312L15.5312 10.5312Z"})),Z.createElement("path",{d:"M12 20C9.125 20 6.5 18.5 5.0625 16C3.625 13.5312 3.625 10.5 5.0625 8C6.5 5.53125 9.125 4 12 4C14.8438 4 17.4688 5.53125 18.9062 8C20.3438 10.5 20.3438 13.5312 18.9062 16C17.4688 18.5 14.8438 20 12 20ZM15.5312 10.5312H15.5C15.8125 10.25 15.8125 9.78125 15.5 9.46875C15.2188 9.1875 14.75 9.1875 14.4688 9.46875L11 12.9688L9.53125 11.5C9.21875 11.1875 8.75 11.1875 8.46875 11.5C8.15625 11.7812 8.15625 12.25 8.46875 12.5312L10.4688 14.5312C10.75 14.8438 11.2188 14.8438 11.5312 14.5312L15.5312 10.5312Z",fill:"#0EA449"}),Z.createElement("path",{d:"M5.0625 16L5.92942 15.5015L5.92668 15.4968L5.0625 16ZM5.0625 8L4.19831 7.4968L4.19559 7.50153L5.0625 8ZM18.9062 8L19.7732 7.50152L19.7704 7.49681L18.9062 8ZM18.9062 16L18.0421 15.4968L18.0393 15.5015L18.9062 16ZM15.5312 10.5312L16.2384 11.2384L17.9455 9.53125H15.5312V10.5312ZM15.5 10.5312L14.831 9.78796L12.894 11.5312H15.5V10.5312ZM14.4688 9.46875L13.7616 8.76164L13.7585 8.76482L14.4688 9.46875ZM11 12.9688L10.2929 13.6759L11.0032 14.3861L11.7103 13.6727L11 12.9688ZM8.46875 11.5L9.13771 12.2433L9.17684 12.2081L9.21204 12.169L8.46875 11.5ZM8.46875 12.5312L9.17586 11.8241L9.15726 11.8055L9.13771 11.788L8.46875 12.5312ZM10.4688 14.5312L11.212 13.8623L11.1945 13.8427L11.1759 13.8241L10.4688 14.5312ZM12 20V19C9.479 19 7.18657 17.6879 5.92941 15.5015L5.0625 16L4.19559 16.4985C5.81343 19.3121 8.771 21 12 21V20ZM5.0625 16L5.92668 15.4968C4.6714 13.341 4.66824 10.6918 5.92941 8.49847L5.0625 8L4.19559 7.50153C2.58176 10.3082 2.5786 13.7215 4.19832 16.5032L5.0625 16ZM5.0625 8L5.92668 8.50319C7.18712 6.33851 9.48502 5 12 5V4V3C8.76498 3 5.81288 4.72399 4.19832 7.49681L5.0625 8ZM12 4V5C14.4816 5 16.7805 6.33661 18.0421 8.50319L18.9062 8L19.7704 7.49681C18.157 4.72589 15.2059 3 12 3V4ZM18.9062 8L18.0393 8.49847C19.3005 10.6918 19.2973 13.341 18.0421 15.4968L18.9062 16L19.7704 16.5032C21.3902 13.7215 21.387 10.3082 19.7732 7.50153L18.9062 8ZM18.9062 16L18.0393 15.5015C16.7811 17.6898 14.4876 19 12 19V20V21C15.1999 21 18.1564 19.3102 19.7732 16.4985L18.9062 16ZM15.5312 10.5312V9.53125H15.5V10.5312V11.5312H15.5312V10.5312ZM15.5 10.5312L16.169 11.2745C16.9447 10.5764 16.8883 9.44281 16.2071 8.76164L15.5 9.46875L14.7929 10.1759C14.7696 10.1525 14.7344 10.0966 14.7344 10.0117C14.7344 9.92377 14.7735 9.83972 14.831 9.78796L15.5 10.5312ZM15.5 9.46875L16.2071 8.76164C15.5353 8.08987 14.4334 8.08987 13.7616 8.76164L14.4688 9.46875L15.1759 10.1759C15.1167 10.235 15.0442 10.2578 14.9844 10.2578C14.9245 10.2578 14.8521 10.235 14.7929 10.1759L15.5 9.46875ZM14.4688 9.46875L13.7585 8.76482L10.2897 12.2648L11 12.9688L11.7103 13.6727L15.179 10.1727L14.4688 9.46875ZM11 12.9688L11.7071 12.2616L10.2384 10.7929L9.53125 11.5L8.82414 12.2071L10.2929 13.6759L11 12.9688ZM9.53125 11.5L10.2384 10.7929C9.55719 10.1117 8.42362 10.0553 7.72546 10.831L8.46875 11.5L9.21204 12.169C9.16028 12.2265 9.07623 12.2656 8.98828 12.2656C8.90344 12.2656 8.84748 12.2304 8.82414 12.2071L9.53125 11.5ZM8.46875 11.5L7.79979 10.7567C7.04591 11.4352 7.04591 12.5961 7.79979 13.2745L8.46875 12.5312L9.13771 11.788C9.19301 11.8377 9.23438 11.9208 9.23438 12.0156C9.23438 12.1105 9.19301 12.1935 9.13771 12.2433L8.46875 11.5ZM8.46875 12.5312L7.76164 13.2384L9.76164 15.2384L10.4688 14.5312L11.1759 13.8241L9.17586 11.8241L8.46875 12.5312ZM10.4688 14.5312L9.72546 15.2002C10.4236 15.976 11.5572 15.9195 12.2384 15.2384L11.5312 14.5312L10.8241 13.8241C10.8475 13.8008 10.9034 13.7656 10.9883 13.7656C11.0762 13.7656 11.1603 13.8048 11.212 13.8623L10.4688 14.5312ZM11.5312 14.5312L12.2384 15.2384L16.2384 11.2384L15.5312 10.5312L14.8241 9.82414L10.8241 13.8241L11.5312 14.5312Z",fill:"white",mask:"url(#path-2-outside-1_3089_3799)"}));wc.propTypes={dashColor:n.string};const Cc=n,{styled:_c}=o,kc=s,{color:Sc}=i,Ec=kc("pie-lib:chart:bars"),Oc=["#006699","#F59B00","#08916D","#529EE0","#52B7D8","#D9A6C2","#FFB03B","#54A77B","#E16032","#4FD2D2","#F0E442","#E287B2"],Lc=["#003754","#975616","#00503B","#225982","#1F687D","#825E6F","#996428","#255E44","#8A331F","#167A7A","#91862D","#894A65"],Mc=_c(function(e){var t=e.className,n=e.innerRef,r=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,Oa);return Z.createElement("rect",La({ref:n,className:Ea("visx-bar",t)},r))})(()=>({fill:Sc.defaults.TERTIARY}));class Ac extends Z.Component{static __initStatic(){this.propTypes={barColor:Cc.string,onChangeCategory:Cc.func,value:Cc.number,label:Cc.string,xBand:Cc.func,index:Cc.number.isRequired,graphProps:yt.isRequired,interactive:Cc.bool,correctness:Cc.shape({value:Cc.string,label:Cc.string}),correctData:Cc.array,defineChart:Cc.bool}}constructor(e){super(e),Ac.prototype.__init.call(this),Ac.prototype.__init2.call(this),Ac.prototype.__init3.call(this),Ac.prototype.__init4.call(this),Ac.prototype.__init5.call(this),Ac.prototype.__init6.call(this),Ac.prototype.__init7.call(this),this.state={dragValue:void 0,isHovered:!1},this.mouseX=0,this.mouseY=0}componentDidMount(){window.addEventListener("mousemove",this.handleMouseMove)}componentWillUnmount(){window.removeEventListener("mousemove",this.handleMouseMove)}__init(){this.handleMouseMove=e=>{this.mouseX=e.clientX,this.mouseY=e.clientY;const t=this.isMouseInsideSvgElement();this.setState({isHovered:t})}}__init2(){this.isMouseInsideSvgElement=()=>{const e=this.gRef.getBoundingClientRect();return this.mouseX>=e.left&&this.mouseX<=e.right&&this.mouseY>=e.top&&this.mouseY<=e.bottom}}__init3(){this.handleMouseEnter=()=>this.setState({isHovered:!0})}__init4(){this.handleMouseLeave=()=>this.setState({isHovered:!1})}__init5(){this.setDragValue=e=>this.setState({dragValue:e})}__init6(){this.dragStop=()=>{const{label:e,onChangeCategory:t}=this.props,{dragValue:n}=this.state;Ec("[dragStop]",n),void 0!==n&&t({label:e,value:n}),this.setDragValue(void 0)}}__init7(){this.dragValue=(e,t)=>{Ec("[dragValue] next:",t),this.setDragValue(t)}}render(){const{graphProps:e,value:t,label:n,xBand:r,index:i,interactive:o,correctness:a,barColor:s,defineChart:l,correctData:c}=this.props,{scale:u,range:h}=e,{dragValue:p,isHovered:d}=this.state,f=((e,t,n,r,i)=>e&&t&&i?r[n%r.length]:e&&i?Sc.visualElementsColors.ROLLOVER_FILL_BAR_COLOR:t||null)(d,s,i,Lc,o&&!a),g=Number.isFinite(p)?p:t,m=r.bandwidth(),y=u.y(h.max-g),v=r(ul({label:n},i)),b=h.max-g,x=h.max-b,w=c?c.find(e=>e.label===n):null,C=o?xc:bc,_=!!s;return Z.createElement("g",{ref:e=>this.gRef=e,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onTouchStart:this.handleMouseEnter,onTouchEnd:this.handleMouseLeave},Z.createElement(Mc,{x:v,y:u.y(x),width:m,height:y,style:{fill:f}}),a&&"incorrect"===a.value&&(()=>{const e=parseFloat(w&&w.value);if(isNaN(e))return null;const t=u.y(h.max-e),n=y,r=Math.abs(t-n),i=u.y(e),o=t>n?Sc.borderGray():Sc.defaults.WHITE,a=t>n?i:i-r;return Z.createElement(Z.Fragment,null,Z.createElement(Mc,{x:v+2,y:a,width:m-4,height:r,style:{stroke:o,strokeWidth:2,strokeDasharray:"5,2",fill:"none"}}),Z.createElement("foreignObject",{x:v+m-(_?24:14),y:i-12,width:24,height:24},Z.createElement(wc,{dashColor:o})))})(),Z.createElement(C,{x:v,y:g,defineChart:l,interactive:o,width:m,onDrag:e=>this.dragValue(t,e),onDragStop:this.dragStop,graphProps:e,correctness:a,isHovered:d,color:f}))}}Ac.__initStatic();const Tc=Ac;class Pc extends Z.Component{static __initStatic2(){this.propTypes={data:Cc.array,correctData:Cc.array,onChangeCategory:Cc.func,defineChart:Cc.bool,xBand:Cc.func,graphProps:yt.isRequired,histogram:Cc.bool}}render(){const{data:e,graphProps:t,xBand:n,onChangeCategory:r,defineChart:i,histogram:o,correctData:a}=this.props;return Z.createElement(Lo,null,(e||[]).map((e,s)=>Z.createElement(Tc,{value:e.value,interactive:i||e.interactive,defineChart:i,label:e.label,xBand:n,index:s,key:`bar-${e.label}-${e.value}-${s}`,onChangeCategory:e=>r(s,e),graphProps:t,correctness:e.correctness,correctData:a,barColor:o&&(Oc[s]?Oc[s]:Oc[s%Oc.length])})))}}Pc.__initStatic2();const Rc=n;class Nc extends Z.Component{static __initStatic(){this.propTypes={data:Rc.array,onChange:Rc.func,graphProps:yt.isRequired}}render(){const e=this.props,{data:t,graphProps:n}=e,{scale:r={},size:i={}}=n||{},o=hl(r.x,t,i.width,"bar");return Z.createElement(Pc,{...e,xBand:o})}}Nc.__initStatic();const Dc=n;class jc extends Z.Component{static __initStatic(){this.propTypes={data:Dc.array,onChange:Dc.func,graphProps:yt.isRequired}}render(){const e=this.props,{data:t,graphProps:n}=e,{scale:r={},size:i={}}=n||{},o=hl(r.x,t,i.width,"histogram");return Z.createElement(Pc,{...e,xBand:o,histogram:!0})}}jc.__initStatic();const Ic=l,$c=n,{styled:Fc}=o,{color:zc}=i,Vc=Fc("g")(({theme:e})=>({color:"black","& .handle":{transition:"fill 200ms linear, height 200ms linear","&.non-interactive":Pl("fill")},"& .transparentHandle":{height:"20px",fill:"transparent",stroke:"transparent"},"& .line":{stroke:zc.defaults.TEXT,transition:"fill 200ms linear, height 200ms linear","&.non-interactive":Pl("stroke")},"& .disabledPoint":{fill:zc.defaults.BLACK+" !important",stroke:zc.defaults.BLACK+" !important"},"& .correctIcon":{backgroundColor:zc.correct()},"& .incorrectIcon":{backgroundColor:zc.incorrectWithIcon()},"& .correctnessIcon":{borderRadius:e.spacing(2),color:zc.defaults.WHITE,fontSize:"16px",width:"16px",height:"16px",padding:"2px",border:`1px solid ${zc.defaults.WHITE}`,stroke:"initial",boxSizing:"unset"},"& .smallIcon":{fontSize:"10px",width:"10px",height:"10px"}}));class Hc extends Z.Component{static __initStatic(){this.propTypes={x:$c.number.isRequired,y:$c.number.isRequired,width:$c.number,graphProps:yt.isRequired,className:$c.string,interactive:$c.bool,CustomDraggableComponent:$c.func,correctness:$c.shape({value:$c.string,label:$c.string})}}render(){const{x:e,y:t,graphProps:n,className:r,interactive:i,CustomDraggableComponent:o,correctness:a,...s}=this.props,{scale:l}=n;return o?Z.createElement(Vc,null,Z.createElement(o,{scale:l,x:e,y:t,className:Ic(r,!i&&"non-interactive"),correctness:a,interactive:i,...s})):null}}Hc.__initStatic();const Wc=Hc,Bc=on({axis:"y",fromDelta:(e,t)=>{t.x=0;return kt(e).add(kt(t)).y},bounds:(e,{domain:t,range:n})=>{const r={left:0,top:e.y,bottom:e.y,right:0};return _t(r,t,n)},anchorPoint:e=>({x:e.x,y:e.y})})(Wc),Uc=n,{styled:qc}=o,{isEqual:Yc}=r,{color:Xc}=i,Kc=(e,t)=>{const{max:n}=t||{},r=e.length;return n&&r?e.map((e,t)=>({...e,x:r>1?t*(n/(r-1)):.5,y:e.value})):[]},Zc=qc(Sa)(()=>({fill:"transparent",stroke:Xc.defaults.TERTIARY,strokeWidth:3,transition:"stroke 200ms ease-in, stroke-width 200ms ease-in"}));class Gc extends Z.Component{static __initStatic(){this.propTypes={onChange:Uc.func,value:Uc.number,label:Uc.string,xBand:Uc.func,index:Uc.number.isRequired,graphProps:yt.isRequired,defineChart:Uc.bool,data:Uc.arrayOf(Uc.shape({label:Uc.string,value:Uc.number})),CustomDraggableComponent:Uc.func,correctData:Uc.array}}static __initStatic2(){this.defaultProps={index:0}}constructor(e){super(e),Gc.prototype.__init.call(this),Gc.prototype.__init2.call(this),Gc.prototype.__init3.call(this),this.state={dragValue:void 0,line:Kc(e.data,e.graphProps.domain)}}UNSAFE_componentWillReceiveProps(e){Yc(this.props.data,e.data)||this.setState({line:Kc(e.data,e.graphProps.domain)})}__init(){this.setDragValue=e=>this.setState({line:e})}__init2(){this.dragStop=e=>{const{onChange:t}=this.props;this.setState({dragging:!1},()=>{t(e,this.state.line[e])})}}__init3(){this.dragValue=(e,t,n)=>{const r=[...this.state.line];r[e].dragValue=n,this.setDragValue(r)}}render(){const{graphProps:e,data:t,CustomDraggableComponent:n,defineChart:r,correctData:i}=this.props,{line:o,dragging:a}=this.state,{scale:s}=e,l=a?o:Kc(t,e.domain);return Z.createElement(Z.Fragment,null,Z.createElement(Zc,{data:l,x:e=>s.x(e.x),y:e=>s.y(void 0!==e.dragValue?e.dragValue:e.y),className:"line"}),l&&l.map((t,o)=>{const a=r||t.interactive,s=a?Bc:Wc;return Z.createElement(s,{key:`point-${t.x}-${o}`,x:t.x,y:void 0!==t.dragValue?t.dragValue:t.y,interactive:a,r:6,onDragStart:()=>this.setState({dragging:!0}),onDrag:e=>this.dragValue(o,void 0!==t.dragValue?t.dragValue:t.y,e),onDragStop:()=>this.dragStop(o),graphProps:e,CustomDraggableComponent:n,correctness:t.correctness,correctData:i,label:t.label})}))}}Gc.__initStatic(),Gc.__initStatic2();const Jc=qc(Gc)(()=>({"& .line":{fill:"transparent",stroke:Xc.defaults.TERTIARY,strokeWidth:3,transition:"stroke 200ms ease-in, stroke-width 200ms ease-in"}}));class Qc extends Z.Component{constructor(...e){super(...e),Qc.prototype.__init4.call(this)}static __initStatic3(){this.propTypes={data:Uc.array,onChange:Uc.func,xBand:Uc.func,graphProps:yt.isRequired,CustomDraggableComponent:Uc.func,defineChart:Uc.bool,correctData:Uc.array}}__init4(){this.changeLine=(e,t)=>{const{onChange:n}=this.props,r=[...this.props.data],{dragValue:i,value:o}=t;r[e].value=i>=0?i:o,n(r)}}render(){const e=this.props;return Z.createElement(Lo,null,Z.createElement(Jc,{...e,onChange:this.changeLine}))}}Qc.__initStatic3();const eu=n,{styled:tu}=o,{color:nu}=i,ru=tu("circle")(()=>({})),iu=tu("circle")(()=>({height:"20px",fill:"transparent",stroke:"none",pointerEvents:"auto"})),ou=({scale:e,x:t,y:n,r:r,correctness:i,interactive:o,correctData:a,label:s,...l})=>{const[c,u]=Z.useState(!1),h=!i&&o;return Z.createElement("g",{onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onTouchStart:()=>u(!0),onTouchEnd:()=>u(!1)},Z.createElement(iu,{cx:e.x(t),cy:e.y(n),r:3*r,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),...l}),Z.createElement(ru,{cx:e.x(t),cy:e.y(n),r:r,correctness:i,interactive:o,...l}),Z.createElement(sl,{scale:e,x:t,y:n,r:r,correctness:i,interactive:o}),Z.createElement(ll,{scale:e,x:t,r:r,correctness:i,correctData:a,label:s}),c&&h&&Z.createElement("rect",{x:e.x(t)-2*r,y:e.y(n)-2*r,width:4*r,height:4*r,stroke:nu.defaults.BORDER_GRAY,strokeWidth:"1",fill:"none"}))};ou.propTypes={scale:eu.object,x:eu.number,y:eu.number,r:eu.number,correctness:eu.shape({value:eu.string,label:eu.string}),interactive:eu.bool,correctData:eu.array,label:eu.string};class au extends Z.Component{static __initStatic(){this.propTypes={data:eu.array,onChange:eu.func,graphProps:yt.isRequired}}render(){const e=this.props,{data:t,graphProps:n}=e,{scale:r={},size:i={}}=n||{},o=hl(r.x,t,i.width,"lineDot");return Z.createElement(Qc,{...e,xBand:o,CustomDraggableComponent:ou})}}au.__initStatic();const su=n,{styled:lu}=o,{color:cu}=i;function uu(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}const hu=lu(Sa)(()=>({stroke:cu.defaults.TEXT,transition:"fill 200ms linear, height 200ms linear","&.non-interactive":{stroke:uu([cu,"access",e=>e.disabled,"optionalCall",e=>e()])||"#ccc"}})),pu=lu(Lo)(({correctness:e,interactive:t})=>({stroke:cu.defaults.TEXT,transition:"fill 200ms linear, height 200ms linear",...e&&!t&&{fill:`${cu.defaults.BLACK} !important`,stroke:`${cu.defaults.BLACK} !important`},"&.non-interactive":{stroke:uu([cu,"access",e=>e.disabled,"optionalCall",e=>e()])||"#ccc"}})),du=lu("circle")(()=>({height:"20px",fill:"transparent",stroke:"transparent"})),fu=e=>{const{className:t,scale:n,x:r,y:i,r:o,correctness:a,interactive:s,correctData:l,label:c,...u}=e,[h,p]=f.exports.useState(!1),d=4*o,g=d/2,m=n.x(r),y=n.y(i);return Z.createElement(pu,{className:t,correctness:a,interactive:s},Z.createElement(hu,{data:[{x:n.x(r)-o,y:n.y(i)+o},{x:n.x(r)+o,y:n.y(i)-o}],key:`point-${r}-${i}-1`,x:e=>e.x,y:e=>e.y,strokeWidth:5,style:{pointerEvents:"none"}}),Z.createElement(hu,{data:[{x:n.x(r)-o,y:n.y(i)-o},{x:n.x(r)+o,y:n.y(i)+o}],key:`point-${r}-${i}-2`,x:e=>e.x,y:e=>e.y,strokeWidth:5,style:{pointerEvents:"none"}}),h&&Z.createElement("rect",{x:m-g,y:y-g,width:d,height:d,stroke:cu.defaults.BORDER_GRAY,fill:"none",strokeWidth:2,pointerEvents:"none"}),Z.createElement(du,{cx:m,cy:y,r:2*o,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),...u}),Z.createElement(sl,{scale:n,x:r,y:i,r:o,correctness:a,interactive:s}),Z.createElement(ll,{scale:n,x:r,r:o,correctness:a,correctData:l,label:c}))};fu.propTypes={scale:su.object,x:su.number,y:su.number,r:su.number,className:su.string,correctness:su.shape({value:su.string,label:su.string}),interactive:su.bool,correctData:su.array,label:su.string};class gu extends Z.Component{static __initStatic(){this.propTypes={data:su.array,onChange:su.func,graphProps:yt.isRequired}}render(){const e=this.props,{data:t,graphProps:n}=e,{scale:r={},size:i={}}=n||{},o=hl(r.x,t,i.width,"lineCross");return Z.createElement(Qc,{...e,xBand:o,CustomDraggableComponent:fu})}}gu.__initStatic();const mu=n,{Check:yu}=c,{styled:vu}=o,bu=s,{color:xu}=i;function wu(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}const Cu=bu("pie-lib:chart:bars");class _u extends Z.Component{static __initStatic(){this.propTypes={onChangeCategory:mu.func,value:mu.number,label:mu.string,xBand:mu.func,index:mu.number.isRequired,graphProps:yt.isRequired,CustomBarElement:mu.func,interactive:mu.bool,correctness:mu.shape({value:mu.string,label:mu.string}),defineChart:mu.bool,correctData:mu.arrayOf(mu.shape({value:mu.oneOfType([mu.string,mu.number]),label:mu.string})),className:mu.string}}constructor(e){super(e),_u.prototype.__init.call(this),_u.prototype.__init2.call(this),_u.prototype.__init3.call(this),_u.prototype.__init4.call(this),_u.prototype.__init5.call(this),_u.prototype.__init6.call(this),this.state={dragValue:void 0,isHovered:!1}}__init(){this.handleMouseEnter=()=>{this.setState({isHovered:!0})}}__init2(){this.handleMouseLeave=()=>{this.setState({isHovered:!1})}}__init3(){this.setDragValue=e=>this.setState({dragValue:e})}__init4(){this.dragStop=()=>{const{label:e,onChangeCategory:t}=this.props,{dragValue:n}=this.state;Cu("[dragStop]",n),void 0!==n&&t({label:e,value:n}),this.setDragValue(void 0)}}__init5(){this.dragValue=(e,t)=>{Cu("[dragValue] next:",t),this.setDragValue(t)}}__init6(){this.renderCorrectnessIcon=(e,t,n,r,i,o,a)=>{let s;if(0===n)s=i.y(0)-8;else{const e=n-1;s=i.y(e)-(o-a)/2-a/2-8}return Z.createElement("foreignObject",{x:e+t/2-8,y:s,width:16,height:16},Z.createElement(yu,{className:"correctnessIcon correctIcon smallIcon",title:r.label}))}}render(){const{graphProps:e,value:t,label:n,xBand:r,index:i,CustomBarElement:o,interactive:a,correctness:s,defineChart:l,correctData:c,className:u}=this.props,{scale:h,range:p,size:d}=e,{max:f}=p||{},{dragValue:g,isHovered:m}=this.state,y=Number.isFinite(g)?g:t,v=r.bandwidth(),b=h.y(p.max-y),x=r(ul({label:n},i));Cu("label:",n,"barX:",x,"v: ",y,"barHeight:",b,"barWidth: ",v);const w=[];for(let e=0;e<y;e++)w.push(e);const C=d.height/f,_=.8*(C>v?v:C),k=a?xc:bc,S=a&&!s;return Z.createElement(Z.Fragment,null,Z.createElement("g",{className:u,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onTouchStart:this.handleMouseEnter,onTouchEnd:this.handleMouseLeave},m&&S&&Z.createElement("rect",{x:x,y:h.y(y),width:v,height:wu([w,"optionalAccess",e=>e.length])?C*w.length:0,stroke:xu.defaults.BORDER_GRAY,strokeWidth:"4px",fill:"transparent"}),w.map(e=>o({index:e,pointDiameter:_,barX:x,barWidth:v,pointHeight:C,label:n,value:t,scale:h})),s&&"incorrect"===s.value&&(()=>{const e=parseFloat(c[i]&&c[i].value);if(isNaN(e))return null;const a=y;if(0===e)return this.renderCorrectnessIcon(x,v,e,s,h,C,_);if(a>e){const a=[];for(let t=0;t<e;t++)a.push(t);const l=a[a.length-1],c=r(ul({label:n},i)),u=r.bandwidth(),p=d.height/f,g=.8*(p>u?u:p);return Z.createElement(Z.Fragment,null,Z.createElement(o,{index:l,pointDiameter:g+10,barX:c,barWidth:u,pointHeight:p,label:n,value:t,scale:h,dottedOverline:!0}),this.renderCorrectnessIcon(c,u,e,s,h,p,g))}const l=[];for(let t=a;t<e;t++)l.push(t);return Z.createElement(Z.Fragment,null,l.map(e=>o({index:e,pointDiameter:_,barX:x,barWidth:v,pointHeight:C,label:n,value:t,scale:h,dottedOverline:!0})),this.renderCorrectnessIcon(x,v,e,s,h,C,_))})(),Z.createElement(k,{x:x,y:y,interactive:a,width:v,onDrag:e=>this.dragValue(t,e),onDragStop:this.dragStop,graphProps:e,correctness:s,isHovered:m,defineChart:l,color:xu.primaryDark(),isPlot:!0})))}}_u.__initStatic();const ku=vu(_u)(({theme:e})=>({"& .dot":{fill:xu.visualElementsColors.PLOT_FILL_COLOR,"&.correct":Rl("stroke"),"&.incorrect":Nl("stroke")},"& .dotColor":{fill:xu.visualElementsColors.PLOT_FILL_COLOR,"&.correct":Rl("fill"),"&.incorrect":Nl("fill")},"& .line":{stroke:xu.visualElementsColors.PLOT_FILL_COLOR,"&.correct":Rl("stroke"),"&.incorrect":Nl("stroke")},"& .correctIcon":{backgroundColor:xu.correct()},"& .incorrectIcon":{backgroundColor:xu.incorrectWithIcon()},"& .correctnessIcon":{borderRadius:e.spacing(2),color:xu.defaults.WHITE,fontSize:"16px",width:"16px",height:"16px",padding:"2px",border:`1px solid ${xu.defaults.WHITE}`,stroke:"initial",boxSizing:"unset",display:"block"},"& .smallIcon":{fontSize:"10px",width:"10px",height:"10px"}}));class Su extends Z.Component{static __initStatic2(){this.propTypes={data:mu.array,onChangeCategory:mu.func,xBand:mu.func,graphProps:yt.isRequired,defineChart:mu.bool,CustomBarElement:mu.func,correctData:mu.arrayOf(mu.shape({value:mu.oneOfType([mu.string,mu.number]),label:mu.string})),className:mu.string}}render(){const{data:e,graphProps:t,xBand:n,CustomBarElement:r,onChangeCategory:i,defineChart:o,correctData:a}=this.props;return Z.createElement(Lo,null,(e||[]).map((e,s)=>Z.createElement(ku,{value:e.value,label:e.label,interactive:o||e.interactive,defineChart:o,xBand:n,index:s,key:`bar-${e.label}-${e.value}-${s}`,onChangeCategory:e=>i(s,e),graphProps:t,CustomBarElement:r,correctness:e.correctness,correctData:a})))}}Su.__initStatic2();const Eu=n,{color:Ou}=i,{styled:Lu}=o,Mu=Lu(Pa)(()=>({fill:Ou.visualElementsColors.PLOT_FILL_COLOR,"&.correct":Rl("stroke"),"&.incorrect":Nl("stroke")})),Au=e=>{const{index:t,pointDiameter:n,barX:r,barWidth:i,pointHeight:o,label:a,value:s,scale:l,dottedOverline:c}=e,u=n/2,h=r+(i-n)/2+u,p=l.y(t)-(o-n)/2-u;return c?Z.createElement(Pa,{key:`point-${a}-${s}-${t}`,cx:h,cy:p,r:u+2,strokeDasharray:"4,4",stroke:Ou.defaults.BORDER_GRAY,fill:"none"}):Z.createElement(Mu,{key:`point-${a}-${s}-${t}`,cx:h,cy:p,r:u})};Au.propTypes={index:Eu.number,pointDiameter:Eu.number,barX:Eu.number,barWidth:Eu.number,pointHeight:Eu.number,value:Eu.number,label:Eu.string,scale:Eu.object,dottedOverline:Eu.bool};class Tu extends Z.Component{static __initStatic(){this.propTypes={data:Eu.array,onChange:Eu.func,graphProps:yt.isRequired}}render(){const e=this.props,{data:t,graphProps:n}=e,{scale:r={},size:i={}}=n||{},o=hl(r.x,t,i.width,"dotPlot");return Z.createElement(Su,{...e,xBand:o,CustomBarElement:Au})}}Tu.__initStatic();const Pu=n,{styled:Ru}=o,{color:Nu}=i,Du=Ru(Sa)(()=>({stroke:Nu.visualElementsColors.PLOT_FILL_COLOR,"&.correct":Rl("stroke"),"&.incorrect":Nl("stroke")})),ju=e=>{const{index:t,pointDiameter:n,barX:r,barWidth:i,pointHeight:o,label:a,value:s,scale:l,dottedOverline:c}=e,u=r+(i-n)/2,h=l.y(t)-(o-n)/2;return c?Z.createElement("rect",{key:`point-${a}-${s}-${t}`,x:u-2,y:h-n-2,width:n+4,height:n+4,strokeDasharray:"4,4",stroke:Nu.defaults.BORDER_GRAY,fill:"none"}):Z.createElement(Lo,null,Z.createElement(Du,{data:[{x:u,y:h},{x:u+n,y:h-n}],key:`point-${a}-${s}-${t}-1`,className:"line",x:e=>e.x,y:e=>e.y,strokeWidth:n/5}),Z.createElement(Du,{data:[{x:u,y:h-n},{x:u+n,y:h}],key:`point-${a}-${s}-${t}-2`,x:e=>e.x,y:e=>e.y,strokeWidth:n/5,className:"line"}))};ju.propTypes={index:Pu.number,pointDiameter:Pu.number,barX:Pu.number,barWidth:Pu.number,pointHeight:Pu.number,value:Pu.number,label:Pu.string,scale:Pu.object,dottedOverline:Pu.bool};class Iu extends Z.Component{static __initStatic(){this.propTypes={data:Pu.array,onChange:Pu.func,graphProps:yt.isRequired}}render(){const e=this.props,{data:t,graphProps:n}=e,{scale:r={},size:i={}}=n||{},o=hl(r.x,t,i.width,"linePlot");return Z.createElement(Su,{...e,xBand:o,CustomBarElement:ju})}}Iu.__initStatic();var $u=()=>({type:"bar",Component:Nc,name:"Bar"}),Fu=()=>({type:"histogram",Component:jc,name:"Histogram"}),zu=()=>({type:"lineDot",Component:au,name:"Line Dot"}),Vu=()=>({type:"dotPlot",Component:Tu,name:"Dot Plot"}),Hu=()=>({type:"linePlot",Component:Iu,name:"Line Plot"}),Wu=()=>({type:"lineCross",Component:gu,name:"Line Cross"});function Bu(e,t){return null!=e?e:t()}function Uu(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}const qu=e=>"string"==typeof e,Yu=()=>{let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Xu=e=>null==e?"":""+e,Ku=/###/g,Zu=e=>e&&e.indexOf("###")>-1?e.replace(Ku,"."):e,Gu=e=>!e||qu(e),Ju=(e,t,n)=>{const r=qu(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(Gu(e))return{};const t=Zu(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Gu(e)?{}:{obj:e,k:Zu(r[i])}},Qu=(e,t,n)=>{const{obj:r,k:i}=Ju(e,t,Object);if(void 0!==r||1===t.length)return void(r[i]=n);let o=t[t.length-1],a=t.slice(0,t.length-1),s=Ju(e,a,Object);for(;void 0===s.obj&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=Ju(e,a,Object),Uu([s,"optionalAccess",e=>e.obj])&&void 0!==s.obj[`${s.k}.${o}`]&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},eh=(e,t)=>{const{obj:n,k:r}=Ju(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},th=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?qu(e[r])||e[r]instanceof String||qu(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):th(e[r],t[r],n):e[r]=t[r]);return e},nh=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var rh={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const ih=e=>qu(e)?e.replace(/[&<>"'\/]/g,e=>rh[e]):e;const oh=[" ",",","?","!",";"],ah=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),sh=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const r=t.split(n);let i=e;for(let e=0;e<r.length;){if(!i||"object"!=typeof i)return;let t,o="";for(let a=e;a<r.length;++a)if(a!==e&&(o+=n),o+=r[a],t=i[o],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<r.length-1)continue;e+=a-e+1;break}i=t}return i},lh=e=>Uu([e,"optionalAccess",e=>e.replace,"call",e=>e("_","-")]),ch={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){Uu([console,"optionalAccess",t=>t[e],"optionalAccess",e=>e.apply,"optionalCall",e=>e(console,t)])}};class uh{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||ch,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(qu(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new uh(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new uh(this.logger,e)}}var hh=new uh;class ph{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}}}class dh extends ph{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){const i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):qu(n)&&i?a.push(...n.split(i)):a.push(n)));const s=eh(this.data,a);return!s&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!s&&o&&qu(n)?sh(Uu([this,"access",e=>e.data,"optionalAccess",t=>t[e],"optionalAccess",e=>e[t]]),n,i):s}addResource(e,t,n,r,i={silent:!1}){const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),Qu(this.data,a,r),i.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(const r in n)(qu(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,i,o={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let s=eh(this.data,a)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?th(s,n,i):s={...s,...n},Qu(this.data,a,s),o.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var fh={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=Bu(Uu([this,"access",e=>e.processors,"access",t=>t[e],"optionalAccess",e=>e.process,"call",e=>e(t,n,r,i)]),()=>t)}),t}};const gh=Symbol("i18next/PATH_KEY");function mh(e,t){const{[gh]:n}=e(function(){const e=[],t=Object.create(null);let n;return t.get=(r,i)=>(Uu([n,"optionalAccess",e=>e.revoke,"optionalCall",e=>e()]),i===gh?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return n.join(Bu(Uu([t,"optionalAccess",e=>e.keySeparator]),()=>"."))}const yh={},vh=e=>!qu(e)&&"boolean"!=typeof e&&"number"!=typeof e;class bh extends ph{constructor(e,t={}){super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=hh.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const r=this.resolve(e,n);if(void 0===Uu([r,"optionalAccess",e=>e.res]))return!1;const i=vh(r.res);return!1!==n.returnObjects||!i}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const o=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=oh.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===r.length)return!0;const i=ah.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`);let o=!i.test(e);if(!o){const t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(o=!0)}return o})(e,n,r));if(o&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:qu(i)?[i]:i};const o=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(o[0])>-1)&&(i=o.shift()),e=o.join(r)}return{key:e,namespaces:qu(i)?[i]:i}}translate(e,t,n){let r="object"==typeof t?{...t}:t;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==e)return"";"function"==typeof e&&(e=mh(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]);const i=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(e[e.length-1],r),l=s[s.length-1];let c=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const u=r.lng||this.language,h=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===Uu([u,"optionalAccess",e=>e.toLowerCase,"call",e=>e()]))return h?i?{res:`${l}${c}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${c}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:a;const p=this.resolve(e,r);let d=Uu([p,"optionalAccess",e=>e.res]);const f=Uu([p,"optionalAccess",e=>e.usedKey])||a,g=Uu([p,"optionalAccess",e=>e.exactUsedKey])||a,m=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==r.count&&!qu(r.count),b=bh.hasDefaultValue(r),x=v?this.pluralResolver.getSuffix(u,r.count,r):"",w=r.ordinal&&v?this.pluralResolver.getSuffix(u,r.count,{ordinal:!1}):"",C=v&&!r.ordinal&&0===r.count,_=C&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${x}`]||r[`defaultValue${w}`]||r.defaultValue;let k=d;y&&!d&&b&&(k=_);const S=vh(k),E=Object.prototype.toString.apply(k);if(!(y&&k&&S&&["[object Number]","[object Function]","[object RegExp]"].indexOf(E)<0)||qu(m)&&Array.isArray(k))if(y&&qu(m)&&Array.isArray(d))d=d.join(m),d&&(d=this.extendTranslation(d,e,r,n));else{let t=!1,i=!1;!this.isValidLookup(d)&&b&&(t=!0,d=_),this.isValidLookup(d)||(i=!0,d=a);const s=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:d,h=b&&_!==d&&this.options.updateMissing;if(i||t||h){if(this.logger.log(h?"updateKey":"missingKey",u,l,a,h?_:d),o){const e=this.resolve(a,{...r,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(r.lng||this.language):e.push(r.lng||this.language);const n=(e,t,n)=>{const i=b&&n!==d?n:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,i,h,r):Uu([this,"access",e=>e.backendConnector,"optionalAccess",e=>e.saveMissing])&&this.backendConnector.saveMissing(e,l,t,i,h,r),this.emit("missingKey",e,l,t,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,r);C&&r[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],a+t,r[`defaultValue${t}`]||_)})}):n(e,a,_))}d=this.extendTranslation(d,e,r,p,n),i&&d===a&&this.options.appendNamespaceToMissingKey&&(d=`${l}${c}${a}`),(i||t)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${a}`:a,t?d:void 0,r))}else{if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,k,{...r,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(p.res=e,p.usedParams=this.getUsedParamsDetails(r),p):e}if(o){const e=Array.isArray(k),t=e?[]:{},n=e?g:f;for(const e in k)if(Object.prototype.hasOwnProperty.call(k,e)){const i=`${n}${o}${e}`;t[e]=b&&!d?this.translate(i,{...r,defaultValue:vh(_)?_[e]:void 0,joinArrays:!1,ns:s}):this.translate(i,{...r,joinArrays:!1,ns:s}),t[e]===i&&(t[e]=k[e])}d=t}}return i?(p.res=d,p.usedParams=this.getUsedParamsDetails(r),p):d}extendTranslation(e,t,n,r,i){if(Uu([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.parse]))e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const o=qu(e)&&(void 0!==Uu([n,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(o){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let s=n.replace&&!qu(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),o){const t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>Uu([i,"optionalAccess",e=>e[0]])!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}const o=n.postProcess||this.options.postProcess,a=qu(o)?[o]:o;return null!=e&&Uu([a,"optionalAccess",e=>e.length])&&!1!==n.applyPostProcessor&&(e=fh.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,o,a;return qu(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;const s=this.extractFromKey(e,t),l=s.key;r=l;let c=s.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==t.count&&!qu(t.count),h=u&&!t.ordinal&&0===t.count,p=void 0!==t.context&&(qu(t.context)||"number"==typeof t.context)&&""!==t.context,d=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(n)||(a=e,yh[`${d[0]}-${e}`]||!Uu([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||Uu([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(a)])||(yh[`${d[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${d.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),d.forEach(r=>{if(this.isValidLookup(n))return;o=r;const a=[l];if(Uu([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.addLookupKeys]))this.i18nFormat.addLookupKeys(a,l,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));const n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&0===e.indexOf(i)&&a.push(l+e.replace(i,this.options.pluralSeparator)),a.push(l+e),h&&a.push(l+n)),p){const r=`${l}${this.options.contextSeparator||"_"}${t.context}`;a.push(r),u&&(t.ordinal&&0===e.indexOf(i)&&a.push(r+e.replace(i,this.options.pluralSeparator)),a.push(r+e),h&&a.push(r+n))}}let s;for(;s=a.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,r={}){return Uu([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.getResource])?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!qu(e.replace);let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}class xh{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=hh.create("languageUtils")}getScriptPartFromCode(e){if(!(e=lh(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=lh(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(qu(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?e:e.indexOf("-")<0&&r.indexOf("-")<0?void 0:e.indexOf("-")>0&&r.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),qu(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return qu(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):qu(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}}const wh={zero:0,one:1,two:2,few:3,many:4,other:5},Ch={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class _h{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=hh.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=lh("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(n,{type:r})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Ch;if(!e.match(/-|_/))return Ch;const r=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(r,t)}return this.pluralRulesCache[i]=o,o}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),Uu([n,"optionalAccess",e=>e.resolvedOptions,"call",e=>e(),"access",e=>e.pluralCategories,"access",e=>e.length])>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((e,t)=>wh[e]-wh[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){const r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const kh=(e,t,n,r=".",i=!0)=>{let o=((e,t,n)=>{const r=eh(e,n);return void 0!==r?r:eh(t,n)})(e,t,n);return!o&&i&&qu(n)&&(o=sh(e,n,r),void 0===o&&(o=sh(t,n,r))),o},Sh=e=>e.replace(/\$/g,"$$$$");class Eh{constructor(e={}){this.logger=hh.create("interpolator"),this.options=e,this.format=Uu([e,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.format])||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:s,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:h,nestingPrefixEscaped:p,nestingSuffix:d,nestingSuffixEscaped:f,nestingOptionsSeparator:g,maxReplaces:m,alwaysFormat:y}=e.interpolation;this.escape=void 0!==t?t:ih,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=i?nh(i):o||"{{",this.suffix=a?nh(a):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=h?nh(h):p||nh("$t("),this.nestingSuffix=d?nh(d):f||nh(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>Uu([e,"optionalAccess",e=>e.source])===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,o,a;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const i=kh(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}const i=e.split(this.formatSeparator),o=i.shift().trim(),a=i.join(this.formatSeparator).trim();return this.format(kh(t,s,o,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:o})};this.resetRegExp();const c=Uu([r,"optionalAccess",e=>e.missingInterpolationHandler])||this.options.missingInterpolationHandler,u=void 0!==Uu([r,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Sh(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Sh(this.escape(e)):Sh(e)}].forEach(t=>{for(a=0;i=t.regex.exec(e);){const n=i[1].trim();if(o=l(n),void 0===o)if("function"==typeof c){const t=c(e,i,r);o=qu(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))o="";else{if(u){o=i[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),o=""}else qu(o)||this.useRawValueToEscape||(o=Xu(o));const s=t.safeValue(o);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,o;const a=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let i=`{${r[1]}`;e=r[0],i=this.interpolate(i,o);const a=i.match(/'/g),s=i.match(/"/g);(Bu(Uu([a,"optionalAccess",e=>e.length]),()=>0)%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];o={...n},o=o.replace&&!qu(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const l=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==l&&(s=r[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,l)),i=t(a.call(this,r[1].trim(),o),o),i&&r[0]===e&&!qu(i))return i;qu(i)||(i=Xu(i)),i||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),i=""),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}}const Oh=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=r+JSON.stringify(o);let s=t[a];return s||(s=e(lh(r),i),t[a]=s),s(n)}},Lh=e=>(t,n,r)=>e(lh(n),r)(t);class Mh{constructor(e={}){this.logger=hh.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?Oh:Lh;this.formats={number:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Oh(t)}format(e,t,n,r={}){const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(e=>e.indexOf(")")>-1)){const e=i.findIndex(e=>e.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}const o=i.reduce((e,t)=>{const{formatName:i,formatOptions:o}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(e=>{if(e){const[t,...r]=e.split(":"),i=r.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();n[o]||(n[o]=i),"false"===i&&(n[o]=!1),"true"===i&&(n[o]=!0),isNaN(i)||(n[o]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[i]){let t=e;try{const a=Uu([r,"optionalAccess",e=>e.formatParams,"optionalAccess",e=>e[r.interpolationkey]])||{},s=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...o,...r,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e);return o}}class Ah extends ph{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=hh.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],Uu([this,"access",e=>e.backend,"optionalAccess",e=>e.init,"optionalCall",e=>e(n,r.backend,r)])}queueLoad(e,t,n,r){const i={},o={},a={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{const a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===o[a]&&(o[a]=!0):(this.state[a]=1,r=!1,void 0===o[a]&&(o[a]=!0),void 0===i[a]&&(i[a]=!0),void 0===s[t]&&(s[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),!t&&n&&this.store.addResourceBundle(i,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:r,k:i}=Ju(e,t,Object);r[i]=r[i]||[],r[i].push(n)})(n.loaded,[i],o),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:o});this.readingCalls++;const a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&s&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*i,o)},i):o(a,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,a);try{const n=s(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(e){a(e)}}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();qu(e)&&(e=this.languageUtils.toResolveHierarchy(e)),qu(t)&&(t=[t]);const i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),r=n[0],i=n[1];this.read(r,i,"read",void 0,void 0,(n,o)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&o&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,o),this.loaded(e,n,o)})}saveMissing(e,t,n,r,i,o={},a=()=>{}){if(!Uu([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||Uu([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(t)])){if(null!=n&&""!==n){if(Uu([this,"access",e=>e.backend,"optionalAccess",e=>e.create])){const s={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;i=5===l.length?l(e,t,n,r,s):l(e,t,n,r),i&&"function"==typeof i.then?i.then(e=>a(null,e)).catch(a):a(null,i)}catch(e){a(e)}else l(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const Th=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),qu(e[1])&&(t.defaultValue=e[1]),qu(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Ph=e=>(qu(e.ns)&&(e.ns=[e.ns]),qu(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),qu(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),Uu([e,"access",e=>e.supportedLngs,"optionalAccess",e=>e.indexOf,"optionalCall",e=>e("cimode")])<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),Rh=()=>{};class Nh extends ph{constructor(e={},t){var n;if(super(),this.options=Ph(e),this.services={},this.logger=hh,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(qu(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=Th();var r;this.options={...n,...this.options,...Ph(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(Uu([r=this,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||Uu([r,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||Uu([r,"optionalAccess",e=>e.options,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.backends])&&r.options.backend.backends.some(e=>Uu([e,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0||Uu([e,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0))||"undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const i=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?hh.init(i(this.modules.logger),this.options):hh.init(null,this.options),e=this.modules.formatter?this.modules.formatter:Mh;const t=new xh(this.options);this.store=new dh(this.options.resources,this.options);const r=this.services;r.logger=hh,r.resourceStore=this.store,r.languageUtils=t,r.pluralResolver=new _h(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix});this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(r.formatter=i(e),r.formatter.init&&r.formatter.init(r,this.options),this.options.interpolation.format=r.formatter.format.bind(r.formatter)),r.interpolator=new Eh(this.options),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},r.backendConnector=new Ah(i(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(r.languageDetector=i(this.modules.languageDetector),r.languageDetector.init&&r.languageDetector.init(r,this.options.detection,this.options)),this.modules.i18nFormat&&(r.i18nFormat=i(this.modules.i18nFormat),r.i18nFormat.init&&r.i18nFormat.init(this)),this.translator=new bh(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Rh),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const o=Yu(),a=()=>{const e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),o}loadResources(e,t=Rh){let n=t;const r=qu(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===Uu([r,"optionalAccess",e=>e.toLowerCase,"call",e=>e()])&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(r)t(r);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e))}Uu([this,"access",e=>e.options,"access",e=>e.preload,"optionalAccess",e=>e.forEach,"optionalCall",e=>e(e=>t(e))]),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){const r=Yu();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Rh),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&fh.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=Yu();this.emit("languageChanging",e);const r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,o)=>{o?this.isLanguageChangingTo===e&&(r(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},o=t=>{e||t||!this.services.languageDetector||(t=[]);const n=qu(t)?t:t&&t[0],o=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(qu(t)?[t]:t);o&&(this.language||r(o),this.translator.language||this.translator.changeLanguage(o),Uu([this,"access",e=>e.services,"access",e=>e.languageDetector,"optionalAccess",e=>e.cacheUserLanguage,"optionalCall",e=>e(o)])),this.loadResources(o,e=>{i(e,o)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),n}getFixedT(e,t,n){const r=(e,t,...i)=>{let o;o="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(i)):{...t},o.lng=o.lng||r.lng,o.lngs=o.lngs||r.lngs,o.ns=o.ns||r.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||n||r.keyPrefix);const a=this.options.keySeparator||".";let s;return o.keyPrefix&&Array.isArray(e)?s=e.map(e=>("function"==typeof e&&(e=mh(e,{...this.options,...t})),`${o.keyPrefix}${a}${e}`)):("function"==typeof e&&(e=mh(e,{...this.options,...t})),s=o.keyPrefix?`${o.keyPrefix}${a}${e}`:e),this.t(s,o)};return qu(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return Uu([this,"access",e=>e.translator,"optionalAccess",e=>e.translate,"call",t=>t(...e)])}exists(...e){return Uu([this,"access",e=>e.translator,"optionalAccess",e=>e.exists,"call",t=>t(...e)])}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const o=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,o);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!o(n,e)||r&&!o(i,e)))}loadNamespaces(e,t){const n=Yu();return this.options.ns?(qu(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Yu();qu(e)&&(e=[e]);const r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(Uu([this,"access",e=>e.languages,"optionalAccess",e=>e.length])>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=Uu([this,"access",e=>e.services,"optionalAccess",e=>e.languageUtils])||new xh(Th());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const n=new Nh(e,t);return n.createInstance=Nh.createInstance,n}cloneInstance(e={},t=Rh){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},i=new Nh(r);void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e));if(["store","services","language"].forEach(e=>{i[e]=this[e]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{});i.store=new dh(e,r),i.services.resourceStore=i.store}if(e.interpolation){const t={...Th().interpolation,...this.options.interpolation,...e.interpolation},n={...r,interpolation:t};i.services.interpolator=new Eh(n)}return i.translator=new bh(i.services,r),i.translator.on("*",(e,...t)=>{i.emit(e,...t)}),i.init(r,t),i.translator.options=r,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Dh=Nh.createInstance();Dh.createInstance,Dh.dir,Dh.init,Dh.loadResources,Dh.reloadResources,Dh.use,Dh.changeLanguage,Dh.getFixedT,Dh.t,Dh.exists,Dh.setDefaultNamespace,Dh.hasLoadedNamespace,Dh.loadNamespaces,Dh.loadLanguages;Dh.init({fallbackLng:"en",lng:"en",debug:!0,resources:{en:{translation:{categorize:{limitMaxChoicesPerCategory:"You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",maxChoicesPerCategoryRestriction:"To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s]."},ebsr:{part:"Part {{index}}"},numberLine:{addElementLimit_one:"You can only add {{count}} element",addElementLimit_other:"You can only add {{count}} elements",clearAll:"Clear all"},imageClozeAssociation:{reachedLimit_one:"You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.",reachedLimit_other:"Full"},drawingResponse:{fillColor:"Fill color",outlineColor:"Outline color",noFill:"No fill",lightblue:"Light blue",lightyellow:"Light yellow",red:"Red",orange:"Orange",yellow:"Yellow",violet:"Violet",blue:"Blue",green:"Green",white:"White",black:"Black",onDoubleClick:"Double click to edit this text. Press Enter to submit."},charting:{addCategory:"Add category",actions:"Actions",add:"Add",delete:"Delete",newLabel:"New label",reachedLimit_other:"There can't be more than {{count}} categories.",keyLegend:{incorrectAnswer:"Student incorrect answer",correctAnswer:"Student correct answer",correctKeyAnswer:"Answer key correct"}},graphing:{point:"Point",circle:"Circle",line:"Line",parabola:"Parabola",absolute:"Absolute Value",exponential:"Exponential",polygon:"Polygon",ray:"Ray",segment:"Segment",sine:"Sine",vector:"Vector",label:"Label",redo:"Redo",reset:"Reset"},mathInline:{primaryCorrectWithAlternates:"Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct."},multipleChoice:{minSelections:"Select at least {{minSelections}}.",maxSelections_one:"Only {{maxSelections}} answer is allowed.",maxSelections_other:"Only {{maxSelections}} answers are allowed.",minmaxSelections_equal:"Select {{minSelections}}.",minmaxSelections_range:"Select between {{minSelections}} and {{maxSelections}}."},selectText:{correctAnswerSelected:"Correct",correctAnswerNotSelected:"Correct Answer Not Selected",incorrectSelection:"Incorrect Selection",key:"Key"}},common:{undo:"Undo",clearAll:"Clear all",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Show correct answer",hideCorrectAnswer:"Hide correct answer",commonCorrectAnswerWithAlternates:"Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.",warning:"Warning",showNote:"Show Note",hideNote:"Hide Note",cancel:"Cancel"}},es:{translation:{categorize:{limitMaxChoicesPerCategory:"Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",maxChoicesPerCategoryRestriction:"Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta"},ebsr:{part:"Parte {{index}}"},numberLine:{addElementLimit_one:"Solo puedes agregar {{count}} elemento",addElementLimit_other:"Solo puedes agregar {{count}} elementos",clearAll:"Borrar todo"},imageClozeAssociation:{reachedLimit_one:"Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",reachedLimit_other:"Lleno"},drawingResponse:{fillColor:"Color de relleno",outlineColor:"Color del contorno",noFill:"Sin relleno",lightblue:"Azul claro",lightyellow:"Amarillo claro",red:"Rojo",orange:"Naranja",yellow:"Amarillo",violet:"Violeta",blue:"Azul",green:"Verde",white:"Blanco",black:"Negro",onDoubleClick:"Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar"},charting:{addCategory:"Añadir categoría",actions:"Acciones",add:"Añadir",delete:"Eliminar",newLabel:"Nueva etiqueta",reachedLimit_other:"No puede haber más de {{count}} categorías.",keyLegend:{incorrectAnswer:"Respuesta incorrecta del estudiante",correctAnswer:"Respuesta correcta del estudiante",correctKeyAnswer:"Clave de respuesta correcta"}},graphing:{point:"Punto",circle:"Circulo",line:"Línea",parabola:"Parábola",absolute:"Valor absoluto",exponential:"Exponencial",polygon:"Polígono",ray:"Semirrecta",segment:"Segmento ",sine:"Seno",vector:"Vector",label:"Etiqueta",redo:"Rehacer",reset:"Reiniciar"},mathInline:{primaryCorrectWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas."},multipleChoice:{minSelections:"Seleccione al menos {{minSelections}}.",maxSelections_one:"Sólo se permite {{maxSelections}} respuesta.",maxSelections_other:"Sólo se permiten {{maxSelections}} respuestas.",minmaxSelections_equal:"Seleccione {{minSelections}}.",minmaxSelections_range:"Seleccione entre {{minSelections}} y {{maxSelections}}."},selectText:{correctAnswerSelected:"Respuesta Correcta",correctAnswerNotSelected:"Respuesta Correcta No Seleccionada",incorrectSelection:"Selección Incorrecta",key:"Clave"}},common:{undo:"Deshacer",clearAll:"Borrar todo",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Mostrar respuesta correcta",hideCorrectAnswer:"Ocultar respuesta correcta",commonCorrectAnswerWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.",warning:"Advertencia",showNote:"Mostrar Nota",hideNote:"Ocultar Nota",cancel:"Cancelar"}}}});var jh={translator:{...Dh,t:(e,t)=>{const{lng:n}=t;switch(n){case"en_US":case"en-US":t.lng="en";break;case"es_ES":case"es-ES":case"es_MX":case"es-MX":t.lng="es"}return Dh.t(e,{lng:n,...t})}},languageOptions:[{value:"en_US",label:"English (US)"},{value:"es_ES",label:"Spanish"}]};const Ih=n,{styled:$h}=o,{Button:Fh}=u,{Popover:zh}=u,{Paper:Vh}=u,{color:Hh}=i,{translator:Wh}=jh,Bh=$h("div")(()=>({alignSelf:"flex-end"})),Uh=$h("div")(({theme:e})=>({cursor:"pointer",fontSize:e.typography.fontSize,color:Hh.tertiary(),padding:e.spacing(1)})),qh=$h(Vh)(({theme:e})=>({padding:e.spacing(1),display:"flex",flexDirection:"column",gap:e.spacing(1),"& button":{textTransform:"none",fontSize:e.typography.fontSize,color:Hh.text(),justifyContent:"flex-start"}}));class Yh extends Z.Component{constructor(e){super(e),Yh.prototype.__init.call(this),Yh.prototype.__init2.call(this),Yh.prototype.__init3.call(this),Yh.prototype.__init4.call(this),this.state={actionsAnchorEl:null}}componentWillUnmount(){this.setState({actionsAnchorEl:null})}static __initStatic(){this.propTypes={addCategory:Ih.func.isRequired,deleteCategory:Ih.func.isRequired,language:Ih.string,categories:Ih.array}}__init(){this.handleActionsClick=e=>{this.setState({actionsAnchorEl:e.currentTarget})}}__init2(){this.handleActionsClose=()=>{this.setState({actionsAnchorEl:null})}}__init3(){this.handleAddCategory=()=>{const{addCategory:e}=this.props;e(),this.handleActionsClose()}}__init4(){this.handleDeleteCategory=e=>{const{deleteCategory:t}=this.props;t(e),this.handleActionsClose()}}render(){const{categories:e,language:t}=this.props,{actionsAnchorEl:n}=this.state;return Z.createElement(Bh,null,Z.createElement(Uh,{role:"button",tabIndex:0,onClick:this.handleActionsClick},"Actions"),Z.createElement(zh,{key:`actions-popover-${Math.random()}`,open:Boolean(n),anchorEl:n,onClose:this.handleActionsClose,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"}},Z.createElement(qh,null,Z.createElement(Fh,{onClick:()=>this.handleAddCategory()},"+ ",Wh.t("charting.add",{lng:t})),e.length>0&&e.map((e,n)=>e.deletable&&!e.correctness&&Z.createElement(Fh,{key:n,onClick:()=>this.handleDeleteCategory(n)},`${Wh.t("charting.delete",{lng:t})} <${e.label||Wh.t("charting.newLabel",{lng:t})}>`)))))}}Yh.__initStatic();const Xh=n,{styled:Kh}=o,Zh=s,{cloneDeep:Gh}=r,{AlertDialog:Jh}=p;function Qh(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}const{translator:ep}=jh,tp=Zh("pie-lib:charts:chart"),np=Kh("div")(()=>({width:"min-content"}));class rp extends Z.Component{constructor(e){super(e),rp.prototype.__init.call(this),rp.prototype.__init2.call(this),rp.prototype.__init3.call(this),rp.prototype.__init4.call(this),rp.prototype.__init5.call(this),rp.prototype.__init6.call(this),rp.prototype.__init7.call(this),rp.prototype.__init8.call(this),rp.prototype.__init9.call(this),this.state={dialog:{open:!1},actionsAnchorEl:null},this.maskUid=this.generateMaskId()}static __initStatic(){this.propTypes={className:Xh.string,chartType:Xh.string.isRequired,size:Xh.shape({width:Xh.number,height:Xh.number}),domain:Xh.shape({label:Xh.string,min:Xh.number,max:Xh.number,axisLabel:Xh.string}),data:Xh.arrayOf(Xh.shape({label:Xh.string,value:Xh.number})),range:Xh.shape({label:Xh.string,min:Xh.number,max:Xh.number,step:Xh.number,labelStep:Xh.number,axisLabel:Xh.string}),charts:Xh.array,labelsPlaceholders:Xh.object,title:Xh.string,titlePlaceholder:Xh.string,onDataChange:Xh.func,onChangeLabels:Xh.func,onChangeTitle:Xh.func,error:Xh.any,addCategoryEnabled:Xh.bool,showPixelGuides:Xh.bool,categoryDefaultLabel:Xh.string,categoryDefaults:Xh.object,defineChart:Xh.bool,theme:Xh.object,chartingOptions:Xh.object,changeInteractiveEnabled:Xh.bool,changeEditableEnabled:Xh.bool,language:Xh.string,mathMlOptions:Xh.object,labelsCharactersLimit:Xh.number,correctData:Xh.arrayOf(Xh.shape({label:Xh.string,value:Xh.number}))}}static __initStatic2(){this.defaultProps={size:{width:480,height:480}}}__init(){this.state={charts:[$u(),Fu(),zu(),Wu(),Vu(),Hu()],autoFocus:!1}}generateMaskId(){return"chart-"+(1e4*Math.random()).toFixed()}__init2(){this.handleAlertDialog=(e,t)=>this.setState({dialog:{open:e}},t)}__init3(){this.getChart=()=>{const e=this.props.charts||this.state.charts;let{chartType:t}=this.props,n=null,r=null;return t?(r=e&&e.find(e=>e.type===t),n=r&&r.Component):(r=e&&e[0],n=r&&r.Component,t=r&&r.type),{type:t,ChartComponent:n}}}__init4(){this.changeData=e=>{const{onDataChange:t}=this.props;t(e)}}__init5(){this.changeCategory=(e,t)=>{const n=parseInt(e,10);if(n>=0){const{data:e,onDataChange:r}=this.props;e[n]={...e[n],...t},r(e)}}}__init6(){this.addCategory=()=>{const{onDataChange:e,data:t,categoryDefaultLabel:n,defineChart:r,categoryDefaults:i,language:o}=this.props;(t||[]).length>19?this.setState({dialog:{open:!0,title:ep.t("common:warning",{lng:o}),text:ep.t("charting.reachedLimit_other",{count:20,lng:o}),onConfirm:()=>this.handleAlertDialog(!1)}}):(this.setState({autoFocus:!0}),e([...t,{inDefineChart:r,label:n||ep.t("charting.newLabel",{lng:o}),value:0,deletable:!0,editable:!i||Qh([i,"optionalAccess",e=>e.editable]),interactive:!i||Qh([i,"optionalAccess",e=>e.interactive])}]))}}__init7(){this.deleteCategory=e=>{const{data:t,onDataChange:n}=this.props;"number"!=typeof e||e<0||t&&t.length>0&&n(t.filter((t,n)=>n!==e))}}__init8(){this.getFilteredCategories=()=>{const{data:e,defineChart:t}=this.props;return e?e.map(e=>({...e,deletable:t||e.deletable})):[]}}__init9(){this.resetAutoFocus=()=>{this.setState({autoFocus:!1})}}render(){const{domain:e={},range:t={},chartingOptions:n,size:r,title:i,onChangeTitle:o,onChangeLabels:a,labelsPlaceholders:s,titlePlaceholder:l,addCategoryEnabled:c,changeInteractiveEnabled:u,changeEditableEnabled:h,showPixelGuides:p,error:d,mathMlOptions:f={},language:g,labelsCharactersLimit:m,correctData:y}=this.props;let{chartType:v}=this.props;const{dialog:b}=this.state,x=this.props.defineChart||!1,{width:w,height:C}=r||{},_={left:Qh([t,"optionalAccess",e=>e.label])||"",bottom:Qh([e,"optionalAccess",e=>e.label])||""},{ChartComponent:k}=this.getChart(),S=this.getFilteredCategories(),E=((e,t,n)=>{let{step:r,labelStep:i,min:o,max:a}=t||{};switch(o||(o=0),(!a||a<0)&&(a=t.min+1),r||(r=i||1),(!i||isNaN(i)&&r)&&(i=r||1),t.max=a,n){case"dotPlot":case"linePlot":{const n=Math.round(o),r=Math.round(a);return{domain:{...e,step:1,labelStep:1,min:0,max:1},range:{...t,min:n,max:n===r?n+1:r,labelStep:i,step:1}}}default:return{domain:{...e,step:1,labelStep:1,min:0,max:1},range:{...t,labelStep:i,step:r}}}})(e,t,v),{verticalLines:O,horizontalLines:L,leftAxis:M}=((e,t)=>{switch(t){case"lineDot":case"lineCross":return{verticalLines:void 0,horizontalLines:pl(e),leftAxis:!0};case"dotPlot":case"linePlot":return{verticalLines:[],horizontalLines:[],leftAxis:!1};default:return{verticalLines:[],horizontalLines:pl(e),leftAxis:!0}}})(E.range,v),A={graphProps:mo(E.domain,E.range,r,()=>this.rootNode)};tp("[render] common:",A);const T={x:-10,y:-75,width:w+20,height:C+130},{scale:P}=A.graphProps,R=hl(P.x,S,w,v),N=x?160:60,D=(e=>e<30?50:e<40?30:e<60?15:0)(R.bandwidth()||P.x(E.domain.max)/S.length),j=Gh(A);j.graphProps.size.height+=D+N;return("dotPlot"===v||"linePlot"===v)&&Qh([y,"optionalAccess",e=>e.length])&&_.bottom&&(j.graphProps.size.height+=25),Z.createElement(np,null,Z.createElement(Zt,{title:i,onChangeTitle:o,disabledTitle:!x,showTitle:!0,showLabels:!0,labels:_,onChangeLabels:a,labelsPlaceholders:s,titlePlaceholder:l,defineChart:x,disabledLabels:!x,isChart:!0,showPixelGuides:p,rootRef:e=>this.rootNode=e,mathMlOptions:f,labelsCharactersLimit:m,...j},Z.createElement(ma,{...A,xBand:R,rowTickValues:L,columnTickValues:O}),Z.createElement(oc,{autoFocus:this.state.autoFocus,onAutoFocusUsed:this.resetAutoFocus,...A,defineChart:x,categories:S,xBand:R,leftAxis:M,onChange:this.changeData,onChangeCategory:this.changeCategory,chartingOptions:n,changeInteractiveEnabled:u,changeEditableEnabled:h,top:D,error:d,showCorrectness:"linePlot"===v||"dotPlot"===v}),c?Z.createElement("foreignObject",{x:w,y:C-16,width:w,height:C},Z.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{display:"flex",justifyContent:"flex-start"}},Z.createElement(Yh,{categories:S,addCategory:this.addCategory,deleteCategory:this.deleteCategory,language:g}))):null,Z.createElement("mask",{id:`${this.maskUid}`},Z.createElement("rect",{...T,fill:"white"})),Z.createElement("g",{id:"marks",mask:`url('#${this.maskUid}')`},k&&Z.createElement(k,{...A,data:S,height:j.graphProps.size.height,defineChart:x,onChange:this.changeData,onChangeCategory:this.changeCategory,correctData:y}))),Z.createElement(Jh,{open:b.open,title:b.title,text:b.text,onClose:b.onClose,onConfirm:b.onConfirm}))}}rp.__initStatic(),rp.__initStatic2();const{styled:ip}=o,{FormControl:op}=u,{InputLabel:ap}=u,sp=n;ip("div")(()=>({width:"160px"})),ip(op)(()=>({width:"160px"})),ip(ap)(()=>({backgroundColor:"transparent"})),sp.func.isRequired,sp.string.isRequired,sp.shape({histogram:sp.string,bar:sp.string,lineDot:sp.string,lineCross:sp.string,dotPlot:sp.string,linePlot:sp.string}),sp.string;const lp=n,{color:cp}=i,{styled:up}=o,{Typography:hp}=u,{NumberTextFieldCustom:pp}=p;up("div")(()=>({width:"450px"})),up("div")(({theme:e})=>({display:"flex",flexDirection:"column",width:"100%",marginTop:e.spacing(3)})),up("div")(()=>({display:"flex",flexDirection:"column",alignItems:"center"})),up("div")(()=>({display:"flex",justifyContent:"space-around",alignItems:"center"})),up(pp)(({theme:e})=>({width:"130px",margin:`${e.spacing(1)} ${e.spacing(.5)}`})),up(pp)(({theme:e})=>({width:"160px",margin:`${e.spacing(1)} ${e.spacing(.5)}`})),up("div")(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",margin:`${e.spacing(3)} 0`})),up(hp)(()=>({color:cp.disabled()})),lp.object,lp.object,lp.object,lp.object,lp.object,lp.func,lp.object,lp.object,lp.object,lp.object,lp.object,lp.string;const dp=n,{styled:fp}=o,{Check:gp}=c,{Close:mp}=c,{color:yp}=i,vp=fp("div")(({theme:e})=>({backgroundColor:yp.defaults.WHITE,padding:e.spacing(2),width:"355px",boxShadow:"inset 0px 1px 5px 0px #9297A6",display:"flex",flexDirection:"column",gap:"16px"})),bp=fp("div")(()=>({display:"flex",alignItems:"center",gap:"12px"})),xp=fp("div")(({theme:e})=>({fontSize:e.typography.h6.fontSize,fontWeight:"700"})),wp=fp("div")(()=>({marginLeft:"2px"})),Cp=fp(gp)(({theme:e})=>({backgroundColor:yp.correct(),borderRadius:e.spacing(2),color:yp.defaults.WHITE})),_p=fp(mp)(({theme:e})=>({backgroundColor:yp.incorrectWithIcon(),borderRadius:e.spacing(2),color:yp.defaults.WHITE})),kp=fp("div")(()=>({marginLeft:"3px",display:"flex",alignItems:"center",gap:"12px"})),{translator:Sp}=jh,Ep=({language:e})=>Z.createElement(vp,null,Z.createElement(xp,null,"Key"),Z.createElement(bp,null,Z.createElement(_p,null),Z.createElement("div",null,Sp.t("charting.keyLegend.incorrectAnswer",{lng:e}))),Z.createElement(bp,null,Z.createElement(Cp,null),Z.createElement("div",null,Sp.t("charting.keyLegend.correctAnswer",{lng:e}))),Z.createElement(kp,null,Z.createElement(Cp,{fontSize:"small"}),Z.createElement(wp,null,Sp.t("charting.keyLegend.correctKeyAnswer",{lng:e}))));Ep.propTypes={language:dp.string};const Op=n,{styled:Lp}=o,{color:Mp}=i,{Collapsible:Ap}=i,{hasText:Tp}=i,{PreviewPrompt:Pp}=i,{UiLayout:Rp}=i,{hasMedia:Np}=i,{isEqual:Dp}=r,jp=h;const Ip=Lp(Rp)({color:Mp.text(),backgroundColor:Mp.background(),overflowX:"scroll",overflowY:"hidden"}),$p=Lp(rp)(({theme:e})=>({marginTop:e.spacing(2),marginBottom:e.spacing(2)})),Fp=Lp(Ap)(({theme:e})=>({marginBottom:e.spacing(2)}));class zp extends Z.Component{static __initStatic(){this.propTypes={model:Op.object.isRequired,onAnswersChange:Op.func,categories:Op.array}}constructor(e){super(e),zp.prototype.__init.call(this),zp.prototype.__init2.call(this),this.state={categories:e.categories||e.model.data,showingCorrect:!1}}componentDidUpdate(e){Dp(e.categories,this.props.categories)?Dp(e.model.data,this.props.model.data)||this.setState({categories:this.props.model.data}):this.setState({categories:this.props.categories})}__init(){this.changeData=e=>this.setState({categories:e},()=>this.props.onAnswersChange(e))}__init2(){this.toggleCorrect=e=>this.setState({showingCorrect:e})}render(){const{categories:e,showingCorrect:t}=this.state,{model:n}=this.props,{teacherInstructions:r,prompt:i,chartType:o,size:a,domain:s,range:l,title:c,addCategoryEnabled:u,studentNewCategoryDefaultLabel:h,showToggle:p,rationale:d,correctAnswer:f,language:g,env:m,showKeyLegend:y}=n;let{correctedAnswer:v,extraCSSRules:b}=n;const x=(function(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}([f,"optionalAccess",e=>e.data])||[]).map(e=>({...e,interactive:!1,editable:!1})),{mode:w}=m||{};"view"===w&&(v=(v||[]).map(e=>({...e,editable:!1})));const C=n.rationale&&(Tp(n.rationale)||Np(n.rationale)),_=n.teacherInstructions&&(Tp(n.teacherInstructions)||Np(n.teacherInstructions));return Z.createElement(Ip,{extraCSSRules:b},_&&Z.createElement(Fp,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},Z.createElement(Pp,{prompt:r})),i&&Z.createElement(Pp,{className:"prompt",prompt:i}),Z.createElement(jp,{show:p,toggled:t,onToggle:this.toggleCorrect,language:g}),t&&p?Z.createElement($p,{chartType:o,size:a,domain:s,range:l,charts:[$u(),Fu(),zu(),Wu(),Vu(),Hu()],data:x||e,title:c,onDataChange:this.changeData,addCategoryEnabled:!1,categoryDefaultLabel:h,language:g,labelsPlaceholders:{}}):Z.createElement($p,{chartType:o,size:a,domain:s,range:l,charts:[$u(),Fu(),zu(),Wu(),Vu(),Hu()],data:v||e,title:c,onDataChange:this.changeData,addCategoryEnabled:u,categoryDefaultLabel:h,language:g,labelsPlaceholders:{},correctData:p?x:void 0}),!t&&y&&Z.createElement(Ep,{language:g}),C&&Z.createElement(Ap,{labels:{hidden:"Show Rationale",visible:"Hide Rationale"}},Z.createElement(Pp,{prompt:d})))}}zp.__initStatic();var Vp={};Object.defineProperty(Vp,"__esModule",{value:!0});class Hp extends CustomEvent{constructor(e,t,n){super(Hp.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:n}}),this.component=e,this.complete=t}}Hp.TYPE="model-set";var Wp=Vp.ModelSetEvent=Hp;class Bp extends CustomEvent{constructor(e,t){super(Bp.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}Bp.TYPE="session-changed";var Up=Vp.SessionChangedEvent=Bp;const{renderMath:qp}=e;class Yp extends HTMLElement{constructor(){super(),Yp.prototype.__init.call(this),Yp.prototype.__init2.call(this),this._root=null}set model(e){this._model=e,this._session&&this.isComplete(this._session.answer)?this.dispatchEvent(new Wp(this.tagName.toLowerCase(),!0,!!this._model)):this.dispatchEvent(new Wp(this.tagName.toLowerCase(),!1,!!this._model)),this._render()}set session(e){this._session=e,this._render()}get session(){return this._session}connectedCallback(){this._render()}__init(){this.isComplete=e=>Array.isArray(e)&&e.length>0}__init2(){this.changeAnswers=e=>{this._session.answer=e,this.dispatchEvent(new Up(this.tagName.toLowerCase(),this.isComplete(this._session.answer))),this._render()}}_render(){if(!this._model||!this._session)return;const e={...this._model,data:this._model.data?[...this._model.data]:this._model.data},t=Z.createElement(zp,{model:e,categories:this._session.answer,onAnswersChange:this.changeAnswers});this._root||(this._root=G(this)),this._root.render(t),queueMicrotask(()=>{qp(this)})}disconnectedCallback(){this._root&&this._root.unmount()}}export{zp as Component,Yp as default};