ezpm2gui 1.8.0 → 1.10.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.
Files changed (33) hide show
  1. package/README.md +363 -330
  2. package/bin/ezpm2gui.js +8 -8
  3. package/bin/ezpm2gui.ts +51 -51
  4. package/bin/generate-ecosystem.js +35 -35
  5. package/bin/generate-ecosystem.ts +56 -56
  6. package/dist/server/config/project-configs.json +235 -235
  7. package/dist/server/index.js +4 -4
  8. package/dist/server/routes/deployApplication.js +4 -4
  9. package/dist/server/routes/logStreaming.js +35 -4
  10. package/dist/server/routes/remoteConnections.js +44 -12
  11. package/dist/server/utils/encryption.d.ts +22 -0
  12. package/dist/server/utils/encryption.js +53 -0
  13. package/dist/server/utils/remote-connection.js +3 -3
  14. package/dist/server/utils/remote-metrics-db.js +59 -59
  15. package/package.json +86 -86
  16. package/scripts/postinstall.js +36 -36
  17. package/src/client/build/asset-manifest.json +6 -6
  18. package/src/client/build/favicon.ico +2 -2
  19. package/src/client/build/index.html +1 -1
  20. package/src/client/build/logo192.svg +7 -7
  21. package/src/client/build/logo512.svg +7 -7
  22. package/src/client/build/manifest.json +24 -24
  23. package/src/client/build/static/css/main.8f39974b.css +5 -0
  24. package/src/client/build/static/css/main.8f39974b.css.map +1 -0
  25. package/src/client/build/static/js/main.71236659.js +3 -0
  26. package/src/client/build/static/js/main.71236659.js.map +1 -0
  27. package/dist/server/config/cron-jobs.json +0 -1
  28. package/dist/server/config/remote-connections.json +0 -3
  29. package/src/client/build/static/css/main.9decb204.css +0 -5
  30. package/src/client/build/static/css/main.9decb204.css.map +0 -1
  31. package/src/client/build/static/js/main.28a4a583.js +0 -3
  32. package/src/client/build/static/js/main.28a4a583.js.map +0 -1
  33. /package/src/client/build/static/js/{main.28a4a583.js.LICENSE.txt → main.71236659.js.LICENSE.txt} +0 -0
@@ -1,3 +0,0 @@
1
- /*! For license information please see main.28a4a583.js.LICENSE.txt */
2
- (()=>{var e={39:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=n(4421)},191:(e,t)=>{"use strict";var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler");Symbol.for("react.provider");var s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.view_transition"),m=Symbol.for("react.client.reference");function g(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case o:case i:case a:case d:case u:case f:return e;default:switch(e=e&&e.$$typeof){case l:case c:case p:case h:case s:return e;default:return t}}case r:return t}}}t.vM=c,t.lD=h},219:(e,t,n)=>{"use strict";var r=n(3763),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?i:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=i;var c=Object.defineProperty,d=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(f){var o=p(n);o&&o!==f&&e(t,o,r)}var i=d(n);u&&(i=i.concat(u(n)));for(var s=l(t),m=l(n),g=0;g<i.length;++g){var x=i[g];if(!a[x]&&(!r||!r[x])&&(!m||!m[x])&&(!s||!s[x])){var b=h(n,x);try{c(t,x,b)}catch(v){}}}}return t}},457:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.A});var r=n(7868)},579:(e,t,n)=>{"use strict";e.exports=n(1153)},869:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});n(5043);var r=n(3290),o=n(579);function a(e){const{styles:t,defaultTheme:n={}}=e,a="function"===typeof t?e=>{return t(void 0===(r=e)||null===r||0===Object.keys(r).length?n:e);var r}:t;return(0,o.jsx)(r.mL,{styles:a})}},918:(e,t,n)=>{"use strict";function r(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}n.d(t,{A:()=>r})},950:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(3468).A},1132:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var o=r(n(39)),a=n(579);t.A=(0,o.default)((0,a.jsx)("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"}),"Download")},1153:(e,t,n)=>{"use strict";var r=n(5043),o=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,a={},c=null,d=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(d=t.ref),t)i.call(t,r)&&!l.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:d,props:a,_owner:s.current}}t.Fragment=a,t.jsx=c,t.jsxs=c},1337:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var o=r(n(39)),a=n(579);t.A=(0,o.default)((0,a.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore")},1475:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(7123);const o=e=>(0,r.A)(e)&&"classes"!==e},1668:(e,t,n)=>{"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,{A:()=>r})},1722:(e,t,n)=>{"use strict";n.d(t,{Rk:()=>r,SF:()=>o,sk:()=>a});function r(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")})),r}var o=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},a=function(e,t,n){o(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a=t;do{e.insert(t===a?"."+r:"",a,e.sheet,!0),a=a.next}while(void 0!==a)}}},1782:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(5043),o=n(4440);const a=function(e){const t=r.useRef(e);return(0,o.A)((()=>{t.current=e})),r.useRef((function(){return(0,t.current)(...arguments)})).current}},2372:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>a});var r=n(9386);const o={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function a(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui";const a=o[t];return a?"".concat(n,"-").concat(a):"".concat(r.A.generate(e),"-").concat(t)}},2374:(e,t,n)=>{"use strict";t.A=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(5043)),o=n(3174);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}t.A=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=r.useContext(o.ThemeContext);return t&&(n=t,0!==Object.keys(n).length)?t:e;var n}},2427:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(1668).A},2456:(e,t,n)=>{"use strict";function r(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(((e,t)=>null==t?e:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];e.apply(this,r),t.apply(this,r)}),(()=>{}))}n.d(t,{A:()=>r})},2505:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var o=r(n(39)),a=n(579);t.A=(0,o.default)((0,a.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add")},2532:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(2372);function o(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui";const o={};return t.forEach((t=>{o[t]=(0,r.Ay)(e,t,n)})),o}},2730:(e,t,n)=>{"use strict";var r=n(5043),o=n(8853);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,s={};function l(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(s[e]=t,e=0;e<t.length;e++)i.add(t[e])}var d=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),u=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},f={};function m(e,t,n,r,o,a,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=i}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new m(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];g[t]=new m(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new m(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){g[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new m(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new m(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new m(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)}));var x=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}function v(e,t,n,r){var o=g.hasOwnProperty(t)?g[t]:null;(null!==o?0!==o.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!u.call(f,e)||!u.call(p,e)&&(h.test(e)?f[e]=!0:(p[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(x,b);g[t]=new m(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(x,b);g[t]=new m(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(x,b);g[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)})),g.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)}));var y=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for("react.element"),k=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),_=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),P=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var O=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var T=Symbol.iterator;function L(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=T&&e[T]||e["@@iterator"])?e:null}var I,z=Object.assign;function D(e){if(void 0===I)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);I=t&&t[1]||""}return"\n"+I+e}var F=!1;function B(e,t){if(!e||F)return"";F=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&"string"===typeof c.stack){for(var o=c.stack.split("\n"),a=r.stack.split("\n"),i=o.length-1,s=a.length-1;1<=i&&0<=s&&o[i]!==a[s];)s--;for(;1<=i&&0<=s;i--,s--)if(o[i]!==a[s]){if(1!==i||1!==s)do{if(i--,0>--s||o[i]!==a[s]){var l="\n"+o[i].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=i&&0<=s);break}}}finally{F=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?D(e):""}function W(e){switch(e.tag){case 5:return D(e.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return e=B(e.type,!1);case 11:return e=B(e.type.render,!1);case 1:return e=B(e.type,!0);default:return""}}function H(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case S:return"Fragment";case k:return"Portal";case A:return"Profiler";case j:return"StrictMode";case M:return"Suspense";case N:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case _:return(e.displayName||"Context")+".Consumer";case C:return(e._context.displayName||"Context")+".Provider";case E:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case R:return null!==(t=e.displayName||null)?t:H(e.type)||"Memo";case P:t=e._payload,e=e._init;try{return H(e(t))}catch(n){}}return null}function V(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return H(t);case 8:return t===j?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function U(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function q(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function $(e){e._valueTracker||(e._valueTracker=function(e){var t=q(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var o=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function K(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=q(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function X(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Y(e,t){var n=t.checked;return z({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function G(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=U(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Z(e,t){null!=(t=t.checked)&&v(e,"checked",t,!1)}function J(e,t){Z(e,t);var n=U(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,U(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Q(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&X(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+U(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function re(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(a(91));return z({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function oe(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(a(92));if(te(n)){if(1<n.length)throw Error(a(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:U(n)}}function ae(e,t){var n=U(t.value),r=U(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ie(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function se(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function le(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?se(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ce,de,ue=(de=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ce=ce||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return de(e,t)}))}:de);function he(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var pe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},fe=["Webkit","ms","Moz","O"];function me(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||pe.hasOwnProperty(e)&&pe[e]?(""+t).trim():t+"px"}function ge(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=me(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(pe).forEach((function(e){fe.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pe[t]=pe[e]}))}));var xe=z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function be(e,t){if(t){if(xe[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(a(62))}}function ve(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ye=null;function we(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var ke=null,Se=null,je=null;function Ae(e){if(e=yo(e)){if("function"!==typeof ke)throw Error(a(280));var t=e.stateNode;t&&(t=ko(t),ke(e.stateNode,e.type,t))}}function Ce(e){Se?je?je.push(e):je=[e]:Se=e}function _e(){if(Se){var e=Se,t=je;if(je=Se=null,Ae(e),t)for(e=0;e<t.length;e++)Ae(t[e])}}function Ee(e,t){return e(t)}function Me(){}var Ne=!1;function Re(e,t,n){if(Ne)return e(t,n);Ne=!0;try{return Ee(e,t,n)}finally{Ne=!1,(null!==Se||null!==je)&&(Me(),_e())}}function Pe(e,t){var n=e.stateNode;if(null===n)return null;var r=ko(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(a(231,t,typeof n));return n}var Oe=!1;if(d)try{var Te={};Object.defineProperty(Te,"passive",{get:function(){Oe=!0}}),window.addEventListener("test",Te,Te),window.removeEventListener("test",Te,Te)}catch(de){Oe=!1}function Le(e,t,n,r,o,a,i,s,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var Ie=!1,ze=null,De=!1,Fe=null,Be={onError:function(e){Ie=!0,ze=e}};function We(e,t,n,r,o,a,i,s,l){Ie=!1,ze=null,Le.apply(Be,arguments)}function He(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Ve(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Ue(e){if(He(e)!==e)throw Error(a(188))}function qe(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=He(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var i=o.alternate;if(null===i){if(null!==(r=o.return)){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Ue(o),e;if(i===r)return Ue(o),t;i=i.sibling}throw Error(a(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(e))?$e(e):null}function $e(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=$e(e);if(null!==t)return t;e=e.sibling}return null}var Ke=o.unstable_scheduleCallback,Xe=o.unstable_cancelCallback,Ye=o.unstable_shouldYield,Ge=o.unstable_requestPaint,Ze=o.unstable_now,Je=o.unstable_getCurrentPriorityLevel,Qe=o.unstable_ImmediatePriority,et=o.unstable_UserBlockingPriority,tt=o.unstable_NormalPriority,nt=o.unstable_LowPriority,rt=o.unstable_IdlePriority,ot=null,at=null;var it=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(st(e)/lt|0)|0},st=Math.log,lt=Math.LN2;var ct=64,dt=4194304;function ut(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ht(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,a=e.pingedLanes,i=268435455&n;if(0!==i){var s=i&~o;0!==s?r=ut(s):0!==(a&=i)&&(r=ut(a))}else 0!==(i=n&~o)?r=ut(i):0!==a&&(r=ut(a));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&o)&&((o=r&-r)>=(a=t&-t)||16===o&&0!==(4194240&a)))return t;if(0!==(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)o=1<<(n=31-it(t)),r|=e[n],t&=~o;return r}function pt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function ft(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function mt(){var e=ct;return 0===(4194240&(ct<<=1))&&(ct=64),e}function gt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function xt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-it(t)]=n}function bt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-it(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var vt=0;function yt(e){return 1<(e&=-e)?4<e?0!==(268435455&e)?16:536870912:4:1}var wt,kt,St,jt,At,Ct=!1,_t=[],Et=null,Mt=null,Nt=null,Rt=new Map,Pt=new Map,Ot=[],Tt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Lt(e,t){switch(e){case"focusin":case"focusout":Et=null;break;case"dragenter":case"dragleave":Mt=null;break;case"mouseover":case"mouseout":Nt=null;break;case"pointerover":case"pointerout":Rt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pt.delete(t.pointerId)}}function It(e,t,n,r,o,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[o]},null!==t&&(null!==(t=yo(t))&&kt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function zt(e){var t=vo(e.target);if(null!==t){var n=He(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Ve(n)))return e.blockedOn=t,void At(e.priority,(function(){St(n)}))}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Dt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Yt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=yo(n))&&kt(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);ye=r,n.target.dispatchEvent(r),ye=null,t.shift()}return!0}function Ft(e,t,n){Dt(e)&&n.delete(t)}function Bt(){Ct=!1,null!==Et&&Dt(Et)&&(Et=null),null!==Mt&&Dt(Mt)&&(Mt=null),null!==Nt&&Dt(Nt)&&(Nt=null),Rt.forEach(Ft),Pt.forEach(Ft)}function Wt(e,t){e.blockedOn===t&&(e.blockedOn=null,Ct||(Ct=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,Bt)))}function Ht(e){function t(t){return Wt(t,e)}if(0<_t.length){Wt(_t[0],e);for(var n=1;n<_t.length;n++){var r=_t[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Et&&Wt(Et,e),null!==Mt&&Wt(Mt,e),null!==Nt&&Wt(Nt,e),Rt.forEach(t),Pt.forEach(t),n=0;n<Ot.length;n++)(r=Ot[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Ot.length&&null===(n=Ot[0]).blockedOn;)zt(n),null===n.blockedOn&&Ot.shift()}var Vt=y.ReactCurrentBatchConfig,Ut=!0;function qt(e,t,n,r){var o=vt,a=Vt.transition;Vt.transition=null;try{vt=1,Kt(e,t,n,r)}finally{vt=o,Vt.transition=a}}function $t(e,t,n,r){var o=vt,a=Vt.transition;Vt.transition=null;try{vt=4,Kt(e,t,n,r)}finally{vt=o,Vt.transition=a}}function Kt(e,t,n,r){if(Ut){var o=Yt(e,t,n,r);if(null===o)Ur(e,t,r,Xt,n),Lt(e,r);else if(function(e,t,n,r,o){switch(t){case"focusin":return Et=It(Et,e,t,n,r,o),!0;case"dragenter":return Mt=It(Mt,e,t,n,r,o),!0;case"mouseover":return Nt=It(Nt,e,t,n,r,o),!0;case"pointerover":var a=o.pointerId;return Rt.set(a,It(Rt.get(a)||null,e,t,n,r,o)),!0;case"gotpointercapture":return a=o.pointerId,Pt.set(a,It(Pt.get(a)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r))r.stopPropagation();else if(Lt(e,r),4&t&&-1<Tt.indexOf(e)){for(;null!==o;){var a=yo(o);if(null!==a&&wt(a),null===(a=Yt(e,t,n,r))&&Ur(e,t,r,Xt,n),a===o)break;o=a}null!==o&&r.stopPropagation()}else Ur(e,t,r,null,n)}}var Xt=null;function Yt(e,t,n,r){if(Xt=null,null!==(e=vo(e=we(r))))if(null===(t=He(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=Ve(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Xt=e,null}function Gt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Je()){case Qe:return 1;case et:return 4;case tt:case nt:return 16;case rt:return 536870912;default:return 16}default:return 16}}var Zt=null,Jt=null,Qt=null;function en(){if(Qt)return Qt;var e,t,n=Jt,r=n.length,o="value"in Zt?Zt.value:Zt.textContent,a=o.length;for(e=0;e<r&&n[e]===o[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===o[a-t];t++);return Qt=o.slice(e,1<t?1-t:void 0)}function tn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function nn(){return!0}function rn(){return!1}function on(e){function t(t,n,r,o,a){for(var i in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(i)&&(t=e[i],this[i]=t?t(o):o[i]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?nn:rn,this.isPropagationStopped=rn,this}return z(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var an,sn,ln,cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dn=on(cn),un=z({},cn,{view:0,detail:0}),hn=on(un),pn=z({},un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:An,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ln&&(ln&&"mousemove"===e.type?(an=e.screenX-ln.screenX,sn=e.screenY-ln.screenY):sn=an=0,ln=e),an)},movementY:function(e){return"movementY"in e?e.movementY:sn}}),fn=on(pn),mn=on(z({},pn,{dataTransfer:0})),gn=on(z({},un,{relatedTarget:0})),xn=on(z({},cn,{animationName:0,elapsedTime:0,pseudoElement:0})),bn=z({},cn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vn=on(bn),yn=on(z({},cn,{data:0})),wn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Sn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Sn[e])&&!!t[e]}function An(){return jn}var Cn=z({},un,{key:function(e){if(e.key){var t=wn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?kn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:An,charCode:function(e){return"keypress"===e.type?tn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),_n=on(Cn),En=on(z({},pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Mn=on(z({},un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:An})),Nn=on(z({},cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Rn=z({},pn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Pn=on(Rn),On=[9,13,27,32],Tn=d&&"CompositionEvent"in window,Ln=null;d&&"documentMode"in document&&(Ln=document.documentMode);var In=d&&"TextEvent"in window&&!Ln,zn=d&&(!Tn||Ln&&8<Ln&&11>=Ln),Dn=String.fromCharCode(32),Fn=!1;function Bn(e,t){switch(e){case"keyup":return-1!==On.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wn(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Hn=!1;var Vn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Un(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Vn[e.type]:"textarea"===t}function qn(e,t,n,r){Ce(r),0<(t=$r(t,"onChange")).length&&(n=new dn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var $n=null,Kn=null;function Xn(e){Dr(e,0)}function Yn(e){if(K(wo(e)))return e}function Gn(e,t){if("change"===e)return t}var Zn=!1;if(d){var Jn;if(d){var Qn="oninput"in document;if(!Qn){var er=document.createElement("div");er.setAttribute("oninput","return;"),Qn="function"===typeof er.oninput}Jn=Qn}else Jn=!1;Zn=Jn&&(!document.documentMode||9<document.documentMode)}function tr(){$n&&($n.detachEvent("onpropertychange",nr),Kn=$n=null)}function nr(e){if("value"===e.propertyName&&Yn(Kn)){var t=[];qn(t,Kn,e,we(e)),Re(Xn,t)}}function rr(e,t,n){"focusin"===e?(tr(),Kn=n,($n=t).attachEvent("onpropertychange",nr)):"focusout"===e&&tr()}function or(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Yn(Kn)}function ar(e,t){if("click"===e)return Yn(t)}function ir(e,t){if("input"===e||"change"===e)return Yn(t)}var sr="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function lr(e,t){if(sr(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!u.call(t,o)||!sr(e[o],t[o]))return!1}return!0}function cr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dr(e,t){var n,r=cr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=cr(r)}}function ur(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?ur(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function hr(){for(var e=window,t=X();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=X((e=t.contentWindow).document)}return t}function pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function fr(e){var t=hr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ur(n.ownerDocument.documentElement,n)){if(null!==r&&pr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var o=n.textContent.length,a=Math.min(r.start,o);r=void 0===r.end?a:Math.min(r.end,o),!e.extend&&a>r&&(o=r,r=a,a=o),o=dr(n,a);var i=dr(n,r);o&&i&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var mr=d&&"documentMode"in document&&11>=document.documentMode,gr=null,xr=null,br=null,vr=!1;function yr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;vr||null==gr||gr!==X(r)||("selectionStart"in(r=gr)&&pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},br&&lr(br,r)||(br=r,0<(r=$r(xr,"onSelect")).length&&(t=new dn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=gr)))}function wr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var kr={animationend:wr("Animation","AnimationEnd"),animationiteration:wr("Animation","AnimationIteration"),animationstart:wr("Animation","AnimationStart"),transitionend:wr("Transition","TransitionEnd")},Sr={},jr={};function Ar(e){if(Sr[e])return Sr[e];if(!kr[e])return e;var t,n=kr[e];for(t in n)if(n.hasOwnProperty(t)&&t in jr)return Sr[e]=n[t];return e}d&&(jr=document.createElement("div").style,"AnimationEvent"in window||(delete kr.animationend.animation,delete kr.animationiteration.animation,delete kr.animationstart.animation),"TransitionEvent"in window||delete kr.transitionend.transition);var Cr=Ar("animationend"),_r=Ar("animationiteration"),Er=Ar("animationstart"),Mr=Ar("transitionend"),Nr=new Map,Rr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Pr(e,t){Nr.set(e,t),l(t,[e])}for(var Or=0;Or<Rr.length;Or++){var Tr=Rr[Or];Pr(Tr.toLowerCase(),"on"+(Tr[0].toUpperCase()+Tr.slice(1)))}Pr(Cr,"onAnimationEnd"),Pr(_r,"onAnimationIteration"),Pr(Er,"onAnimationStart"),Pr("dblclick","onDoubleClick"),Pr("focusin","onFocus"),Pr("focusout","onBlur"),Pr(Mr,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ir=new Set("cancel close invalid load scroll toggle".split(" ").concat(Lr));function zr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,o,i,s,l,c){if(We.apply(this,arguments),Ie){if(!Ie)throw Error(a(198));var d=ze;Ie=!1,ze=null,De||(De=!0,Fe=d)}}(r,t,void 0,e),e.currentTarget=null}function Dr(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var i=r.length-1;0<=i;i--){var s=r[i],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==a&&o.isPropagationStopped())break e;zr(o,s,c),a=l}else for(i=0;i<r.length;i++){if(l=(s=r[i]).instance,c=s.currentTarget,s=s.listener,l!==a&&o.isPropagationStopped())break e;zr(o,s,c),a=l}}}if(De)throw e=Fe,De=!1,Fe=null,e}function Fr(e,t){var n=t[go];void 0===n&&(n=t[go]=new Set);var r=e+"__bubble";n.has(r)||(Vr(t,e,2,!1),n.add(r))}function Br(e,t,n){var r=0;t&&(r|=4),Vr(n,e,r,t)}var Wr="_reactListening"+Math.random().toString(36).slice(2);function Hr(e){if(!e[Wr]){e[Wr]=!0,i.forEach((function(t){"selectionchange"!==t&&(Ir.has(t)||Br(t,!1,e),Br(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Wr]||(t[Wr]=!0,Br("selectionchange",!1,t))}}function Vr(e,t,n,r){switch(Gt(t)){case 1:var o=qt;break;case 4:o=$t;break;default:o=Kt}n=o.bind(null,t,n,e),o=void 0,!Oe||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Ur(e,t,n,r,o){var a=r;if(0===(1&t)&&0===(2&t)&&null!==r)e:for(;;){if(null===r)return;var i=r.tag;if(3===i||4===i){var s=r.stateNode.containerInfo;if(s===o||8===s.nodeType&&s.parentNode===o)break;if(4===i)for(i=r.return;null!==i;){var l=i.tag;if((3===l||4===l)&&((l=i.stateNode.containerInfo)===o||8===l.nodeType&&l.parentNode===o))return;i=i.return}for(;null!==s;){if(null===(i=vo(s)))return;if(5===(l=i.tag)||6===l){r=a=i;continue e}s=s.parentNode}}r=r.return}Re((function(){var r=a,o=we(n),i=[];e:{var s=Nr.get(e);if(void 0!==s){var l=dn,c=e;switch(e){case"keypress":if(0===tn(n))break e;case"keydown":case"keyup":l=_n;break;case"focusin":c="focus",l=gn;break;case"focusout":c="blur",l=gn;break;case"beforeblur":case"afterblur":l=gn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=fn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=mn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Mn;break;case Cr:case _r:case Er:l=xn;break;case Mr:l=Nn;break;case"scroll":l=hn;break;case"wheel":l=Pn;break;case"copy":case"cut":case"paste":l=vn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=En}var d=0!==(4&t),u=!d&&"scroll"===e,h=d?null!==s?s+"Capture":null:s;d=[];for(var p,f=r;null!==f;){var m=(p=f).stateNode;if(5===p.tag&&null!==m&&(p=m,null!==h&&(null!=(m=Pe(f,h))&&d.push(qr(f,m,p)))),u)break;f=f.return}0<d.length&&(s=new l(s,c,null,n,o),i.push({event:s,listeners:d}))}}if(0===(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===ye||!(c=n.relatedTarget||n.fromElement)||!vo(c)&&!c[mo])&&(l||s)&&(s=o.window===o?o:(s=o.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(c=(c=n.relatedTarget||n.toElement)?vo(c):null)&&(c!==(u=He(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=r),l!==c)){if(d=fn,m="onMouseLeave",h="onMouseEnter",f="mouse","pointerout"!==e&&"pointerover"!==e||(d=En,m="onPointerLeave",h="onPointerEnter",f="pointer"),u=null==l?s:wo(l),p=null==c?s:wo(c),(s=new d(m,f+"leave",l,n,o)).target=u,s.relatedTarget=p,m=null,vo(o)===r&&((d=new d(h,f+"enter",c,n,o)).target=p,d.relatedTarget=u,m=d),u=m,l&&c)e:{for(h=c,f=0,p=d=l;p;p=Kr(p))f++;for(p=0,m=h;m;m=Kr(m))p++;for(;0<f-p;)d=Kr(d),f--;for(;0<p-f;)h=Kr(h),p--;for(;f--;){if(d===h||null!==h&&d===h.alternate)break e;d=Kr(d),h=Kr(h)}d=null}else d=null;null!==l&&Xr(i,s,l,d,!1),null!==c&&null!==u&&Xr(i,u,c,d,!0)}if("select"===(l=(s=r?wo(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var g=Gn;else if(Un(s))if(Zn)g=ir;else{g=or;var x=rr}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(g=ar);switch(g&&(g=g(e,r))?qn(i,g,n,o):(x&&x(e,s,r),"focusout"===e&&(x=s._wrapperState)&&x.controlled&&"number"===s.type&&ee(s,"number",s.value)),x=r?wo(r):window,e){case"focusin":(Un(x)||"true"===x.contentEditable)&&(gr=x,xr=r,br=null);break;case"focusout":br=xr=gr=null;break;case"mousedown":vr=!0;break;case"contextmenu":case"mouseup":case"dragend":vr=!1,yr(i,n,o);break;case"selectionchange":if(mr)break;case"keydown":case"keyup":yr(i,n,o)}var b;if(Tn)e:{switch(e){case"compositionstart":var v="onCompositionStart";break e;case"compositionend":v="onCompositionEnd";break e;case"compositionupdate":v="onCompositionUpdate";break e}v=void 0}else Hn?Bn(e,n)&&(v="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(v="onCompositionStart");v&&(zn&&"ko"!==n.locale&&(Hn||"onCompositionStart"!==v?"onCompositionEnd"===v&&Hn&&(b=en()):(Jt="value"in(Zt=o)?Zt.value:Zt.textContent,Hn=!0)),0<(x=$r(r,v)).length&&(v=new yn(v,e,null,n,o),i.push({event:v,listeners:x}),b?v.data=b:null!==(b=Wn(n))&&(v.data=b))),(b=In?function(e,t){switch(e){case"compositionend":return Wn(t);case"keypress":return 32!==t.which?null:(Fn=!0,Dn);case"textInput":return(e=t.data)===Dn&&Fn?null:e;default:return null}}(e,n):function(e,t){if(Hn)return"compositionend"===e||!Tn&&Bn(e,t)?(e=en(),Qt=Jt=Zt=null,Hn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return zn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=$r(r,"onBeforeInput")).length&&(o=new yn("onBeforeInput","beforeinput",null,n,o),i.push({event:o,listeners:r}),o.data=b))}Dr(i,t)}))}function qr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function $r(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,a=o.stateNode;5===o.tag&&null!==a&&(o=a,null!=(a=Pe(e,n))&&r.unshift(qr(e,a,o)),null!=(a=Pe(e,t))&&r.push(qr(e,a,o))),e=e.return}return r}function Kr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Xr(e,t,n,r,o){for(var a=t._reactName,i=[];null!==n&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==c&&(s=c,o?null!=(l=Pe(n,a))&&i.unshift(qr(n,l,s)):o||null!=(l=Pe(n,a))&&i.push(qr(n,l,s))),n=n.return}0!==i.length&&e.push({event:t,listeners:i})}var Yr=/\r\n?/g,Gr=/\u0000|\uFFFD/g;function Zr(e){return("string"===typeof e?e:""+e).replace(Yr,"\n").replace(Gr,"")}function Jr(e,t,n){if(t=Zr(t),Zr(e)!==t&&n)throw Error(a(425))}function Qr(){}var eo=null,to=null;function no(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ro="function"===typeof setTimeout?setTimeout:void 0,oo="function"===typeof clearTimeout?clearTimeout:void 0,ao="function"===typeof Promise?Promise:void 0,io="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof ao?function(e){return ao.resolve(null).then(e).catch(so)}:ro;function so(e){setTimeout((function(){throw e}))}function lo(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType)if("/$"===(n=o.data)){if(0===r)return e.removeChild(o),void Ht(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=o}while(n);Ht(t)}function co(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function uo(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var ho=Math.random().toString(36).slice(2),po="__reactFiber$"+ho,fo="__reactProps$"+ho,mo="__reactContainer$"+ho,go="__reactEvents$"+ho,xo="__reactListeners$"+ho,bo="__reactHandles$"+ho;function vo(e){var t=e[po];if(t)return t;for(var n=e.parentNode;n;){if(t=n[mo]||n[po]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=uo(e);null!==e;){if(n=e[po])return n;e=uo(e)}return t}n=(e=n).parentNode}return null}function yo(e){return!(e=e[po]||e[mo])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function wo(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(a(33))}function ko(e){return e[fo]||null}var So=[],jo=-1;function Ao(e){return{current:e}}function Co(e){0>jo||(e.current=So[jo],So[jo]=null,jo--)}function _o(e,t){jo++,So[jo]=e.current,e.current=t}var Eo={},Mo=Ao(Eo),No=Ao(!1),Ro=Eo;function Po(e,t){var n=e.type.contextTypes;if(!n)return Eo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,a={};for(o in n)a[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Oo(e){return null!==(e=e.childContextTypes)&&void 0!==e}function To(){Co(No),Co(Mo)}function Lo(e,t,n){if(Mo.current!==Eo)throw Error(a(168));_o(Mo,t),_o(No,n)}function Io(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in t))throw Error(a(108,V(e)||"Unknown",o));return z({},n,r)}function zo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Eo,Ro=Mo.current,_o(Mo,e),_o(No,No.current),!0}function Do(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=Io(e,t,Ro),r.__reactInternalMemoizedMergedChildContext=e,Co(No),Co(Mo),_o(Mo,e)):Co(No),_o(No,n)}var Fo=null,Bo=!1,Wo=!1;function Ho(e){null===Fo?Fo=[e]:Fo.push(e)}function Vo(){if(!Wo&&null!==Fo){Wo=!0;var e=0,t=vt;try{var n=Fo;for(vt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Fo=null,Bo=!1}catch(o){throw null!==Fo&&(Fo=Fo.slice(e+1)),Ke(Qe,Vo),o}finally{vt=t,Wo=!1}}return null}var Uo=[],qo=0,$o=null,Ko=0,Xo=[],Yo=0,Go=null,Zo=1,Jo="";function Qo(e,t){Uo[qo++]=Ko,Uo[qo++]=$o,$o=e,Ko=t}function ea(e,t,n){Xo[Yo++]=Zo,Xo[Yo++]=Jo,Xo[Yo++]=Go,Go=e;var r=Zo;e=Jo;var o=32-it(r)-1;r&=~(1<<o),n+=1;var a=32-it(t)+o;if(30<a){var i=o-o%5;a=(r&(1<<i)-1).toString(32),r>>=i,o-=i,Zo=1<<32-it(t)+o|n<<o|r,Jo=a+e}else Zo=1<<a|n<<o|r,Jo=e}function ta(e){null!==e.return&&(Qo(e,1),ea(e,1,0))}function na(e){for(;e===$o;)$o=Uo[--qo],Uo[qo]=null,Ko=Uo[--qo],Uo[qo]=null;for(;e===Go;)Go=Xo[--Yo],Xo[Yo]=null,Jo=Xo[--Yo],Xo[Yo]=null,Zo=Xo[--Yo],Xo[Yo]=null}var ra=null,oa=null,aa=!1,ia=null;function sa(e,t){var n=Rc(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function la(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ra=e,oa=co(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ra=e,oa=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Go?{id:Zo,overflow:Jo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Rc(18,null,null,0)).stateNode=t,n.return=e,e.child=n,ra=e,oa=null,!0);default:return!1}}function ca(e){return 0!==(1&e.mode)&&0===(128&e.flags)}function da(e){if(aa){var t=oa;if(t){var n=t;if(!la(e,t)){if(ca(e))throw Error(a(418));t=co(n.nextSibling);var r=ra;t&&la(e,t)?sa(r,n):(e.flags=-4097&e.flags|2,aa=!1,ra=e)}}else{if(ca(e))throw Error(a(418));e.flags=-4097&e.flags|2,aa=!1,ra=e}}}function ua(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ra=e}function ha(e){if(e!==ra)return!1;if(!aa)return ua(e),aa=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!no(e.type,e.memoizedProps)),t&&(t=oa)){if(ca(e))throw pa(),Error(a(418));for(;t;)sa(e,t),t=co(t.nextSibling)}if(ua(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){oa=co(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}oa=null}}else oa=ra?co(e.stateNode.nextSibling):null;return!0}function pa(){for(var e=oa;e;)e=co(e.nextSibling)}function fa(){oa=ra=null,aa=!1}function ma(e){null===ia?ia=[e]:ia.push(e)}var ga=y.ReactCurrentBatchConfig;function xa(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var r=n.stateNode}if(!r)throw Error(a(147,e));var o=r,i=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===i?t.ref:(t=function(e){var t=o.refs;null===e?delete t[i]:t[i]=e},t._stringRef=i,t)}if("string"!==typeof e)throw Error(a(284));if(!n._owner)throw Error(a(290,e))}return e}function ba(e,t){throw e=Object.prototype.toString.call(t),Error(a(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function va(e){return(0,e._init)(e._payload)}function ya(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=Oc(e,t)).index=0,e.sibling=null,e}function i(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=zc(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function c(e,t,n,r){var a=n.type;return a===S?u(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===a||"object"===typeof a&&null!==a&&a.$$typeof===P&&va(a)===t.type)?((r=o(t,n.props)).ref=xa(e,t,n),r.return=e,r):((r=Tc(n.type,n.key,n.props,null,e.mode,r)).ref=xa(e,t,n),r.return=e,r)}function d(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Dc(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function u(e,t,n,r,a){return null===t||7!==t.tag?((t=Lc(n,e.mode,r,a)).return=e,t):((t=o(t,n)).return=e,t)}function h(e,t,n){if("string"===typeof t&&""!==t||"number"===typeof t)return(t=zc(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case w:return(n=Tc(t.type,t.key,t.props,null,e.mode,n)).ref=xa(e,null,t),n.return=e,n;case k:return(t=Dc(t,e.mode,n)).return=e,t;case P:return h(e,(0,t._init)(t._payload),n)}if(te(t)||L(t))return(t=Lc(t,e.mode,n,null)).return=e,t;ba(e,t)}return null}function p(e,t,n,r){var o=null!==t?t.key:null;if("string"===typeof n&&""!==n||"number"===typeof n)return null!==o?null:l(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case w:return n.key===o?c(e,t,n,r):null;case k:return n.key===o?d(e,t,n,r):null;case P:return p(e,t,(o=n._init)(n._payload),r)}if(te(n)||L(n))return null!==o?null:u(e,t,n,r,null);ba(e,n)}return null}function f(e,t,n,r,o){if("string"===typeof r&&""!==r||"number"===typeof r)return l(t,e=e.get(n)||null,""+r,o);if("object"===typeof r&&null!==r){switch(r.$$typeof){case w:return c(t,e=e.get(null===r.key?n:r.key)||null,r,o);case k:return d(t,e=e.get(null===r.key?n:r.key)||null,r,o);case P:return f(e,t,n,(0,r._init)(r._payload),o)}if(te(r)||L(r))return u(t,e=e.get(n)||null,r,o,null);ba(t,r)}return null}function m(o,a,s,l){for(var c=null,d=null,u=a,m=a=0,g=null;null!==u&&m<s.length;m++){u.index>m?(g=u,u=null):g=u.sibling;var x=p(o,u,s[m],l);if(null===x){null===u&&(u=g);break}e&&u&&null===x.alternate&&t(o,u),a=i(x,a,m),null===d?c=x:d.sibling=x,d=x,u=g}if(m===s.length)return n(o,u),aa&&Qo(o,m),c;if(null===u){for(;m<s.length;m++)null!==(u=h(o,s[m],l))&&(a=i(u,a,m),null===d?c=u:d.sibling=u,d=u);return aa&&Qo(o,m),c}for(u=r(o,u);m<s.length;m++)null!==(g=f(u,o,m,s[m],l))&&(e&&null!==g.alternate&&u.delete(null===g.key?m:g.key),a=i(g,a,m),null===d?c=g:d.sibling=g,d=g);return e&&u.forEach((function(e){return t(o,e)})),aa&&Qo(o,m),c}function g(o,s,l,c){var d=L(l);if("function"!==typeof d)throw Error(a(150));if(null==(l=d.call(l)))throw Error(a(151));for(var u=d=null,m=s,g=s=0,x=null,b=l.next();null!==m&&!b.done;g++,b=l.next()){m.index>g?(x=m,m=null):x=m.sibling;var v=p(o,m,b.value,c);if(null===v){null===m&&(m=x);break}e&&m&&null===v.alternate&&t(o,m),s=i(v,s,g),null===u?d=v:u.sibling=v,u=v,m=x}if(b.done)return n(o,m),aa&&Qo(o,g),d;if(null===m){for(;!b.done;g++,b=l.next())null!==(b=h(o,b.value,c))&&(s=i(b,s,g),null===u?d=b:u.sibling=b,u=b);return aa&&Qo(o,g),d}for(m=r(o,m);!b.done;g++,b=l.next())null!==(b=f(m,o,g,b.value,c))&&(e&&null!==b.alternate&&m.delete(null===b.key?g:b.key),s=i(b,s,g),null===u?d=b:u.sibling=b,u=b);return e&&m.forEach((function(e){return t(o,e)})),aa&&Qo(o,g),d}return function e(r,a,i,l){if("object"===typeof i&&null!==i&&i.type===S&&null===i.key&&(i=i.props.children),"object"===typeof i&&null!==i){switch(i.$$typeof){case w:e:{for(var c=i.key,d=a;null!==d;){if(d.key===c){if((c=i.type)===S){if(7===d.tag){n(r,d.sibling),(a=o(d,i.props.children)).return=r,r=a;break e}}else if(d.elementType===c||"object"===typeof c&&null!==c&&c.$$typeof===P&&va(c)===d.type){n(r,d.sibling),(a=o(d,i.props)).ref=xa(r,d,i),a.return=r,r=a;break e}n(r,d);break}t(r,d),d=d.sibling}i.type===S?((a=Lc(i.props.children,r.mode,l,i.key)).return=r,r=a):((l=Tc(i.type,i.key,i.props,null,r.mode,l)).ref=xa(r,a,i),l.return=r,r=l)}return s(r);case k:e:{for(d=i.key;null!==a;){if(a.key===d){if(4===a.tag&&a.stateNode.containerInfo===i.containerInfo&&a.stateNode.implementation===i.implementation){n(r,a.sibling),(a=o(a,i.children||[])).return=r,r=a;break e}n(r,a);break}t(r,a),a=a.sibling}(a=Dc(i,r.mode,l)).return=r,r=a}return s(r);case P:return e(r,a,(d=i._init)(i._payload),l)}if(te(i))return m(r,a,i,l);if(L(i))return g(r,a,i,l);ba(r,i)}return"string"===typeof i&&""!==i||"number"===typeof i?(i=""+i,null!==a&&6===a.tag?(n(r,a.sibling),(a=o(a,i)).return=r,r=a):(n(r,a),(a=zc(i,r.mode,l)).return=r,r=a),s(r)):n(r,a)}}var wa=ya(!0),ka=ya(!1),Sa=Ao(null),ja=null,Aa=null,Ca=null;function _a(){Ca=Aa=ja=null}function Ea(e){var t=Sa.current;Co(Sa),e._currentValue=t}function Ma(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Na(e,t){ja=e,Ca=Aa=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(vs=!0),e.firstContext=null)}function Ra(e){var t=e._currentValue;if(Ca!==e)if(e={context:e,memoizedValue:t,next:null},null===Aa){if(null===ja)throw Error(a(308));Aa=e,ja.dependencies={lanes:0,firstContext:e}}else Aa=Aa.next=e;return t}var Pa=null;function Oa(e){null===Pa?Pa=[e]:Pa.push(e)}function Ta(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,Oa(t)):(n.next=o.next,o.next=n),t.interleaved=n,La(e,r)}function La(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Ia=!1;function za(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Da(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Fa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ba(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!==(2&El)){var o=r.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),r.pending=t,La(e,n)}return null===(o=r.interleaved)?(t.next=t,Oa(r)):(t.next=o.next,o.next=t),r.interleaved=t,La(e,n)}function Wa(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194240&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,bt(e,n)}}function Ha(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===a?o=a=i:a=a.next=i,n=n.next}while(null!==n);null===a?o=a=t:a=a.next=t}else o=a=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:a,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Va(e,t,n,r){var o=e.updateQueue;Ia=!1;var a=o.firstBaseUpdate,i=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var l=s,c=l.next;l.next=null,null===i?a=c:i.next=c,i=l;var d=e.alternate;null!==d&&((s=(d=d.updateQueue).lastBaseUpdate)!==i&&(null===s?d.firstBaseUpdate=c:s.next=c,d.lastBaseUpdate=l))}if(null!==a){var u=o.baseState;for(i=0,d=c=l=null,s=a;;){var h=s.lane,p=s.eventTime;if((r&h)===h){null!==d&&(d=d.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var f=e,m=s;switch(h=t,p=n,m.tag){case 1:if("function"===typeof(f=m.payload)){u=f.call(p,u,h);break e}u=f;break e;case 3:f.flags=-65537&f.flags|128;case 0:if(null===(h="function"===typeof(f=m.payload)?f.call(p,u,h):f)||void 0===h)break e;u=z({},u,h);break e;case 2:Ia=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(h=o.effects)?o.effects=[s]:h.push(s))}else p={eventTime:p,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===d?(c=d=p,l=u):d=d.next=p,i|=h;if(null===(s=s.next)){if(null===(s=o.shared.pending))break;s=(h=s).next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}if(null===d&&(l=u),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=d,null!==(t=o.shared.interleaved)){o=t;do{i|=o.lane,o=o.next}while(o!==t)}else null===a&&(o.shared.lanes=0);Il|=i,e.lanes=i,e.memoizedState=u}}function Ua(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(null!==o){if(r.callback=null,r=n,"function"!==typeof o)throw Error(a(191,o));o.call(r)}}}var qa={},$a=Ao(qa),Ka=Ao(qa),Xa=Ao(qa);function Ya(e){if(e===qa)throw Error(a(174));return e}function Ga(e,t){switch(_o(Xa,t),_o(Ka,e),_o($a,qa),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:t=le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Co($a),_o($a,t)}function Za(){Co($a),Co(Ka),Co(Xa)}function Ja(e){Ya(Xa.current);var t=Ya($a.current),n=le(t,e.type);t!==n&&(_o(Ka,e),_o($a,n))}function Qa(e){Ka.current===e&&(Co($a),Co(Ka))}var ei=Ao(0);function ti(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ni=[];function ri(){for(var e=0;e<ni.length;e++)ni[e]._workInProgressVersionPrimary=null;ni.length=0}var oi=y.ReactCurrentDispatcher,ai=y.ReactCurrentBatchConfig,ii=0,si=null,li=null,ci=null,di=!1,ui=!1,hi=0,pi=0;function fi(){throw Error(a(321))}function mi(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sr(e[n],t[n]))return!1;return!0}function gi(e,t,n,r,o,i){if(ii=i,si=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,oi.current=null===e||null===e.memoizedState?Qi:es,e=n(r,o),ui){i=0;do{if(ui=!1,hi=0,25<=i)throw Error(a(301));i+=1,ci=li=null,t.updateQueue=null,oi.current=ts,e=n(r,o)}while(ui)}if(oi.current=Ji,t=null!==li&&null!==li.next,ii=0,ci=li=si=null,di=!1,t)throw Error(a(300));return e}function xi(){var e=0!==hi;return hi=0,e}function bi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ci?si.memoizedState=ci=e:ci=ci.next=e,ci}function vi(){if(null===li){var e=si.alternate;e=null!==e?e.memoizedState:null}else e=li.next;var t=null===ci?si.memoizedState:ci.next;if(null!==t)ci=t,li=e;else{if(null===e)throw Error(a(310));e={memoizedState:(li=e).memoizedState,baseState:li.baseState,baseQueue:li.baseQueue,queue:li.queue,next:null},null===ci?si.memoizedState=ci=e:ci=ci.next=e}return ci}function yi(e,t){return"function"===typeof t?t(e):t}function wi(e){var t=vi(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=li,o=r.baseQueue,i=n.pending;if(null!==i){if(null!==o){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(null!==o){i=o.next,r=r.baseState;var l=s=null,c=null,d=i;do{var u=d.lane;if((ii&u)===u)null!==c&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var h={lane:u,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};null===c?(l=c=h,s=r):c=c.next=h,si.lanes|=u,Il|=u}d=d.next}while(null!==d&&d!==i);null===c?s=r:c.next=l,sr(r,t.memoizedState)||(vs=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=c,n.lastRenderedState=r}if(null!==(e=n.interleaved)){o=e;do{i=o.lane,si.lanes|=i,Il|=i,o=o.next}while(o!==e)}else null===o&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ki(e){var t=vi(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(null!==o){n.pending=null;var s=o=o.next;do{i=e(i,s.action),s=s.next}while(s!==o);sr(i,t.memoizedState)||(vs=!0),t.memoizedState=i,null===t.baseQueue&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Si(){}function ji(e,t){var n=si,r=vi(),o=t(),i=!sr(r.memoizedState,o);if(i&&(r.memoizedState=o,vs=!0),r=r.queue,Ii(_i.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||null!==ci&&1&ci.memoizedState.tag){if(n.flags|=2048,Ri(9,Ci.bind(null,n,r,o,t),void 0,null),null===Ml)throw Error(a(349));0!==(30&ii)||Ai(n,t,o)}return o}function Ai(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=si.updateQueue)?(t={lastEffect:null,stores:null},si.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ci(e,t,n,r){t.value=n,t.getSnapshot=r,Ei(t)&&Mi(e)}function _i(e,t,n){return n((function(){Ei(t)&&Mi(e)}))}function Ei(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!sr(e,n)}catch(r){return!0}}function Mi(e){var t=La(e,1);null!==t&&nc(t,e,1,-1)}function Ni(e){var t=bi();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:yi,lastRenderedState:e},t.queue=e,e=e.dispatch=Xi.bind(null,si,e),[t.memoizedState,e]}function Ri(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=si.updateQueue)?(t={lastEffect:null,stores:null},si.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Pi(){return vi().memoizedState}function Oi(e,t,n,r){var o=bi();si.flags|=e,o.memoizedState=Ri(1|t,n,void 0,void 0===r?null:r)}function Ti(e,t,n,r){var o=vi();r=void 0===r?null:r;var a=void 0;if(null!==li){var i=li.memoizedState;if(a=i.destroy,null!==r&&mi(r,i.deps))return void(o.memoizedState=Ri(t,n,a,r))}si.flags|=e,o.memoizedState=Ri(1|t,n,a,r)}function Li(e,t){return Oi(8390656,8,e,t)}function Ii(e,t){return Ti(2048,8,e,t)}function zi(e,t){return Ti(4,2,e,t)}function Di(e,t){return Ti(4,4,e,t)}function Fi(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Bi(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Ti(4,4,Fi.bind(null,t,e),n)}function Wi(){}function Hi(e,t){var n=vi();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&mi(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Vi(e,t){var n=vi();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&mi(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ui(e,t,n){return 0===(21&ii)?(e.baseState&&(e.baseState=!1,vs=!0),e.memoizedState=n):(sr(n,t)||(n=mt(),si.lanes|=n,Il|=n,e.baseState=!0),t)}function qi(e,t){var n=vt;vt=0!==n&&4>n?n:4,e(!0);var r=ai.transition;ai.transition={};try{e(!1),t()}finally{vt=n,ai.transition=r}}function $i(){return vi().memoizedState}function Ki(e,t,n){var r=tc(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Yi(e))Gi(t,n);else if(null!==(n=Ta(e,t,n,r))){nc(n,e,r,ec()),Zi(n,t,r)}}function Xi(e,t,n){var r=tc(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Yi(e))Gi(t,o);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var i=t.lastRenderedState,s=a(i,n);if(o.hasEagerState=!0,o.eagerState=s,sr(s,i)){var l=t.interleaved;return null===l?(o.next=o,Oa(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(c){}null!==(n=Ta(e,t,o,r))&&(nc(n,e,r,o=ec()),Zi(n,t,r))}}function Yi(e){var t=e.alternate;return e===si||null!==t&&t===si}function Gi(e,t){ui=di=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Zi(e,t,n){if(0!==(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,bt(e,n)}}var Ji={readContext:Ra,useCallback:fi,useContext:fi,useEffect:fi,useImperativeHandle:fi,useInsertionEffect:fi,useLayoutEffect:fi,useMemo:fi,useReducer:fi,useRef:fi,useState:fi,useDebugValue:fi,useDeferredValue:fi,useTransition:fi,useMutableSource:fi,useSyncExternalStore:fi,useId:fi,unstable_isNewReconciler:!1},Qi={readContext:Ra,useCallback:function(e,t){return bi().memoizedState=[e,void 0===t?null:t],e},useContext:Ra,useEffect:Li,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Oi(4194308,4,Fi.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Oi(4194308,4,e,t)},useInsertionEffect:function(e,t){return Oi(4,2,e,t)},useMemo:function(e,t){var n=bi();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=bi();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Ki.bind(null,si,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},bi().memoizedState=e},useState:Ni,useDebugValue:Wi,useDeferredValue:function(e){return bi().memoizedState=e},useTransition:function(){var e=Ni(!1),t=e[0];return e=qi.bind(null,e[1]),bi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=si,o=bi();if(aa){if(void 0===n)throw Error(a(407));n=n()}else{if(n=t(),null===Ml)throw Error(a(349));0!==(30&ii)||Ai(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Li(_i.bind(null,r,i,e),[e]),r.flags|=2048,Ri(9,Ci.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=bi(),t=Ml.identifierPrefix;if(aa){var n=Jo;t=":"+t+"R"+(n=(Zo&~(1<<32-it(Zo)-1)).toString(32)+n),0<(n=hi++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=pi++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},es={readContext:Ra,useCallback:Hi,useContext:Ra,useEffect:Ii,useImperativeHandle:Bi,useInsertionEffect:zi,useLayoutEffect:Di,useMemo:Vi,useReducer:wi,useRef:Pi,useState:function(){return wi(yi)},useDebugValue:Wi,useDeferredValue:function(e){return Ui(vi(),li.memoizedState,e)},useTransition:function(){return[wi(yi)[0],vi().memoizedState]},useMutableSource:Si,useSyncExternalStore:ji,useId:$i,unstable_isNewReconciler:!1},ts={readContext:Ra,useCallback:Hi,useContext:Ra,useEffect:Ii,useImperativeHandle:Bi,useInsertionEffect:zi,useLayoutEffect:Di,useMemo:Vi,useReducer:ki,useRef:Pi,useState:function(){return ki(yi)},useDebugValue:Wi,useDeferredValue:function(e){var t=vi();return null===li?t.memoizedState=e:Ui(t,li.memoizedState,e)},useTransition:function(){return[ki(yi)[0],vi().memoizedState]},useMutableSource:Si,useSyncExternalStore:ji,useId:$i,unstable_isNewReconciler:!1};function ns(e,t){if(e&&e.defaultProps){for(var n in t=z({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function rs(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:z({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var os={isMounted:function(e){return!!(e=e._reactInternals)&&He(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ec(),o=tc(e),a=Fa(r,o);a.payload=t,void 0!==n&&null!==n&&(a.callback=n),null!==(t=Ba(e,a,o))&&(nc(t,e,o,r),Wa(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ec(),o=tc(e),a=Fa(r,o);a.tag=1,a.payload=t,void 0!==n&&null!==n&&(a.callback=n),null!==(t=Ba(e,a,o))&&(nc(t,e,o,r),Wa(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ec(),r=tc(e),o=Fa(n,r);o.tag=2,void 0!==t&&null!==t&&(o.callback=t),null!==(t=Ba(e,o,r))&&(nc(t,e,r,n),Wa(t,e,r))}};function as(e,t,n,r,o,a,i){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,i):!t.prototype||!t.prototype.isPureReactComponent||(!lr(n,r)||!lr(o,a))}function is(e,t,n){var r=!1,o=Eo,a=t.contextType;return"object"===typeof a&&null!==a?a=Ra(a):(o=Oo(t)?Ro:Mo.current,a=(r=null!==(r=t.contextTypes)&&void 0!==r)?Po(e,o):Eo),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=os,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=a),t}function ss(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&os.enqueueReplaceState(t,t.state,null)}function ls(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},za(e);var a=t.contextType;"object"===typeof a&&null!==a?o.context=Ra(a):(a=Oo(t)?Ro:Mo.current,o.context=Po(e,a)),o.state=e.memoizedState,"function"===typeof(a=t.getDerivedStateFromProps)&&(rs(e,t,a,n),o.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof o.getSnapshotBeforeUpdate||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||(t=o.state,"function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&os.enqueueReplaceState(o,o.state,null),Va(e,n,o,r),o.state=e.memoizedState),"function"===typeof o.componentDidMount&&(e.flags|=4194308)}function cs(e,t){try{var n="",r=t;do{n+=W(r),r=r.return}while(r);var o=n}catch(a){o="\nError generating stack: "+a.message+"\n"+a.stack}return{value:e,source:t,stack:o,digest:null}}function ds(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function us(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}var hs="function"===typeof WeakMap?WeakMap:Map;function ps(e,t,n){(n=Fa(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ul||(Ul=!0,ql=r),us(0,t)},n}function fs(e,t,n){(n=Fa(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){us(0,t)}}var a=e.stateNode;return null!==a&&"function"===typeof a.componentDidCatch&&(n.callback=function(){us(0,t),"function"!==typeof r&&(null===$l?$l=new Set([this]):$l.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function ms(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hs;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Ac.bind(null,e,t,n),t.then(e,e))}function gs(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function xs(e,t,n,r,o){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Fa(-1,1)).tag=2,Ba(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var bs=y.ReactCurrentOwner,vs=!1;function ys(e,t,n,r){t.child=null===e?ka(t,null,n,r):wa(t,e.child,n,r)}function ws(e,t,n,r,o){n=n.render;var a=t.ref;return Na(t,o),r=gi(e,t,n,r,a,o),n=xi(),null===e||vs?(aa&&n&&ta(t),t.flags|=1,ys(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Us(e,t,o))}function ks(e,t,n,r,o){if(null===e){var a=n.type;return"function"!==typeof a||Pc(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Tc(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Ss(e,t,a,r,o))}if(a=e.child,0===(e.lanes&o)){var i=a.memoizedProps;if((n=null!==(n=n.compare)?n:lr)(i,r)&&e.ref===t.ref)return Us(e,t,o)}return t.flags|=1,(e=Oc(a,r)).ref=t.ref,e.return=t,t.child=e}function Ss(e,t,n,r,o){if(null!==e){var a=e.memoizedProps;if(lr(a,r)&&e.ref===t.ref){if(vs=!1,t.pendingProps=r=a,0===(e.lanes&o))return t.lanes=e.lanes,Us(e,t,o);0!==(131072&e.flags)&&(vs=!0)}}return Cs(e,t,n,r,o)}function js(e,t,n){var r=t.pendingProps,o=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},_o(Ol,Pl),Pl|=n;else{if(0===(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,_o(Ol,Pl),Pl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==a?a.baseLanes:n,_o(Ol,Pl),Pl|=r}else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,_o(Ol,Pl),Pl|=r;return ys(e,t,o,n),t.child}function As(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Cs(e,t,n,r,o){var a=Oo(n)?Ro:Mo.current;return a=Po(t,a),Na(t,o),n=gi(e,t,n,r,a,o),r=xi(),null===e||vs?(aa&&r&&ta(t),t.flags|=1,ys(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Us(e,t,o))}function _s(e,t,n,r,o){if(Oo(n)){var a=!0;zo(t)}else a=!1;if(Na(t,o),null===t.stateNode)Vs(e,t),is(t,n,r),ls(t,n,r,o),r=!0;else if(null===e){var i=t.stateNode,s=t.memoizedProps;i.props=s;var l=i.context,c=n.contextType;"object"===typeof c&&null!==c?c=Ra(c):c=Po(t,c=Oo(n)?Ro:Mo.current);var d=n.getDerivedStateFromProps,u="function"===typeof d||"function"===typeof i.getSnapshotBeforeUpdate;u||"function"!==typeof i.UNSAFE_componentWillReceiveProps&&"function"!==typeof i.componentWillReceiveProps||(s!==r||l!==c)&&ss(t,i,r,c),Ia=!1;var h=t.memoizedState;i.state=h,Va(t,r,i,o),l=t.memoizedState,s!==r||h!==l||No.current||Ia?("function"===typeof d&&(rs(t,n,d,r),l=t.memoizedState),(s=Ia||as(t,n,s,r,h,l,c))?(u||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||("function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"===typeof i.componentDidMount&&(t.flags|=4194308)):("function"===typeof i.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),i.props=r,i.state=l,i.context=c,r=s):("function"===typeof i.componentDidMount&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Da(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:ns(t.type,s),i.props=c,u=t.pendingProps,h=i.context,"object"===typeof(l=n.contextType)&&null!==l?l=Ra(l):l=Po(t,l=Oo(n)?Ro:Mo.current);var p=n.getDerivedStateFromProps;(d="function"===typeof p||"function"===typeof i.getSnapshotBeforeUpdate)||"function"!==typeof i.UNSAFE_componentWillReceiveProps&&"function"!==typeof i.componentWillReceiveProps||(s!==u||h!==l)&&ss(t,i,r,l),Ia=!1,h=t.memoizedState,i.state=h,Va(t,r,i,o);var f=t.memoizedState;s!==u||h!==f||No.current||Ia?("function"===typeof p&&(rs(t,n,p,r),f=t.memoizedState),(c=Ia||as(t,n,c,r,h,f,l)||!1)?(d||"function"!==typeof i.UNSAFE_componentWillUpdate&&"function"!==typeof i.componentWillUpdate||("function"===typeof i.componentWillUpdate&&i.componentWillUpdate(r,f,l),"function"===typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(r,f,l)),"function"===typeof i.componentDidUpdate&&(t.flags|=4),"function"===typeof i.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof i.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof i.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=f),i.props=r,i.state=f,i.context=l,r=c):("function"!==typeof i.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof i.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Es(e,t,n,r,a,o)}function Es(e,t,n,r,o,a){As(e,t);var i=0!==(128&t.flags);if(!r&&!i)return o&&Do(t,n,!1),Us(e,t,a);r=t.stateNode,bs.current=t;var s=i&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&i?(t.child=wa(t,e.child,null,a),t.child=wa(t,null,s,a)):ys(e,t,s,a),t.memoizedState=r.state,o&&Do(t,n,!0),t.child}function Ms(e){var t=e.stateNode;t.pendingContext?Lo(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Lo(0,t.context,!1),Ga(e,t.containerInfo)}function Ns(e,t,n,r,o){return fa(),ma(o),t.flags|=256,ys(e,t,n,r),t.child}var Rs,Ps,Os,Ts,Ls={dehydrated:null,treeContext:null,retryLane:0};function Is(e){return{baseLanes:e,cachePool:null,transitions:null}}function zs(e,t,n){var r,o=t.pendingProps,i=ei.current,s=!1,l=0!==(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!==(2&i)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(i|=1),_o(ei,1&i),null===e)return da(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(l=o.children,e=o.fallback,s?(o=t.mode,s=t.child,l={mode:"hidden",children:l},0===(1&o)&&null!==s?(s.childLanes=0,s.pendingProps=l):s=Ic(l,o,0,null),e=Lc(e,o,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Is(n),t.memoizedState=Ls,e):Ds(t,l));if(null!==(i=e.memoizedState)&&null!==(r=i.dehydrated))return function(e,t,n,r,o,i,s){if(n)return 256&t.flags?(t.flags&=-257,Fs(e,t,s,r=ds(Error(a(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Ic({mode:"visible",children:r.children},o,0,null),(i=Lc(i,o,s,null)).flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,0!==(1&t.mode)&&wa(t,e.child,null,s),t.child.memoizedState=Is(s),t.memoizedState=Ls,i);if(0===(1&t.mode))return Fs(e,t,s,null);if("$!"===o.data){if(r=o.nextSibling&&o.nextSibling.dataset)var l=r.dgst;return r=l,Fs(e,t,s,r=ds(i=Error(a(419)),r,void 0))}if(l=0!==(s&e.childLanes),vs||l){if(null!==(r=Ml)){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!==(o&(r.suspendedLanes|s))?0:o)&&o!==i.retryLane&&(i.retryLane=o,La(e,o),nc(r,e,o,-1))}return mc(),Fs(e,t,s,r=ds(Error(a(421))))}return"$?"===o.data?(t.flags|=128,t.child=e.child,t=_c.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,oa=co(o.nextSibling),ra=t,aa=!0,ia=null,null!==e&&(Xo[Yo++]=Zo,Xo[Yo++]=Jo,Xo[Yo++]=Go,Zo=e.id,Jo=e.overflow,Go=t),t=Ds(t,r.children),t.flags|=4096,t)}(e,t,l,o,r,i,n);if(s){s=o.fallback,l=t.mode,r=(i=e.child).sibling;var c={mode:"hidden",children:o.children};return 0===(1&l)&&t.child!==i?((o=t.child).childLanes=0,o.pendingProps=c,t.deletions=null):(o=Oc(i,c)).subtreeFlags=14680064&i.subtreeFlags,null!==r?s=Oc(r,s):(s=Lc(s,l,n,null)).flags|=2,s.return=t,o.return=t,o.sibling=s,t.child=o,o=s,s=t.child,l=null===(l=e.child.memoizedState)?Is(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=Ls,o}return e=(s=e.child).sibling,o=Oc(s,{mode:"visible",children:o.children}),0===(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function Ds(e,t){return(t=Ic({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Fs(e,t,n,r){return null!==r&&ma(r),wa(t,e.child,null,n),(e=Ds(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Bs(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Ma(e.return,t,n)}function Ws(e,t,n,r,o){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o)}function Hs(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;if(ys(e,t,r.children,n),0!==(2&(r=ei.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Bs(e,n,t);else if(19===e.tag)Bs(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(_o(ei,r),0===(1&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===ti(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ws(t,!1,o,n,a);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===ti(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ws(t,!0,n,null,a);break;case"together":Ws(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Vs(e,t){0===(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Us(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Il|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=Oc(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Oc(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function qs(e,t){if(!aa)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function $s(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ks(e,t,n){var r=t.pendingProps;switch(na(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $s(t),null;case 1:case 17:return Oo(t.type)&&To(),$s(t),null;case 3:return r=t.stateNode,Za(),Co(No),Co(Mo),ri(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(ha(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==ia&&(ic(ia),ia=null))),Ps(e,t),$s(t),null;case 5:Qa(t);var o=Ya(Xa.current);if(n=t.type,null!==e&&null!=t.stateNode)Os(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(a(166));return $s(t),null}if(e=Ya($a.current),ha(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[po]=t,r[fo]=i,e=0!==(1&t.mode),n){case"dialog":Fr("cancel",r),Fr("close",r);break;case"iframe":case"object":case"embed":Fr("load",r);break;case"video":case"audio":for(o=0;o<Lr.length;o++)Fr(Lr[o],r);break;case"source":Fr("error",r);break;case"img":case"image":case"link":Fr("error",r),Fr("load",r);break;case"details":Fr("toggle",r);break;case"input":G(r,i),Fr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Fr("invalid",r);break;case"textarea":oe(r,i),Fr("invalid",r)}for(var l in be(n,i),o=null,i)if(i.hasOwnProperty(l)){var c=i[l];"children"===l?"string"===typeof c?r.textContent!==c&&(!0!==i.suppressHydrationWarning&&Jr(r.textContent,c,e),o=["children",c]):"number"===typeof c&&r.textContent!==""+c&&(!0!==i.suppressHydrationWarning&&Jr(r.textContent,c,e),o=["children",""+c]):s.hasOwnProperty(l)&&null!=c&&"onScroll"===l&&Fr("scroll",r)}switch(n){case"input":$(r),Q(r,i,!0);break;case"textarea":$(r),ie(r);break;case"select":case"option":break;default:"function"===typeof i.onClick&&(r.onclick=Qr)}r=o,t.updateQueue=r,null!==r&&(t.flags|=4)}else{l=9===o.nodeType?o:o.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=se(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),"select"===n&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[po]=t,e[fo]=r,Rs(e,t,!1,!1),t.stateNode=e;e:{switch(l=ve(n,r),n){case"dialog":Fr("cancel",e),Fr("close",e),o=r;break;case"iframe":case"object":case"embed":Fr("load",e),o=r;break;case"video":case"audio":for(o=0;o<Lr.length;o++)Fr(Lr[o],e);o=r;break;case"source":Fr("error",e),o=r;break;case"img":case"image":case"link":Fr("error",e),Fr("load",e),o=r;break;case"details":Fr("toggle",e),o=r;break;case"input":G(e,r),o=Y(e,r),Fr("invalid",e);break;case"option":default:o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=z({},r,{value:void 0}),Fr("invalid",e);break;case"textarea":oe(e,r),o=re(e,r),Fr("invalid",e)}for(i in be(n,o),c=o)if(c.hasOwnProperty(i)){var d=c[i];"style"===i?ge(e,d):"dangerouslySetInnerHTML"===i?null!=(d=d?d.__html:void 0)&&ue(e,d):"children"===i?"string"===typeof d?("textarea"!==n||""!==d)&&he(e,d):"number"===typeof d&&he(e,""+d):"suppressContentEditableWarning"!==i&&"suppressHydrationWarning"!==i&&"autoFocus"!==i&&(s.hasOwnProperty(i)?null!=d&&"onScroll"===i&&Fr("scroll",e):null!=d&&v(e,i,d,l))}switch(n){case"input":$(e),Q(e,r,!1);break;case"textarea":$(e),ie(e);break;case"option":null!=r.value&&e.setAttribute("value",""+U(r.value));break;case"select":e.multiple=!!r.multiple,null!=(i=r.value)?ne(e,!!r.multiple,i,!1):null!=r.defaultValue&&ne(e,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof o.onClick&&(e.onclick=Qr)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return $s(t),null;case 6:if(e&&null!=t.stateNode)Ts(e,t,e.memoizedProps,r);else{if("string"!==typeof r&&null===t.stateNode)throw Error(a(166));if(n=Ya(Xa.current),Ya($a.current),ha(t)){if(r=t.stateNode,n=t.memoizedProps,r[po]=t,(i=r.nodeValue!==n)&&null!==(e=ra))switch(e.tag){case 3:Jr(r.nodeValue,n,0!==(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Jr(r.nodeValue,n,0!==(1&e.mode))}i&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[po]=t,t.stateNode=r}return $s(t),null;case 13:if(Co(ei),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(aa&&null!==oa&&0!==(1&t.mode)&&0===(128&t.flags))pa(),fa(),t.flags|=98560,i=!1;else if(i=ha(t),null!==r&&null!==r.dehydrated){if(null===e){if(!i)throw Error(a(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(a(317));i[po]=t}else fa(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;$s(t),i=!1}else null!==ia&&(ic(ia),ia=null),i=!0;if(!i)return 65536&t.flags?t:null}return 0!==(128&t.flags)?(t.lanes=n,t):((r=null!==r)!==(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,0!==(1&t.mode)&&(null===e||0!==(1&ei.current)?0===Tl&&(Tl=3):mc())),null!==t.updateQueue&&(t.flags|=4),$s(t),null);case 4:return Za(),Ps(e,t),null===e&&Hr(t.stateNode.containerInfo),$s(t),null;case 10:return Ea(t.type._context),$s(t),null;case 19:if(Co(ei),null===(i=t.memoizedState))return $s(t),null;if(r=0!==(128&t.flags),null===(l=i.rendering))if(r)qs(i,!1);else{if(0!==Tl||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(l=ti(e))){for(t.flags|=128,qs(i,!1),null!==(r=l.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(i=n).flags&=14680066,null===(l=i.alternate)?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,e=l.dependencies,i.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return _o(ei,1&ei.current|2),t.child}e=e.sibling}null!==i.tail&&Ze()>Hl&&(t.flags|=128,r=!0,qs(i,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=ti(l))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),qs(i,!0),null===i.tail&&"hidden"===i.tailMode&&!l.alternate&&!aa)return $s(t),null}else 2*Ze()-i.renderingStartTime>Hl&&1073741824!==n&&(t.flags|=128,r=!0,qs(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=i.last)?n.sibling=l:t.child=l,i.last=l)}return null!==i.tail?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ze(),t.sibling=null,n=ei.current,_o(ei,r?1&n|2:1&n),t):($s(t),null);case 22:case 23:return uc(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!==(1&t.mode)?0!==(1073741824&Pl)&&($s(t),6&t.subtreeFlags&&(t.flags|=8192)):$s(t),null;case 24:case 25:return null}throw Error(a(156,t.tag))}function Xs(e,t){switch(na(t),t.tag){case 1:return Oo(t.type)&&To(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Za(),Co(No),Co(Mo),ri(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Qa(t),null;case 13:if(Co(ei),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));fa()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Co(ei),null;case 4:return Za(),null;case 10:return Ea(t.type._context),null;case 22:case 23:return uc(),null;default:return null}}Rs=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ps=function(){},Os=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Ya($a.current);var a,i=null;switch(n){case"input":o=Y(e,o),r=Y(e,r),i=[];break;case"select":o=z({},o,{value:void 0}),r=z({},r,{value:void 0}),i=[];break;case"textarea":o=re(e,o),r=re(e,r),i=[];break;default:"function"!==typeof o.onClick&&"function"===typeof r.onClick&&(e.onclick=Qr)}for(d in be(n,r),n=null,o)if(!r.hasOwnProperty(d)&&o.hasOwnProperty(d)&&null!=o[d])if("style"===d){var l=o[d];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==d&&"children"!==d&&"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&"autoFocus"!==d&&(s.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in r){var c=r[d];if(l=null!=o?o[d]:void 0,r.hasOwnProperty(d)&&c!==l&&(null!=c||null!=l))if("style"===d)if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(i||(i=[]),i.push(d,n)),n=c;else"dangerouslySetInnerHTML"===d?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(i=i||[]).push(d,c)):"children"===d?"string"!==typeof c&&"number"!==typeof c||(i=i||[]).push(d,""+c):"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&(s.hasOwnProperty(d)?(null!=c&&"onScroll"===d&&Fr("scroll",e),i||l===c||(i=[])):(i=i||[]).push(d,c))}n&&(i=i||[]).push("style",n);var d=i;(t.updateQueue=d)&&(t.flags|=4)}},Ts=function(e,t,n,r){n!==r&&(t.flags|=4)};var Ys=!1,Gs=!1,Zs="function"===typeof WeakSet?WeakSet:Set,Js=null;function Qs(e,t){var n=e.ref;if(null!==n)if("function"===typeof n)try{n(null)}catch(r){jc(e,t,r)}else n.current=null}function el(e,t,n){try{n()}catch(r){jc(e,t,r)}}var tl=!1;function nl(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var a=o.destroy;o.destroy=void 0,void 0!==a&&el(t,n,a)}o=o.next}while(o!==r)}}function rl(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ol(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"===typeof t?t(e):t.current=e}}function al(e){var t=e.alternate;null!==t&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[po],delete t[fo],delete t[go],delete t[xo],delete t[bo])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function il(e){return 5===e.tag||3===e.tag||4===e.tag}function sl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||il(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function ll(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=Qr));else if(4!==r&&null!==(e=e.child))for(ll(e,t,n),e=e.sibling;null!==e;)ll(e,t,n),e=e.sibling}function cl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(cl(e,t,n),e=e.sibling;null!==e;)cl(e,t,n),e=e.sibling}var dl=null,ul=!1;function hl(e,t,n){for(n=n.child;null!==n;)pl(e,t,n),n=n.sibling}function pl(e,t,n){if(at&&"function"===typeof at.onCommitFiberUnmount)try{at.onCommitFiberUnmount(ot,n)}catch(s){}switch(n.tag){case 5:Gs||Qs(n,t);case 6:var r=dl,o=ul;dl=null,hl(e,t,n),ul=o,null!==(dl=r)&&(ul?(e=dl,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):dl.removeChild(n.stateNode));break;case 18:null!==dl&&(ul?(e=dl,n=n.stateNode,8===e.nodeType?lo(e.parentNode,n):1===e.nodeType&&lo(e,n),Ht(e)):lo(dl,n.stateNode));break;case 4:r=dl,o=ul,dl=n.stateNode.containerInfo,ul=!0,hl(e,t,n),dl=r,ul=o;break;case 0:case 11:case 14:case 15:if(!Gs&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var a=o,i=a.destroy;a=a.tag,void 0!==i&&(0!==(2&a)||0!==(4&a))&&el(n,t,i),o=o.next}while(o!==r)}hl(e,t,n);break;case 1:if(!Gs&&(Qs(n,t),"function"===typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){jc(n,t,s)}hl(e,t,n);break;case 21:hl(e,t,n);break;case 22:1&n.mode?(Gs=(r=Gs)||null!==n.memoizedState,hl(e,t,n),Gs=r):hl(e,t,n);break;default:hl(e,t,n)}}function fl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Zs),t.forEach((function(t){var r=Ec.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function ml(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 5:dl=l.stateNode,ul=!1;break e;case 3:case 4:dl=l.stateNode.containerInfo,ul=!0;break e}l=l.return}if(null===dl)throw Error(a(160));pl(i,s,o),dl=null,ul=!1;var c=o.alternate;null!==c&&(c.return=null),o.return=null}catch(d){jc(o,t,d)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)gl(t,e),t=t.sibling}function gl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ml(t,e),xl(e),4&r){try{nl(3,e,e.return),rl(3,e)}catch(g){jc(e,e.return,g)}try{nl(5,e,e.return)}catch(g){jc(e,e.return,g)}}break;case 1:ml(t,e),xl(e),512&r&&null!==n&&Qs(n,n.return);break;case 5:if(ml(t,e),xl(e),512&r&&null!==n&&Qs(n,n.return),32&e.flags){var o=e.stateNode;try{he(o,"")}catch(g){jc(e,e.return,g)}}if(4&r&&null!=(o=e.stateNode)){var i=e.memoizedProps,s=null!==n?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,null!==c)try{"input"===l&&"radio"===i.type&&null!=i.name&&Z(o,i),ve(l,s);var d=ve(l,i);for(s=0;s<c.length;s+=2){var u=c[s],h=c[s+1];"style"===u?ge(o,h):"dangerouslySetInnerHTML"===u?ue(o,h):"children"===u?he(o,h):v(o,u,h,d)}switch(l){case"input":J(o,i);break;case"textarea":ae(o,i);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var f=i.value;null!=f?ne(o,!!i.multiple,f,!1):p!==!!i.multiple&&(null!=i.defaultValue?ne(o,!!i.multiple,i.defaultValue,!0):ne(o,!!i.multiple,i.multiple?[]:"",!1))}o[fo]=i}catch(g){jc(e,e.return,g)}}break;case 6:if(ml(t,e),xl(e),4&r){if(null===e.stateNode)throw Error(a(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(g){jc(e,e.return,g)}}break;case 3:if(ml(t,e),xl(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Ht(t.containerInfo)}catch(g){jc(e,e.return,g)}break;case 4:default:ml(t,e),xl(e);break;case 13:ml(t,e),xl(e),8192&(o=e.child).flags&&(i=null!==o.memoizedState,o.stateNode.isHidden=i,!i||null!==o.alternate&&null!==o.alternate.memoizedState||(Wl=Ze())),4&r&&fl(e);break;case 22:if(u=null!==n&&null!==n.memoizedState,1&e.mode?(Gs=(d=Gs)||u,ml(t,e),Gs=d):ml(t,e),xl(e),8192&r){if(d=null!==e.memoizedState,(e.stateNode.isHidden=d)&&!u&&0!==(1&e.mode))for(Js=e,u=e.child;null!==u;){for(h=Js=u;null!==Js;){switch(f=(p=Js).child,p.tag){case 0:case 11:case 14:case 15:nl(4,p,p.return);break;case 1:Qs(p,p.return);var m=p.stateNode;if("function"===typeof m.componentWillUnmount){r=p,n=p.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){jc(r,n,g)}}break;case 5:Qs(p,p.return);break;case 22:if(null!==p.memoizedState){wl(h);continue}}null!==f?(f.return=p,Js=f):wl(h)}u=u.sibling}e:for(u=null,h=e;;){if(5===h.tag){if(null===u){u=h;try{o=h.stateNode,d?"function"===typeof(i=o.style).setProperty?i.setProperty("display","none","important"):i.display="none":(l=h.stateNode,s=void 0!==(c=h.memoizedProps.style)&&null!==c&&c.hasOwnProperty("display")?c.display:null,l.style.display=me("display",s))}catch(g){jc(e,e.return,g)}}}else if(6===h.tag){if(null===u)try{h.stateNode.nodeValue=d?"":h.memoizedProps}catch(g){jc(e,e.return,g)}}else if((22!==h.tag&&23!==h.tag||null===h.memoizedState||h===e)&&null!==h.child){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;null===h.sibling;){if(null===h.return||h.return===e)break e;u===h&&(u=null),h=h.return}u===h&&(u=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:ml(t,e),xl(e),4&r&&fl(e);case 21:}}function xl(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(il(n)){var r=n;break e}n=n.return}throw Error(a(160))}switch(r.tag){case 5:var o=r.stateNode;32&r.flags&&(he(o,""),r.flags&=-33),cl(e,sl(e),o);break;case 3:case 4:var i=r.stateNode.containerInfo;ll(e,sl(e),i);break;default:throw Error(a(161))}}catch(s){jc(e,e.return,s)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function bl(e,t,n){Js=e,vl(e,t,n)}function vl(e,t,n){for(var r=0!==(1&e.mode);null!==Js;){var o=Js,a=o.child;if(22===o.tag&&r){var i=null!==o.memoizedState||Ys;if(!i){var s=o.alternate,l=null!==s&&null!==s.memoizedState||Gs;s=Ys;var c=Gs;if(Ys=i,(Gs=l)&&!c)for(Js=o;null!==Js;)l=(i=Js).child,22===i.tag&&null!==i.memoizedState?kl(o):null!==l?(l.return=i,Js=l):kl(o);for(;null!==a;)Js=a,vl(a,t,n),a=a.sibling;Js=o,Ys=s,Gs=c}yl(e)}else 0!==(8772&o.subtreeFlags)&&null!==a?(a.return=o,Js=a):yl(e)}}function yl(e){for(;null!==Js;){var t=Js;if(0!==(8772&t.flags)){var n=t.alternate;try{if(0!==(8772&t.flags))switch(t.tag){case 0:case 11:case 15:Gs||rl(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!Gs)if(null===n)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:ns(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;null!==i&&Ua(t,i,r);break;case 3:var s=t.updateQueue;if(null!==s){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}Ua(t,s,n)}break;case 5:var l=t.stateNode;if(null===n&&4&t.flags){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var d=t.alternate;if(null!==d){var u=d.memoizedState;if(null!==u){var h=u.dehydrated;null!==h&&Ht(h)}}}break;default:throw Error(a(163))}Gs||512&t.flags&&ol(t)}catch(p){jc(t,t.return,p)}}if(t===e){Js=null;break}if(null!==(n=t.sibling)){n.return=t.return,Js=n;break}Js=t.return}}function wl(e){for(;null!==Js;){var t=Js;if(t===e){Js=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Js=n;break}Js=t.return}}function kl(e){for(;null!==Js;){var t=Js;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{rl(4,t)}catch(l){jc(t,n,l)}break;case 1:var r=t.stateNode;if("function"===typeof r.componentDidMount){var o=t.return;try{r.componentDidMount()}catch(l){jc(t,o,l)}}var a=t.return;try{ol(t)}catch(l){jc(t,a,l)}break;case 5:var i=t.return;try{ol(t)}catch(l){jc(t,i,l)}}}catch(l){jc(t,t.return,l)}if(t===e){Js=null;break}var s=t.sibling;if(null!==s){s.return=t.return,Js=s;break}Js=t.return}}var Sl,jl=Math.ceil,Al=y.ReactCurrentDispatcher,Cl=y.ReactCurrentOwner,_l=y.ReactCurrentBatchConfig,El=0,Ml=null,Nl=null,Rl=0,Pl=0,Ol=Ao(0),Tl=0,Ll=null,Il=0,zl=0,Dl=0,Fl=null,Bl=null,Wl=0,Hl=1/0,Vl=null,Ul=!1,ql=null,$l=null,Kl=!1,Xl=null,Yl=0,Gl=0,Zl=null,Jl=-1,Ql=0;function ec(){return 0!==(6&El)?Ze():-1!==Jl?Jl:Jl=Ze()}function tc(e){return 0===(1&e.mode)?1:0!==(2&El)&&0!==Rl?Rl&-Rl:null!==ga.transition?(0===Ql&&(Ql=mt()),Ql):0!==(e=vt)?e:e=void 0===(e=window.event)?16:Gt(e.type)}function nc(e,t,n,r){if(50<Gl)throw Gl=0,Zl=null,Error(a(185));xt(e,n,r),0!==(2&El)&&e===Ml||(e===Ml&&(0===(2&El)&&(zl|=n),4===Tl&&sc(e,Rl)),rc(e,r),1===n&&0===El&&0===(1&t.mode)&&(Hl=Ze()+500,Bo&&Vo()))}function rc(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,a=e.pendingLanes;0<a;){var i=31-it(a),s=1<<i,l=o[i];-1===l?0!==(s&n)&&0===(s&r)||(o[i]=pt(s,t)):l<=t&&(e.expiredLanes|=s),a&=~s}}(e,t);var r=ht(e,e===Ml?Rl:0);if(0===r)null!==n&&Xe(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Xe(n),1===t)0===e.tag?function(e){Bo=!0,Ho(e)}(lc.bind(null,e)):Ho(lc.bind(null,e)),io((function(){0===(6&El)&&Vo()})),n=null;else{switch(yt(r)){case 1:n=Qe;break;case 4:n=et;break;case 16:default:n=tt;break;case 536870912:n=rt}n=Mc(n,oc.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function oc(e,t){if(Jl=-1,Ql=0,0!==(6&El))throw Error(a(327));var n=e.callbackNode;if(kc()&&e.callbackNode!==n)return null;var r=ht(e,e===Ml?Rl:0);if(0===r)return null;if(0!==(30&r)||0!==(r&e.expiredLanes)||t)t=gc(e,r);else{t=r;var o=El;El|=2;var i=fc();for(Ml===e&&Rl===t||(Vl=null,Hl=Ze()+500,hc(e,t));;)try{bc();break}catch(l){pc(e,l)}_a(),Al.current=i,El=o,null!==Nl?t=0:(Ml=null,Rl=0,t=Tl)}if(0!==t){if(2===t&&(0!==(o=ft(e))&&(r=o,t=ac(e,o))),1===t)throw n=Ll,hc(e,0),sc(e,r),rc(e,Ze()),n;if(6===t)sc(e,r);else{if(o=e.current.alternate,0===(30&r)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var o=n[r],a=o.getSnapshot;o=o.value;try{if(!sr(a(),o))return!1}catch(s){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(o)&&(2===(t=gc(e,r))&&(0!==(i=ft(e))&&(r=i,t=ac(e,i))),1===t))throw n=Ll,hc(e,0),sc(e,r),rc(e,Ze()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(a(345));case 2:case 5:wc(e,Bl,Vl);break;case 3:if(sc(e,r),(130023424&r)===r&&10<(t=Wl+500-Ze())){if(0!==ht(e,0))break;if(((o=e.suspendedLanes)&r)!==r){ec(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=ro(wc.bind(null,e,Bl,Vl),t);break}wc(e,Bl,Vl);break;case 4:if(sc(e,r),(4194240&r)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-it(r);i=1<<s,(s=t[s])>o&&(o=s),r&=~i}if(r=o,10<(r=(120>(r=Ze()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*jl(r/1960))-r)){e.timeoutHandle=ro(wc.bind(null,e,Bl,Vl),r);break}wc(e,Bl,Vl);break;default:throw Error(a(329))}}}return rc(e,Ze()),e.callbackNode===n?oc.bind(null,e):null}function ac(e,t){var n=Fl;return e.current.memoizedState.isDehydrated&&(hc(e,t).flags|=256),2!==(e=gc(e,t))&&(t=Bl,Bl=n,null!==t&&ic(t)),e}function ic(e){null===Bl?Bl=e:Bl.push.apply(Bl,e)}function sc(e,t){for(t&=~Dl,t&=~zl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-it(t),r=1<<n;e[n]=-1,t&=~r}}function lc(e){if(0!==(6&El))throw Error(a(327));kc();var t=ht(e,0);if(0===(1&t))return rc(e,Ze()),null;var n=gc(e,t);if(0!==e.tag&&2===n){var r=ft(e);0!==r&&(t=r,n=ac(e,r))}if(1===n)throw n=Ll,hc(e,0),sc(e,t),rc(e,Ze()),n;if(6===n)throw Error(a(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,wc(e,Bl,Vl),rc(e,Ze()),null}function cc(e,t){var n=El;El|=1;try{return e(t)}finally{0===(El=n)&&(Hl=Ze()+500,Bo&&Vo())}}function dc(e){null!==Xl&&0===Xl.tag&&0===(6&El)&&kc();var t=El;El|=1;var n=_l.transition,r=vt;try{if(_l.transition=null,vt=1,e)return e()}finally{vt=r,_l.transition=n,0===(6&(El=t))&&Vo()}}function uc(){Pl=Ol.current,Co(Ol)}function hc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,oo(n)),null!==Nl)for(n=Nl.return;null!==n;){var r=n;switch(na(r),r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&To();break;case 3:Za(),Co(No),Co(Mo),ri();break;case 5:Qa(r);break;case 4:Za();break;case 13:case 19:Co(ei);break;case 10:Ea(r.type._context);break;case 22:case 23:uc()}n=n.return}if(Ml=e,Nl=e=Oc(e.current,null),Rl=Pl=t,Tl=0,Ll=null,Dl=zl=Il=0,Bl=Fl=null,null!==Pa){for(t=0;t<Pa.length;t++)if(null!==(r=(n=Pa[t]).interleaved)){n.interleaved=null;var o=r.next,a=n.pending;if(null!==a){var i=a.next;a.next=o,r.next=i}n.pending=r}Pa=null}return e}function pc(e,t){for(;;){var n=Nl;try{if(_a(),oi.current=Ji,di){for(var r=si.memoizedState;null!==r;){var o=r.queue;null!==o&&(o.pending=null),r=r.next}di=!1}if(ii=0,ci=li=si=null,ui=!1,hi=0,Cl.current=null,null===n||null===n.return){Tl=1,Ll=t,Nl=null;break}e:{var i=e,s=n.return,l=n,c=t;if(t=Rl,l.flags|=32768,null!==c&&"object"===typeof c&&"function"===typeof c.then){var d=c,u=l,h=u.tag;if(0===(1&u.mode)&&(0===h||11===h||15===h)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var f=gs(s);if(null!==f){f.flags&=-257,xs(f,s,l,0,t),1&f.mode&&ms(i,d,t),c=d;var m=(t=f).updateQueue;if(null===m){var g=new Set;g.add(c),t.updateQueue=g}else m.add(c);break e}if(0===(1&t)){ms(i,d,t),mc();break e}c=Error(a(426))}else if(aa&&1&l.mode){var x=gs(s);if(null!==x){0===(65536&x.flags)&&(x.flags|=256),xs(x,s,l,0,t),ma(cs(c,l));break e}}i=c=cs(c,l),4!==Tl&&(Tl=2),null===Fl?Fl=[i]:Fl.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t,Ha(i,ps(0,c,t));break e;case 1:l=c;var b=i.type,v=i.stateNode;if(0===(128&i.flags)&&("function"===typeof b.getDerivedStateFromError||null!==v&&"function"===typeof v.componentDidCatch&&(null===$l||!$l.has(v)))){i.flags|=65536,t&=-t,i.lanes|=t,Ha(i,fs(i,l,t));break e}}i=i.return}while(null!==i)}yc(n)}catch(y){t=y,Nl===n&&null!==n&&(Nl=n=n.return);continue}break}}function fc(){var e=Al.current;return Al.current=Ji,null===e?Ji:e}function mc(){0!==Tl&&3!==Tl&&2!==Tl||(Tl=4),null===Ml||0===(268435455&Il)&&0===(268435455&zl)||sc(Ml,Rl)}function gc(e,t){var n=El;El|=2;var r=fc();for(Ml===e&&Rl===t||(Vl=null,hc(e,t));;)try{xc();break}catch(o){pc(e,o)}if(_a(),El=n,Al.current=r,null!==Nl)throw Error(a(261));return Ml=null,Rl=0,Tl}function xc(){for(;null!==Nl;)vc(Nl)}function bc(){for(;null!==Nl&&!Ye();)vc(Nl)}function vc(e){var t=Sl(e.alternate,e,Pl);e.memoizedProps=e.pendingProps,null===t?yc(e):Nl=t,Cl.current=null}function yc(e){var t=e;do{var n=t.alternate;if(e=t.return,0===(32768&t.flags)){if(null!==(n=Ks(n,t,Pl)))return void(Nl=n)}else{if(null!==(n=Xs(n,t)))return n.flags&=32767,void(Nl=n);if(null===e)return Tl=6,void(Nl=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Nl=t);Nl=t=e}while(null!==t);0===Tl&&(Tl=5)}function wc(e,t,n){var r=vt,o=_l.transition;try{_l.transition=null,vt=1,function(e,t,n,r){do{kc()}while(null!==Xl);if(0!==(6&El))throw Error(a(327));n=e.finishedWork;var o=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(a(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-it(n),a=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~a}}(e,i),e===Ml&&(Nl=Ml=null,Rl=0),0===(2064&n.subtreeFlags)&&0===(2064&n.flags)||Kl||(Kl=!0,Mc(tt,(function(){return kc(),null}))),i=0!==(15990&n.flags),0!==(15990&n.subtreeFlags)||i){i=_l.transition,_l.transition=null;var s=vt;vt=1;var l=El;El|=4,Cl.current=null,function(e,t){if(eo=Ut,pr(e=hr())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch(w){n=null;break e}var s=0,l=-1,c=-1,d=0,u=0,h=e,p=null;t:for(;;){for(var f;h!==n||0!==o&&3!==h.nodeType||(l=s+o),h!==i||0!==r&&3!==h.nodeType||(c=s+r),3===h.nodeType&&(s+=h.nodeValue.length),null!==(f=h.firstChild);)p=h,h=f;for(;;){if(h===e)break t;if(p===n&&++d===o&&(l=s),p===i&&++u===r&&(c=s),null!==(f=h.nextSibling))break;p=(h=p).parentNode}h=f}n=-1===l||-1===c?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(to={focusedElem:e,selectionRange:n},Ut=!1,Js=t;null!==Js;)if(e=(t=Js).child,0!==(1028&t.subtreeFlags)&&null!==e)e.return=t,Js=e;else for(;null!==Js;){t=Js;try{var m=t.alternate;if(0!==(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==m){var g=m.memoizedProps,x=m.memoizedState,b=t.stateNode,v=b.getSnapshotBeforeUpdate(t.elementType===t.type?g:ns(t.type,g),x);b.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var y=t.stateNode.containerInfo;1===y.nodeType?y.textContent="":9===y.nodeType&&y.documentElement&&y.removeChild(y.documentElement);break;default:throw Error(a(163))}}catch(w){jc(t,t.return,w)}if(null!==(e=t.sibling)){e.return=t.return,Js=e;break}Js=t.return}m=tl,tl=!1}(e,n),gl(n,e),fr(to),Ut=!!eo,to=eo=null,e.current=n,bl(n,e,o),Ge(),El=l,vt=s,_l.transition=i}else e.current=n;if(Kl&&(Kl=!1,Xl=e,Yl=o),i=e.pendingLanes,0===i&&($l=null),function(e){if(at&&"function"===typeof at.onCommitFiberRoot)try{at.onCommitFiberRoot(ot,e,void 0,128===(128&e.current.flags))}catch(t){}}(n.stateNode),rc(e,Ze()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Ul)throw Ul=!1,e=ql,ql=null,e;0!==(1&Yl)&&0!==e.tag&&kc(),i=e.pendingLanes,0!==(1&i)?e===Zl?Gl++:(Gl=0,Zl=e):Gl=0,Vo()}(e,t,n,r)}finally{_l.transition=o,vt=r}return null}function kc(){if(null!==Xl){var e=yt(Yl),t=_l.transition,n=vt;try{if(_l.transition=null,vt=16>e?16:e,null===Xl)var r=!1;else{if(e=Xl,Xl=null,Yl=0,0!==(6&El))throw Error(a(331));var o=El;for(El|=4,Js=e.current;null!==Js;){var i=Js,s=i.child;if(0!==(16&Js.flags)){var l=i.deletions;if(null!==l){for(var c=0;c<l.length;c++){var d=l[c];for(Js=d;null!==Js;){var u=Js;switch(u.tag){case 0:case 11:case 15:nl(8,u,i)}var h=u.child;if(null!==h)h.return=u,Js=h;else for(;null!==Js;){var p=(u=Js).sibling,f=u.return;if(al(u),u===d){Js=null;break}if(null!==p){p.return=f,Js=p;break}Js=f}}}var m=i.alternate;if(null!==m){var g=m.child;if(null!==g){m.child=null;do{var x=g.sibling;g.sibling=null,g=x}while(null!==g)}}Js=i}}if(0!==(2064&i.subtreeFlags)&&null!==s)s.return=i,Js=s;else e:for(;null!==Js;){if(0!==(2048&(i=Js).flags))switch(i.tag){case 0:case 11:case 15:nl(9,i,i.return)}var b=i.sibling;if(null!==b){b.return=i.return,Js=b;break e}Js=i.return}}var v=e.current;for(Js=v;null!==Js;){var y=(s=Js).child;if(0!==(2064&s.subtreeFlags)&&null!==y)y.return=s,Js=y;else e:for(s=v;null!==Js;){if(0!==(2048&(l=Js).flags))try{switch(l.tag){case 0:case 11:case 15:rl(9,l)}}catch(k){jc(l,l.return,k)}if(l===s){Js=null;break e}var w=l.sibling;if(null!==w){w.return=l.return,Js=w;break e}Js=l.return}}if(El=o,Vo(),at&&"function"===typeof at.onPostCommitFiberRoot)try{at.onPostCommitFiberRoot(ot,e)}catch(k){}r=!0}return r}finally{vt=n,_l.transition=t}}return!1}function Sc(e,t,n){e=Ba(e,t=ps(0,t=cs(n,t),1),1),t=ec(),null!==e&&(xt(e,1,t),rc(e,t))}function jc(e,t,n){if(3===e.tag)Sc(e,e,n);else for(;null!==t;){if(3===t.tag){Sc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===$l||!$l.has(r))){t=Ba(t,e=fs(t,e=cs(n,e),1),1),e=ec(),null!==t&&(xt(t,1,e),rc(t,e));break}}t=t.return}}function Ac(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=ec(),e.pingedLanes|=e.suspendedLanes&n,Ml===e&&(Rl&n)===n&&(4===Tl||3===Tl&&(130023424&Rl)===Rl&&500>Ze()-Wl?hc(e,0):Dl|=n),rc(e,t)}function Cc(e,t){0===t&&(0===(1&e.mode)?t=1:(t=dt,0===(130023424&(dt<<=1))&&(dt=4194304)));var n=ec();null!==(e=La(e,t))&&(xt(e,t,n),rc(e,n))}function _c(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Cc(e,n)}function Ec(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(a(314))}null!==r&&r.delete(t),Cc(e,n)}function Mc(e,t){return Ke(e,t)}function Nc(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rc(e,t,n,r){return new Nc(e,t,n,r)}function Pc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Oc(e,t){var n=e.alternate;return null===n?((n=Rc(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Tc(e,t,n,r,o,i){var s=2;if(r=e,"function"===typeof e)Pc(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case S:return Lc(n.children,o,i,t);case j:s=8,o|=8;break;case A:return(e=Rc(12,n,t,2|o)).elementType=A,e.lanes=i,e;case M:return(e=Rc(13,n,t,o)).elementType=M,e.lanes=i,e;case N:return(e=Rc(19,n,t,o)).elementType=N,e.lanes=i,e;case O:return Ic(n,o,i,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case C:s=10;break e;case _:s=9;break e;case E:s=11;break e;case R:s=14;break e;case P:s=16,r=null;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=Rc(s,n,t,o)).elementType=e,t.type=r,t.lanes=i,t}function Lc(e,t,n,r){return(e=Rc(7,e,r,t)).lanes=n,e}function Ic(e,t,n,r){return(e=Rc(22,e,r,t)).elementType=O,e.lanes=n,e.stateNode={isHidden:!1},e}function zc(e,t,n){return(e=Rc(6,e,null,t)).lanes=n,e}function Dc(e,t,n){return(t=Rc(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fc(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gt(0),this.expirationTimes=gt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Bc(e,t,n,r,o,a,i,s,l){return e=new Fc(e,t,n,s,l),1===t?(t=1,!0===a&&(t|=8)):t=0,a=Rc(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},za(a),e}function Wc(e){if(!e)return Eo;e:{if(He(e=e._reactInternals)!==e||1!==e.tag)throw Error(a(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Oo(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(a(171))}if(1===e.tag){var n=e.type;if(Oo(n))return Io(e,n,t)}return t}function Hc(e,t,n,r,o,a,i,s,l){return(e=Bc(n,r,!0,e,0,a,0,s,l)).context=Wc(null),n=e.current,(a=Fa(r=ec(),o=tc(n))).callback=void 0!==t&&null!==t?t:null,Ba(n,a,o),e.current.lanes=o,xt(e,o,r),rc(e,r),e}function Vc(e,t,n,r){var o=t.current,a=ec(),i=tc(o);return n=Wc(n),null===t.context?t.context=n:t.pendingContext=n,(t=Fa(a,i)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Ba(o,t,i))&&(nc(e,o,i,a),Wa(e,o,i)),i}function Uc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function qc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function $c(e,t){qc(e,t),(e=e.alternate)&&qc(e,t)}Sl=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||No.current)vs=!0;else{if(0===(e.lanes&n)&&0===(128&t.flags))return vs=!1,function(e,t,n){switch(t.tag){case 3:Ms(t),fa();break;case 5:Ja(t);break;case 1:Oo(t.type)&&zo(t);break;case 4:Ga(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;_o(Sa,r._currentValue),r._currentValue=o;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(_o(ei,1&ei.current),t.flags|=128,null):0!==(n&t.child.childLanes)?zs(e,t,n):(_o(ei,1&ei.current),null!==(e=Us(e,t,n))?e.sibling:null);_o(ei,1&ei.current);break;case 19:if(r=0!==(n&t.childLanes),0!==(128&e.flags)){if(r)return Hs(e,t,n);t.flags|=128}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),_o(ei,ei.current),r)break;return null;case 22:case 23:return t.lanes=0,js(e,t,n)}return Us(e,t,n)}(e,t,n);vs=0!==(131072&e.flags)}else vs=!1,aa&&0!==(1048576&t.flags)&&ea(t,Ko,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Vs(e,t),e=t.pendingProps;var o=Po(t,Mo.current);Na(t,n),o=gi(null,t,r,e,o,n);var i=xi();return t.flags|=1,"object"===typeof o&&null!==o&&"function"===typeof o.render&&void 0===o.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Oo(r)?(i=!0,zo(t)):i=!1,t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,za(t),o.updater=os,t.stateNode=o,o._reactInternals=t,ls(t,r,e,n),t=Es(null,t,r,!0,i,n)):(t.tag=0,aa&&i&&ta(t),ys(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Vs(e,t),e=t.pendingProps,r=(o=r._init)(r._payload),t.type=r,o=t.tag=function(e){if("function"===typeof e)return Pc(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===E)return 11;if(e===R)return 14}return 2}(r),e=ns(r,e),o){case 0:t=Cs(null,t,r,e,n);break e;case 1:t=_s(null,t,r,e,n);break e;case 11:t=ws(null,t,r,e,n);break e;case 14:t=ks(null,t,r,ns(r.type,e),n);break e}throw Error(a(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,Cs(e,t,r,o=t.elementType===r?o:ns(r,o),n);case 1:return r=t.type,o=t.pendingProps,_s(e,t,r,o=t.elementType===r?o:ns(r,o),n);case 3:e:{if(Ms(t),null===e)throw Error(a(387));r=t.pendingProps,o=(i=t.memoizedState).element,Da(e,t),Va(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated){if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,256&t.flags){t=Ns(e,t,r,n,o=cs(Error(a(423)),t));break e}if(r!==o){t=Ns(e,t,r,n,o=cs(Error(a(424)),t));break e}for(oa=co(t.stateNode.containerInfo.firstChild),ra=t,aa=!0,ia=null,n=ka(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(fa(),r===o){t=Us(e,t,n);break e}ys(e,t,r,n)}t=t.child}return t;case 5:return Ja(t),null===e&&da(t),r=t.type,o=t.pendingProps,i=null!==e?e.memoizedProps:null,s=o.children,no(r,o)?s=null:null!==i&&no(r,i)&&(t.flags|=32),As(e,t),ys(e,t,s,n),t.child;case 6:return null===e&&da(t),null;case 13:return zs(e,t,n);case 4:return Ga(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=wa(t,null,r,n):ys(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,ws(e,t,r,o=t.elementType===r?o:ns(r,o),n);case 7:return ys(e,t,t.pendingProps,n),t.child;case 8:case 12:return ys(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,_o(Sa,r._currentValue),r._currentValue=s,null!==i)if(sr(i.value,s)){if(i.children===o.children&&!No.current){t=Us(e,t,n);break e}}else for(null!==(i=t.child)&&(i.return=t);null!==i;){var l=i.dependencies;if(null!==l){s=i.child;for(var c=l.firstContext;null!==c;){if(c.context===r){if(1===i.tag){(c=Fa(-1,n&-n)).tag=2;var d=i.updateQueue;if(null!==d){var u=(d=d.shared).pending;null===u?c.next=c:(c.next=u.next,u.next=c),d.pending=c}}i.lanes|=n,null!==(c=i.alternate)&&(c.lanes|=n),Ma(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(10===i.tag)s=i.type===t.type?null:i.child;else if(18===i.tag){if(null===(s=i.return))throw Error(a(341));s.lanes|=n,null!==(l=s.alternate)&&(l.lanes|=n),Ma(s,n,t),s=i.sibling}else s=i.child;if(null!==s)s.return=i;else for(s=i;null!==s;){if(s===t){s=null;break}if(null!==(i=s.sibling)){i.return=s.return,s=i;break}s=s.return}i=s}ys(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Na(t,n),r=r(o=Ra(o)),t.flags|=1,ys(e,t,r,n),t.child;case 14:return o=ns(r=t.type,t.pendingProps),ks(e,t,r,o=ns(r.type,o),n);case 15:return Ss(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ns(r,o),Vs(e,t),t.tag=1,Oo(r)?(e=!0,zo(t)):e=!1,Na(t,n),is(t,r,o),ls(t,r,o,n),Es(null,t,r,!0,e,n);case 19:return Hs(e,t,n);case 22:return js(e,t,n)}throw Error(a(156,t.tag))};var Kc="function"===typeof reportError?reportError:function(e){console.error(e)};function Xc(e){this._internalRoot=e}function Yc(e){this._internalRoot=e}function Gc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Zc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Jc(){}function Qc(e,t,n,r,o){var a=n._reactRootContainer;if(a){var i=a;if("function"===typeof o){var s=o;o=function(){var e=Uc(i);s.call(e)}}Vc(t,i,e,o)}else i=function(e,t,n,r,o){if(o){if("function"===typeof r){var a=r;r=function(){var e=Uc(i);a.call(e)}}var i=Hc(t,r,e,0,null,!1,0,"",Jc);return e._reactRootContainer=i,e[mo]=i.current,Hr(8===e.nodeType?e.parentNode:e),dc(),i}for(;o=e.lastChild;)e.removeChild(o);if("function"===typeof r){var s=r;r=function(){var e=Uc(l);s.call(e)}}var l=Bc(e,0,!1,null,0,!1,0,"",Jc);return e._reactRootContainer=l,e[mo]=l.current,Hr(8===e.nodeType?e.parentNode:e),dc((function(){Vc(t,l,n,r)})),l}(n,t,e,o,r);return Uc(i)}Yc.prototype.render=Xc.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(a(409));Vc(e,t,null,null)},Yc.prototype.unmount=Xc.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;dc((function(){Vc(null,e,null,null)})),t[mo]=null}},Yc.prototype.unstable_scheduleHydration=function(e){if(e){var t=jt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ot.length&&0!==t&&t<Ot[n].priority;n++);Ot.splice(n,0,e),0===n&&zt(e)}},wt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ut(t.pendingLanes);0!==n&&(bt(t,1|n),rc(t,Ze()),0===(6&El)&&(Hl=Ze()+500,Vo()))}break;case 13:dc((function(){var t=La(e,1);if(null!==t){var n=ec();nc(t,e,1,n)}})),$c(e,1)}},kt=function(e){if(13===e.tag){var t=La(e,134217728);if(null!==t)nc(t,e,134217728,ec());$c(e,134217728)}},St=function(e){if(13===e.tag){var t=tc(e),n=La(e,t);if(null!==n)nc(n,e,t,ec());$c(e,t)}},jt=function(){return vt},At=function(e,t){var n=vt;try{return vt=e,t()}finally{vt=n}},ke=function(e,t,n){switch(t){case"input":if(J(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=ko(r);if(!o)throw Error(a(90));K(r),J(r,o)}}}break;case"textarea":ae(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},Ee=cc,Me=dc;var ed={usingClientEntryPoint:!1,Events:[yo,wo,ko,Ce,_e,cc]},td={findFiberByHostInstance:vo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nd={bundleType:td.bundleType,version:td.version,rendererPackageName:td.rendererPackageName,rendererConfig:td.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:y.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=qe(e))?null:e.stateNode},findFiberByHostInstance:td.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var rd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rd.isDisabled&&rd.supportsFiber)try{ot=rd.inject(nd),at=rd}catch(de){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ed,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Gc(t))throw Error(a(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:k,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.createRoot=function(e,t){if(!Gc(e))throw Error(a(299));var n=!1,r="",o=Kc;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(o=t.onRecoverableError)),t=Bc(e,1,!1,null,0,n,0,r,o),e[mo]=t.current,Hr(8===e.nodeType?e.parentNode:e),new Xc(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(a(188));throw e=Object.keys(e).join(","),Error(a(268,e))}return e=null===(e=qe(t))?null:e.stateNode},t.flushSync=function(e){return dc(e)},t.hydrate=function(e,t,n){if(!Zc(t))throw Error(a(200));return Qc(null,e,t,!0,n)},t.hydrateRoot=function(e,t,n){if(!Gc(e))throw Error(a(405));var r=null!=n&&n.hydratedSources||null,o=!1,i="",s=Kc;if(null!==n&&void 0!==n&&(!0===n.unstable_strictMode&&(o=!0),void 0!==n.identifierPrefix&&(i=n.identifierPrefix),void 0!==n.onRecoverableError&&(s=n.onRecoverableError)),t=Hc(t,null,e,1,null!=n?n:null,o,0,i,s),e[mo]=t.current,Hr(e),r)for(e=0;e<r.length;e++)o=(o=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Yc(t)},t.render=function(e,t,n){if(!Zc(t))throw Error(a(200));return Qc(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Zc(e))throw Error(a(40));return!!e._reactRootContainer&&(dc((function(){Qc(null,null,e,!1,(function(){e._reactRootContainer=null,e[mo]=null}))})),!0)},t.unstable_batchedUpdates=cc,t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Zc(n))throw Error(a(200));if(null==e||void 0===e._reactInternals)throw Error(a(38));return Qc(e,t,n,!1,r)},t.version="18.3.1-next-f1338f8080-20240426"},3030:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(8168);function o(e,t){const n=(0,r.A)({},t);return Object.keys(e).forEach((a=>{if(a.toString().match(/^(components|slots)$/))n[a]=(0,r.A)({},e[a],n[a]);else if(a.toString().match(/^(componentsProps|slotProps)$/)){const i=e[a]||{},s=t[a];n[a]={},s&&Object.keys(s)?i&&Object.keys(i)?(n[a]=(0,r.A)({},s),Object.keys(i).forEach((e=>{n[a][e]=o(i[e],s[e])}))):n[a]=s:n[a]=i}else void 0===n[a]&&(n[a]=e[a])})),n}},3174:(e,t,n)=>{"use strict";n.r(t),n.d(t,{GlobalStyles:()=>k.A,StyledEngineProvider:()=>w,ThemeContext:()=>o.T,css:()=>x.AH,default:()=>S,internal_processStyles:()=>j,keyframes:()=>x.i7});var r=n(8168),o=n(9369),a=n(6598),i=n(9436),s=n(1722),l=n(5043),c=n(918),d=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,u=(0,c.A)((function(e){return d.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),h=function(e){return"theme"!==e},p=function(e){return"string"===typeof e&&e.charCodeAt(0)>96?u:h},f=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!==typeof r&&n&&(r=e.__emotion_forwardProp),r},m=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return(0,s.SF)(t,n,r),(0,i.s)((function(){return(0,s.sk)(t,n,r)})),null},g=function e(t,n){var i,c,d=t.__emotion_real===t,u=d&&t.__emotion_base||t;void 0!==n&&(i=n.label,c=n.target);var h=f(t,n,d),g=h||p(u),x=!g("as");return function(){var b=arguments,v=d&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==i&&v.push("label:"+i+";"),null==b[0]||void 0===b[0].raw)v.push.apply(v,b);else{var y=b[0];v.push(y[0]);for(var w=b.length,k=1;k<w;k++)v.push(b[k],y[k])}var S=(0,o.w)((function(e,t,n){var r=x&&e.as||u,i="",d=[],f=e;if(null==e.theme){for(var b in f={},e)f[b]=e[b];f.theme=l.useContext(o.T)}"string"===typeof e.className?i=(0,s.Rk)(t.registered,d,e.className):null!=e.className&&(i=e.className+" ");var y=(0,a.J)(v.concat(d),t.registered,f);i+=t.key+"-"+y.name,void 0!==c&&(i+=" "+c);var w=x&&void 0===h?p(r):g,k={};for(var S in e)x&&"as"===S||w(S)&&(k[S]=e[S]);return k.className=i,n&&(k.ref=n),l.createElement(l.Fragment,null,l.createElement(m,{cache:t,serialized:y,isStringTag:"string"===typeof r}),l.createElement(r,k))}));return S.displayName=void 0!==i?i:"Styled("+("string"===typeof u?u:u.displayName||u.name||"Component")+")",S.defaultProps=t.defaultProps,S.__emotion_real=S,S.__emotion_base=u,S.__emotion_styles=v,S.__emotion_forwardProp=h,Object.defineProperty(S,"toString",{value:function(){return"."+c}}),S.withComponent=function(t,o){return e(t,(0,r.A)({},n,o,{shouldForwardProp:f(S,o,!0)})).apply(void 0,v)},S}}.bind(null);["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){g[e]=g(e)}));var x=n(3290),b=n(3803),v=n(579);let y;function w(e){const{injectFirst:t,children:n}=e;return t&&y?(0,v.jsx)(o.C,{value:y,children:n}):n}"object"===typeof document&&(y=(0,b.A)({key:"css",prepend:!0}));var k=n(869);function S(e,t){return g(e,t)}const j=(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}},3234:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.A,extendSxProp:()=>o.A,unstable_createStyleFunctionSx:()=>r.k,unstable_defaultSxConfig:()=>a.A});var r=n(8812),o=n(8698),a=n(7758)},3290:(e,t,n)=>{"use strict";n.d(t,{AH:()=>d,i7:()=>u,mL:()=>c});var r=n(9369),o=n(5043),a=n(1722),i=n(9436),s=n(6598),l=(n(3803),n(219),function(e,t){var n=arguments;if(null==t||!r.h.call(t,"css"))return o.createElement.apply(void 0,n);var a=n.length,i=new Array(a);i[0]=r.E,i[1]=(0,r.c)(e,t);for(var s=2;s<a;s++)i[s]=n[s];return o.createElement.apply(null,i)});!function(e){var t;t||(t=e.JSX||(e.JSX={}))}(l||(l={}));var c=(0,r.w)((function(e,t){var n=e.styles,l=(0,s.J)([n],void 0,o.useContext(r.T)),c=o.useRef();return(0,i.i)((function(){var e=t.key+"-global",n=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),r=!1,o=document.querySelector('style[data-emotion="'+e+" "+l.name+'"]');return t.sheet.tags.length&&(n.before=t.sheet.tags[0]),null!==o&&(r=!0,o.setAttribute("data-emotion",e),n.hydrate([o])),c.current=[n,r],function(){n.flush()}}),[t]),(0,i.i)((function(){var e=c.current,n=e[0];if(e[1])e[1]=!1;else{if(void 0!==l.next&&(0,a.sk)(t,l.next,!0),n.tags.length){var r=n.tags[n.tags.length-1].nextElementSibling;n.before=r,n.flush()}t.insert("",l,n,!1)}}),[t,l.name]),null}));function d(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,s.J)(t)}function u(){var e=d.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}},3319:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(1782).A},3375:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r="$$material"},3382:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l,getFunctionName:()=>a});var r=n(191);const o=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function a(e){const t="".concat(e).match(o);return t&&t[1]||""}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.displayName||e.name||a(e)||t}function s(e,t,n){const r=i(t);return e.displayName||(""!==r?"".concat(n,"(").concat(r,")"):n)}function l(e){if(null!=e){if("string"===typeof e)return e;if("function"===typeof e)return i(e,"Component");if("object"===typeof e)switch(e.$$typeof){case r.vM:return s(e,e.render,"ForwardRef");case r.lD:return s(e,e.type,"memo");default:return}}}},3462:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(5043),o=n(6564);function a(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.useMemo((()=>t.every((e=>null==e))?null:e=>{t.forEach((t=>{(0,o.A)(t,e)}))}),t)}},3468:(e,t,n)=>{"use strict";function r(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];clearTimeout(t),t=setTimeout((()=>{e.apply(this,o)}),n)}return r.clear=()=>{clearTimeout(t)},r}n.d(t,{A:()=>r})},3471:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var o=r(n(39)),a=n(579);t.A=(0,o.default)((0,a.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete")},3531:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var o=r(n(39)),a=n(579);t.A=(0,o.default)((0,a.jsx)("path",{d:"M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h1.9c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m0 12H6V10h12z"}),"LockOpen")},3574:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(5043),o=n(9303);let a=!0,i=!1;const s=new o.E,l={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function c(e){e.metaKey||e.altKey||e.ctrlKey||(a=!0)}function d(){a=!1}function u(){"hidden"===this.visibilityState&&i&&(a=!0)}function h(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch(n){}return a||function(e){const{type:t,tagName:n}=e;return!("INPUT"!==n||!l[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}const p=function(){const e=r.useCallback((e=>{var t;null!=e&&((t=e.ownerDocument).addEventListener("keydown",c,!0),t.addEventListener("mousedown",d,!0),t.addEventListener("pointerdown",d,!0),t.addEventListener("touchstart",d,!0),t.addEventListener("visibilitychange",u,!0))}),[]),t=r.useRef(!1);return{isFocusVisibleRef:t,onFocus:function(e){return!!h(e)&&(t.current=!0,!0)},onBlur:function(){return!!t.current&&(i=!0,s.start(100,(()=>{i=!1})),t.current=!1,!0)},ref:e}}},3654:(e,t,n)=>{"use strict";n.d(t,{A:()=>l,b:()=>s});var r=n(5043),o=n(3030),a=n(579);const i=r.createContext(void 0);function s(e){let{props:t,name:n}=e;return function(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const a=t.components[n];return a.defaultProps?(0,o.A)(a.defaultProps,r):a.styleOverrides||a.variants?r:(0,o.A)(a,r)}({props:t,name:n,theme:{components:r.useContext(i)}})}const l=function(e){let{value:t,children:n}=e;return(0,a.jsx)(i.Provider,{value:t,children:n})}},3664:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var o=r(n(39)),a=n(579);t.A=(0,o.default)((0,a.jsx)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m0 12H4V8h16z"}),"FolderOpen")},3763:(e,t,n)=>{"use strict";e.exports=n(4983)},3803:(e,t,n)=>{"use strict";n.d(t,{A:()=>oe});var r=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(r){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)})),this.tags=[],this.ctr=0},e}(),o=Math.abs,a=String.fromCharCode,i=Object.assign;function s(e){return e.trim()}function l(e,t,n){return e.replace(t,n)}function c(e,t){return e.indexOf(t)}function d(e,t){return 0|e.charCodeAt(t)}function u(e,t,n){return e.slice(t,n)}function h(e){return e.length}function p(e){return e.length}function f(e,t){return t.push(e),e}var m=1,g=1,x=0,b=0,v=0,y="";function w(e,t,n,r,o,a,i){return{value:e,root:t,parent:n,type:r,props:o,children:a,line:m,column:g,length:i,return:""}}function k(e,t){return i(w("",null,null,"",null,null,0),e,{length:-e.length},t)}function S(){return v=b>0?d(y,--b):0,g--,10===v&&(g=1,m--),v}function j(){return v=b<x?d(y,b++):0,g++,10===v&&(g=1,m++),v}function A(){return d(y,b)}function C(){return b}function _(e,t){return u(y,e,t)}function E(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function M(e){return m=g=1,x=h(y=e),b=0,[]}function N(e){return y="",e}function R(e){return s(_(b-1,T(91===e?e+2:40===e?e+1:e)))}function P(e){for(;(v=A())&&v<33;)j();return E(e)>2||E(v)>3?"":" "}function O(e,t){for(;--t&&j()&&!(v<48||v>102||v>57&&v<65||v>70&&v<97););return _(e,C()+(t<6&&32==A()&&32==j()))}function T(e){for(;j();)switch(v){case e:return b;case 34:case 39:34!==e&&39!==e&&T(v);break;case 40:41===e&&T(e);break;case 92:j()}return b}function L(e,t){for(;j()&&e+v!==57&&(e+v!==84||47!==A()););return"/*"+_(t,b-1)+"*"+a(47===e?e:j())}function I(e){for(;!E(A());)j();return _(e,b)}var z="-ms-",D="-moz-",F="-webkit-",B="comm",W="rule",H="decl",V="@keyframes";function U(e,t){for(var n="",r=p(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function q(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case H:return e.return=e.return||e.value;case B:return"";case V:return e.return=e.value+"{"+U(e.children,r)+"}";case W:e.value=e.props.join(",")}return h(n=U(e.children,r))?e.return=e.value+"{"+n+"}":""}function $(e){return N(K("",null,null,null,[""],e=M(e),0,[0],e))}function K(e,t,n,r,o,i,s,u,p){for(var m=0,g=0,x=s,b=0,v=0,y=0,w=1,k=1,_=1,E=0,M="",N=o,T=i,z=r,D=M;k;)switch(y=E,E=j()){case 40:if(108!=y&&58==d(D,x-1)){-1!=c(D+=l(R(E),"&","&\f"),"&\f")&&(_=-1);break}case 34:case 39:case 91:D+=R(E);break;case 9:case 10:case 13:case 32:D+=P(y);break;case 92:D+=O(C()-1,7);continue;case 47:switch(A()){case 42:case 47:f(Y(L(j(),C()),t,n),p);break;default:D+="/"}break;case 123*w:u[m++]=h(D)*_;case 125*w:case 59:case 0:switch(E){case 0:case 125:k=0;case 59+g:-1==_&&(D=l(D,/\f/g,"")),v>0&&h(D)-x&&f(v>32?G(D+";",r,n,x-1):G(l(D," ","")+";",r,n,x-2),p);break;case 59:D+=";";default:if(f(z=X(D,t,n,m,g,o,u,M,N=[],T=[],x),i),123===E)if(0===g)K(D,t,z,z,N,i,x,u,T);else switch(99===b&&110===d(D,3)?100:b){case 100:case 108:case 109:case 115:K(e,z,z,r&&f(X(e,z,z,0,0,o,u,M,o,N=[],x),T),o,T,x,u,r?N:T);break;default:K(D,z,z,z,[""],T,0,u,T)}}m=g=v=0,w=_=1,M=D="",x=s;break;case 58:x=1+h(D),v=y;default:if(w<1)if(123==E)--w;else if(125==E&&0==w++&&125==S())continue;switch(D+=a(E),E*w){case 38:_=g>0?1:(D+="\f",-1);break;case 44:u[m++]=(h(D)-1)*_,_=1;break;case 64:45===A()&&(D+=R(j())),b=A(),g=x=h(M=D+=I(C())),E++;break;case 45:45===y&&2==h(D)&&(w=0)}}return i}function X(e,t,n,r,a,i,c,d,h,f,m){for(var g=a-1,x=0===a?i:[""],b=p(x),v=0,y=0,k=0;v<r;++v)for(var S=0,j=u(e,g+1,g=o(y=c[v])),A=e;S<b;++S)(A=s(y>0?x[S]+" "+j:l(j,/&\f/g,x[S])))&&(h[k++]=A);return w(e,t,n,0===a?W:d,h,f,m)}function Y(e,t,n){return w(e,t,n,B,a(v),u(e,2,-2),0)}function G(e,t,n,r){return w(e,t,n,H,u(e,0,r),u(e,r+1,-1),r)}var Z=function(e,t,n){for(var r=0,o=0;r=o,o=A(),38===r&&12===o&&(t[n]=1),!E(o);)j();return _(e,b)},J=function(e,t){return N(function(e,t){var n=-1,r=44;do{switch(E(r)){case 0:38===r&&12===A()&&(t[n]=1),e[n]+=Z(b-1,t,n);break;case 2:e[n]+=R(r);break;case 4:if(44===r){e[++n]=58===A()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=a(r)}}while(r=j());return e}(M(e),t))},Q=new WeakMap,ee=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Q.get(n))&&!r){Q.set(e,!0);for(var o=[],a=J(t,o),i=n.props,s=0,l=0;s<a.length;s++)for(var c=0;c<i.length;c++,l++)e.props[l]=o[s]?a[s].replace(/&\f/g,i[c]):i[c]+" "+a[s]}}},te=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function ne(e,t){switch(function(e,t){return 45^d(e,0)?(((t<<2^d(e,0))<<2^d(e,1))<<2^d(e,2))<<2^d(e,3):0}(e,t)){case 5103:return F+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return F+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return F+e+D+e+z+e+e;case 6828:case 4268:return F+e+z+e+e;case 6165:return F+e+z+"flex-"+e+e;case 5187:return F+e+l(e,/(\w+).+(:[^]+)/,F+"box-$1$2"+z+"flex-$1$2")+e;case 5443:return F+e+z+"flex-item-"+l(e,/flex-|-self/,"")+e;case 4675:return F+e+z+"flex-line-pack"+l(e,/align-content|flex-|-self/,"")+e;case 5548:return F+e+z+l(e,"shrink","negative")+e;case 5292:return F+e+z+l(e,"basis","preferred-size")+e;case 6060:return F+"box-"+l(e,"-grow","")+F+e+z+l(e,"grow","positive")+e;case 4554:return F+l(e,/([^-])(transform)/g,"$1"+F+"$2")+e;case 6187:return l(l(l(e,/(zoom-|grab)/,F+"$1"),/(image-set)/,F+"$1"),e,"")+e;case 5495:case 3959:return l(e,/(image-set\([^]*)/,F+"$1$`$1");case 4968:return l(l(e,/(.+:)(flex-)?(.*)/,F+"box-pack:$3"+z+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+F+e+e;case 4095:case 3583:case 4068:case 2532:return l(e,/(.+)-inline(.+)/,F+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(h(e)-1-t>6)switch(d(e,t+1)){case 109:if(45!==d(e,t+4))break;case 102:return l(e,/(.+:)(.+)-([^]+)/,"$1"+F+"$2-$3$1"+D+(108==d(e,t+3)?"$3":"$2-$3"))+e;case 115:return~c(e,"stretch")?ne(l(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==d(e,t+1))break;case 6444:switch(d(e,h(e)-3-(~c(e,"!important")&&10))){case 107:return l(e,":",":"+F)+e;case 101:return l(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+F+(45===d(e,14)?"inline-":"")+"box$3$1"+F+"$2$3$1"+z+"$2box$3")+e}break;case 5936:switch(d(e,t+11)){case 114:return F+e+z+l(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return F+e+z+l(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return F+e+z+l(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return F+e+z+e+e}return e}var re=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case H:e.return=ne(e.value,e.length);break;case V:return U([k(e,{value:l(e.value,"@","@"+F)})],r);case W:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return U([k(e,{props:[l(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return U([k(e,{props:[l(t,/:(plac\w+)/,":"+F+"input-$1")]}),k(e,{props:[l(t,/:(plac\w+)/,":-moz-$1")]}),k(e,{props:[l(t,/:(plac\w+)/,z+"input-$1")]})],r)}return""}))}}],oe=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var o,a,i=e.stylisPlugins||re,s={},l=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)s[t[n]]=!0;l.push(e)}));var c,d,u=[q,(d=function(e){c.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],h=function(e){var t=p(e);return function(n,r,o,a){for(var i="",s=0;s<t;s++)i+=e[s](n,r,o,a)||"";return i}}([ee,te].concat(i,u));a=function(e,t,n,r){c=n,U($(e?e+"{"+t.styles+"}":t.styles),h),r&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new r({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:a};return f.sheet.hydrate(l),f}},3815:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(9172);const o=function(e,t){return t?(0,r.A)(e,t,{clone:!1}):e}},3940:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(1668);function o(e){return(0,r.A)(e).defaultView||window}},4202:(e,t)=>{"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function x(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||f}function b(){}function v(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||f}x.prototype.isReactComponent={},x.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")},x.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=x.prototype;var y=v.prototype=new b;y.constructor=v,m(y,x.prototype),y.isPureReactComponent=!0;var w=Array.isArray,k=Object.prototype.hasOwnProperty,S={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function A(e,t,r){var o,a={},i=null,s=null;if(null!=t)for(o in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(i=""+t.key),t)k.call(t,o)&&!j.hasOwnProperty(o)&&(a[o]=t[o]);var l=arguments.length-2;if(1===l)a.children=r;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];a.children=c}if(e&&e.defaultProps)for(o in l=e.defaultProps)void 0===a[o]&&(a[o]=l[o]);return{$$typeof:n,type:e,key:i,ref:s,props:a,_owner:S.current}}function C(e){return"object"===typeof e&&null!==e&&e.$$typeof===n}var _=/\/+/g;function E(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 M(e,t,o,a,i){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l=!1;if(null===e)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case r:l=!0}}if(l)return i=i(l=e),e=""===a?"."+E(l,0):a,w(i)?(o="",null!=e&&(o=e.replace(_,"$&/")+"/"),M(i,t,o,"",(function(e){return e}))):null!=i&&(C(i)&&(i=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,o+(!i.key||l&&l.key===i.key?"":(""+i.key).replace(_,"$&/")+"/")+e)),t.push(i)),1;if(l=0,a=""===a?".":a+":",w(e))for(var c=0;c<e.length;c++){var d=a+E(s=e[c],c);l+=M(s,t,o,d,i)}else if(d=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"===typeof d)for(e=d.call(e),c=0;!(s=e.next()).done;)l+=M(s=s.value,t,o,d=a+E(s,c++),i);else if("object"===s)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 l}function N(e,t,n){if(null==e)return e;var r=[],o=0;return M(e,r,"","",(function(e){return t.call(n,e,o++)})),r}function R(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 P={current:null},O={transition:null},T={ReactCurrentDispatcher:P,ReactCurrentBatchConfig:O,ReactCurrentOwner:S};function L(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:N,forEach:function(e,t,n){N(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return N(e,(function(){t++})),t},toArray:function(e){return N(e,(function(e){return e}))||[]},only:function(e){if(!C(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=x,t.Fragment=o,t.Profiler=i,t.PureComponent=v,t.StrictMode=a,t.Suspense=d,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T,t.act=L,t.cloneElement=function(e,t,r){if(null===e||void 0===e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=m({},e.props),a=e.key,i=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,s=S.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)k.call(t,c)&&!j.hasOwnProperty(c)&&(o[c]=void 0===t[c]&&void 0!==l?l[c]:t[c])}var c=arguments.length-2;if(1===c)o.children=r;else if(1<c){l=Array(c);for(var d=0;d<c;d++)l[d]=arguments[d+2];o.children=l}return{$$typeof:n,type:e.type,key:a,ref:i,props:o,_owner:s}},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},t.createElement=A,t.createFactory=function(e){var t=A.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=C,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:R}},t.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=O.transition;O.transition={};try{e()}finally{O.transition=t}},t.unstable_act=L,t.useCallback=function(e,t){return P.current.useCallback(e,t)},t.useContext=function(e){return P.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return P.current.useDeferredValue(e)},t.useEffect=function(e,t){return P.current.useEffect(e,t)},t.useId=function(){return P.current.useId()},t.useImperativeHandle=function(e,t,n){return P.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return P.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return P.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return P.current.useMemo(e,t)},t.useReducer=function(e,t,n){return P.current.useReducer(e,t,n)},t.useRef=function(e){return P.current.useRef(e)},t.useState=function(e){return P.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return P.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return P.current.useTransition()},t.version="18.3.1"},4318:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>d,p0:()=>s});var r=n(8587),o=n(8168);const a=["duration","easing","delay"],i={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},s={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function l(e){return"".concat(Math.round(e),"ms")}function c(e){if(!e)return 0;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}function d(e){const t=(0,o.A)({},i,e.easing),n=(0,o.A)({},s,e.duration);return(0,o.A)({getAutoHeightDuration:c,create:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{duration:i=n.standard,easing:s=t.easeInOut,delay:c=0}=o;(0,r.A)(o,a);return(Array.isArray(e)?e:[e]).map((e=>"".concat(e," ").concat("string"===typeof i?i:l(i)," ").concat(s," ").concat("string"===typeof c?c:l(c)))).join(",")}},e,{easing:t,duration:n})}},4358:(e,t)=>{"use strict";const n=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,r=/^[\u0021-\u003A\u003C-\u007E]*$/,o=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,a=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,s=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function l(e,t,n){do{const n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<n);return n}function c(e,t,n){for(;t>n;){const n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return n}function d(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(t){return e}}},4391:(e,t,n)=>{"use strict";var r=n(7950);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},4421:(e,t,n)=>{"use strict";n.r(t),n.d(t,{capitalize:()=>o.A,createChainedFunction:()=>a,createSvgIcon:()=>i.A,debounce:()=>s.A,deprecatedPropType:()=>l,isMuiElement:()=>c.A,ownerDocument:()=>d.A,ownerWindow:()=>u.A,requirePropFactory:()=>h,setRef:()=>p,unstable_ClassNameGenerator:()=>w,unstable_useEnhancedEffect:()=>f.A,unstable_useId:()=>m.A,unsupportedProp:()=>g,useControlled:()=>x.A,useEventCallback:()=>b.A,useForkRef:()=>v.A,useIsFocusVisible:()=>y.A});var r=n(9386),o=n(6803);const a=n(2456).A;var i=n(9662),s=n(950);const l=function(e,t){return()=>null};var c=n(7328),d=n(2427),u=n(6078);const h=function(e,t){return()=>null};const p=n(6564).A;var f=n(5013),m=n(5879);const g=function(e,t,n,r,o){return null};var x=n(5420),b=n(3319),v=n(5849),y=n(3574);const w={configure:e=>{r.A.configure(e)}}},4440:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(5043);const o="undefined"!==typeof window?r.useLayoutEffect:r.useEffect},4535:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>s});var r=n(8052),o=n(5170),a=n(3375),i=n(1475);const s=(0,r.Ay)({themeId:a.A,defaultTheme:o.A,rootShouldForwardProp:i.A})},4634:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4802:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var o=r(n(39)),a=n(579);t.A=(0,o.default)((0,a.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close")},4853:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(8587),o=n(8168);const a=["values","unit","step"],i=e=>{const t=Object.keys(e).map((t=>({key:t,val:e[t]})))||[];return t.sort(((e,t)=>e.val-t.val)),t.reduce(((e,t)=>(0,o.A)({},e,{[t.key]:t.val})),{})};function s(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:s=5}=e,l=(0,r.A)(e,a),c=i(t),d=Object.keys(c);function u(e){const r="number"===typeof t[e]?t[e]:e;return"@media (min-width:".concat(r).concat(n,")")}function h(e){const r="number"===typeof t[e]?t[e]:e;return"@media (max-width:".concat(r-s/100).concat(n,")")}function p(e,r){const o=d.indexOf(r);return"@media (min-width:".concat("number"===typeof t[e]?t[e]:e).concat(n,") and ")+"(max-width:".concat((-1!==o&&"number"===typeof t[d[o]]?t[d[o]]:r)-s/100).concat(n,")")}return(0,o.A)({keys:d,values:c,up:u,down:h,between:p,only:function(e){return d.indexOf(e)+1<d.length?p(e,d[d.indexOf(e)+1]):u(e)},not:function(e){const t=d.indexOf(e);return 0===t?u(d[1]):t===d.length-1?h(d[t]):p(e,d[d.indexOf(e)+1]).replace("@media","@media not all and")},unit:n},l)}},4893:e=>{e.exports=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n},e.exports.__esModule=!0,e.exports.default=e.exports},4983:(e,t)=>{"use strict";var n="function"===typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,d=n?Symbol.for("react.async_mode"):60111,u=n?Symbol.for("react.concurrent_mode"):60111,h=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,f=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,x=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,v=n?Symbol.for("react.responder"):60118,y=n?Symbol.for("react.scope"):60119;function w(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case d:case u:case a:case s:case i:case p:return e;default:switch(e=e&&e.$$typeof){case c:case h:case g:case m:case l:return e;default:return t}}case o:return t}}}function k(e){return w(e)===u}t.AsyncMode=d,t.ConcurrentMode=u,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=h,t.Fragment=a,t.Lazy=g,t.Memo=m,t.Portal=o,t.Profiler=s,t.StrictMode=i,t.Suspense=p,t.isAsyncMode=function(e){return k(e)||w(e)===d},t.isConcurrentMode=k,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===h},t.isFragment=function(e){return w(e)===a},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===s},t.isStrictMode=function(e){return w(e)===i},t.isSuspense=function(e){return w(e)===p},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===a||e===u||e===s||e===i||e===p||e===f||"object"===typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===h||e.$$typeof===b||e.$$typeof===v||e.$$typeof===y||e.$$typeof===x)},t.typeOf=w},4989:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.A,private_createBreakpoints:()=>o.A,unstable_applyStyles:()=>a.A});var r=n(8280),o=n(4853),a=n(9703)},4994:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},5013:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(4440).A},5043:(e,t,n)=>{"use strict";e.exports=n(4202)},5170:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=(0,n(7344).A)()},5420:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(5043);const o=function(e){let{controlled:t,default:n,name:o,state:a="value"}=e;const{current:i}=r.useRef(void 0!==t),[s,l]=r.useState(n);return[i?t:s,r.useCallback((e=>{i||l(e)}),[])]}},5473:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var o=r(n(39)),a=n(579);t.A=(0,o.default)((0,a.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess")},5844:(e,t,n)=>{"use strict";var r;n.d(t,{A:()=>s});var o=n(5043);let a=0;const i=(r||(r=n.t(o,2)))["useId".toString()];function s(e){if(void 0!==i){const t=i();return null!=e?e:t}return function(e){const[t,n]=o.useState(e),r=e||t;return o.useEffect((()=>{null==t&&(a+=1,n("mui-".concat(a)))}),[t]),r}(e)}},5849:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(3462).A},5879:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(5844).A},6078:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(3940).A},6170:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var o=r(n(39)),a=n(579);t.A=(0,o.default)((0,a.jsx)("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91"}),"RestartAlt")},6191:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;!function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}r.default=e,n&&n.set(e,r)}(n(5043));var o=r(n(39)),a=n(579);function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}t.A=(0,o.default)((0,a.jsx)("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub")},6360:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var o=r(n(39)),a=n(579);t.A=(0,o.default)((0,a.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search")},6564:(e,t,n)=>{"use strict";function r(e,t){"function"===typeof e?e(t):e&&(e.current=t)}n.d(t,{A:()=>r})},6598:(e,t,n)=>{"use strict";n.d(t,{J:()=>g});var r={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},o=n(918),a=!1,i=/[A-Z]|^ms/g,s=/_EMO_([^_]+?)_([^]*?)_EMO_/g,l=function(e){return 45===e.charCodeAt(1)},c=function(e){return null!=e&&"boolean"!==typeof e},d=(0,o.A)((function(e){return l(e)?e:e.replace(i,"-$&").toLowerCase()})),u=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(s,(function(e,t,n){return f={name:t,styles:n,next:f},t}))}return 1===r[e]||l(e)||"number"!==typeof t||0===t?t:t+"px"},h="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function p(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var o=n;if(1===o.anim)return f={name:o.name,styles:o.styles,next:f},o.name;var i=n;if(void 0!==i.styles){var s=i.next;if(void 0!==s)for(;void 0!==s;)f={name:s.name,styles:s.styles,next:f},s=s.next;return i.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=p(e,t,n[o])+";";else for(var i in n){var s=n[i];if("object"!==typeof s){var l=s;null!=t&&void 0!==t[l]?r+=i+"{"+t[l]+"}":c(l)&&(r+=d(i)+":"+u(i,l)+";")}else{if("NO_COMPONENT_SELECTOR"===i&&a)throw new Error(h);if(!Array.isArray(s)||"string"!==typeof s[0]||null!=t&&void 0!==t[s[0]]){var f=p(e,t,s);switch(i){case"animation":case"animationName":r+=d(i)+":"+f+";";break;default:r+=i+"{"+f+"}"}}else for(var m=0;m<s.length;m++)c(s[m])&&(r+=d(i)+":"+u(i,s[m])+";")}}return r}(e,t,n);case"function":if(void 0!==e){var l=f,m=n(e);return f=l,p(e,t,m)}}var g=n;if(null==t)return g;var x=t[g];return void 0!==x?x:g}var f,m=/label:\s*([^\s;{]+)\s*(;|$)/g;function g(e,t,n){if(1===e.length&&"object"===typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,o="";f=void 0;var a=e[0];null==a||void 0===a.raw?(r=!1,o+=p(n,t,a)):o+=a[0];for(var i=1;i<e.length;i++){if(o+=p(n,t,e[i]),r)o+=a[i]}m.lastIndex=0;for(var s,l="";null!==(s=m.exec(o));)l+="-"+s[1];var c=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+l;return{name:c,styles:o,next:f}}},6803:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(7598).A},6974:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var o=r(n(39)),a=n(579);t.A=(0,o.default)((0,a.jsx)("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"}),"Tune")},7021:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var o=r(n(39)),a=n(579);t.A=(0,o.default)((0,a.jsx)("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10c1.38 0 2.5-1.12 2.5-2.5 0-.61-.23-1.2-.64-1.67-.08-.1-.13-.21-.13-.33 0-.28.22-.5.5-.5H16c3.31 0 6-2.69 6-6 0-4.96-4.49-9-10-9m5.5 11c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m-3-4c-.83 0-1.5-.67-1.5-1.5S13.67 6 14.5 6s1.5.67 1.5 1.5S15.33 9 14.5 9M5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S7.33 13 6.5 13 5 12.33 5 11.5m6-4c0 .83-.67 1.5-1.5 1.5S8 8.33 8 7.5 8.67 6 9.5 6s1.5.67 1.5 1.5"}),"Palette")},7123:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}},7162:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>s,BO:()=>i,Yn:()=>a});var r=n(7598),o=n(9751);function a(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||"string"!==typeof t)return null;if(e&&e.vars&&n){const n="vars.".concat(t).split(".").reduce(((e,t)=>e&&e[t]?e[t]:null),e);if(null!=n)return n}return t.split(".").reduce(((e,t)=>e&&null!=e[t]?e[t]:null),e)}function i(e,t,n){let r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;return r="function"===typeof e?e(n):Array.isArray(e)?e[n]||o:a(e,n)||o,t&&(r=t(r,o,e)),r}const s=function(e){const{prop:t,cssProperty:n=e.prop,themeKey:s,transform:l}=e,c=e=>{if(null==e[t])return null;const c=e[t],d=a(e.theme,s)||{};return(0,o.NI)(e,c,(e=>{let o=i(d,l,e);return e===o&&"string"===typeof e&&(o=i(d,l,"".concat(t).concat("default"===e?"":(0,r.A)(e)),e)),!1===n?o:{[n]:o}}))};return c.propTypes={},c.filterProps=[t],c}},7193:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var o=r(n(39)),a=n(579);t.A=(0,o.default)((0,a.jsx)("path",{d:"m12 16.5 4-4h-3v-9h-2v9H8zm9-13h-6v1.99h6v14.03H3V5.49h6V3.5H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2v-14c0-1.1-.9-2-2-2"}),"SystemUpdateAlt")},7234:(e,t)=>{"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<a(o,t)))break e;e[r]=t,e[n]=o,n=r}}function r(e){return 0===e.length?null:e[0]}function o(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,i=o>>>1;r<i;){var s=2*(r+1)-1,l=e[s],c=s+1,d=e[c];if(0>a(l,n))c<o&&0>a(d,l)?(e[r]=d,e[c]=n,r=c):(e[r]=l,e[s]=n,r=s);else{if(!(c<o&&0>a(d,n)))break e;e[r]=d,e[c]=n,r=c}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var i=performance;t.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var c=[],d=[],u=1,h=null,p=3,f=!1,m=!1,g=!1,x="function"===typeof setTimeout?setTimeout:null,b="function"===typeof clearTimeout?clearTimeout:null,v="undefined"!==typeof setImmediate?setImmediate:null;function y(e){for(var t=r(d);null!==t;){if(null===t.callback)o(d);else{if(!(t.startTime<=e))break;o(d),t.sortIndex=t.expirationTime,n(c,t)}t=r(d)}}function w(e){if(g=!1,y(e),!m)if(null!==r(c))m=!0,O(k);else{var t=r(d);null!==t&&T(w,t.startTime-e)}}function k(e,n){m=!1,g&&(g=!1,b(C),C=-1),f=!0;var a=p;try{for(y(n),h=r(c);null!==h&&(!(h.expirationTime>n)||e&&!M());){var i=h.callback;if("function"===typeof i){h.callback=null,p=h.priorityLevel;var s=i(h.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?h.callback=s:h===r(c)&&o(c),y(n)}else o(c);h=r(c)}if(null!==h)var l=!0;else{var u=r(d);null!==u&&T(w,u.startTime-n),l=!1}return l}finally{h=null,p=a,f=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,j=!1,A=null,C=-1,_=5,E=-1;function M(){return!(t.unstable_now()-E<_)}function N(){if(null!==A){var e=t.unstable_now();E=e;var n=!0;try{n=A(!0,e)}finally{n?S():(j=!1,A=null)}}else j=!1}if("function"===typeof v)S=function(){v(N)};else if("undefined"!==typeof MessageChannel){var R=new MessageChannel,P=R.port2;R.port1.onmessage=N,S=function(){P.postMessage(null)}}else S=function(){x(N,0)};function O(e){A=e,j||(j=!0,S())}function T(e,n){C=x((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){m||f||(m=!0,O(k))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(c)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,o,a){var i=t.unstable_now();switch("object"===typeof a&&null!==a?a="number"===typeof(a=a.delay)&&0<a?i+a:i:a=i,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:u++,callback:o,priorityLevel:e,startTime:a,expirationTime:s=a+s,sortIndex:-1},a>i?(e.sortIndex=a,n(d,e),null===r(c)&&e===r(d)&&(g?(b(C),C=-1):g=!0,T(w,a-i))):(e.sortIndex=s,n(c,e),m||f||(m=!0,O(k))),e},t.unstable_shouldYield=M,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},7266:(e,t,n)=>{"use strict";var r=n(4994);t.X4=p,t.e$=f,t.tL=g,t.eM=function(e,t){const n=h(e),r=h(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},t.a=m;var o=r(n(457)),a=r(n(9214));function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return(0,a.default)(e,t,n)}function s(e){e=e.slice(1);const t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g");let n=e.match(t);return n&&1===n[0].length&&(n=n.map((e=>e+e))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map(((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3)).join(", "),")"):""}function l(e){if(e.type)return e;if("#"===e.charAt(0))return l(s(e));const t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(n))throw new Error((0,o.default)(9,e));let r,a=e.substring(t+1,e.length-1);if("color"===n){if(a=a.split(" "),r=a.shift(),4===a.length&&"/"===a[3].charAt(0)&&(a[3]=a[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(r))throw new Error((0,o.default)(10,r))}else a=a.split(",");return a=a.map((e=>parseFloat(e))),{type:n,values:a,colorSpace:r}}const c=e=>{const t=l(e);return t.values.slice(0,3).map(((e,n)=>-1!==t.type.indexOf("hsl")&&0!==n?"".concat(e,"%"):e)).join(" ")};function d(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return-1!==t.indexOf("rgb")?r=r.map(((e,t)=>t<3?parseInt(e,10):e)):-1!==t.indexOf("hsl")&&(r[1]="".concat(r[1],"%"),r[2]="".concat(r[2],"%")),r=-1!==t.indexOf("color")?"".concat(n," ").concat(r.join(" ")):"".concat(r.join(", ")),"".concat(t,"(").concat(r,")")}function u(e){e=l(e);const{values:t}=e,n=t[0],r=t[1]/100,o=t[2]/100,a=r*Math.min(o,1-o),i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return o-a*Math.max(Math.min(t-3,9-t,1),-1)};let s="rgb";const c=[Math.round(255*i(0)),Math.round(255*i(8)),Math.round(255*i(4))];return"hsla"===e.type&&(s+="a",c.push(t[3])),d({type:s,values:c})}function h(e){let t="hsl"===(e=l(e)).type||"hsla"===e.type?l(u(e)).values:e.values;return t=t.map((t=>("color"!==e.type&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4))),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function p(e,t){return e=l(e),t=i(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]="/".concat(t):e.values[3]=t,d(e)}function f(e,t){if(e=l(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return d(e)}function m(e,t){if(e=l(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return d(e)}function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return h(e)>.5?f(e,t):m(e,t)}},7328:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(5043);const o=function(e,t){var n,o;return r.isValidElement(e)&&-1!==t.indexOf(null!=(n=e.type.muiName)?n:null==(o=e.type)||null==(o=o._payload)||null==(o=o.value)?void 0:o.muiName)}},7344:(e,t,n)=>{"use strict";n.d(t,{A:()=>T});var r=n(8168),o=n(8587),a=n(7868),i=n(9172),s=n(7758),l=n(8812),c=n(8280);var d=n(7266);const u={black:"#000",white:"#fff"},h={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},p={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},f={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},m={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},g={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},x={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},b={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},v=["mode","contrastThreshold","tonalOffset"],y={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:u.white,default:u.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},w={text:{primary:u.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:u.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function k(e,t,n,r){const o=r.light||r,a=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=(0,d.a)(e.main,o):"dark"===t&&(e.dark=(0,d.e$)(e.main,a)))}function S(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:s=.2}=e,l=(0,o.A)(e,v),c=e.primary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:g[200],light:g[50],dark:g[400]}:{main:g[700],light:g[400],dark:g[800]}}(t),S=e.secondary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:p[200],light:p[50],dark:p[400]}:{main:p[500],light:p[300],dark:p[700]}}(t),j=e.error||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:f[500],light:f[300],dark:f[700]}:{main:f[700],light:f[400],dark:f[800]}}(t),A=e.info||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:x[400],light:x[300],dark:x[700]}:{main:x[700],light:x[500],dark:x[900]}}(t),C=e.success||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:b[400],light:b[300],dark:b[700]}:{main:b[800],light:b[500],dark:b[900]}}(t),_=e.warning||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:m[400],light:m[300],dark:m[700]}:{main:"#ed6c02",light:m[500],dark:m[900]}}(t);function E(e){return(0,d.eM)(e,w.text.primary)>=n?w.text.primary:y.text.primary}const M=e=>{let{color:t,name:n,mainShade:o=500,lightShade:i=300,darkShade:l=700}=e;if(t=(0,r.A)({},t),!t.main&&t[o]&&(t.main=t[o]),!t.hasOwnProperty("main"))throw new Error((0,a.A)(11,n?" (".concat(n,")"):"",o));if("string"!==typeof t.main)throw new Error((0,a.A)(12,n?" (".concat(n,")"):"",JSON.stringify(t.main)));return k(t,"light",i,s),k(t,"dark",l,s),t.contrastText||(t.contrastText=E(t.main)),t},N={dark:w,light:y};return(0,i.A)((0,r.A)({common:(0,r.A)({},u),mode:t,primary:M({color:c,name:"primary"}),secondary:M({color:S,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:M({color:j,name:"error"}),warning:M({color:_,name:"warning"}),info:M({color:A,name:"info"}),success:M({color:C,name:"success"}),grey:h,contrastThreshold:n,getContrastText:E,augmentColor:M,tonalOffset:s},N[t]),l)}const j=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];const A={textTransform:"uppercase"},C='"Roboto", "Helvetica", "Arial", sans-serif';function _(e,t){const n="function"===typeof t?t(e):t,{fontFamily:a=C,fontSize:s=14,fontWeightLight:l=300,fontWeightRegular:c=400,fontWeightMedium:d=500,fontWeightBold:u=700,htmlFontSize:h=16,allVariants:p,pxToRem:f}=n,m=(0,o.A)(n,j);const g=s/14,x=f||(e=>"".concat(e/h*g,"rem")),b=(e,t,n,o,i)=>{return(0,r.A)({fontFamily:a,fontWeight:e,fontSize:x(t),lineHeight:n},a===C?{letterSpacing:"".concat((s=o/t,Math.round(1e5*s)/1e5),"em")}:{},i,p);var s},v={h1:b(l,96,1.167,-1.5),h2:b(l,60,1.2,-.5),h3:b(c,48,1.167,0),h4:b(c,34,1.235,.25),h5:b(c,24,1.334,0),h6:b(d,20,1.6,.15),subtitle1:b(c,16,1.75,.15),subtitle2:b(d,14,1.57,.1),body1:b(c,16,1.5,.15),body2:b(c,14,1.43,.15),button:b(d,14,1.75,.4,A),caption:b(c,12,1.66,.4),overline:b(c,12,2.66,1,A),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return(0,i.A)((0,r.A)({htmlFontSize:h,pxToRem:x,fontFamily:a,fontSize:s,fontWeightLight:l,fontWeightRegular:c,fontWeightMedium:d,fontWeightBold:u},v),m,{clone:!1})}function E(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}const M=["none",E(0,2,1,-1,0,1,1,0,0,1,3,0),E(0,3,1,-2,0,2,2,0,0,1,5,0),E(0,3,3,-2,0,3,4,0,0,1,8,0),E(0,2,4,-1,0,4,5,0,0,1,10,0),E(0,3,5,-1,0,5,8,0,0,1,14,0),E(0,3,5,-1,0,6,10,0,0,1,18,0),E(0,4,5,-2,0,7,10,1,0,2,16,1),E(0,5,5,-3,0,8,10,1,0,3,14,2),E(0,5,6,-3,0,9,12,1,0,3,16,2),E(0,6,6,-3,0,10,14,1,0,4,18,3),E(0,6,7,-4,0,11,15,1,0,4,20,3),E(0,7,8,-4,0,12,17,2,0,5,22,4),E(0,7,8,-4,0,13,19,2,0,5,24,4),E(0,7,9,-4,0,14,21,2,0,5,26,4),E(0,8,9,-5,0,15,22,2,0,6,28,5),E(0,8,10,-5,0,16,24,2,0,6,30,5),E(0,8,11,-5,0,17,26,2,0,6,32,5),E(0,9,11,-5,0,18,28,2,0,7,34,6),E(0,9,12,-6,0,19,29,2,0,7,36,6),E(0,10,13,-6,0,20,31,3,0,8,38,7),E(0,10,13,-6,0,21,33,3,0,8,40,7),E(0,10,14,-6,0,22,35,3,0,8,42,7),E(0,11,14,-7,0,23,36,3,0,9,44,8),E(0,11,15,-7,0,24,38,3,0,9,46,8)];var N=n(4318);const R={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},P=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function O(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{mixins:t={},palette:n={},transitions:d={},typography:u={}}=e,h=(0,o.A)(e,P);if(e.vars&&void 0===e.generateCssVars)throw new Error((0,a.A)(18));const p=S(n),f=(0,c.A)(e);let m=(0,i.A)(f,{mixins:(g=f.breakpoints,x=t,(0,r.A)({toolbar:{minHeight:56,[g.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[g.up("sm")]:{minHeight:64}}},x)),palette:p,shadows:M.slice(),typography:_(p,u),transitions:(0,N.Ay)(d),zIndex:(0,r.A)({},R)});var g,x;m=(0,i.A)(m,h);for(var b=arguments.length,v=new Array(b>1?b-1:0),y=1;y<b;y++)v[y-1]=arguments[y];return m=v.reduce(((e,t)=>(0,i.A)(e,t)),m),m.unstable_sxConfig=(0,r.A)({},s.A,null==h?void 0:h.unstable_sxConfig),m.unstable_sx=function(e){return(0,l.A)({sx:e,theme:this})},m}const T=O},7555:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var o=r(n(39)),a=n(579);t.A=(0,o.default)((0,a.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1z"}),"Lock")},7598:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(7868);function o(e){if("string"!==typeof e)throw new Error((0,r.A)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},7758:(e,t,n)=>{"use strict";n.d(t,{A:()=>T});var r=n(8604),o=n(7162),a=n(3815);const i=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t.reduce(((e,t)=>(t.filterProps.forEach((n=>{e[n]=t})),e)),{}),o=e=>Object.keys(e).reduce(((t,n)=>r[n]?(0,a.A)(t,r[n](e)):t),{});return o.propTypes={},o.filterProps=t.reduce(((e,t)=>e.concat(t.filterProps)),[]),o};var s=n(9751);function l(e){return"number"!==typeof e?e:"".concat(e,"px solid")}function c(e,t){return(0,o.Ay)({prop:e,themeKey:"borders",transform:t})}const d=c("border",l),u=c("borderTop",l),h=c("borderRight",l),p=c("borderBottom",l),f=c("borderLeft",l),m=c("borderColor"),g=c("borderTopColor"),x=c("borderRightColor"),b=c("borderBottomColor"),v=c("borderLeftColor"),y=c("outline",l),w=c("outlineColor"),k=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){const t=(0,r.MA)(e.theme,"shape.borderRadius",4,"borderRadius"),n=e=>({borderRadius:(0,r._W)(t,e)});return(0,s.NI)(e,e.borderRadius,n)}return null};k.propTypes={},k.filterProps=["borderRadius"];i(d,u,h,p,f,m,g,x,b,v,k,y,w);const S=e=>{if(void 0!==e.gap&&null!==e.gap){const t=(0,r.MA)(e.theme,"spacing",8,"gap"),n=e=>({gap:(0,r._W)(t,e)});return(0,s.NI)(e,e.gap,n)}return null};S.propTypes={},S.filterProps=["gap"];const j=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){const t=(0,r.MA)(e.theme,"spacing",8,"columnGap"),n=e=>({columnGap:(0,r._W)(t,e)});return(0,s.NI)(e,e.columnGap,n)}return null};j.propTypes={},j.filterProps=["columnGap"];const A=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){const t=(0,r.MA)(e.theme,"spacing",8,"rowGap"),n=e=>({rowGap:(0,r._W)(t,e)});return(0,s.NI)(e,e.rowGap,n)}return null};A.propTypes={},A.filterProps=["rowGap"];i(S,j,A,(0,o.Ay)({prop:"gridColumn"}),(0,o.Ay)({prop:"gridRow"}),(0,o.Ay)({prop:"gridAutoFlow"}),(0,o.Ay)({prop:"gridAutoColumns"}),(0,o.Ay)({prop:"gridAutoRows"}),(0,o.Ay)({prop:"gridTemplateColumns"}),(0,o.Ay)({prop:"gridTemplateRows"}),(0,o.Ay)({prop:"gridTemplateAreas"}),(0,o.Ay)({prop:"gridArea"}));function C(e,t){return"grey"===t?t:e}i((0,o.Ay)({prop:"color",themeKey:"palette",transform:C}),(0,o.Ay)({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:C}),(0,o.Ay)({prop:"backgroundColor",themeKey:"palette",transform:C}));function _(e){return e<=1&&0!==e?"".concat(100*e,"%"):e}const E=(0,o.Ay)({prop:"width",transform:_}),M=e=>{if(void 0!==e.maxWidth&&null!==e.maxWidth){const t=t=>{var n,r;const o=(null==(n=e.theme)||null==(n=n.breakpoints)||null==(n=n.values)?void 0:n[t])||s.zu[t];return o?"px"!==(null==(r=e.theme)||null==(r=r.breakpoints)?void 0:r.unit)?{maxWidth:"".concat(o).concat(e.theme.breakpoints.unit)}:{maxWidth:o}:{maxWidth:_(t)}};return(0,s.NI)(e,e.maxWidth,t)}return null};M.filterProps=["maxWidth"];const N=(0,o.Ay)({prop:"minWidth",transform:_}),R=(0,o.Ay)({prop:"height",transform:_}),P=(0,o.Ay)({prop:"maxHeight",transform:_}),O=(0,o.Ay)({prop:"minHeight",transform:_}),T=((0,o.Ay)({prop:"size",cssProperty:"width",transform:_}),(0,o.Ay)({prop:"size",cssProperty:"height",transform:_}),i(E,M,N,R,P,O,(0,o.Ay)({prop:"boxSizing"})),{border:{themeKey:"borders",transform:l},borderTop:{themeKey:"borders",transform:l},borderRight:{themeKey:"borders",transform:l},borderBottom:{themeKey:"borders",transform:l},borderLeft:{themeKey:"borders",transform:l},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:l},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:k},color:{themeKey:"palette",transform:C},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:C},backgroundColor:{themeKey:"palette",transform:C},p:{style:r.Ms},pt:{style:r.Ms},pr:{style:r.Ms},pb:{style:r.Ms},pl:{style:r.Ms},px:{style:r.Ms},py:{style:r.Ms},padding:{style:r.Ms},paddingTop:{style:r.Ms},paddingRight:{style:r.Ms},paddingBottom:{style:r.Ms},paddingLeft:{style:r.Ms},paddingX:{style:r.Ms},paddingY:{style:r.Ms},paddingInline:{style:r.Ms},paddingInlineStart:{style:r.Ms},paddingInlineEnd:{style:r.Ms},paddingBlock:{style:r.Ms},paddingBlockStart:{style:r.Ms},paddingBlockEnd:{style:r.Ms},m:{style:r.Lc},mt:{style:r.Lc},mr:{style:r.Lc},mb:{style:r.Lc},ml:{style:r.Lc},mx:{style:r.Lc},my:{style:r.Lc},margin:{style:r.Lc},marginTop:{style:r.Lc},marginRight:{style:r.Lc},marginBottom:{style:r.Lc},marginLeft:{style:r.Lc},marginX:{style:r.Lc},marginY:{style:r.Lc},marginInline:{style:r.Lc},marginInlineStart:{style:r.Lc},marginInlineEnd:{style:r.Lc},marginBlock:{style:r.Lc},marginBlockStart:{style:r.Lc},marginBlockEnd:{style:r.Lc},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:S},rowGap:{style:A},columnGap:{style:j},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:_},maxWidth:{style:M},minWidth:{transform:_},height:{transform:_},maxHeight:{transform:_},minHeight:{transform:_},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}})},7868:(e,t,n)=>{"use strict";function r(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}n.d(t,{A:()=>r})},7918:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.A});var r=n(7598)},7940:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var o=r(n(39)),a=n(579);t.A=(0,o.default)((0,a.jsx)("path",{d:"M20 4H4c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2m0 14H4V8h16zm-2-1h-6v-2h6zM7.5 17l-1.41-1.41L8.67 13l-2.59-2.59L7.5 9l4 4z"}),"Terminal")},7950:(e,t,n)=>{"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(2730)},8052:(e,t,n)=>{"use strict";var r=n(4994);t.Ay=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:t,defaultTheme:n=m,rootShouldForwardProp:r=f,slotShouldForwardProp:l=f}=e,d=e=>(0,c.default)((0,o.default)({},e,{theme:x((0,o.default)({},e,{defaultTheme:n,themeId:t}))}));return d.__mui_systemSx=!0,function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.internal_processStyles)(e,(e=>e.filter((e=>!(null!=e&&e.__mui_systemSx)))));const{name:u,slot:p,skipVariantsResolver:m,skipSx:y,overridesResolver:w=b(g(p))}=c,k=(0,a.default)(c,h),S=void 0!==m?m:p&&"Root"!==p&&"root"!==p||!1,j=y||!1;let A=f;"Root"===p||"root"===p?A=r:p?A=l:function(e){return"string"===typeof e&&e.charCodeAt(0)>96}(e)&&(A=void 0);const C=(0,i.default)(e,(0,o.default)({shouldForwardProp:A,label:undefined},k)),_=e=>"function"===typeof e&&e.__emotion_real!==e||(0,s.isPlainObject)(e)?r=>v(e,(0,o.default)({},r,{theme:x({theme:r.theme,defaultTheme:n,themeId:t})})):e,E=function(r){let a=_(r);for(var i=arguments.length,s=new Array(i>1?i-1:0),l=1;l<i;l++)s[l-1]=arguments[l];const c=s?s.map(_):[];u&&w&&c.push((e=>{const r=x((0,o.default)({},e,{defaultTheme:n,themeId:t}));if(!r.components||!r.components[u]||!r.components[u].styleOverrides)return null;const a=r.components[u].styleOverrides,i={};return Object.entries(a).forEach((t=>{let[n,a]=t;i[n]=v(a,(0,o.default)({},e,{theme:r}))})),w(e,i)})),u&&!S&&c.push((e=>{var r;const a=x((0,o.default)({},e,{defaultTheme:n,themeId:t}));return v({variants:null==a||null==(r=a.components)||null==(r=r[u])?void 0:r.variants},(0,o.default)({},e,{theme:a}))})),j||c.push(d);const h=c.length-s.length;if(Array.isArray(r)&&h>0){const e=new Array(h).fill("");a=[...r,...e],a.raw=[...r.raw,...e]}const p=C(a,...c);return e.muiName&&(p.muiName=e.muiName),p};return C.withConfig&&(E.withConfig=C.withConfig),E}};var o=r(n(4634)),a=r(n(4893)),i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(3174)),s=n(9482),l=(r(n(7918)),r(n(3382)),r(n(4989))),c=r(n(3234));const d=["ownerState"],u=["variants"],h=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function f(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}const m=(0,l.default)(),g=e=>e?e.charAt(0).toLowerCase()+e.slice(1):e;function x(e){let{defaultTheme:t,theme:n,themeId:r}=e;return o=n,0===Object.keys(o).length?t:n[r]||n;var o}function b(e){return e?(t,n)=>n[e]:null}function v(e,t){let{ownerState:n}=t,r=(0,a.default)(t,d);const i="function"===typeof e?e((0,o.default)({ownerState:n},r)):e;if(Array.isArray(i))return i.flatMap((e=>v(e,(0,o.default)({ownerState:n},r))));if(i&&"object"===typeof i&&Array.isArray(i.variants)){const{variants:e=[]}=i;let t=(0,a.default)(i,u);return e.forEach((e=>{let a=!0;"function"===typeof e.props?a=e.props((0,o.default)({ownerState:n},r,n)):Object.keys(e.props).forEach((t=>{(null==n?void 0:n[t])!==e.props[t]&&r[t]!==e.props[t]&&(a=!1)})),a&&(Array.isArray(t)||(t=[t]),t.push("function"===typeof e.style?e.style((0,o.default)({ownerState:n},r,n)):e.style))})),t}return i}},8168:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(null,arguments)}n.d(t,{A:()=>r})},8206:(e,t,n)=>{"use strict";n.d(t,{b:()=>o});n(5043);var r=n(3654);n(579);function o(e){return(0,r.b)(e)}},8280:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(8168),o=n(8587),a=n(9172),i=n(4853);const s={borderRadius:4};var l=n(8604);var c=n(8812),d=n(7758),u=n(9703);const h=["breakpoints","palette","spacing","shape"];const p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{breakpoints:t={},palette:n={},spacing:p,shape:f={}}=e,m=(0,o.A)(e,h),g=(0,i.A)(t),x=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;const t=(0,l.LX)({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(0===n.length?[1]:n).map((e=>{const n=t(e);return"number"===typeof n?"".concat(n,"px"):n})).join(" ")};return n.mui=!0,n}(p);let b=(0,a.A)({breakpoints:g,direction:"ltr",components:{},palette:(0,r.A)({mode:"light"},n),spacing:x,shape:(0,r.A)({},s,f)},m);b.applyStyles=u.A;for(var v=arguments.length,y=new Array(v>1?v-1:0),w=1;w<v;w++)y[w-1]=arguments[w];return b=y.reduce(((e,t)=>(0,a.A)(e,t)),b),b.unstable_sxConfig=(0,r.A)({},d.A,null==m?void 0:m.unstable_sxConfig),b.unstable_sx=function(e){return(0,c.A)({sx:e,theme:this})},b}},8387:(e,t,n)=>{"use strict";function r(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=r(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}n.d(t,{A:()=>o});const o=function(){for(var e,t,n=0,o="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=r(e))&&(o&&(o+=" "),o+=t);return o}},8587:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}n.d(t,{A:()=>r})},8604:(e,t,n)=>{"use strict";n.d(t,{LX:()=>f,MA:()=>p,_W:()=>m,Lc:()=>b,Ms:()=>v});var r=n(9751),o=n(7162),a=n(3815);const i={m:"margin",p:"padding"},s={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},l={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},c=function(e){const t={};return n=>(void 0===t[n]&&(t[n]=e(n)),t[n])}((e=>{if(e.length>2){if(!l[e])return[e];e=l[e]}const[t,n]=e.split(""),r=i[t],o=s[n]||"";return Array.isArray(o)?o.map((e=>r+e)):[r+o]})),d=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],u=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],h=[...d,...u];function p(e,t,n,r){var a;const i=null!=(a=(0,o.Yn)(e,t,!1))?a:n;return"number"===typeof i?e=>"string"===typeof e?e:i*e:Array.isArray(i)?e=>"string"===typeof e?e:i[e]:"function"===typeof i?i:()=>{}}function f(e){return p(e,"spacing",8)}function m(e,t){if("string"===typeof t||null==t)return t;const n=e(Math.abs(t));return t>=0?n:"number"===typeof n?-n:"-".concat(n)}function g(e,t,n,o){if(-1===t.indexOf(n))return null;const a=function(e,t){return n=>e.reduce(((e,r)=>(e[r]=m(t,n),e)),{})}(c(n),o),i=e[n];return(0,r.NI)(e,i,a)}function x(e,t){const n=f(e.theme);return Object.keys(e).map((r=>g(e,t,r,n))).reduce(a.A,{})}function b(e){return x(e,d)}function v(e){return x(e,u)}function y(e){return x(e,h)}b.propTypes={},b.filterProps=d,v.propTypes={},v.filterProps=u,y.propTypes={},y.filterProps=h},8610:(e,t,n)=>{"use strict";function r(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const r={};return Object.keys(e).forEach((o=>{r[o]=e[o].reduce(((e,r)=>{if(r){const o=t(r);""!==o&&e.push(o),n&&n[r]&&e.push(n[r])}return e}),[]).join(" ")})),r}n.d(t,{A:()=>r})},8625:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var o=r(n(39)),a=n(579);t.A=(0,o.default)((0,a.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh")},8698:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(8168),o=n(8587),a=n(9172),i=n(7758);const s=["sx"],l=e=>{var t,n;const r={systemProps:{},otherProps:{}},o=null!=(t=null==e||null==(n=e.theme)?void 0:n.unstable_sxConfig)?t:i.A;return Object.keys(e).forEach((t=>{o[t]?r.systemProps[t]=e[t]:r.otherProps[t]=e[t]})),r};function c(e){const{sx:t}=e,n=(0,o.A)(e,s),{systemProps:i,otherProps:c}=l(n);let d;return d=Array.isArray(t)?[i,...t]:"function"===typeof t?function(){const e=t(...arguments);return(0,a.Q)(e)?(0,r.A)({},i,e):i}:(0,r.A)({},i,t),(0,r.A)({},c,{sx:d})}},8812:(e,t,n)=>{"use strict";n.d(t,{A:()=>d,k:()=>l});var r=n(7598),o=n(3815),a=n(7162),i=n(9751),s=n(7758);function l(){function e(e,t,n,o){const s={[e]:t,theme:n},l=o[e];if(!l)return{[e]:t};const{cssProperty:c=e,themeKey:d,transform:u,style:h}=l;if(null==t)return null;if("typography"===d&&"inherit"===t)return{[e]:t};const p=(0,a.Yn)(n,d)||{};if(h)return h(s);return(0,i.NI)(s,t,(t=>{let n=(0,a.BO)(p,u,t);return t===n&&"string"===typeof t&&(n=(0,a.BO)(p,u,"".concat(e).concat("default"===t?"":(0,r.A)(t)),t)),!1===c?n:{[c]:n}}))}return function t(n){var r;const{sx:a,theme:l={}}=n||{};if(!a)return null;const c=null!=(r=l.unstable_sxConfig)?r:s.A;function d(n){let r=n;if("function"===typeof n)r=n(l);else if("object"!==typeof n)return n;if(!r)return null;const a=(0,i.EU)(l.breakpoints),s=Object.keys(a);let d=a;return Object.keys(r).forEach((n=>{const a=(s=r[n],u=l,"function"===typeof s?s(u):s);var s,u;if(null!==a&&void 0!==a)if("object"===typeof a)if(c[n])d=(0,o.A)(d,e(n,a,l,c));else{const e=(0,i.NI)({theme:l},a,(e=>({[n]:e})));!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t.reduce(((e,t)=>e.concat(Object.keys(t))),[]),o=new Set(r);return t.every((e=>o.size===Object.keys(e).length))}(e,a)?d=(0,o.A)(d,e):d[n]=t({sx:a,theme:l})}else d=(0,o.A)(d,e(n,a,l,c))})),(0,i.vf)(s,d)}return Array.isArray(a)?a.map(d):d(a)}}const c=l();c.filterProps=["sx"];const d=c},8853:(e,t,n)=>{"use strict";e.exports=n(7234)},9172:(e,t,n)=>{"use strict";n.d(t,{A:()=>s,Q:()=>a});var r=n(8168),o=n(5043);function a(e){if("object"!==typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function i(e){if(o.isValidElement(e)||!a(e))return e;const t={};return Object.keys(e).forEach((n=>{t[n]=i(e[n])})),t}function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0};const l=n.clone?(0,r.A)({},e):e;return a(e)&&a(t)&&Object.keys(t).forEach((r=>{o.isValidElement(t[r])?l[r]=t[r]:a(t[r])&&Object.prototype.hasOwnProperty.call(e,r)&&a(e[r])?l[r]=s(e[r],t[r],n):n.clone?l[r]=a(t[r])?i(t[r]):t[r]:l[r]=t[r]})),l}},9214:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MIN_SAFE_INTEGER,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_SAFE_INTEGER;return Math.max(t,Math.min(e,n))}},9303:(e,t,n)=>{"use strict";n.d(t,{E:()=>i,A:()=>s});var r=n(5043);const o={};const a=[];class i{constructor(){this.currentId=null,this.clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new i}start(e,t){this.clear(),this.currentId=setTimeout((()=>{this.currentId=null,t()}),e)}}function s(){const e=function(e,t){const n=r.useRef(o);return n.current===o&&(n.current=e(t)),n}(i.create).current;var t;return t=e.disposeEffect,r.useEffect(t,a),e}},9369:(e,t,n)=>{"use strict";n.d(t,{C:()=>c,E:()=>g,T:()=>u,c:()=>f,h:()=>h,w:()=>d});var r=n(5043),o=n(3803),a=n(1722),i=n(6598),s=n(9436),l=r.createContext("undefined"!==typeof HTMLElement?(0,o.A)({key:"css"}):null),c=l.Provider,d=function(e){return(0,r.forwardRef)((function(t,n){var o=(0,r.useContext)(l);return e(t,o,n)}))},u=r.createContext({});var h={}.hasOwnProperty,p="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",f=function(e,t){var n={};for(var r in t)h.call(t,r)&&(n[r]=t[r]);return n[p]=e,n},m=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return(0,a.SF)(t,n,r),(0,s.s)((function(){return(0,a.sk)(t,n,r)})),null},g=d((function(e,t,n){var o=e.css;"string"===typeof o&&void 0!==t.registered[o]&&(o=t.registered[o]);var s=e[p],l=[o],c="";"string"===typeof e.className?c=(0,a.Rk)(t.registered,l,e.className):null!=e.className&&(c=e.className+" ");var d=(0,i.J)(l,void 0,r.useContext(u));c+=t.key+"-"+d.name;var f={};for(var g in e)h.call(e,g)&&"css"!==g&&g!==p&&(f[g]=e[g]);return f.className=c,n&&(f.ref=n),r.createElement(r.Fragment,null,r.createElement(m,{cache:t,serialized:d,isStringTag:"string"===typeof s}),r.createElement(s,f))}))},9386:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});const r=e=>e,o=(()=>{let e=r;return{configure(t){e=t},generate:t=>e(t),reset(){e=r}}})()},9436:(e,t,n)=>{"use strict";var r;n.d(t,{i:()=>s,s:()=>i});var o=n(5043),a=!!(r||(r=n.t(o,2))).useInsertionEffect&&(r||(r=n.t(o,2))).useInsertionEffect,i=a||function(e){return e()},s=a||o.useLayoutEffect},9482:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.A,isPlainObject:()=>r.Q});var r=n(9172)},9662:(e,t,n)=>{"use strict";n.d(t,{A:()=>v});var r=n(8168),o=n(5043),a=n(8587),i=n(8387),s=n(8610),l=n(6803),c=n(8206),d=n(4535),u=n(2532),h=n(2372);function p(e){return(0,h.Ay)("MuiSvgIcon",e)}(0,u.A)("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);var f=n(579);const m=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],g=(0,d.Ay)("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"inherit"!==n.color&&t["color".concat((0,l.A)(n.color))],t["fontSize".concat((0,l.A)(n.fontSize))]]}})((e=>{let{theme:t,ownerState:n}=e;var r,o,a,i,s,l,c,d,u,h,p,f,m;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:n.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:null==(r=t.transitions)||null==(o=r.create)?void 0:o.call(r,"fill",{duration:null==(a=t.transitions)||null==(a=a.duration)?void 0:a.shorter}),fontSize:{inherit:"inherit",small:(null==(i=t.typography)||null==(s=i.pxToRem)?void 0:s.call(i,20))||"1.25rem",medium:(null==(l=t.typography)||null==(c=l.pxToRem)?void 0:c.call(l,24))||"1.5rem",large:(null==(d=t.typography)||null==(u=d.pxToRem)?void 0:u.call(d,35))||"2.1875rem"}[n.fontSize],color:null!=(h=null==(p=(t.vars||t).palette)||null==(p=p[n.color])?void 0:p.main)?h:{action:null==(f=(t.vars||t).palette)||null==(f=f.action)?void 0:f.active,disabled:null==(m=(t.vars||t).palette)||null==(m=m.action)?void 0:m.disabled,inherit:void 0}[n.color]}})),x=o.forwardRef((function(e,t){const n=(0,c.b)({props:e,name:"MuiSvgIcon"}),{children:d,className:u,color:h="inherit",component:x="svg",fontSize:b="medium",htmlColor:v,inheritViewBox:y=!1,titleAccess:w,viewBox:k="0 0 24 24"}=n,S=(0,a.A)(n,m),j=o.isValidElement(d)&&"svg"===d.type,A=(0,r.A)({},n,{color:h,component:x,fontSize:b,instanceFontSize:e.fontSize,inheritViewBox:y,viewBox:k,hasSvgAsChild:j}),C={};y||(C.viewBox=k);const _=(e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root","inherit"!==t&&"color".concat((0,l.A)(t)),"fontSize".concat((0,l.A)(n))]};return(0,s.A)(o,p,r)})(A);return(0,f.jsxs)(g,(0,r.A)({as:x,className:(0,i.A)(_.root,u),focusable:"false",color:v,"aria-hidden":!w||void 0,role:w?"img":void 0,ref:t},C,S,j&&d.props,{ownerState:A,children:[j?d.props.children:d,w?(0,f.jsx)("title",{children:w}):null]}))}));x.muiName="SvgIcon";const b=x;function v(e,t){function n(n,o){return(0,f.jsx)(b,(0,r.A)({"data-testid":"".concat(t,"Icon"),ref:o},n,{children:e}))}return n.muiName=b.muiName,o.memo(o.forwardRef(n))}},9703:(e,t,n)=>{"use strict";function r(e,t){const n=this;if(n.vars&&"function"===typeof n.getColorSchemeSelector){const r=n.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)");return{[r]:t}}return n.palette.mode===e?t:{}}n.d(t,{A:()=>r})},9719:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var o=r(n(39)),a=n(579);t.A=(0,o.default)((0,a.jsx)("path",{d:"M15 16h4v2h-4zm0-8h7v2h-7zm0 4h6v2h-6zM3 18c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V8H3zM14 5h-3l-1-1H6L5 5H2v2h12z"}),"DeleteSweep")},9751:(e,t,n)=>{"use strict";n.d(t,{EU:()=>s,NI:()=>i,iZ:()=>c,kW:()=>d,vf:()=>l,zu:()=>o});var r=n(9172);const o={xs:0,sm:600,md:900,lg:1200,xl:1536},a={keys:["xs","sm","md","lg","xl"],up:e=>"@media (min-width:".concat(o[e],"px)")};function i(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const e=r.breakpoints||a;return t.reduce(((r,o,a)=>(r[e.up(e.keys[a])]=n(t[a]),r)),{})}if("object"===typeof t){const e=r.breakpoints||a;return Object.keys(t).reduce(((r,a)=>{if(-1!==Object.keys(e.values||o).indexOf(a)){r[e.up(a)]=n(t[a],a)}else{const e=a;r[e]=t[e]}return r}),{})}return n(t)}function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t;return(null==(t=e.keys)?void 0:t.reduce(((t,n)=>(t[e.up(n)]={},t)),{}))||{}}function l(e,t){return e.reduce(((e,t)=>{const n=e[t];return(!n||0===Object.keys(n).length)&&delete e[t],e}),t)}function c(e){const t=s(e);for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];const i=[t,...o].reduce(((e,t)=>(0,r.A)(e,t)),{});return l(Object.keys(t),i)}function d(e){let{values:t,breakpoints:n,base:r}=e;const o=r||function(e,t){if("object"!==typeof e)return{};const n={},r=Object.keys(t);return Array.isArray(e)?r.forEach(((t,r)=>{r<e.length&&(n[t]=!0)})):r.forEach((t=>{null!=e[t]&&(n[t]=!0)})),n}(t,n),a=Object.keys(o);if(0===a.length)return t;let i;return a.reduce(((e,n,r)=>(Array.isArray(t)?(e[n]=null!=t[r]?t[r]:t[i],i=r):"object"===typeof t?(e[n]=null!=t[n]?t[n]:t[i],i=n):e[n]=t,e)),{})}},9778:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var o=r(n(39)),a=n(579);t.A=(0,o.default)((0,a.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle")}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;n.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if("object"===typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&"function"===typeof r.then)return r}var a=Object.create(null);n.r(a);var i={};e=e||[null,t({}),t([]),t(t)];for(var s=2&o&&r;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((e=>i[e]=()=>r[e]));return i.default=()=>r,n.d(a,i),a}})(),n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};n.r(e),n.d(e,{Decoder:()=>Se,Encoder:()=>we,PacketType:()=>ye,protocol:()=>ve});var t={};n.r(t),n.d(t,{hasBrowserEnv:()=>Lt,hasStandardBrowserEnv:()=>zt,hasStandardBrowserWebWorkerEnv:()=>Dt,navigator:()=>It,origin:()=>Ft});var r=n(5043),o=n(4391);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}function s(e,t,n){return(t=i(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const d=Object.create(null);d.open="0",d.close="1",d.ping="2",d.pong="3",d.message="4",d.upgrade="5",d.noop="6";const u=Object.create(null);Object.keys(d).forEach((e=>{u[d[e]]=e}));const h={type:"error",data:"parser error"},p="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),f="function"===typeof ArrayBuffer,m=e=>"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,g=(e,t,n)=>{let{type:r,data:o}=e;return p&&o instanceof Blob?t?n(o):x(o,n):f&&(o instanceof ArrayBuffer||m(o))?t?n(o):x(new Blob([o]),n):n(d[r]+(o||""))},x=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};function b(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let v;const y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w="undefined"===typeof Uint8Array?[]:new Uint8Array(256);for(let n=0;n<64;n++)w[y.charCodeAt(n)]=n;const k="function"===typeof ArrayBuffer,S=(e,t)=>{if("string"!==typeof e)return{type:"message",data:A(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:j(e.substring(1),t)};return u[n]?e.length>1?{type:u[n],data:e.substring(1)}:{type:u[n]}:h},j=(e,t)=>{if(k){const n=(e=>{let t,n,r,o,a,i=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);const c=new ArrayBuffer(i),d=new Uint8Array(c);for(t=0;t<s;t+=4)n=w[e.charCodeAt(t)],r=w[e.charCodeAt(t+1)],o=w[e.charCodeAt(t+2)],a=w[e.charCodeAt(t+3)],d[l++]=n<<2|r>>4,d[l++]=(15&r)<<4|o>>2,d[l++]=(3&o)<<6|63&a;return c})(e);return A(n,t)}return{base64:!0,data:e}},A=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,C=String.fromCharCode(30);function _(){return new TransformStream({transform(e,t){!function(e,t){p&&e.data instanceof Blob?e.data.arrayBuffer().then(b).then(t):f&&(e.data instanceof ArrayBuffer||m(e.data))?t(b(e.data)):g(e,!1,(e=>{v||(v=new TextEncoder),t(v.encode(e))}))}(e,(n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const e=new DataView(o.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{o=new Uint8Array(9);const e=new DataView(o.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&"string"!==typeof e.data&&(o[0]|=128),t.enqueue(o),t.enqueue(n)}))}})}let E;function M(e){return e.reduce(((e,t)=>e+t.length),0)}function N(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function R(e){if(e)return function(e){for(var t in R.prototype)e[t]=R.prototype[t];return e}(e)}R.prototype.on=R.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},R.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},R.prototype.off=R.prototype.removeListener=R.prototype.removeAllListeners=R.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},R.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t)}return this},R.prototype.emitReserved=R.prototype.emit,R.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},R.prototype.hasListeners=function(e){return!!this.listeners(e).length};const P="function"===typeof Promise&&"function"===typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),O="undefined"!==typeof self?self:"undefined"!==typeof window?window:Function("return this")();function T(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const L=O.setTimeout,I=O.clearTimeout;function z(e,t){t.useNativeTimers?(e.setTimeoutFn=L.bind(O),e.clearTimeoutFn=I.bind(O)):(e.setTimeoutFn=O.setTimeout.bind(O),e.clearTimeoutFn=O.clearTimeout.bind(O))}function D(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class F extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class B extends R{constructor(e){super(),this.writable=!1,z(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new F(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=S(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=function(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}(e);return t.length?"?"+t:""}}class W extends B{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(C),r=[];for(let o=0;o<n.length;o++){const e=S(n[o],t);if(r.push(e),"error"===e.type)break}return r})(e,this.socket.binaryType).forEach((e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach(((e,a)=>{g(e,!1,(e=>{r[a]=e,++o===n&&t(r.join(C))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=D()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}}let H=!1;try{H="undefined"!==typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(NR){}const V=H;function U(){}class q extends W{constructor(e){if(super(e),"undefined"!==typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!==typeof location&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}class $ extends R{constructor(e,t,n){super(),this.createRequest=e,z(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=void 0!==n.data?n.data:null,this._create()}_create(){var e;const t=T(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(t);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&n.setRequestHeader(e,this._opts.extraHeaders[e])}}catch(r){}if("POST"===this._method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(r){}try{n.setRequestHeader("Accept","*/*")}catch(r){}null===(e=this._opts.cookieJar)||void 0===e||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var e;3===n.readyState&&(null===(e=this._opts.cookieJar)||void 0===e||e.parseCookies(n.getResponseHeader("set-cookie"))),4===n.readyState&&(200===n.status||1223===n.status?this._onLoad():this.setTimeoutFn((()=>{this._onError("number"===typeof n.status?n.status:0)}),0))},n.send(this._data)}catch(r){return void this.setTimeoutFn((()=>{this._onError(r)}),0)}"undefined"!==typeof document&&(this._index=$.requestsCount++,$.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if("undefined"!==typeof this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=U,e)try{this._xhr.abort()}catch(t){}"undefined"!==typeof document&&delete $.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if($.requestsCount=0,$.requests={},"undefined"!==typeof document)if("function"===typeof attachEvent)attachEvent("onunload",K);else if("function"===typeof addEventListener){addEventListener("onpagehide"in O?"pagehide":"unload",K,!1)}function K(){for(let e in $.requests)$.requests.hasOwnProperty(e)&&$.requests[e].abort()}const X=function(){const e=Y({xdomain:!1});return e&&null!==e.responseType}();function Y(e){const t=e.xdomain;try{if("undefined"!==typeof XMLHttpRequest&&(!t||V))return new XMLHttpRequest}catch(n){}if(!t)try{return new(O[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(n){}}const G="undefined"!==typeof navigator&&"string"===typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class Z extends B{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,n=G?{}:T(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(NR){return this.emitReserved("error",NR)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;g(n,this.supportsBinary,(e=>{try{this.doWrite(n,e)}catch(t){}r&&P((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){"undefined"!==typeof this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=D()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const J=O.WebSocket||O.MozWebSocket;const Q={websocket:class extends Z{createSocket(e,t,n){return G?new J(e,t,n):t?new J(e,t):new J(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends B{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(NR){return this.emitReserved("error",NR)}this._transport.closed.then((()=>{this.onClose()})).catch((e=>{this.onError("webtransport error",e)})),this._transport.ready.then((()=>{this._transport.createBidirectionalStream().then((e=>{const t=function(e,t){E||(E=new TextDecoder);const n=[];let r=0,o=-1,a=!1;return new TransformStream({transform(i,s){for(n.push(i);;){if(0===r){if(M(n)<1)break;const e=N(n,1);a=128===(128&e[0]),o=127&e[0],r=o<126?3:126===o?1:2}else if(1===r){if(M(n)<2)break;const e=N(n,2);o=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(2===r){if(M(n)<8)break;const e=N(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),a=t.getUint32(0);if(a>Math.pow(2,21)-1){s.enqueue(h);break}o=a*Math.pow(2,32)+t.getUint32(4),r=3}else{if(M(n)<o)break;const e=N(n,o);s.enqueue(S(a?e:E.decode(e),t)),r=0}if(0===o||o>e){s.enqueue(h);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=_();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();const o=()=>{n.read().then((e=>{let{done:t,value:n}=e;t||(this.onPacket(n),o())})).catch((e=>{}))};o();const a={type:"open"};this.query.sid&&(a.data='{"sid":"'.concat(this.query.sid,'"}')),this._writer.write(a).then((()=>this.onOpen()))}))}))}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;this._writer.write(n).then((()=>{r&&P((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var e;null===(e=this._transport)||void 0===e||e.close()}},polling:class extends q{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=X&&!t}request(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(e,{xd:this.xd},this.opts),new $(Y,this.uri(),e)}}},ee=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,te=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ne(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=ee.exec(e||""),a={},i=14;for(;i--;)a[te[i]]=o[i]||"";return-1!=n&&-1!=r&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=function(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,a.path),a.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,a.query),a}const re="function"===typeof addEventListener&&"function"===typeof removeEventListener,oe=[];re&&addEventListener("offline",(()=>{oe.forEach((e=>e()))}),!1);class ae extends R{constructor(e,t){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"===typeof e&&(t=e,e=null),e){const n=ne(e);t.hostname=n.host,t.secure="https"===n.protocol||"wss"===n.protocol,t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=ne(t.host).host);z(this,t),this.secure=null!=t.secure?t.secure:"undefined"!==typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!==typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!==typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach((e=>{const t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e})),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"===typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let e=n[r].split("=");t[decodeURIComponent(e[0])]=decodeURIComponent(e[1])}return t}(this.opts.query)),re&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},oe.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);const e=this.opts.rememberUpgrade&&ae.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",(e=>this._onClose("transport close",e)))}onOpen(){this.readyState="open",ae.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn((()=>{this._onClose("ping timeout")}),e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(e+="string"===typeof(t=r)?function(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(t):Math.ceil(1.33*(t.byteLength||t.size))),n>0&&e>this._maxPayload)return this.writeBuffer.slice(0,n);e+=2}var t;return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,P((()=>{this._onClose("ping timeout")}),this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,r){if("function"===typeof t&&(r=t,t=void 0),"function"===typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}_onError(e){if(ae.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),re&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const e=oe.indexOf(this._offlineEventListener);-1!==e&&oe.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}ae.protocol=4;class ie extends ae{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;ae.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",(e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;ae.priorWebsocketSuccess="websocket"===t.name,this.transport.pause((()=>{n||"closed"!==this.readyState&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}})))};function o(){n||(n=!0,c(),t.close(),t=null)}const a=e=>{const n=new Error("probe error: "+e);n.transport=t.name,o(),this.emitReserved("upgradeError",n)};function i(){a("transport closed")}function s(){a("socket closed")}function l(e){t&&e.name!==t.name&&o()}const c=()=>{t.removeListener("open",r),t.removeListener("error",a),t.removeListener("close",i),this.off("close",s),this.off("upgrading",l)};t.once("open",r),t.once("error",a),t.once("close",i),this.once("close",s),this.once("upgrading",l),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn((()=>{n||t.open()}),200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}class se extends ie{constructor(e){const t="object"===typeof e?e:arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(!t.transports||t.transports&&"string"===typeof t.transports[0])&&(t.transports=(t.transports||["polling","websocket","webtransport"]).map((e=>Q[e])).filter((e=>!!e))),super(e,t)}}const le="function"===typeof ArrayBuffer,ce=Object.prototype.toString,de="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===ce.call(Blob),ue="function"===typeof File||"undefined"!==typeof File&&"[object FileConstructor]"===ce.call(File);function he(e){return le&&(e instanceof ArrayBuffer||(e=>"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||de&&e instanceof Blob||ue&&e instanceof File}function pe(e,t){if(!e||"object"!==typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(pe(e[t]))return!0;return!1}if(he(e))return!0;if(e.toJSON&&"function"===typeof e.toJSON&&1===arguments.length)return pe(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&pe(e[n]))return!0;return!1}function fe(e){const t=[],n=e.data,r=e;return r.data=me(n,t),r.attachments=t.length,{packet:r,buffers:t}}function me(e,t){if(!e)return e;if(he(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=me(e[r],t);return n}if("object"===typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=me(e[r],t));return n}return e}function ge(e,t){return e.data=xe(e.data,t),delete e.attachments,e}function xe(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"===typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=xe(e[n],t);else if("object"===typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=xe(e[n],t));return e}const be=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ve=5;var ye;!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(ye||(ye={}));class we{constructor(e){this.replacer=e}encode(e){return e.type!==ye.EVENT&&e.type!==ye.ACK||!pe(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===ye.EVENT?ye.BINARY_EVENT:ye.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==ye.BINARY_EVENT&&e.type!==ye.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=fe(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}}function ke(e){return"[object Object]"===Object.prototype.toString.call(e)}class Se extends R{constructor(e){super(),this.reviver=e}add(e){let t;if("string"===typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===ye.BINARY_EVENT;n||t.type===ye.BINARY_ACK?(t.type=n?ye.EVENT:ye.ACK,this.reconstructor=new je(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!he(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===ye[n.type])throw new Error("unknown packet type "+n.type);if(n.type===ye.BINARY_EVENT||n.type===ye.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const o=e.substring(r,t);if(o!=Number(o)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!Se.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(t){return!1}}static isPayloadValid(e,t){switch(e){case ye.CONNECT:return ke(t);case ye.DISCONNECT:return void 0===t;case ye.CONNECT_ERROR:return"string"===typeof t||ke(t);case ye.EVENT:case ye.BINARY_EVENT:return Array.isArray(t)&&("number"===typeof t[0]||"string"===typeof t[0]&&-1===be.indexOf(t[0]));case ye.ACK:case ye.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class je{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=ge(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Ae(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Ce=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class _e extends R{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Ae(e,"open",this.onopen.bind(this)),Ae(e,"packet",this.onpacket.bind(this)),Ae(e,"error",this.onerror.bind(this)),Ae(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.unshift("message"),this.emit.apply(this,t),this}emit(e){var t,n,r;if(Ce.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];if(a.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(a),this;const s={type:ye.EVENT,data:a,options:{}};if(s.options.compress=!1!==this.flags.compress,"function"===typeof a[a.length-1]){const e=this.ids++,t=a.pop();this._registerAckCallback(e,t),s.id=e}const l=null===(n=null===(t=this.io.engine)||void 0===t?void 0:t.transport)||void 0===n?void 0:n.writable,c=this.connected&&!(null===(r=this.io.engine)||void 0===r?void 0:r._hasPingExpired());return this.flags.volatile&&!l||(c?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(e,t){var n,r=this;const o=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===o)return void(this.acks[e]=t);const a=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))}),o),i=function(){r.io.clearTimeoutFn(a);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];t.apply(r,n)};i.withError=!0,this.acks[e]=i}emitWithAck(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new Promise(((t,r)=>{const o=(e,n)=>e?r(e):t(n);o.withError=!0,n.push(o),this.emit(e,...n)}))}_addToQueue(e){var t=this;let n;"function"===typeof e[e.length-1]&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((function(e){if(r!==t._queue[0])return;if(null!==e)r.tryCount>t._opts.retries&&(t._queue.shift(),n&&n(e));else if(t._queue.shift(),n){for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];n(null,...a)}return r.pending=!1,t._drainQueue()})),this._queue.push(r),this._drainQueue()}_drainQueue(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this._sendConnectPacket(e)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:ye.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach((e=>{if(!this.sendBuffer.some((t=>String(t.id)===e))){const t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,new Error("socket has been disconnected"))}}))}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case ye.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ye.EVENT:case ye.BINARY_EVENT:this.onevent(e);break;case ye.ACK:case ye.BINARY_ACK:this.onack(e);break;case ye.DISCONNECT:this.ondisconnect();break;case ye.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"===typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(){if(!n){n=!0;for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];t.packet({type:ye.ACK,id:e,data:o})}}}onack(e){const t=this.acks[e.id];"function"===typeof t&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ye.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function Ee(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ee.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},Ee.prototype.reset=function(){this.attempts=0},Ee.prototype.setMin=function(e){this.ms=e},Ee.prototype.setMax=function(e){this.max=e},Ee.prototype.setJitter=function(e){this.jitter=e};class Me extends R{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&"object"===typeof t&&(n=t,t=void 0),(n=n||{}).path=n.path||"/socket.io",this.opts=n,z(this,n),this.reconnection(!1!==n.reconnection),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(r=n.randomizationFactor)&&void 0!==r?r:.5),this.backoff=new Ee({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==n.timeout?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||e;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=!1!==n.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new se(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=Ae(t,"open",(function(){n.onopen(),e&&e()})),o=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},a=Ae(t,"error",o);if(!1!==this._timeout){const e=this._timeout,n=this.setTimeoutFn((()=>{r(),o(new Error("timeout")),t.close()}),e);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}return this.subs.push(r),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Ae(e,"ping",this.onping.bind(this)),Ae(e,"data",this.ondata.bind(this)),Ae(e,"error",this.onerror.bind(this)),Ae(e,"close",this.onclose.bind(this)),Ae(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){P((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new _e(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t){if(this.nsps[n].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach((e=>e())),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),null===(n=this.engine)||void 0===n||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Ne={};function Re(e,t){"object"===typeof e&&(t=e,e=void 0);const n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=e;n=n||"undefined"!==typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"===typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e="undefined"!==typeof n?n.protocol+"//"+e:"https://"+e),r=ne(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,o=n.id,a=n.path,i=Ne[o]&&a in Ne[o].nsps;let s;return t.forceNew||t["force new connection"]||!1===t.multiplex||i?s=new Me(r,t):(Ne[o]||(Ne[o]=new Me(r,t)),s=Ne[o]),n.query&&!t.query&&(t.query=n.queryKey),s.socket(n.path,t)}function Pe(e,t){return function(){return e.apply(t,arguments)}}Object.assign(Re,{Manager:Me,Socket:_e,io:Re,connect:Re});const{toString:Oe}=Object.prototype,{getPrototypeOf:Te}=Object,{iterator:Le,toStringTag:Ie}=Symbol,ze=(e=>t=>{const n=Oe.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),De=e=>(e=e.toLowerCase(),t=>ze(t)===e),Fe=e=>t=>typeof t===e,{isArray:Be}=Array,We=Fe("undefined");const He=De("ArrayBuffer");const Ve=Fe("string"),Ue=Fe("function"),qe=Fe("number"),$e=e=>null!==e&&"object"===typeof e,Ke=e=>{if("object"!==ze(e))return!1;const t=Te(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Ie in e)&&!(Le in e)},Xe=De("Date"),Ye=De("File"),Ge=De("Blob"),Ze=De("FileList"),Je=De("URLSearchParams"),[Qe,et,tt,nt]=["ReadableStream","Request","Response","Headers"].map(De);function rt(e,t){let n,r,{allOwnKeys:o=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),Be(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{const r=o?Object.getOwnPropertyNames(e):Object.keys(e),a=r.length;let i;for(n=0;n<a;n++)i=r[n],t.call(null,e[i],i,e)}}function ot(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const at="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:global,it=e=>!We(e)&&e!==at;const st=(lt="undefined"!==typeof Uint8Array&&Te(Uint8Array),e=>lt&&e instanceof lt);var lt;const ct=De("HTMLFormElement"),dt=(e=>{let{hasOwnProperty:t}=e;return(e,n)=>t.call(e,n)})(Object.prototype),ut=De("RegExp"),ht=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};rt(n,((n,o)=>{let a;!1!==(a=t(n,o,e))&&(r[o]=a||n)})),Object.defineProperties(e,r)};const pt=De("AsyncFunction"),ft=((e,t)=>{return e?setImmediate:t?(n="axios@".concat(Math.random()),r=[],at.addEventListener("message",(e=>{let{source:t,data:o}=e;t===at&&o===n&&r.length&&r.shift()()}),!1),e=>{r.push(e),at.postMessage(n,"*")}):e=>setTimeout(e);var n,r})("function"===typeof setImmediate,Ue(at.postMessage)),mt="undefined"!==typeof queueMicrotask?queueMicrotask.bind(at):"undefined"!==typeof process&&process.nextTick||ft,gt={isArray:Be,isArrayBuffer:He,isBuffer:function(e){return null!==e&&!We(e)&&null!==e.constructor&&!We(e.constructor)&&Ue(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"===typeof FormData&&e instanceof FormData||Ue(e.append)&&("formdata"===(t=ze(e))||"object"===t&&Ue(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&He(e.buffer),t},isString:Ve,isNumber:qe,isBoolean:e=>!0===e||!1===e,isObject:$e,isPlainObject:Ke,isReadableStream:Qe,isRequest:et,isResponse:tt,isHeaders:nt,isUndefined:We,isDate:Xe,isFile:Ye,isBlob:Ge,isRegExp:ut,isFunction:Ue,isStream:e=>$e(e)&&Ue(e.pipe),isURLSearchParams:Je,isTypedArray:st,isFileList:Ze,forEach:rt,merge:function e(){const{caseless:t}=it(this)&&this||{},n={},r=(r,o)=>{const a=t&&ot(n,o)||o;Ke(n[a])&&Ke(r)?n[a]=e(n[a],r):Ke(r)?n[a]=e({},r):Be(r)?n[a]=r.slice():n[a]=r};for(let o=0,a=arguments.length;o<a;o++)arguments[o]&&rt(arguments[o],r);return n},extend:function(e,t,n){let{allOwnKeys:r}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return rt(t,((t,r)=>{n&&Ue(t)?e[r]=Pe(t,n):e[r]=t}),{allOwnKeys:r}),e},trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,a,i;const s={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),a=o.length;a-- >0;)i=o[a],r&&!r(i,e,t)||s[i]||(t[i]=e[i],s[i]=!0);e=!1!==n&&Te(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:ze,kindOfTest:De,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Be(e))return e;let t=e.length;if(!qe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Le]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:ct,hasOwnProperty:dt,hasOwnProp:dt,reduceDescriptors:ht,freezeMethods:e=>{ht(e,((t,n)=>{if(Ue(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];Ue(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return Be(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:ot,global:at,isContextDefined:it,isSpecCompliantForm:function(e){return!!(e&&Ue(e.append)&&"FormData"===e[Ie]&&e[Le])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if($e(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=Be(e)?[]:{};return rt(e,((e,t)=>{const a=n(e,r+1);!We(a)&&(o[t]=a)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:pt,isThenable:e=>e&&($e(e)||Ue(e))&&Ue(e.then)&&Ue(e.catch),setImmediate:ft,asap:mt,isIterable:e=>null!=e&&Ue(e[Le])};function xt(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}gt.inherits(xt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:gt.toJSONObject(this.config),code:this.code,status:this.status}}});const bt=xt.prototype,vt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{vt[e]={value:e}})),Object.defineProperties(xt,vt),Object.defineProperty(bt,"isAxiosError",{value:!0}),xt.from=(e,t,n,r,o,a)=>{const i=Object.create(bt);return gt.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),xt.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,a&&Object.assign(i,a),i};const yt=xt;function wt(e){return gt.isPlainObject(e)||gt.isArray(e)}function kt(e){return gt.endsWith(e,"[]")?e.slice(0,-2):e}function St(e,t,n){return e?e.concat(t).map((function(e,t){return e=kt(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const jt=gt.toFlatObject(gt,{},null,(function(e){return/^is[A-Z]/.test(e)}));const At=function(e,t,n){if(!gt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=gt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!gt.isUndefined(t[e])}))).metaTokens,o=n.visitor||c,a=n.dots,i=n.indexes,s=(n.Blob||"undefined"!==typeof Blob&&Blob)&&gt.isSpecCompliantForm(t);if(!gt.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(gt.isDate(e))return e.toISOString();if(!s&&gt.isBlob(e))throw new yt("Blob is not supported. Use a Buffer instead.");return gt.isArrayBuffer(e)||gt.isTypedArray(e)?s&&"function"===typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,o){let s=e;if(e&&!o&&"object"===typeof e)if(gt.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(gt.isArray(e)&&function(e){return gt.isArray(e)&&!e.some(wt)}(e)||(gt.isFileList(e)||gt.endsWith(n,"[]"))&&(s=gt.toArray(e)))return n=kt(n),s.forEach((function(e,r){!gt.isUndefined(e)&&null!==e&&t.append(!0===i?St([n],r,a):null===i?n:n+"[]",l(e))})),!1;return!!wt(e)||(t.append(St(o,n,a),l(e)),!1)}const d=[],u=Object.assign(jt,{defaultVisitor:c,convertValue:l,isVisitable:wt});if(!gt.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!gt.isUndefined(n)){if(-1!==d.indexOf(n))throw Error("Circular reference detected in "+r.join("."));d.push(n),gt.forEach(n,(function(n,a){!0===(!(gt.isUndefined(n)||null===n)&&o.call(t,n,gt.isString(a)?a.trim():a,r,u))&&e(n,r?r.concat(a):[a])})),d.pop()}}(e),t};function Ct(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function _t(e,t){this._pairs=[],e&&At(e,this,t)}const Et=_t.prototype;Et.append=function(e,t){this._pairs.push([e,t])},Et.toString=function(e){const t=e?function(t){return e.call(this,t,Ct)}:Ct;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Mt=_t;function Nt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Rt(e,t,n){if(!t)return e;const r=n&&n.encode||Nt;gt.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let a;if(a=o?o(t,n):gt.isURLSearchParams(t)?t.toString():new Mt(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const Pt=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){gt.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Ot={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Tt={isBrowser:!0,classes:{URLSearchParams:"undefined"!==typeof URLSearchParams?URLSearchParams:Mt,FormData:"undefined"!==typeof FormData?FormData:null,Blob:"undefined"!==typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Lt="undefined"!==typeof window&&"undefined"!==typeof document,It="object"===typeof navigator&&navigator||void 0,zt=Lt&&(!It||["ReactNative","NativeScript","NS"].indexOf(It.product)<0),Dt="undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"===typeof self.importScripts,Ft=Lt&&window.location.href||"http://localhost",Bt=c(c({},t),Tt);const Wt=function(e){function t(e,n,r,o){let a=e[o++];if("__proto__"===a)return!0;const i=Number.isFinite(+a),s=o>=e.length;if(a=!a&&gt.isArray(r)?r.length:a,s)return gt.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!i;r[a]&&gt.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],o)&&gt.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let a;for(r=0;r<o;r++)a=n[r],t[a]=e[a];return t}(r[a])),!i}if(gt.isFormData(e)&&gt.isFunction(e.entries)){const n={};return gt.forEachEntry(e,((e,r)=>{t(function(e){return gt.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null};const Ht={transitional:Ot,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=gt.isObject(e);o&&gt.isHTMLForm(e)&&(e=new FormData(e));if(gt.isFormData(e))return r?JSON.stringify(Wt(e)):e;if(gt.isArrayBuffer(e)||gt.isBuffer(e)||gt.isStream(e)||gt.isFile(e)||gt.isBlob(e)||gt.isReadableStream(e))return e;if(gt.isArrayBufferView(e))return e.buffer;if(gt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return At(e,new Bt.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Bt.isNode&&gt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=gt.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return At(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(gt.isString(e))try{return(t||JSON.parse)(e),gt.trim(e)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Ht.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(gt.isResponse(e)||gt.isReadableStream(e))return e;if(e&&gt.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(o){if(n){if("SyntaxError"===o.name)throw yt.from(o,yt.ERR_BAD_RESPONSE,this,null,this.response);throw o}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Bt.classes.FormData,Blob:Bt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};gt.forEach(["delete","get","head","post","put","patch"],(e=>{Ht.headers[e]={}}));const Vt=Ht,Ut=gt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),qt=Symbol("internals");function $t(e){return e&&String(e).trim().toLowerCase()}function Kt(e){return!1===e||null==e?e:gt.isArray(e)?e.map(Kt):String(e)}function Xt(e,t,n,r,o){return gt.isFunction(r)?r.call(this,t,n):(o&&(t=n),gt.isString(t)?gt.isString(r)?-1!==t.indexOf(r):gt.isRegExp(r)?r.test(t):void 0:void 0)}class Yt{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=$t(t);if(!o)throw new Error("header name must be a non-empty string");const a=gt.findKey(r,o);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=Kt(e))}const a=(e,t)=>gt.forEach(e,((e,n)=>o(e,n,t)));if(gt.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(gt.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Ut[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(gt.isObject(e)&&gt.isIterable(e)){let n,r,o={};for(const t of e){if(!gt.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?gt.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}a(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=$t(e)){const n=gt.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(gt.isFunction(t))return t.call(this,e,n);if(gt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=$t(e)){const n=gt.findKey(this,e);return!(!n||void 0===this[n]||t&&!Xt(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=$t(e)){const o=gt.findKey(n,e);!o||t&&!Xt(0,n[o],o,t)||(delete n[o],r=!0)}}return gt.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Xt(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return gt.forEach(this,((r,o)=>{const a=gt.findKey(n,o);if(a)return t[a]=Kt(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=Kt(r),n[i]=!0})),this}concat(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.constructor.concat(this,...t)}toJSON(e){const t=Object.create(null);return gt.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&gt.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((e=>{let[t,n]=e;return t+": "+n})).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e){const t=new this(e);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.forEach((e=>t.set(e))),t}static accessor(e){const t=(this[qt]=this[qt]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=$t(e);t[r]||(!function(e,t){const n=gt.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return gt.isArray(e)?e.forEach(r):r(e),this}}Yt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),gt.reduceDescriptors(Yt.prototype,((e,t)=>{let{value:n}=e,r=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(e){this[r]=e}}})),gt.freezeMethods(Yt);const Gt=Yt;function Zt(e,t){const n=this||Vt,r=t||n,o=Gt.from(r.headers);let a=r.data;return gt.forEach(e,(function(e){a=e.call(n,a,o.normalize(),t?t.status:void 0)})),o.normalize(),a}function Jt(e){return!(!e||!e.__CANCEL__)}function Qt(e,t,n){yt.call(this,null==e?"canceled":e,yt.ERR_CANCELED,t,n),this.name="CanceledError"}gt.inherits(Qt,yt,{__CANCEL__:!0});const en=Qt;function tn(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new yt("Request failed with status code "+n.status,[yt.ERR_BAD_REQUEST,yt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const nn=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,a=0,i=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=r[i];o||(o=l),n[a]=s,r[a]=l;let d=i,u=0;for(;d!==a;)u+=n[d++],d%=e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),l-o<t)return;const h=c&&l-c;return h?Math.round(1e3*u/h):void 0}};const rn=function(e,t){let n,r,o=0,a=1e3/t;const i=function(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();o=a,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[function(){const e=Date.now(),t=e-o;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];t>=a?i(l,e):(n=l,r||(r=setTimeout((()=>{r=null,i(n)}),a-t)))},()=>n&&i(n)]},on=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0;const o=nn(50,250);return rn((n=>{const a=n.loaded,i=n.lengthComputable?n.total:void 0,s=a-r,l=o(s);r=a;e({loaded:a,total:i,progress:i?a/i:void 0,bytes:s,rate:l||void 0,estimated:l&&i&&a<=i?(i-a)/l:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})}),n)},an=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},sn=e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return gt.asap((()=>e(...n)))},ln=Bt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Bt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Bt.origin),Bt.navigator&&/(msie|trident)/i.test(Bt.navigator.userAgent)):()=>!0,cn=Bt.hasStandardBrowserEnv?{write(e,t,n,r,o,a){const i=[e+"="+encodeURIComponent(t)];gt.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),gt.isString(r)&&i.push("path="+r),gt.isString(o)&&i.push("domain="+o),!0===a&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function dn(e,t,n){let r=!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const un=e=>e instanceof Gt?c({},e):e;function hn(e,t){t=t||{};const n={};function r(e,t,n,r){return gt.isPlainObject(e)&&gt.isPlainObject(t)?gt.merge.call({caseless:r},e,t):gt.isPlainObject(t)?gt.merge({},t):gt.isArray(t)?t.slice():t}function o(e,t,n,o){return gt.isUndefined(t)?gt.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function a(e,t){if(!gt.isUndefined(t))return r(void 0,t)}function i(e,t){return gt.isUndefined(t)?gt.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,a){return a in t?r(n,o):a in e?r(void 0,n):void 0}const l={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:s,headers:(e,t,n)=>o(un(e),un(t),0,!0)};return gt.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=l[r]||o,i=a(e[r],t[r],r);gt.isUndefined(i)&&a!==s||(n[r]=i)})),n}const pn=e=>{const t=hn({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:a,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=Gt.from(s),t.url=Rt(dn(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),gt.isFormData(r))if(Bt.hasStandardBrowserEnv||Bt.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(n=s.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...t].join("; "))}if(Bt.hasStandardBrowserEnv&&(o&&gt.isFunction(o)&&(o=o(t)),o||!1!==o&&ln(t.url))){const e=a&&i&&cn.read(i);e&&s.set(a,e)}return t},fn="undefined"!==typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=pn(e);let o=r.data;const a=Gt.from(r.headers).normalize();let i,s,l,c,d,{responseType:u,onUploadProgress:h,onDownloadProgress:p}=r;function f(){c&&c(),d&&d(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=Gt.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());tn((function(e){t(e),f()}),(function(e){n(e),f()}),{data:u&&"text"!==u&&"json"!==u?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new yt("Request aborted",yt.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new yt("Network Error",yt.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||Ot;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new yt(t,o.clarifyTimeoutError?yt.ETIMEDOUT:yt.ECONNABORTED,e,m)),m=null},void 0===o&&a.setContentType(null),"setRequestHeader"in m&&gt.forEach(a.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),gt.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),u&&"json"!==u&&(m.responseType=r.responseType),p&&([l,d]=on(p,!0),m.addEventListener("progress",l)),h&&m.upload&&([s,c]=on(h),m.upload.addEventListener("progress",s),m.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new en(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const x=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);x&&-1===Bt.protocols.indexOf(x)?n(new yt("Unsupported protocol "+x+":",yt.ERR_BAD_REQUEST,e)):m.send(o||null)}))},mn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof yt?t:new en(t instanceof Error?t.message:t))}};let a=t&&setTimeout((()=>{a=null,o(new yt("timeout ".concat(t," of ms exceeded"),yt.ETIMEDOUT))}),t);const i=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:s}=r;return s.unsubscribe=()=>gt.asap(i),s}};function gn(e,t){this.v=e,this.k=t}function xn(e){return function(){return new bn(e.apply(this,arguments))}}function bn(e){var t,n;function r(t,n){try{var a=e[t](n),i=a.value,s=i instanceof gn;Promise.resolve(s?i.v:i).then((function(n){if(s){var l="return"===t?"return":"next";if(!i.k||n.done)return r(l,n);n=e[l](n).value}o(a.done?"return":"normal",n)}),(function(e){r("throw",e)}))}catch(e){o("throw",e)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise((function(a,i){var s={key:e,arg:o,resolve:a,reject:i,next:null};n?n=n.next=s:(t=n=s,r(e,o))}))},"function"!=typeof e.return&&(this.return=void 0)}function vn(e){return new gn(e,0)}function yn(e){var t={},n=!1;function r(t,r){return n=!0,r=new Promise((function(n){n(e[t](r))})),{done:!1,value:new gn(r,1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return n?(n=!1,e):r("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(n)throw n=!1,e;return r("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return n?(n=!1,e):r("return",e)}),t}function wn(e){var t,n,r,o=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);o--;){if(n&&null!=(t=e[n]))return t.call(e);if(r&&null!=(t=e[r]))return new kn(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function kn(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return kn=function(e){this.s=e,this.n=e.next},kn.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return void 0===n?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return void 0===n?Promise.reject(e):t(n.apply(this.s,arguments))}},new kn(e)}bn.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},bn.prototype.next=function(e){return this._invoke("next",e)},bn.prototype.throw=function(e){return this._invoke("throw",e)},bn.prototype.return=function(e){return this._invoke("return",e)};const Sn=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},jn=function(){var e=xn((function*(e,t){var n,r=!1,o=!1;try{for(var a,i=wn(An(e));r=!(a=yield vn(i.next())).done;r=!1){const e=a.value;yield*yn(wn(Sn(e,t)))}}catch(NR){o=!0,n=NR}finally{try{r&&null!=i.return&&(yield vn(i.return()))}finally{if(o)throw n}}}));return function(t,n){return e.apply(this,arguments)}}(),An=function(){var e=xn((function*(e){if(e[Symbol.asyncIterator])return void(yield*yn(wn(e)));const t=e.getReader();try{for(;;){const{done:e,value:n}=yield vn(t.read());if(e)break;yield n}}finally{yield vn(t.cancel())}}));return function(t){return e.apply(this,arguments)}}(),Cn=(e,t,n,r)=>{const o=jn(e,t);let a,i=0,s=e=>{a||(a=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let a=r.byteLength;if(n){let e=i+=a;n(e)}e.enqueue(new Uint8Array(r))}catch(NR){throw s(NR),NR}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},_n="function"===typeof fetch&&"function"===typeof Request&&"function"===typeof Response,En=_n&&"function"===typeof ReadableStream,Mn=_n&&("function"===typeof TextEncoder?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Nn=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return!!e(...n)}catch(o){return!1}},Rn=En&&Nn((()=>{let e=!1;const t=new Request(Bt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),Pn=En&&Nn((()=>gt.isReadableStream(new Response("").body))),On={stream:Pn&&(e=>e.body)};var Tn;_n&&(Tn=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!On[e]&&(On[e]=gt.isFunction(Tn[e])?t=>t[e]():(t,n)=>{throw new yt("Response type '".concat(e,"' is not supported"),yt.ERR_NOT_SUPPORT,n)})})));const Ln=async(e,t)=>{const n=gt.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(gt.isBlob(e))return e.size;if(gt.isSpecCompliantForm(e)){const t=new Request(Bt.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return gt.isArrayBufferView(e)||gt.isArrayBuffer(e)?e.byteLength:(gt.isURLSearchParams(e)&&(e+=""),gt.isString(e)?(await Mn(e)).byteLength:void 0)})(t):n},In=_n&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:a,timeout:i,onDownloadProgress:s,onUploadProgress:l,responseType:d,headers:u,withCredentials:h="same-origin",fetchOptions:p}=pn(e);d=d?(d+"").toLowerCase():"text";let f,m=mn([o,a&&a.toAbortSignal()],i);const g=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let x;try{if(l&&Rn&&"get"!==n&&"head"!==n&&0!==(x=await Ln(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(gt.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=an(x,on(sn(l)));r=Cn(n.body,65536,e,t)}}gt.isString(h)||(h=h?"include":"omit");const o="credentials"in Request.prototype;f=new Request(t,c(c({},p),{},{signal:m,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:o?h:void 0}));let a=await fetch(f);const i=Pn&&("stream"===d||"response"===d);if(Pn&&(s||i&&g)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=a[t]}));const t=gt.toFiniteNumber(a.headers.get("content-length")),[n,r]=s&&an(t,on(sn(s),!0))||[];a=new Response(Cn(a.body,65536,n,(()=>{r&&r(),g&&g()})),e)}d=d||"text";let b=await On[gt.findKey(On,d)||"text"](a,e);return!i&&g&&g(),await new Promise(((t,n)=>{tn(t,n,{data:b,headers:Gt.from(a.headers),status:a.status,statusText:a.statusText,config:e,request:f})}))}catch(NR){if(g&&g(),NR&&"TypeError"===NR.name&&/Load failed|fetch/i.test(NR.message))throw Object.assign(new yt("Network Error",yt.ERR_NETWORK,e,f),{cause:NR.cause||NR});throw yt.from(NR,NR&&NR.code,e,f)}}),zn={http:null,xhr:fn,fetch:In};gt.forEach(zn,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}}));const Dn=e=>"- ".concat(e),Fn=e=>gt.isFunction(e)||null===e||!1===e,Bn=e=>{e=gt.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let a=0;a<t;a++){let t;if(n=e[a],r=n,!Fn(n)&&(r=zn[(t=String(n)).toLowerCase()],void 0===r))throw new yt("Unknown adapter '".concat(t,"'"));if(r)break;o[t||"#"+a]=r}if(!r){const e=Object.entries(o).map((e=>{let[t,n]=e;return"adapter ".concat(t," ")+(!1===n?"is not supported by the environment":"is not available in the build")}));let n=t?e.length>1?"since :\n"+e.map(Dn).join("\n"):" "+Dn(e[0]):"as no adapter specified";throw new yt("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function Wn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new en(null,e)}function Hn(e){Wn(e),e.headers=Gt.from(e.headers),e.data=Zt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Bn(e.adapter||Vt.adapter)(e).then((function(t){return Wn(e),t.data=Zt.call(e,e.transformResponse,t),t.headers=Gt.from(t.headers),t}),(function(t){return Jt(t)||(Wn(e),t&&t.response&&(t.response.data=Zt.call(e,e.transformResponse,t.response),t.response.headers=Gt.from(t.response.headers))),Promise.reject(t)}))}const Vn="1.9.0",Un={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Un[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const qn={};Un.transitional=function(e,t,n){function r(e,t){return"[Axios v1.9.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,a)=>{if(!1===e)throw new yt(r(o," has been removed"+(t?" in "+t:"")),yt.ERR_DEPRECATED);return t&&!qn[o]&&(qn[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,a)}},Un.spelling=function(e){return(t,n)=>(console.warn("".concat(n," is likely a misspelling of ").concat(e)),!0)};const $n={assertOptions:function(e,t,n){if("object"!==typeof e)throw new yt("options must be an object",yt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const a=r[o],i=t[a];if(i){const t=e[a],n=void 0===t||i(t,a,e);if(!0!==n)throw new yt("option "+a+" must be "+n,yt.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new yt("Unknown option "+a,yt.ERR_BAD_OPTION)}},validators:Un},Kn=$n.validators;class Xn{constructor(e){this.defaults=e||{},this.interceptors={request:new Pt,response:new Pt}}async request(e,t){try{return await this._request(e,t)}catch(NR){if(NR instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{NR.stack?r&&!String(NR.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(NR.stack+="\n"+r):NR.stack=r}catch(n){}}throw NR}}_request(e,t){"string"===typeof e?(t=t||{}).url=e:t=e||{},t=hn(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&$n.assertOptions(n,{silentJSONParsing:Kn.transitional(Kn.boolean),forcedJSONParsing:Kn.transitional(Kn.boolean),clarifyTimeoutError:Kn.transitional(Kn.boolean)},!1),null!=r&&(gt.isFunction(r)?t.paramsSerializer={serialize:r}:$n.assertOptions(r,{encode:Kn.function,serialize:Kn.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),$n.assertOptions(t,{baseUrl:Kn.spelling("baseURL"),withXsrfToken:Kn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=o&&gt.merge(o.common,o[t.method]);o&&gt.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=Gt.concat(a,o);const i=[];let s=!0;this.interceptors.request.forEach((function(e){"function"===typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let d,u=0;if(!s){const e=[Hn.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,l),d=e.length,c=Promise.resolve(t);u<d;)c=c.then(e[u++],e[u++]);return c}d=i.length;let h=t;for(u=0;u<d;){const e=i[u++],t=i[u++];try{h=e(h)}catch(p){t.call(this,p);break}}try{c=Hn.call(this,h)}catch(p){return Promise.reject(p)}for(u=0,d=l.length;u<d;)c=c.then(l[u++],l[u++]);return c}getUri(e){return Rt(dn((e=hn(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}gt.forEach(["delete","get","head","options"],(function(e){Xn.prototype[e]=function(t,n){return this.request(hn(n||{},{method:e,url:t,data:(n||{}).data}))}})),gt.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(hn(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Xn.prototype[e]=t(),Xn.prototype[e+"Form"]=t(!0)}));const Yn=Xn;class Gn{constructor(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new en(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Gn((function(t){e=t})),cancel:e}}}const Zn=Gn;const Jn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Jn).forEach((e=>{let[t,n]=e;Jn[n]=t}));const Qn=Jn;const er=function e(t){const n=new Yn(t),r=Pe(Yn.prototype.request,n);return gt.extend(r,Yn.prototype,n,{allOwnKeys:!0}),gt.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(hn(t,n))},r}(Vt);er.Axios=Yn,er.CanceledError=en,er.CancelToken=Zn,er.isCancel=Jt,er.VERSION=Vn,er.toFormData=At,er.AxiosError=yt,er.Cancel=er.CanceledError,er.all=function(e){return Promise.all(e)},er.spread=function(e){return function(t){return e.apply(null,t)}},er.isAxiosError=function(e){return gt.isObject(e)&&!0===e.isAxiosError},er.mergeConfig=hn,er.AxiosHeaders=Gt,er.formToJSON=e=>Wt(gt.isHTMLForm(e)?new FormData(e):e),er.getAdapter=Bn,er.HttpStatusCode=Qn,er.default=er;const tr=er;var nr=n(8587);function rr(e,t){if(null==e)return{};var n,r,o=(0,nr.A)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}n(4358);const or=["sri"],ar=["page"],ir=["page","matches"],sr=["onClick","discover","prefetch","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],lr=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],cr=["discover","fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition"];var dr="popstate";function ur(){return br((function(e,t){let{pathname:n,search:r,hash:o}=e.location;return mr("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"===typeof t?t:gr(t)}),null,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}function hr(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function pr(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function fr(e,t){return{usr:e.state,key:e.key,idx:t}}function mr(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;return c(c({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?xr(t):t),{},{state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10)})}function gr(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function xr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function br(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},{window:o=document.defaultView,v5Compat:a=!1}=r,i=o.history,s="POP",l=null,d=u();function u(){return(i.state||{idx:null}).idx}function h(){s="POP";let e=u(),t=null==e?null:e-d;d=e,l&&l({action:s,location:f.location,delta:t})}function p(e){return vr(e)}null==d&&(d=0,i.replaceState(c(c({},i.state),{},{idx:d}),""));let f={get action(){return s},get location(){return e(o,i)},listen(e){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(dr,h),l=e,()=>{o.removeEventListener(dr,h),l=null}},createHref:e=>t(o,e),createURL:p,encodeLocation(e){let t=p(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s="PUSH";let r=mr(f.location,e,t);n&&n(r,e),d=u()+1;let c=fr(r,d),h=f.createHref(r);try{i.pushState(c,"",h)}catch(p){if(p instanceof DOMException&&"DataCloneError"===p.name)throw p;o.location.assign(h)}a&&l&&l({action:s,location:f.location,delta:1})},replace:function(e,t){s="REPLACE";let r=mr(f.location,e,t);n&&n(r,e),d=u();let o=fr(r,d),c=f.createHref(r);i.replaceState(o,"",c),a&&l&&l({action:s,location:f.location,delta:0})},go:e=>i.go(e)};return f}function vr(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n="http://localhost";"undefined"!==typeof window&&(n="null"!==window.location.origin?window.location.origin:window.location.href),hr(n,"No window.location.(origin|href) available to create URL");let r="string"===typeof e?e:gr(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}new WeakMap;function yr(e,t){return wr(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/",!1)}function wr(e,t,n,r){let o=Ir(("string"===typeof t?xr(t):t).pathname||"/",n);if(null==o)return null;let a=kr(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(a);let i=null;for(let s=0;null==i&&s<a.length;++s){let e=Lr(o);i=Pr(a[s],e,r)}return i}function kr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=(e,o,a)=>{let i={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(hr(i.relativePath.startsWith(r),'Absolute route path "'.concat(i.relativePath,'" nested under path "').concat(r,'" is not valid. An absolute child route path must start with the combined path of all its parent routes.')),i.relativePath=i.relativePath.slice(r.length));let s=Wr([r,i.relativePath]),l=n.concat(i);e.children&&e.children.length>0&&(hr(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'.concat(s,'".')),kr(e.children,t,l,s)),(null!=e.path||e.index)&&t.push({path:s,score:Rr(s,e.index),routesMeta:l})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!==(n=e.path)&&void 0!==n&&n.includes("?"))for(let r of Sr(e.path))o(e,t,r);else o(e,t)})),t}function Sr(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),a=n.replace(/\?$/,"");if(0===r.length)return o?[a,""]:[a];let i=Sr(r.join("/")),s=[];return s.push(...i.map((e=>""===e?a:[a,e].join("/")))),o&&s.push(...i),s.map((t=>e.startsWith("/")&&""===t?"/":t))}var jr=/^:[\w-]+$/,Ar=3,Cr=2,_r=1,Er=10,Mr=-2,Nr=e=>"*"===e;function Rr(e,t){let n=e.split("/"),r=n.length;return n.some(Nr)&&(r+=Mr),t&&(r+=Cr),n.filter((e=>!Nr(e))).reduce(((e,t)=>e+(jr.test(t)?Ar:""===t?_r:Er)),r)}function Pr(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],{routesMeta:r}=e,o={},a="/",i=[];for(let s=0;s<r.length;++s){let e=r[s],l=s===r.length-1,c="/"===a?t:t.slice(a.length)||"/",d=Or({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c),u=e.route;if(!d&&l&&n&&!r[r.length-1].route.index&&(d=Or({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!d)return null;Object.assign(o,d.params),i.push({params:o,pathname:Wr([a,d.pathname]),pathnameBase:Hr(Wr([a,d.pathnameBase])),route:u}),"/"!==d.pathnameBase&&(a=Wr([a,d.pathnameBase]))}return i}function Or(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Tr(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),s=o.slice(1),l=r.reduce(((e,t,n)=>{let{paramName:r,isOptional:o}=t;if("*"===r){let e=s[n]||"";i=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}const l=s[n];return e[r]=o&&!l?void 0:(l||"").replace(/%2F/g,"/"),e}),{});return{params:l,pathname:a,pathnameBase:i,pattern:e}}function Tr(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];pr("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'.concat(e,'" will be treated as if it were "').concat(e.replace(/\*$/,"/*"),'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "').concat(e.replace(/\*$/,"/*"),'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));return e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function Lr(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return pr(!1,'The URL path "'.concat(e,'" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (').concat(t,").")),e}}function Ir(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function zr(e,t,n,r){return"Cannot include a '".concat(e,"' character in a manually specified `to.").concat(t,"` field [").concat(JSON.stringify(r),"]. Please separate it out to the `to.").concat(n,'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.')}function Dr(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function Fr(e){let t=Dr(e);return t.map(((e,n)=>n===t.length-1?e.pathname:e.pathnameBase))}function Br(e,t,n){let r,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];"string"===typeof e?r=xr(e):(r=c({},e),hr(!r.pathname||!r.pathname.includes("?"),zr("?","pathname","search",r)),hr(!r.pathname||!r.pathname.includes("#"),zr("#","pathname","hash",r)),hr(!r.search||!r.search.includes("#"),zr("#","search","hash",r)));let a,i=""===e||""===r.pathname,s=i?"/":r.pathname;if(null==s)a=n;else{let e=t.length-1;if(!o&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}a=e>=0?t[e]:"/"}let l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",{pathname:n,search:r="",hash:o=""}="string"===typeof e?xr(e):e,a=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:a,search:Vr(r),hash:Ur(o)}}(r,a),d=s&&"/"!==s&&s.endsWith("/"),u=(i||"."===s)&&n.endsWith("/");return l.pathname.endsWith("/")||!d&&!u||(l.pathname+="/"),l}var Wr=e=>e.join("/").replace(/\/\/+/g,"/"),Hr=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Vr=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",Ur=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";function qr(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}var $r=["POST","PUT","PATCH","DELETE"],Kr=(new Set($r),["GET",...$r]);new Set(Kr),Symbol("ResetLoaderData");var Xr=r.createContext(null);Xr.displayName="DataRouter";var Yr=r.createContext(null);Yr.displayName="DataRouterState";var Gr=r.createContext({isTransitioning:!1});Gr.displayName="ViewTransition";var Zr=r.createContext(new Map);Zr.displayName="Fetchers";var Jr=r.createContext(null);Jr.displayName="Await";var Qr=r.createContext(null);Qr.displayName="Navigation";var eo=r.createContext(null);eo.displayName="Location";var to=r.createContext({outlet:null,matches:[],isDataRoute:!1});to.displayName="Route";var no=r.createContext(null);no.displayName="RouteError";function ro(){return null!=r.useContext(eo)}function oo(){return hr(ro(),"useLocation() may be used only in the context of a <Router> component."),r.useContext(eo).location}var ao="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function io(e){r.useContext(Qr).static||r.useLayoutEffect(e)}function so(){let{isDataRoute:e}=r.useContext(to);return e?function(){let{router:e}=bo("useNavigate"),t=yo("useNavigate"),n=r.useRef(!1);io((()=>{n.current=!0}));let o=r.useCallback((async function(r){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};pr(n.current,ao),n.current&&("number"===typeof r?e.navigate(r):await e.navigate(r,c({fromRouteId:t},o)))}),[e,t]);return o}():function(){hr(ro(),"useNavigate() may be used only in the context of a <Router> component.");let e=r.useContext(Xr),{basename:t,navigator:n}=r.useContext(Qr),{matches:o}=r.useContext(to),{pathname:a}=oo(),i=JSON.stringify(Fr(o)),s=r.useRef(!1);io((()=>{s.current=!0}));let l=r.useCallback((function(r){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(pr(s.current,ao),!s.current)return;if("number"===typeof r)return void n.go(r);let l=Br(r,JSON.parse(i),a,"path"===o.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:Wr([t,l.pathname])),(o.replace?n.replace:n.push)(l,o.state,o)}),[t,n,i,a,e]);return l}()}r.createContext(null);function lo(){let{matches:e}=r.useContext(to),t=e[e.length-1];return t?t.params:{}}function co(e){let{relative:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{matches:n}=r.useContext(to),{pathname:o}=oo(),a=JSON.stringify(Fr(n));return r.useMemo((()=>Br(e,JSON.parse(a),o,"path"===t)),[e,a,o,t])}function uo(e,t,n,o){hr(ro(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a,static:i}=r.useContext(Qr),{matches:s}=r.useContext(to),l=s[s.length-1],d=l?l.params:{},u=l?l.pathname:"/",h=l?l.pathnameBase:"/",p=l&&l.route;{let e=p&&p.path||"";So(u,!p||e.endsWith("*")||e.endsWith("*?"),'You rendered descendant <Routes> (or called `useRoutes()`) at "'.concat(u,'" (under <Route path="').concat(e,'">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won\'t match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="').concat(e,'"> to <Route path="').concat("/"===e?"*":"".concat(e,"/*"),'">.'))}let f,m=oo();if(t){var g;let e="string"===typeof t?xr(t):t;hr("/"===h||(null===(g=e.pathname)||void 0===g?void 0:g.startsWith(h)),'When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "'.concat(h,'" but pathname "').concat(e.pathname,'" was given in the `location` prop.')),f=e}else f=m;let x=f.pathname||"/",b=x;if("/"!==h){let e=h.replace(/^\//,"").split("/");b="/"+x.replace(/^\//,"").split("/").slice(e.length).join("/")}let v=!i&&n&&n.matches&&n.matches.length>0?n.matches:yr(e,{pathname:b});pr(p||null!=v,'No routes matched location "'.concat(f.pathname).concat(f.search).concat(f.hash,'" ')),pr(null==v||void 0!==v[v.length-1].route.element||void 0!==v[v.length-1].route.Component||void 0!==v[v.length-1].route.lazy,'Matched leaf route at location "'.concat(f.pathname).concat(f.search).concat(f.hash,'" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.'));let y=go(v&&v.map((e=>Object.assign({},e,{params:Object.assign({},d,e.params),pathname:Wr([h,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?h:Wr([h,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),s,n,o);return t&&y?r.createElement(eo.Provider,{value:{location:c({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:"POP"}},y):y}function ho(){let e=wo(),t=qr(e)?"".concat(e.status," ").concat(e.statusText):e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:o},i={padding:"2px 4px",backgroundColor:o},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=r.createElement(r.Fragment,null,r.createElement("p",null,"\ud83d\udcbf Hey developer \ud83d\udc4b"),r.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",r.createElement("code",{style:i},"ErrorBoundary")," or"," ",r.createElement("code",{style:i},"errorElement")," prop on your route.")),r.createElement(r.Fragment,null,r.createElement("h2",null,"Unexpected Application Error!"),r.createElement("h3",{style:{fontStyle:"italic"}},t),n?r.createElement("pre",{style:a},n):null,s)}var po=r.createElement(ho,null),fo=class extends r.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?r.createElement(to.Provider,{value:this.props.routeContext},r.createElement(no.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function mo(e){let{routeContext:t,match:n,children:o}=e,a=r.useContext(Xr);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),r.createElement(to.Provider,{value:t},o)}function go(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(null==e){if(!n)return null;if(n.errors)e=n.matches;else{if(0!==t.length||n.initialized||!(n.matches.length>0))return null;e=n.matches}}let o=e,a=null===n||void 0===n?void 0:n.errors;if(null!=a){let e=o.findIndex((e=>e.route.id&&void 0!==(null===a||void 0===a?void 0:a[e.route.id])));hr(e>=0,"Could not find a matching route for errors on route IDs: ".concat(Object.keys(a).join(","))),o=o.slice(0,Math.min(o.length,e+1))}let i=!1,s=-1;if(n)for(let r=0;r<o.length;r++){let e=o[r];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(s=r),e.route.id){let{loaderData:t,errors:r}=n,a=e.route.loader&&!t.hasOwnProperty(e.route.id)&&(!r||void 0===r[e.route.id]);if(e.route.lazy||a){i=!0,o=s>=0?o.slice(0,s+1):[o[0]];break}}}return o.reduceRight(((e,l,c)=>{let d,u=!1,h=null,p=null;n&&(d=a&&l.route.id?a[l.route.id]:void 0,h=l.route.errorElement||po,i&&(s<0&&0===c?(So("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),u=!0,p=null):s===c&&(u=!0,p=l.route.hydrateFallbackElement||null)));let f=t.concat(o.slice(0,c+1)),m=()=>{let t;return t=d?h:u?p:l.route.Component?r.createElement(l.route.Component,null):l.route.element?l.route.element:e,r.createElement(mo,{match:l,routeContext:{outlet:e,matches:f,isDataRoute:null!=n},children:t})};return n&&(l.route.ErrorBoundary||l.route.errorElement||0===c)?r.createElement(fo,{location:n.location,revalidation:n.revalidation,component:h,error:d,children:m(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):m()}),null)}function xo(e){return"".concat(e," must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.")}function bo(e){let t=r.useContext(Xr);return hr(t,xo(e)),t}function vo(e){let t=r.useContext(Yr);return hr(t,xo(e)),t}function yo(e){let t=function(e){let t=r.useContext(to);return hr(t,xo(e)),t}(e),n=t.matches[t.matches.length-1];return hr(n.route.id,"".concat(e,' can only be used on routes that contain a unique "id"')),n.route.id}function wo(){var e;let t=r.useContext(no),n=vo("useRouteError"),o=yo("useRouteError");return void 0!==t?t:null===(e=n.errors)||void 0===e?void 0:e[o]}var ko={};function So(e,t,n){t||ko[e]||(ko[e]=!0,pr(!1,n))}r.memo((function(e){let{routes:t,future:n,state:r}=e;return uo(t,void 0,r,n)}));function jo(e){hr(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Ao(e){let{basename:t="/",children:n=null,location:o,navigationType:a="POP",navigator:i,static:s=!1}=e;hr(!ro(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=t.replace(/^\/*/,"/"),c=r.useMemo((()=>({basename:l,navigator:i,static:s,future:{}})),[l,i,s]);"string"===typeof o&&(o=xr(o));let{pathname:d="/",search:u="",hash:h="",state:p=null,key:f="default"}=o,m=r.useMemo((()=>{let e=Ir(d,l);return null==e?null:{location:{pathname:e,search:u,hash:h,state:p,key:f},navigationType:a}}),[l,d,u,h,p,f,a]);return pr(null!=m,'<Router basename="'.concat(l,'"> is not able to match the URL "').concat(d).concat(u).concat(h,"\" because it does not start with the basename, so the <Router> won't render anything.")),null==m?null:r.createElement(Qr.Provider,{value:c},r.createElement(eo.Provider,{children:n,value:m}))}function Co(e){let{children:t,location:n}=e;return uo(_o(t),n)}r.Component;function _o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[];return r.Children.forEach(e,((e,o)=>{if(!r.isValidElement(e))return;let a=[...t,o];if(e.type===r.Fragment)return void n.push.apply(n,_o(e.props.children,a));hr(e.type===jo,"[".concat("string"===typeof e.type?e.type:e.type.name,"] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>")),hr(!e.props.index||!e.props.children,"An index route cannot have child routes.");let i={id:e.props.id||a.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:!0===e.props.hasErrorBoundary||null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(i.children=_o(e.props.children,a)),n.push(i)})),n}var Eo="get",Mo="application/x-www-form-urlencoded";function No(e){return null!=e&&"string"===typeof e.tagName}var Ro=null;var Po=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Oo(e){return null==e||Po.has(e)?e:(pr(!1,'"'.concat(e,'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` and will default to "').concat(Mo,'"')),null)}function To(e,t){let n,r,o,a,i;if(No(s=e)&&"form"===s.tagName.toLowerCase()){let i=e.getAttribute("action");r=i?Ir(i,t):null,n=e.getAttribute("method")||Eo,o=Oo(e.getAttribute("enctype"))||Mo,a=new FormData(e)}else if(function(e){return No(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return No(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||i.getAttribute("action");if(r=s?Ir(s,t):null,n=e.getAttribute("formmethod")||i.getAttribute("method")||Eo,o=Oo(e.getAttribute("formenctype"))||Oo(i.getAttribute("enctype"))||Mo,a=new FormData(i,e),!function(){if(null===Ro)try{new FormData(document.createElement("form"),0),Ro=!1}catch(e){Ro=!0}return Ro}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?"".concat(t,"."):"";a.append("".concat(e,"x"),"0"),a.append("".concat(e,"y"),"0")}else t&&a.append(t,r)}}else{if(No(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Eo,r=null,o=Mo,i=e}var s;return a&&"text/plain"===o&&(i=a,a=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:a,body:i}}function Lo(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}async function Io(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error("Error loading route module `".concat(e.module,"`, reloading page...")),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise((()=>{}))}}function zo(e){return null!=e&&"string"===typeof e.page}function Do(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"===typeof e.imageSrcSet&&"string"===typeof e.imageSizes:"string"===typeof e.rel&&"string"===typeof e.href)}function Fo(e,t,n,r,o,a){let i=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>{var r;return n[t].pathname!==e.pathname||(null===(r=n[t].route.path)||void 0===r?void 0:r.endsWith("*"))&&n[t].params["*"]!==e.params["*"]};return"assets"===a?t.filter(((e,t)=>i(e,t)||s(e,t))):"data"===a?t.filter(((t,a)=>{let l=r.routes[t.route.id];if(!l||!l.hasLoader)return!1;if(i(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){var c;let r=t.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:(null===(c=n[0])||void 0===c?void 0:c.params)||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"===typeof r)return r}return!0})):[]}function Bo(e,t){let{includeHydrateFallback:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r=e.map((e=>{let r=t.routes[e.route.id];if(!r)return[];let o=[r.module];return r.clientActionModule&&(o=o.concat(r.clientActionModule)),r.clientLoaderModule&&(o=o.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(o=o.concat(r.hydrateFallbackModule)),r.imports&&(o=o.concat(r.imports)),o})).flat(1),[...new Set(r)];var r}function Wo(e,t){let n=new Set,r=new Set(t);return e.reduce(((e,o)=>{if(t&&!zo(o)&&"script"===o.as&&o.href&&r.has(o.href))return e;let a=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(o));return n.has(a)||(n.add(a),e.push({key:a,link:o})),e}),[])}function Ho(e){return{__html:e}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");"undefined"!==typeof window?window:"undefined"!==typeof globalThis&&globalThis;Symbol("SingleFetchRedirect");var Vo=new Set([100,101,204,205]);function Uo(e,t){let n="string"===typeof e?new URL(e,"undefined"===typeof window?"server://singlefetch/":window.location.origin):e;return"/"===n.pathname?n.pathname="_root.data":t&&"/"===Ir(n.pathname,t)?n.pathname="".concat(t.replace(/\/$/,""),"/_root.data"):n.pathname="".concat(n.pathname.replace(/\/$/,""),".data"),n}r.Component;function qo(e){let{error:t,isOutsideRemixApp:n}=e;console.error(t);let o,a=r.createElement("script",{dangerouslySetInnerHTML:{__html:'\n console.log(\n "\ud83d\udcbf Hey developer \ud83d\udc4b. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."\n );\n '}});if(qr(t))return r.createElement($o,{title:"Unhandled Thrown Response!"},r.createElement("h1",{style:{fontSize:"24px"}},t.status," ",t.statusText),a);if(t instanceof Error)0;else{let e=null==t?"Unknown Error":"object"===typeof t&&"toString"in t?t.toString():JSON.stringify(t);new Error(e)}return r.createElement($o,{title:"Application Error!",isOutsideRemixApp:n},r.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),r.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},o.stack),a)}function $o(e){var t;let{title:n,renderScripts:o,isOutsideRemixApp:a,children:i}=e,{routeModules:s}=Zo();return null!==s.root&&void 0!==t&&t.Layout&&!a?i:r.createElement("html",{lang:"en"},r.createElement("head",null,r.createElement("meta",{charSet:"utf-8"}),r.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),r.createElement("title",null,n)),r.createElement("body",null,r.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},i,o?r.createElement(oa,null):null)))}function Ko(e,t){return"lazy"===e.mode&&!0===t}function Xo(){let e=r.useContext(Xr);return Lo(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Yo(){let e=r.useContext(Yr);return Lo(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Go=r.createContext(void 0);function Zo(){let e=r.useContext(Go);return Lo(e,"You must render this element inside a <HydratedRouter> element"),e}function Jo(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Qo(e,t,n){if(n&&!ra)return[e[0]];if(t){let n=e.findIndex((e=>void 0!==t[e.route.id]));return e.slice(0,n+1)}return e}function ea(e){let{page:t}=e,n=rr(e,ar),{router:o}=Xo(),a=r.useMemo((()=>yr(o.routes,t,o.basename)),[o.routes,t,o.basename]);return a?r.createElement(na,c({page:t,matches:a},n)):null}function ta(e){let{manifest:t,routeModules:n}=Zo(),[o,a]=r.useState([]);return r.useEffect((()=>{let r=!1;return async function(e,t,n){return Wo((await Promise.all(e.map((async e=>{let r=t.routes[e.route.id];if(r){let e=await Io(r,n);return e.links?e.links():[]}return[]})))).flat(1).filter(Do).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?c(c({},e),{},{rel:"prefetch",as:"style"}):c(c({},e),{},{rel:"prefetch"}))))}(e,t,n).then((e=>{r||a(e)})),()=>{r=!0}}),[e,t,n]),o}function na(e){let{page:t,matches:n}=e,o=rr(e,ir),a=oo(),{manifest:i,routeModules:s}=Zo(),{basename:l}=Xo(),{loaderData:d,matches:u}=Yo(),h=r.useMemo((()=>Fo(t,n,u,i,a,"data")),[t,n,u,i,a]),p=r.useMemo((()=>Fo(t,n,u,i,a,"assets")),[t,n,u,i,a]),f=r.useMemo((()=>{if(t===a.pathname+a.search+a.hash)return[];let e=new Set,r=!1;if(n.forEach((t=>{var n;let o=i.routes[t.route.id];o&&o.hasLoader&&(!h.some((e=>e.route.id===t.route.id))&&t.route.id in d&&null!==(n=s[t.route.id])&&void 0!==n&&n.shouldRevalidate||o.hasClientLoader?r=!0:e.add(t.route.id))})),0===e.size)return[];let o=Uo(t,l);return r&&e.size>0&&o.searchParams.set("_routes",n.filter((t=>e.has(t.route.id))).map((e=>e.route.id)).join(",")),[o.pathname+o.search]}),[l,d,a,i,h,n,t,s]),m=r.useMemo((()=>Bo(p,i)),[p,i]),g=ta(p);return r.createElement(r.Fragment,null,f.map((e=>r.createElement("link",c({key:e,rel:"prefetch",as:"fetch",href:e},o)))),m.map((e=>r.createElement("link",c({key:e,rel:"modulepreload",href:e},o)))),g.map((e=>{let{key:t,link:n}=e;return r.createElement("link",c({key:t},n))})))}Go.displayName="FrameworkContext";var ra=!1;function oa(e){let{manifest:t,serverHandoffString:n,isSpaMode:o,renderMeta:a,routeDiscovery:i,ssr:s}=Zo(),{router:l,static:d,staticContext:u}=Xo(),{matches:h}=Yo(),p=Ko(i,s);a&&(a.didRenderScripts=!0);let f=Qo(h,null,o);r.useEffect((()=>{0}),[]);let m=r.useMemo((()=>{var o;let a=u?"window.__reactRouterContext = ".concat(n,";").concat("window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());"):" ",i=d?"".concat(null!==t.hmr&&void 0!==o&&o.runtime?"import ".concat(JSON.stringify(t.hmr.runtime),";"):"").concat(p?"":"import ".concat(JSON.stringify(t.url)),";\n").concat(f.map(((e,n)=>{let r="route".concat(n),o=t.routes[e.route.id];Lo(o,"Route ".concat(e.route.id," not found in manifest"));let{clientActionModule:a,clientLoaderModule:i,clientMiddlewareModule:s,hydrateFallbackModule:l,module:c}=o,d=[...a?[{module:a,varName:"".concat(r,"_clientAction")}]:[],...i?[{module:i,varName:"".concat(r,"_clientLoader")}]:[],...s?[{module:s,varName:"".concat(r,"_clientMiddleware")}]:[],...l?[{module:l,varName:"".concat(r,"_HydrateFallback")}]:[],{module:c,varName:"".concat(r,"_main")}];return 1===d.length?"import * as ".concat(r," from ").concat(JSON.stringify(c),";"):[d.map((e=>"import * as ".concat(e.varName,' from "').concat(e.module,'";'))).join("\n"),"const ".concat(r," = {").concat(d.map((e=>"...".concat(e.varName))).join(","),"};")].join("\n")})).join("\n"),"\n ").concat(p?"window.__reactRouterManifest = ".concat(JSON.stringify(function(e,t){let{sri:n}=e,r=rr(e,or),o=new Set(t.state.matches.map((e=>e.route.id))),a=t.state.location.pathname.split("/").filter(Boolean),i=["/"];for(a.pop();a.length>0;)i.push("/".concat(a.join("/"))),a.pop();i.forEach((e=>{let n=yr(t.routes,e,t.basename);n&&n.forEach((e=>o.add(e.route.id)))}));let s=[...o].reduce(((e,t)=>Object.assign(e,{[t]:r.routes[t]})),{});return c(c({},r),{},{routes:s,sri:!!n||void 0})}(t,l),null,2),";"):"","\n window.__reactRouterRouteModules = {").concat(f.map(((e,t)=>"".concat(JSON.stringify(e.route.id),":route").concat(t))).join(","),"};\n\nimport(").concat(JSON.stringify(t.entry.module),");"):" ";return r.createElement(r.Fragment,null,r.createElement("script",c(c({},e),{},{suppressHydrationWarning:!0,dangerouslySetInnerHTML:Ho(a),type:void 0})),r.createElement("script",c(c({},e),{},{suppressHydrationWarning:!0,dangerouslySetInnerHTML:Ho(i),type:"module",async:!0})))}),[]),g=ra?[]:(t.entry.imports.concat(Bo(f,t,{includeHydrateFallback:!0})),[...new Set(x)]);var x;let b="object"===typeof t.sri?t.sri:{};return ra?null:r.createElement(r.Fragment,null,"object"===typeof t.sri?r.createElement("script",{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:b})}}):null,p?null:r.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:b[t.url],suppressHydrationWarning:!0}),r.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:b[t.entry.module],suppressHydrationWarning:!0}),g.map((t=>r.createElement("link",{key:t,rel:"modulepreload",href:t,crossOrigin:e.crossOrigin,integrity:b[t],suppressHydrationWarning:!0}))),m)}function aa(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>{t.forEach((t=>{"function"===typeof t?t(e):null!=t&&(t.current=e)}))}}var ia="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement;try{ia&&(window.__reactRouterVersion="7.6.0")}catch(RR){}function sa(e){let{basename:t,children:n,window:o}=e,a=r.useRef();null==a.current&&(a.current=ur({window:o,v5Compat:!0}));let i=a.current,[s,l]=r.useState({action:i.action,location:i.location}),c=r.useCallback((e=>{r.startTransition((()=>l(e)))}),[l]);return r.useLayoutEffect((()=>i.listen(c)),[i,c]),r.createElement(Ao,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:i})}var la=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ca=r.forwardRef((function(e,t){let n,{onClick:o,discover:a="render",prefetch:i="none",relative:s,reloadDocument:l,replace:d,state:u,target:h,to:p,preventScrollReset:f,viewTransition:m}=e,g=rr(e,sr),{basename:x}=r.useContext(Qr),b="string"===typeof p&&la.test(p),v=!1;if("string"===typeof p&&b&&(n=p,ia))try{let e=new URL(window.location.href),t=p.startsWith("//")?new URL(e.protocol+p):new URL(p),n=Ir(t.pathname,x);t.origin===e.origin&&null!=n?p=n+t.search+t.hash:v=!0}catch(RR){pr(!1,'<Link to="'.concat(p,'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.'))}let y=function(e){let{relative:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};hr(ro(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:o}=r.useContext(Qr),{hash:a,pathname:i,search:s}=co(e,{relative:t}),l=i;return"/"!==n&&(l="/"===i?n:Wr([n,i])),o.createHref({pathname:l,search:s,hash:a})}(p,{relative:s}),[w,k,S]=function(e,t){let n=r.useContext(Go),[o,a]=r.useState(!1),[i,s]=r.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:d,onMouseLeave:u,onTouchStart:h}=t,p=r.useRef(null);r.useEffect((()=>{if("render"===e&&s(!0),"viewport"===e){let e=new IntersectionObserver((e=>{e.forEach((e=>{s(e.isIntersecting)}))}),{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}}),[e]),r.useEffect((()=>{if(o){let e=setTimeout((()=>{s(!0)}),100);return()=>{clearTimeout(e)}}}),[o]);let f=()=>{a(!0)},m=()=>{a(!1),s(!1)};return n?"intent"!==e?[i,p,{}]:[i,p,{onFocus:Jo(l,f),onBlur:Jo(c,m),onMouseEnter:Jo(d,f),onMouseLeave:Jo(u,m),onTouchStart:Jo(h,f)}]:[!1,p,{}]}(i,g),j=function(e){let{target:t,replace:n,state:o,preventScrollReset:a,relative:i,viewTransition:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=so(),c=oo(),d=co(e,{relative:i});return r.useCallback((r=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(r,t)){r.preventDefault();let t=void 0!==n?n:gr(c)===gr(d);l(e,{replace:t,state:o,preventScrollReset:a,relative:i,viewTransition:s})}}),[c,l,d,n,o,t,e,a,i,s])}(p,{replace:d,state:u,target:h,preventScrollReset:f,relative:s,viewTransition:m});let A=r.createElement("a",c(c(c({},g),S),{},{href:n||y,onClick:v||l?o:function(e){o&&o(e),e.defaultPrevented||j(e)},ref:aa(t,k),target:h,"data-discover":b||"render"!==a?void 0:"true"}));return w&&!b?r.createElement(r.Fragment,null,A,r.createElement(ea,{page:y})):A}));ca.displayName="Link";var da=r.forwardRef((function(e,t){let{"aria-current":n="page",caseSensitive:o=!1,className:a="",end:i=!1,style:s,to:l,viewTransition:d,children:u}=e,h=rr(e,lr),p=co(l,{relative:h.relative}),f=oo(),m=r.useContext(Yr),{navigator:g,basename:x}=r.useContext(Qr),b=null!=m&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.useContext(Gr);hr(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=pa("useViewTransitionState"),a=co(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Ir(n.currentLocation.pathname,o)||n.currentLocation.pathname,s=Ir(n.nextLocation.pathname,o)||n.nextLocation.pathname;return null!=Or(a.pathname,s)||null!=Or(a.pathname,i)}(p)&&!0===d,v=g.encodeLocation?g.encodeLocation(p).pathname:p.pathname,y=f.pathname,w=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;o||(y=y.toLowerCase(),w=w?w.toLowerCase():null,v=v.toLowerCase()),w&&x&&(w=Ir(w,x)||w);const k="/"!==v&&v.endsWith("/")?v.length-1:v.length;let S,j=y===v||!i&&y.startsWith(v)&&"/"===y.charAt(k),A=null!=w&&(w===v||!i&&w.startsWith(v)&&"/"===w.charAt(v.length)),C={isActive:j,isPending:A,isTransitioning:b},_=j?n:void 0;S="function"===typeof a?a(C):[a,j?"active":null,A?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let E="function"===typeof s?s(C):s;return r.createElement(ca,c(c({},h),{},{"aria-current":_,className:S,ref:t,style:E,to:l,viewTransition:d}),"function"===typeof u?u(C):u)}));da.displayName="NavLink";var ua=r.forwardRef(((e,t)=>{let{discover:n="render",fetcherKey:o,navigate:a,reloadDocument:i,replace:s,state:l,method:d=Eo,action:u,onSubmit:h,relative:p,preventScrollReset:f,viewTransition:m}=e,g=rr(e,cr),x=ga(),b=function(e){let{relative:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{basename:n}=r.useContext(Qr),o=r.useContext(to);hr(o,"useFormAction must be used inside a RouteContext");let[a]=o.matches.slice(-1),i=c({},co(e||".",{relative:t})),s=oo();if(null==e){i.search=s.search;let e=new URLSearchParams(i.search),t=e.getAll("index");if(t.some((e=>""===e))){e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let n=e.toString();i.search=n?"?".concat(n):""}}e&&"."!==e||!a.route.index||(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index");"/"!==n&&(i.pathname="/"===i.pathname?n:Wr([n,i.pathname]));return gr(i)}(u,{relative:p}),v="get"===d.toLowerCase()?"get":"post",y="string"===typeof u&&la.test(u);return r.createElement("form",c(c({ref:t,method:v,action:b,onSubmit:i?h:e=>{if(h&&h(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,n=(null===t||void 0===t?void 0:t.getAttribute("formmethod"))||d;x(t||e.currentTarget,{fetcherKey:o,method:n,navigate:a,replace:s,state:l,relative:p,preventScrollReset:f,viewTransition:m})}},g),{},{"data-discover":y||"render"!==n?void 0:"true"}))}));function ha(e){return"".concat(e," must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.")}function pa(e){let t=r.useContext(Xr);return hr(t,ha(e)),t}ua.displayName="Form";var fa=0,ma=()=>"__".concat(String(++fa),"__");function ga(){let{router:e}=pa("useSubmit"),{basename:t}=r.useContext(Qr),n=yo("useRouteId");return r.useCallback((async function(r){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{action:a,method:i,encType:s,formData:l,body:c}=To(r,t);if(!1===o.navigate){let t=o.fetcherKey||ma();await e.fetch(t,n,o.action||a,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||i,formEncType:o.encType||s,flushSync:o.flushSync})}else await e.navigate(o.action||a,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||i,formEncType:o.encType||s,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})}),[e,t,n])}var xa=n(7344),ba=n(8168);const va=r.createContext(null);function ya(){return r.useContext(va)}const wa="function"===typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__";var ka=n(579);const Sa=function(e){const{children:t,theme:n}=e,o=ya(),a=r.useMemo((()=>{const e=null===o?n:function(e,t){if("function"===typeof t)return t(e);return(0,ba.A)({},e,t)}(o,n);return null!=e&&(e[wa]=null!==o),e}),[n,o]);return(0,ka.jsx)(va.Provider,{value:a,children:t})};var ja=n(9369);const Aa=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=r.useContext(ja.T);return t&&(n=t,0!==Object.keys(n).length)?t:e;var n},Ca=["value"],_a=r.createContext();const Ea=()=>{const e=r.useContext(_a);return null!=e&&e},Ma=function(e){let{value:t}=e,n=(0,nr.A)(e,Ca);return(0,ka.jsx)(_a.Provider,(0,ba.A)({value:null==t||t},n))};var Na=n(3654);const Ra={};function Pa(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return r.useMemo((()=>{const r=e&&t[e]||t;if("function"===typeof n){const a=n(r),i=e?(0,ba.A)({},t,{[e]:a}):a;return o?()=>i:i}return e?(0,ba.A)({},t,{[e]:n}):(0,ba.A)({},t,n)}),[e,t,n,o])}const Oa=function(e){const{children:t,theme:n,themeId:r}=e,o=Aa(Ra),a=ya()||Ra,i=Pa(r,o,n),s=Pa(r,a,n,!0),l="rtl"===i.direction;return(0,ka.jsx)(Sa,{theme:s,children:(0,ka.jsx)(ja.T.Provider,{value:i,children:(0,ka.jsx)(Ma,{value:l,children:(0,ka.jsx)(Na.A,{value:null==i?void 0:i.components,children:t})})})})};var Ta=n(3375);const La=["theme"];function Ia(e){let{theme:t}=e,n=(0,nr.A)(e,La);const r=t[Ta.A];let o=r||t;return"function"!==typeof t&&(r&&!r.vars?o=(0,ba.A)({},r,{vars:null}):t&&!t.vars&&(o=(0,ba.A)({},t,{vars:null}))),(0,ka.jsx)(Oa,(0,ba.A)({},n,{themeId:r?Ta.A:void 0,theme:o}))}var za=n(8387),Da=n(3174),Fa=n(8812),Ba=n(8698),Wa=n(8280);const Ha=(0,Wa.A)();const Va=function(){return Aa(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ha)},Ua=["className","component"];var qa=n(9386),$a=n(2532);const Ka=(0,$a.A)("MuiBox",["root"]),Xa=(0,xa.A)(),Ya=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:t,defaultTheme:n,defaultClassName:o="MuiBox-root",generateClassName:a}=e,i=(0,Da.default)("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(Fa.A);return r.forwardRef((function(e,r){const s=Va(n),l=(0,Ba.A)(e),{className:c,component:d="div"}=l,u=(0,nr.A)(l,Ua);return(0,ka.jsx)(i,(0,ba.A)({as:d,ref:r,className:(0,za.A)(c,a?a(o):o),theme:t&&s[t]||s},u))}))}({themeId:Ta.A,defaultTheme:Xa,defaultClassName:Ka.root,generateClassName:qa.A.generate}),Ga=Ya;var Za=n(8610),Ja=n(7266),Qa=n(4535);const ei=e=>{let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,(t/100).toFixed(2)};var ti=n(8206),ni=n(2372);function ri(e){return(0,ni.Ay)("MuiPaper",e)}(0,$a.A)("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const oi=["className","component","elevation","square","variant"],ai=(0,Qa.Ay)("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,"elevation"===n.variant&&t["elevation".concat(n.elevation)]]}})((e=>{let{theme:t,ownerState:n}=e;var r;return(0,ba.A)({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow")},!n.square&&{borderRadius:t.shape.borderRadius},"outlined"===n.variant&&{border:"1px solid ".concat((t.vars||t).palette.divider)},"elevation"===n.variant&&(0,ba.A)({boxShadow:(t.vars||t).shadows[n.elevation]},!t.vars&&"dark"===t.palette.mode&&{backgroundImage:"linear-gradient(".concat((0,Ja.X4)("#fff",ei(n.elevation)),", ").concat((0,Ja.X4)("#fff",ei(n.elevation)),")")},t.vars&&{backgroundImage:null==(r=t.vars.overlays)?void 0:r[n.elevation]}))})),ii=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiPaper"}),{className:r,component:o="div",elevation:a=1,square:i=!1,variant:s="elevation"}=n,l=(0,nr.A)(n,oi),c=(0,ba.A)({},n,{component:o,elevation:a,square:i,variant:s}),d=(e=>{const{square:t,elevation:n,variant:r,classes:o}=e,a={root:["root",r,!t&&"rounded","elevation"===r&&"elevation".concat(n)]};return(0,Za.A)(a,ri,o)})(c);return(0,ka.jsx)(ai,(0,ba.A)({as:o,ownerState:c,className:(0,za.A)(d.root,r),ref:t},l))}));var si=n(6803);function li(e){return(0,ni.Ay)("MuiButtonGroup",e)}const ci=(0,$a.A)("MuiButtonGroup",["root","contained","outlined","text","disableElevation","disabled","firstButton","fullWidth","vertical","grouped","groupedHorizontal","groupedVertical","groupedText","groupedTextHorizontal","groupedTextVertical","groupedTextPrimary","groupedTextSecondary","groupedOutlined","groupedOutlinedHorizontal","groupedOutlinedVertical","groupedOutlinedPrimary","groupedOutlinedSecondary","groupedContained","groupedContainedHorizontal","groupedContainedVertical","groupedContainedPrimary","groupedContainedSecondary","lastButton","middleButton"]);const di=r.createContext({});const ui=r.createContext(void 0),hi=["children","className","color","component","disabled","disableElevation","disableFocusRipple","disableRipple","fullWidth","orientation","size","variant"],pi=(0,Qa.Ay)("div",{name:"MuiButtonGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{["& .".concat(ci.grouped)]:t.grouped},{["& .".concat(ci.grouped)]:t["grouped".concat((0,si.A)(n.orientation))]},{["& .".concat(ci.grouped)]:t["grouped".concat((0,si.A)(n.variant))]},{["& .".concat(ci.grouped)]:t["grouped".concat((0,si.A)(n.variant)).concat((0,si.A)(n.orientation))]},{["& .".concat(ci.grouped)]:t["grouped".concat((0,si.A)(n.variant)).concat((0,si.A)(n.color))]},{["& .".concat(ci.firstButton)]:t.firstButton},{["& .".concat(ci.lastButton)]:t.lastButton},{["& .".concat(ci.middleButton)]:t.middleButton},t.root,t[n.variant],!0===n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,"vertical"===n.orientation&&t.vertical]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({display:"inline-flex",borderRadius:(t.vars||t).shape.borderRadius},"contained"===n.variant&&{boxShadow:(t.vars||t).shadows[2]},n.disableElevation&&{boxShadow:"none"},n.fullWidth&&{width:"100%"},"vertical"===n.orientation&&{flexDirection:"column"},{["& .".concat(ci.grouped)]:(0,ba.A)({minWidth:40,"&:hover":(0,ba.A)({},"contained"===n.variant&&{boxShadow:"none"})},"contained"===n.variant&&{boxShadow:"none"}),["& .".concat(ci.firstButton,",& .").concat(ci.middleButton)]:(0,ba.A)({},"horizontal"===n.orientation&&{borderTopRightRadius:0,borderBottomRightRadius:0},"vertical"===n.orientation&&{borderBottomRightRadius:0,borderBottomLeftRadius:0},"text"===n.variant&&"horizontal"===n.orientation&&{borderRight:t.vars?"1px solid rgba(".concat(t.vars.palette.common.onBackgroundChannel," / 0.23)"):"1px solid ".concat("light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),["&.".concat(ci.disabled)]:{borderRight:"1px solid ".concat((t.vars||t).palette.action.disabled)}},"text"===n.variant&&"vertical"===n.orientation&&{borderBottom:t.vars?"1px solid rgba(".concat(t.vars.palette.common.onBackgroundChannel," / 0.23)"):"1px solid ".concat("light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),["&.".concat(ci.disabled)]:{borderBottom:"1px solid ".concat((t.vars||t).palette.action.disabled)}},"text"===n.variant&&"inherit"!==n.color&&{borderColor:t.vars?"rgba(".concat(t.vars.palette[n.color].mainChannel," / 0.5)"):(0,Ja.X4)(t.palette[n.color].main,.5)},"outlined"===n.variant&&"horizontal"===n.orientation&&{borderRightColor:"transparent"},"outlined"===n.variant&&"vertical"===n.orientation&&{borderBottomColor:"transparent"},"contained"===n.variant&&"horizontal"===n.orientation&&{borderRight:"1px solid ".concat((t.vars||t).palette.grey[400]),["&.".concat(ci.disabled)]:{borderRight:"1px solid ".concat((t.vars||t).palette.action.disabled)}},"contained"===n.variant&&"vertical"===n.orientation&&{borderBottom:"1px solid ".concat((t.vars||t).palette.grey[400]),["&.".concat(ci.disabled)]:{borderBottom:"1px solid ".concat((t.vars||t).palette.action.disabled)}},"contained"===n.variant&&"inherit"!==n.color&&{borderColor:(t.vars||t).palette[n.color].dark},{"&:hover":(0,ba.A)({},"outlined"===n.variant&&"horizontal"===n.orientation&&{borderRightColor:"currentColor"},"outlined"===n.variant&&"vertical"===n.orientation&&{borderBottomColor:"currentColor"})}),["& .".concat(ci.lastButton,",& .").concat(ci.middleButton)]:(0,ba.A)({},"horizontal"===n.orientation&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},"vertical"===n.orientation&&{borderTopRightRadius:0,borderTopLeftRadius:0},"outlined"===n.variant&&"horizontal"===n.orientation&&{marginLeft:-1},"outlined"===n.variant&&"vertical"===n.orientation&&{marginTop:-1})})})),fi=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiButtonGroup"}),{children:o,className:a,color:i="primary",component:s="div",disabled:l=!1,disableElevation:c=!1,disableFocusRipple:d=!1,disableRipple:u=!1,fullWidth:h=!1,orientation:p="horizontal",size:f="medium",variant:m="outlined"}=n,g=(0,nr.A)(n,hi),x=(0,ba.A)({},n,{color:i,component:s,disabled:l,disableElevation:c,disableFocusRipple:d,disableRipple:u,fullWidth:h,orientation:p,size:f,variant:m}),b=(e=>{const{classes:t,color:n,disabled:r,disableElevation:o,fullWidth:a,orientation:i,variant:s}=e,l={root:["root",s,"vertical"===i&&"vertical",a&&"fullWidth",o&&"disableElevation"],grouped:["grouped","grouped".concat((0,si.A)(i)),"grouped".concat((0,si.A)(s)),"grouped".concat((0,si.A)(s)).concat((0,si.A)(i)),"grouped".concat((0,si.A)(s)).concat((0,si.A)(n)),r&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return(0,Za.A)(l,li,t)})(x),v=r.useMemo((()=>({className:b.grouped,color:i,disabled:l,disableElevation:c,disableFocusRipple:d,disableRipple:u,fullWidth:h,size:f,variant:m})),[i,l,c,d,u,h,f,m,b.grouped]),y=function(e){return r.Children.toArray(e).filter((e=>r.isValidElement(e)))}(o),w=y.length,k=e=>{const t=0===e,n=e===w-1;return t&&n?"":t?b.firstButton:n?b.lastButton:b.middleButton};return(0,ka.jsx)(pi,(0,ba.A)({as:s,role:"group",className:(0,za.A)(b.root,a),ref:t,ownerState:x},g,{children:(0,ka.jsx)(di.Provider,{value:v,children:y.map(((e,t)=>(0,ka.jsx)(ui.Provider,{value:k(t),children:e},t)))})}))})),mi=fi;var gi=n(3030),xi=n(1475),bi=n(5849),vi=n(3319),yi=n(3574);function wi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ki(e,t){return ki=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ki(e,t)}function Si(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ki(e,t)}const ji=r.createContext(null);function Ai(e,t){var n=Object.create(null);return e&&r.Children.map(e,(function(e){return e})).forEach((function(e){n[e.key]=function(e){return t&&(0,r.isValidElement)(e)?t(e):e}(e)})),n}function Ci(e,t,n){return null!=n[t]?n[t]:e.props[t]}function _i(e,t,n){var o=Ai(e.children),a=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,o=Object.create(null),a=[];for(var i in e)i in t?a.length&&(o[i]=a,a=[]):a.push(i);var s={};for(var l in t){if(o[l])for(r=0;r<o[l].length;r++){var c=o[l][r];s[o[l][r]]=n(c)}s[l]=n(l)}for(r=0;r<a.length;r++)s[a[r]]=n(a[r]);return s}(t,o);return Object.keys(a).forEach((function(i){var s=a[i];if((0,r.isValidElement)(s)){var l=i in t,c=i in o,d=t[i],u=(0,r.isValidElement)(d)&&!d.props.in;!c||l&&!u?c||!l||u?c&&l&&(0,r.isValidElement)(d)&&(a[i]=(0,r.cloneElement)(s,{onExited:n.bind(null,s),in:d.props.in,exit:Ci(s,"exit",e),enter:Ci(s,"enter",e)})):a[i]=(0,r.cloneElement)(s,{in:!1}):a[i]=(0,r.cloneElement)(s,{onExited:n.bind(null,s),in:!0,exit:Ci(s,"exit",e),enter:Ci(s,"enter",e)})}})),a}var Ei=Object.values||function(e){return Object.keys(e).map((function(t){return e[t]}))},Mi=function(e){function t(t,n){var r,o=(r=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r));return r.state={contextValue:{isMounting:!0},handleExited:o,firstRender:!0},r}Si(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,o,a=t.children,i=t.handleExited;return{children:t.firstRender?(n=e,o=i,Ai(n.children,(function(e){return(0,r.cloneElement)(e,{onExited:o.bind(null,e),in:!0,appear:Ci(e,"appear",n),enter:Ci(e,"enter",n),exit:Ci(e,"exit",n)})}))):_i(e,a,i),firstRender:!1}},n.handleExited=function(e,t){var n=Ai(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState((function(t){var n=(0,ba.A)({},t.children);return delete n[e.key],{children:n}})))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,o=(0,nr.A)(e,["component","childFactory"]),a=this.state.contextValue,i=Ei(this.state.children).map(n);return delete o.appear,delete o.enter,delete o.exit,null===t?r.createElement(ji.Provider,{value:a},i):r.createElement(ji.Provider,{value:a},r.createElement(t,o,i))},t}(r.Component);Mi.propTypes={},Mi.defaultProps={component:"div",childFactory:function(e){return e}};const Ni=Mi;var Ri=n(3290),Pi=n(9303);const Oi=function(e){const{className:t,classes:n,pulsate:o=!1,rippleX:a,rippleY:i,rippleSize:s,in:l,onExited:c,timeout:d}=e,[u,h]=r.useState(!1),p=(0,za.A)(t,n.ripple,n.rippleVisible,o&&n.ripplePulsate),f={width:s,height:s,top:-s/2+i,left:-s/2+a},m=(0,za.A)(n.child,u&&n.childLeaving,o&&n.childPulsate);return l||u||h(!0),r.useEffect((()=>{if(!l&&null!=c){const e=setTimeout(c,d);return()=>{clearTimeout(e)}}}),[c,l,d]),(0,ka.jsx)("span",{className:p,style:f,children:(0,ka.jsx)("span",{className:m})})};const Ti=(0,$a.A)("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]);var Li,Ii,zi,Di;const Fi=["center","classes","className"];let Bi,Wi,Hi,Vi;const Ui=(0,Ri.i7)(Bi||(Bi=Li||(Li=wi(["\n 0% {\n transform: scale(0);\n opacity: 0.1;\n }\n\n 100% {\n transform: scale(1);\n opacity: 0.3;\n }\n"])))),qi=(0,Ri.i7)(Wi||(Wi=Ii||(Ii=wi(["\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n"])))),$i=(0,Ri.i7)(Hi||(Hi=zi||(zi=wi(["\n 0% {\n transform: scale(1);\n }\n\n 50% {\n transform: scale(0.92);\n }\n\n 100% {\n transform: scale(1);\n }\n"])))),Ki=(0,Qa.Ay)("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),Xi=(0,Qa.Ay)(Oi,{name:"MuiTouchRipple",slot:"Ripple"})(Vi||(Vi=Di||(Di=wi(["\n opacity: 0;\n position: absolute;\n\n &."," {\n opacity: 0.3;\n transform: scale(1);\n animation-name: ",";\n animation-duration: ","ms;\n animation-timing-function: ",";\n }\n\n &."," {\n animation-duration: ","ms;\n }\n\n & ."," {\n opacity: 1;\n display: block;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: currentColor;\n }\n\n & ."," {\n opacity: 0;\n animation-name: ",";\n animation-duration: ","ms;\n animation-timing-function: ",";\n }\n\n & ."," {\n position: absolute;\n /* @noflip */\n left: 0px;\n top: 0;\n animation-name: ",";\n animation-duration: 2500ms;\n animation-timing-function: ",";\n animation-iteration-count: infinite;\n animation-delay: 200ms;\n }\n"]))),Ti.rippleVisible,Ui,550,(e=>{let{theme:t}=e;return t.transitions.easing.easeInOut}),Ti.ripplePulsate,(e=>{let{theme:t}=e;return t.transitions.duration.shorter}),Ti.child,Ti.childLeaving,qi,550,(e=>{let{theme:t}=e;return t.transitions.easing.easeInOut}),Ti.childPulsate,$i,(e=>{let{theme:t}=e;return t.transitions.easing.easeInOut})),Yi=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiTouchRipple"}),{center:o=!1,classes:a={},className:i}=n,s=(0,nr.A)(n,Fi),[l,c]=r.useState([]),d=r.useRef(0),u=r.useRef(null);r.useEffect((()=>{u.current&&(u.current(),u.current=null)}),[l]);const h=r.useRef(!1),p=(0,Pi.A)(),f=r.useRef(null),m=r.useRef(null),g=r.useCallback((e=>{const{pulsate:t,rippleX:n,rippleY:r,rippleSize:o,cb:i}=e;c((e=>[...e,(0,ka.jsx)(Xi,{classes:{ripple:(0,za.A)(a.ripple,Ti.ripple),rippleVisible:(0,za.A)(a.rippleVisible,Ti.rippleVisible),ripplePulsate:(0,za.A)(a.ripplePulsate,Ti.ripplePulsate),child:(0,za.A)(a.child,Ti.child),childLeaving:(0,za.A)(a.childLeaving,Ti.childLeaving),childPulsate:(0,za.A)(a.childPulsate,Ti.childPulsate)},timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:o},d.current)])),d.current+=1,u.current=i}),[a]),x=r.useCallback((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{};const{pulsate:r=!1,center:a=o||t.pulsate,fakeElement:i=!1}=t;if("mousedown"===(null==e?void 0:e.type)&&h.current)return void(h.current=!1);"touchstart"===(null==e?void 0:e.type)&&(h.current=!0);const s=i?null:m.current,l=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0};let c,d,u;if(a||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(l.width/2),d=Math.round(l.height/2);else{const{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;c=Math.round(t-l.left),d=Math.round(n-l.top)}if(a)u=Math.sqrt((2*l.width**2+l.height**2)/3),u%2===0&&(u+=1);else{const e=2*Math.max(Math.abs((s?s.clientWidth:0)-c),c)+2,t=2*Math.max(Math.abs((s?s.clientHeight:0)-d),d)+2;u=Math.sqrt(e**2+t**2)}null!=e&&e.touches?null===f.current&&(f.current=()=>{g({pulsate:r,rippleX:c,rippleY:d,rippleSize:u,cb:n})},p.start(80,(()=>{f.current&&(f.current(),f.current=null)}))):g({pulsate:r,rippleX:c,rippleY:d,rippleSize:u,cb:n})}),[o,g,p]),b=r.useCallback((()=>{x({},{pulsate:!0})}),[x]),v=r.useCallback(((e,t)=>{if(p.clear(),"touchend"===(null==e?void 0:e.type)&&f.current)return f.current(),f.current=null,void p.start(0,(()=>{v(e,t)}));f.current=null,c((e=>e.length>0?e.slice(1):e)),u.current=t}),[p]);return r.useImperativeHandle(t,(()=>({pulsate:b,start:x,stop:v})),[b,x,v]),(0,ka.jsx)(Ki,(0,ba.A)({className:(0,za.A)(Ti.root,a.root,i),ref:m},s,{children:(0,ka.jsx)(Ni,{component:null,exit:!0,children:l})}))})),Gi=Yi;function Zi(e){return(0,ni.Ay)("MuiButtonBase",e)}const Ji=(0,$a.A)("MuiButtonBase",["root","disabled","focusVisible"]),Qi=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],es=(0,Qa.Ay)("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},["&.".concat(Ji.disabled)]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),ts=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiButtonBase"}),{action:o,centerRipple:a=!1,children:i,className:s,component:l="button",disabled:c=!1,disableRipple:d=!1,disableTouchRipple:u=!1,focusRipple:h=!1,LinkComponent:p="a",onBlur:f,onClick:m,onContextMenu:g,onDragLeave:x,onFocus:b,onFocusVisible:v,onKeyDown:y,onKeyUp:w,onMouseDown:k,onMouseLeave:S,onMouseUp:j,onTouchEnd:A,onTouchMove:C,onTouchStart:_,tabIndex:E=0,TouchRippleProps:M,touchRippleRef:N,type:R}=n,P=(0,nr.A)(n,Qi),O=r.useRef(null),T=r.useRef(null),L=(0,bi.A)(T,N),{isFocusVisibleRef:I,onFocus:z,onBlur:D,ref:F}=(0,yi.A)(),[B,W]=r.useState(!1);c&&B&&W(!1),r.useImperativeHandle(o,(()=>({focusVisible:()=>{W(!0),O.current.focus()}})),[]);const[H,V]=r.useState(!1);r.useEffect((()=>{V(!0)}),[]);const U=H&&!d&&!c;function q(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u;return(0,vi.A)((r=>{t&&t(r);return!n&&T.current&&T.current[e](r),!0}))}r.useEffect((()=>{B&&h&&!d&&H&&T.current.pulsate()}),[d,h,B,H]);const $=q("start",k),K=q("stop",g),X=q("stop",x),Y=q("stop",j),G=q("stop",(e=>{B&&e.preventDefault(),S&&S(e)})),Z=q("start",_),J=q("stop",A),Q=q("stop",C),ee=q("stop",(e=>{D(e),!1===I.current&&W(!1),f&&f(e)}),!1),te=(0,vi.A)((e=>{O.current||(O.current=e.currentTarget),z(e),!0===I.current&&(W(!0),v&&v(e)),b&&b(e)})),ne=()=>{const e=O.current;return l&&"button"!==l&&!("A"===e.tagName&&e.href)},re=r.useRef(!1),oe=(0,vi.A)((e=>{h&&!re.current&&B&&T.current&&" "===e.key&&(re.current=!0,T.current.stop(e,(()=>{T.current.start(e)}))),e.target===e.currentTarget&&ne()&&" "===e.key&&e.preventDefault(),y&&y(e),e.target===e.currentTarget&&ne()&&"Enter"===e.key&&!c&&(e.preventDefault(),m&&m(e))})),ae=(0,vi.A)((e=>{h&&" "===e.key&&T.current&&B&&!e.defaultPrevented&&(re.current=!1,T.current.stop(e,(()=>{T.current.pulsate(e)}))),w&&w(e),m&&e.target===e.currentTarget&&ne()&&" "===e.key&&!e.defaultPrevented&&m(e)}));let ie=l;"button"===ie&&(P.href||P.to)&&(ie=p);const se={};"button"===ie?(se.type=void 0===R?"button":R,se.disabled=c):(P.href||P.to||(se.role="button"),c&&(se["aria-disabled"]=c));const le=(0,bi.A)(t,F,O);const ce=(0,ba.A)({},n,{centerRipple:a,component:l,disabled:c,disableRipple:d,disableTouchRipple:u,focusRipple:h,tabIndex:E,focusVisible:B}),de=(e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,a={root:["root",t&&"disabled",n&&"focusVisible"]},i=(0,Za.A)(a,Zi,o);return n&&r&&(i.root+=" ".concat(r)),i})(ce);return(0,ka.jsxs)(es,(0,ba.A)({as:ie,className:(0,za.A)(de.root,s),ownerState:ce,onBlur:ee,onClick:m,onContextMenu:K,onFocus:te,onKeyDown:oe,onKeyUp:ae,onMouseDown:$,onMouseLeave:G,onMouseUp:Y,onDragLeave:X,onTouchEnd:J,onTouchMove:Q,onTouchStart:Z,ref:le,tabIndex:c?-1:E,type:R},se,P,{children:[i,U?(0,ka.jsx)(Gi,(0,ba.A)({ref:L,center:a},M)):null]}))}));function ns(e){return(0,ni.Ay)("MuiButton",e)}const rs=(0,$a.A)("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),os=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],as=e=>(0,ba.A)({},"small"===e.size&&{"& > *:nth-of-type(1)":{fontSize:18}},"medium"===e.size&&{"& > *:nth-of-type(1)":{fontSize:20}},"large"===e.size&&{"& > *:nth-of-type(1)":{fontSize:22}}),is=(0,Qa.Ay)(ts,{shouldForwardProp:e=>(0,xi.A)(e)||"classes"===e,name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t["".concat(n.variant).concat((0,si.A)(n.color))],t["size".concat((0,si.A)(n.size))],t["".concat(n.variant,"Size").concat((0,si.A)(n.size))],"inherit"===n.color&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})((e=>{let{theme:t,ownerState:n}=e;var r,o;const a="light"===t.palette.mode?t.palette.grey[300]:t.palette.grey[800],i="light"===t.palette.mode?t.palette.grey.A100:t.palette.grey[700];return(0,ba.A)({},t.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":(0,ba.A)({textDecoration:"none",backgroundColor:t.vars?"rgba(".concat(t.vars.palette.text.primaryChannel," / ").concat(t.vars.palette.action.hoverOpacity,")"):(0,Ja.X4)(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"text"===n.variant&&"inherit"!==n.color&&{backgroundColor:t.vars?"rgba(".concat(t.vars.palette[n.color].mainChannel," / ").concat(t.vars.palette.action.hoverOpacity,")"):(0,Ja.X4)(t.palette[n.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"outlined"===n.variant&&"inherit"!==n.color&&{border:"1px solid ".concat((t.vars||t).palette[n.color].main),backgroundColor:t.vars?"rgba(".concat(t.vars.palette[n.color].mainChannel," / ").concat(t.vars.palette.action.hoverOpacity,")"):(0,Ja.X4)(t.palette[n.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"contained"===n.variant&&{backgroundColor:t.vars?t.vars.palette.Button.inheritContainedHoverBg:i,boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2],backgroundColor:(t.vars||t).palette.grey[300]}},"contained"===n.variant&&"inherit"!==n.color&&{backgroundColor:(t.vars||t).palette[n.color].dark,"@media (hover: none)":{backgroundColor:(t.vars||t).palette[n.color].main}}),"&:active":(0,ba.A)({},"contained"===n.variant&&{boxShadow:(t.vars||t).shadows[8]}),["&.".concat(rs.focusVisible)]:(0,ba.A)({},"contained"===n.variant&&{boxShadow:(t.vars||t).shadows[6]}),["&.".concat(rs.disabled)]:(0,ba.A)({color:(t.vars||t).palette.action.disabled},"outlined"===n.variant&&{border:"1px solid ".concat((t.vars||t).palette.action.disabledBackground)},"contained"===n.variant&&{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground})},"text"===n.variant&&{padding:"6px 8px"},"text"===n.variant&&"inherit"!==n.color&&{color:(t.vars||t).palette[n.color].main},"outlined"===n.variant&&{padding:"5px 15px",border:"1px solid currentColor"},"outlined"===n.variant&&"inherit"!==n.color&&{color:(t.vars||t).palette[n.color].main,border:t.vars?"1px solid rgba(".concat(t.vars.palette[n.color].mainChannel," / 0.5)"):"1px solid ".concat((0,Ja.X4)(t.palette[n.color].main,.5))},"contained"===n.variant&&{color:t.vars?t.vars.palette.text.primary:null==(r=(o=t.palette).getContrastText)?void 0:r.call(o,t.palette.grey[300]),backgroundColor:t.vars?t.vars.palette.Button.inheritContainedBg:a,boxShadow:(t.vars||t).shadows[2]},"contained"===n.variant&&"inherit"!==n.color&&{color:(t.vars||t).palette[n.color].contrastText,backgroundColor:(t.vars||t).palette[n.color].main},"inherit"===n.color&&{color:"inherit",borderColor:"currentColor"},"small"===n.size&&"text"===n.variant&&{padding:"4px 5px",fontSize:t.typography.pxToRem(13)},"large"===n.size&&"text"===n.variant&&{padding:"8px 11px",fontSize:t.typography.pxToRem(15)},"small"===n.size&&"outlined"===n.variant&&{padding:"3px 9px",fontSize:t.typography.pxToRem(13)},"large"===n.size&&"outlined"===n.variant&&{padding:"7px 21px",fontSize:t.typography.pxToRem(15)},"small"===n.size&&"contained"===n.variant&&{padding:"4px 10px",fontSize:t.typography.pxToRem(13)},"large"===n.size&&"contained"===n.variant&&{padding:"8px 22px",fontSize:t.typography.pxToRem(15)},n.fullWidth&&{width:"100%"})}),(e=>{let{ownerState:t}=e;return t.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},["&.".concat(rs.focusVisible)]:{boxShadow:"none"},"&:active":{boxShadow:"none"},["&.".concat(rs.disabled)]:{boxShadow:"none"}}})),ss=(0,Qa.Ay)("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,t["iconSize".concat((0,si.A)(n.size))]]}})((e=>{let{ownerState:t}=e;return(0,ba.A)({display:"inherit",marginRight:8,marginLeft:-4},"small"===t.size&&{marginLeft:-2},as(t))})),ls=(0,Qa.Ay)("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,t["iconSize".concat((0,si.A)(n.size))]]}})((e=>{let{ownerState:t}=e;return(0,ba.A)({display:"inherit",marginRight:-4,marginLeft:8},"small"===t.size&&{marginRight:-2},as(t))})),cs=r.forwardRef((function(e,t){const n=r.useContext(di),o=r.useContext(ui),a=(0,gi.A)(n,e),i=(0,ti.b)({props:a,name:"MuiButton"}),{children:s,color:l="primary",component:c="button",className:d,disabled:u=!1,disableElevation:h=!1,disableFocusRipple:p=!1,endIcon:f,focusVisibleClassName:m,fullWidth:g=!1,size:x="medium",startIcon:b,type:v,variant:y="text"}=i,w=(0,nr.A)(i,os),k=(0,ba.A)({},i,{color:l,component:c,disabled:u,disableElevation:h,disableFocusRipple:p,fullWidth:g,size:x,type:v,variant:y}),S=(e=>{const{color:t,disableElevation:n,fullWidth:r,size:o,variant:a,classes:i}=e,s={root:["root",a,"".concat(a).concat((0,si.A)(t)),"size".concat((0,si.A)(o)),"".concat(a,"Size").concat((0,si.A)(o)),"color".concat((0,si.A)(t)),n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon","iconSize".concat((0,si.A)(o))],endIcon:["icon","endIcon","iconSize".concat((0,si.A)(o))]},l=(0,Za.A)(s,ns,i);return(0,ba.A)({},i,l)})(k),j=b&&(0,ka.jsx)(ss,{className:S.startIcon,ownerState:k,children:b}),A=f&&(0,ka.jsx)(ls,{className:S.endIcon,ownerState:k,children:f}),C=o||"";return(0,ka.jsxs)(is,(0,ba.A)({ownerState:k,className:(0,za.A)(n.className,S.root,d,C),component:c,disabled:u,focusRipple:!p,focusVisibleClassName:(0,za.A)(S.focusVisible,m),ref:t,type:v},w,{classes:S,children:[j,s,A]}))})),ds=cs;function us(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function hs(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(us(e.value)&&""!==e.value||t&&us(e.defaultValue)&&""!==e.defaultValue)}var ps=n(7328);const fs=r.createContext(void 0);function ms(e){return(0,ni.Ay)("MuiFormControl",e)}(0,$a.A)("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const gs=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],xs=(0,Qa.Ay)("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return(0,ba.A)({},t.root,t["margin".concat((0,si.A)(n.margin))],n.fullWidth&&t.fullWidth)}})((e=>{let{ownerState:t}=e;return(0,ba.A)({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},"normal"===t.margin&&{marginTop:16,marginBottom:8},"dense"===t.margin&&{marginTop:8,marginBottom:4},t.fullWidth&&{width:"100%"})})),bs=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiFormControl"}),{children:o,className:a,color:i="primary",component:s="div",disabled:l=!1,error:c=!1,focused:d,fullWidth:u=!1,hiddenLabel:h=!1,margin:p="none",required:f=!1,size:m="medium",variant:g="outlined"}=n,x=(0,nr.A)(n,gs),b=(0,ba.A)({},n,{color:i,component:s,disabled:l,error:c,fullWidth:u,hiddenLabel:h,margin:p,required:f,size:m,variant:g}),v=(e=>{const{classes:t,margin:n,fullWidth:r}=e,o={root:["root","none"!==n&&"margin".concat((0,si.A)(n)),r&&"fullWidth"]};return(0,Za.A)(o,ms,t)})(b),[y,w]=r.useState((()=>{let e=!1;return o&&r.Children.forEach(o,(t=>{if(!(0,ps.A)(t,["Input","Select"]))return;const n=(0,ps.A)(t,["Select"])?t.props.input:t;n&&n.props.startAdornment&&(e=!0)})),e})),[k,S]=r.useState((()=>{let e=!1;return o&&r.Children.forEach(o,(t=>{(0,ps.A)(t,["Input","Select"])&&(hs(t.props,!0)||hs(t.props.inputProps,!0))&&(e=!0)})),e})),[j,A]=r.useState(!1);l&&j&&A(!1);const C=void 0===d||l?j:d;let _;const E=r.useMemo((()=>({adornedStart:y,setAdornedStart:w,color:i,disabled:l,error:c,filled:k,focused:C,fullWidth:u,hiddenLabel:h,size:m,onBlur:()=>{A(!1)},onEmpty:()=>{S(!1)},onFilled:()=>{S(!0)},onFocus:()=>{A(!0)},registerEffect:_,required:f,variant:g})),[y,i,l,c,k,C,u,h,_,f,m,g]);return(0,ka.jsx)(fs.Provider,{value:E,children:(0,ka.jsx)(xs,(0,ba.A)({as:s,ownerState:b,className:(0,za.A)(v.root,a),ref:t},x,{children:o}))})})),vs=bs;function ys(e){let{props:t,states:n,muiFormControl:r}=e;return n.reduce(((e,n)=>(e[n]=t[n],r&&"undefined"===typeof t[n]&&(e[n]=r[n]),e)),{})}function ws(){return r.useContext(fs)}function ks(e){return(0,ni.Ay)("MuiFormLabel",e)}const Ss=(0,$a.A)("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),js=["children","className","color","component","disabled","error","filled","focused","required"],As=(0,Qa.Ay)("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return(0,ba.A)({},t.root,"secondary"===n.color&&t.colorSecondary,n.filled&&t.filled)}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({color:(t.vars||t).palette.text.secondary},t.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",["&.".concat(Ss.focused)]:{color:(t.vars||t).palette[n.color].main},["&.".concat(Ss.disabled)]:{color:(t.vars||t).palette.text.disabled},["&.".concat(Ss.error)]:{color:(t.vars||t).palette.error.main}})})),Cs=(0,Qa.Ay)("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})((e=>{let{theme:t}=e;return{["&.".concat(Ss.error)]:{color:(t.vars||t).palette.error.main}}})),_s=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiFormLabel"}),{children:r,className:o,component:a="label"}=n,i=(0,nr.A)(n,js),s=ys({props:n,muiFormControl:ws(),states:["color","required","focused","disabled","error","filled"]}),l=(0,ba.A)({},n,{color:s.color||"primary",component:a,disabled:s.disabled,error:s.error,filled:s.filled,focused:s.focused,required:s.required}),c=(e=>{const{classes:t,color:n,focused:r,disabled:o,error:a,filled:i,required:s}=e,l={root:["root","color".concat((0,si.A)(n)),o&&"disabled",a&&"error",i&&"filled",r&&"focused",s&&"required"],asterisk:["asterisk",a&&"error"]};return(0,Za.A)(l,ks,t)})(l);return(0,ka.jsxs)(As,(0,ba.A)({as:a,ownerState:l,className:(0,za.A)(c.root,o),ref:t},i,{children:[r,s.required&&(0,ka.jsxs)(Cs,{ownerState:l,"aria-hidden":!0,className:c.asterisk,children:["\u2009","*"]})]}))})),Es=_s;function Ms(e){return(0,ni.Ay)("MuiInputLabel",e)}(0,$a.A)("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Ns=["disableAnimation","margin","shrink","variant","className"],Rs=(0,Qa.Ay)(Es,{shouldForwardProp:e=>(0,xi.A)(e)||"classes"===e,name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{["& .".concat(Ss.asterisk)]:t.asterisk},t.root,n.formControl&&t.formControl,"small"===n.size&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},n.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},"small"===n.size&&{transform:"translate(0, 17px) scale(1)"},n.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!n.disableAnimation&&{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})},"filled"===n.variant&&(0,ba.A)({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},"small"===n.size&&{transform:"translate(12px, 13px) scale(1)"},n.shrink&&(0,ba.A)({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},"small"===n.size&&{transform:"translate(12px, 4px) scale(0.75)"})),"outlined"===n.variant&&(0,ba.A)({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},"small"===n.size&&{transform:"translate(14px, 9px) scale(1)"},n.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))})),Ps=r.forwardRef((function(e,t){const n=(0,ti.b)({name:"MuiInputLabel",props:e}),{disableAnimation:r=!1,shrink:o,className:a}=n,i=(0,nr.A)(n,Ns),s=ws();let l=o;"undefined"===typeof l&&s&&(l=s.filled||s.focused||s.adornedStart);const c=ys({props:n,muiFormControl:s,states:["size","variant","required","focused"]}),d=(0,ba.A)({},n,{disableAnimation:r,formControl:s,shrink:l,size:c.size,variant:c.variant,required:c.required,focused:c.focused}),u=(e=>{const{classes:t,formControl:n,size:r,shrink:o,disableAnimation:a,variant:i,required:s}=e,l={root:["root",n&&"formControl",!a&&"animated",o&&"shrink",r&&"normal"!==r&&"size".concat((0,si.A)(r)),i],asterisk:[s&&"asterisk"]},c=(0,Za.A)(l,Ms,t);return(0,ba.A)({},t,c)})(d);return(0,ka.jsx)(Rs,(0,ba.A)({"data-shrink":l,ownerState:d,ref:t,className:(0,za.A)(u.root,a)},i,{classes:u}))}));var Os=n(9172);function Ts(e){var t;return parseInt(r.version,10)>=19?(null==e||null==(t=e.props)?void 0:t.ref)||null:(null==e?void 0:e.ref)||null}var Ls=n(7868),Is=n(5844),zs=n(2427),Ds=n(3462);const Fs=function(e){return"string"===typeof e};const Bs=function(e,t,n){return void 0===e||Fs(e)?t:(0,ba.A)({},t,{ownerState:(0,ba.A)({},t.ownerState,n)})};const Ws=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(void 0===e)return{};const n={};return Object.keys(e).filter((n=>n.match(/^on[A-Z]/)&&"function"===typeof e[n]&&!t.includes(n))).forEach((t=>{n[t]=e[t]})),n};const Hs=function(e){if(void 0===e)return{};const t={};return Object.keys(e).filter((t=>!(t.match(/^on[A-Z]/)&&"function"===typeof e[t]))).forEach((n=>{t[n]=e[n]})),t};const Vs=function(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:a}=e;if(!t){const e=(0,za.A)(null==n?void 0:n.className,a,null==o?void 0:o.className,null==r?void 0:r.className),t=(0,ba.A)({},null==n?void 0:n.style,null==o?void 0:o.style,null==r?void 0:r.style),i=(0,ba.A)({},n,o,r);return e.length>0&&(i.className=e),Object.keys(t).length>0&&(i.style=t),{props:i,internalRef:void 0}}const i=Ws((0,ba.A)({},o,r)),s=Hs(r),l=Hs(o),c=t(i),d=(0,za.A)(null==c?void 0:c.className,null==n?void 0:n.className,a,null==o?void 0:o.className,null==r?void 0:r.className),u=(0,ba.A)({},null==c?void 0:c.style,null==n?void 0:n.style,null==o?void 0:o.style,null==r?void 0:r.style),h=(0,ba.A)({},c,n,l,s);return d.length>0&&(h.className=d),Object.keys(u).length>0&&(h.style=u),{props:h,internalRef:c.ref}};const Us=function(e,t,n){return"function"===typeof e?e(t,n):e},qs=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];const $s=function(e){var t;const{elementType:n,externalSlotProps:r,ownerState:o,skipResolvingSlotProps:a=!1}=e,i=(0,nr.A)(e,qs),s=a?{}:Us(r,o),{props:l,internalRef:c}=Vs((0,ba.A)({},i,{externalSlotProps:s})),d=(0,Ds.A)(c,null==s?void 0:s.ref,null==(t=e.additionalProps)?void 0:t.ref);return Bs(n,(0,ba.A)({},l,{ref:d}),o)};const Ks=r.createContext({});function Xs(e){return(0,ni.Ay)("MuiList",e)}(0,$a.A)("MuiList",["root","padding","dense","subheader"]);const Ys=["children","className","component","dense","disablePadding","subheader"],Gs=(0,Qa.Ay)("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})((e=>{let{ownerState:t}=e;return(0,ba.A)({listStyle:"none",margin:0,padding:0,position:"relative"},!t.disablePadding&&{paddingTop:8,paddingBottom:8},t.subheader&&{paddingTop:0})})),Zs=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiList"}),{children:o,className:a,component:i="ul",dense:s=!1,disablePadding:l=!1,subheader:c}=n,d=(0,nr.A)(n,Ys),u=r.useMemo((()=>({dense:s})),[s]),h=(0,ba.A)({},n,{component:i,dense:s,disablePadding:l}),p=(e=>{const{classes:t,disablePadding:n,dense:r,subheader:o}=e,a={root:["root",!n&&"padding",r&&"dense",o&&"subheader"]};return(0,Za.A)(a,Xs,t)})(h);return(0,ka.jsx)(Ks.Provider,{value:u,children:(0,ka.jsxs)(Gs,(0,ba.A)({as:i,className:(0,za.A)(p.root,a),ref:t,ownerState:h},d,{children:[c,o]}))})}));function Js(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}const Qs=Js;var el=n(5013);const tl=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function nl(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function rl(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function ol(e,t){if(void 0===t)return!0;let n=e.innerText;return void 0===n&&(n=e.textContent),n=n.trim().toLowerCase(),0!==n.length&&(t.repeating?n[0]===t.keys[0]:0===n.indexOf(t.keys.join("")))}function al(e,t,n,r,o,a){let i=!1,s=o(e,t,!!t&&n);for(;s;){if(s===e.firstChild){if(i)return!1;i=!0}const t=!r&&(s.disabled||"true"===s.getAttribute("aria-disabled"));if(s.hasAttribute("tabindex")&&ol(s,a)&&!t)return s.focus(),!0;s=o(e,s,n)}return!1}const il=r.forwardRef((function(e,t){const{actions:n,autoFocus:o=!1,autoFocusItem:a=!1,children:i,className:s,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:d,variant:u="selectedMenu"}=e,h=(0,nr.A)(e,tl),p=r.useRef(null),f=r.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});(0,el.A)((()=>{o&&p.current.focus()}),[o]),r.useImperativeHandle(n,(()=>({adjustStyleForScrollbar:(e,t)=>{let{direction:n}=t;const r=!p.current.style.width;if(e.clientHeight<p.current.clientHeight&&r){const t="".concat(Qs((0,zs.A)(e)),"px");p.current.style["rtl"===n?"paddingLeft":"paddingRight"]=t,p.current.style.width="calc(100% + ".concat(t,")")}return p.current}})),[]);const m=(0,bi.A)(p,t);let g=-1;r.Children.forEach(i,((e,t)=>{r.isValidElement(e)?(e.props.disabled||("selectedMenu"===u&&e.props.selected||-1===g)&&(g=t),g===t&&(e.props.disabled||e.props.muiSkipListHighlight||e.type.muiSkipListHighlight)&&(g+=1,g>=i.length&&(g=-1))):g===t&&(g+=1,g>=i.length&&(g=-1))}));const x=r.Children.map(i,((e,t)=>{if(t===g){const t={};return a&&(t.autoFocus=!0),void 0===e.props.tabIndex&&"selectedMenu"===u&&(t.tabIndex=0),r.cloneElement(e,t)}return e}));return(0,ka.jsx)(Zs,(0,ba.A)({role:"menu",ref:m,className:s,onKeyDown:e=>{const t=p.current,n=e.key,r=(0,zs.A)(t).activeElement;if("ArrowDown"===n)e.preventDefault(),al(t,r,c,l,nl);else if("ArrowUp"===n)e.preventDefault(),al(t,r,c,l,rl);else if("Home"===n)e.preventDefault(),al(t,null,c,l,nl);else if("End"===n)e.preventDefault(),al(t,null,c,l,rl);else if(1===n.length){const o=f.current,a=n.toLowerCase(),i=performance.now();o.keys.length>0&&(i-o.lastTime>500?(o.keys=[],o.repeating=!0,o.previousKeyMatched=!0):o.repeating&&a!==o.keys[0]&&(o.repeating=!1)),o.lastTime=i,o.keys.push(a);const s=r&&!o.repeating&&ol(r,o);o.previousKeyMatched&&(s||al(t,r,!1,l,nl,o))?e.preventDefault():o.previousKeyMatched=!1}d&&d(e)},tabIndex:o?0:-1},h,{children:x}))})),sl=il;var ll=n(950),cl=n(6078),dl=n(7950);const ul=!1;var hl="unmounted",pl="exited",fl="entering",ml="entered",gl="exiting",xl=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,a=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?a?(o=pl,r.appearStatus=fl):o=ml:o=t.unmountOnExit||t.mountOnEnter?hl:pl,r.state={status:o},r.nextCallback=null,r}Si(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===hl?{status:pl}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==fl&&n!==ml&&(t=fl):n!==fl&&n!==ml||(t=gl)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!==typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===fl){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:dl.findDOMNode(this);n&&function(e){e.scrollTop}(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===pl&&this.setState({status:hl})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[dl.findDOMNode(this),r],a=o[0],i=o[1],s=this.getTimeouts(),l=r?s.appear:s.enter;!e&&!n||ul?this.safeSetState({status:ml},(function(){t.props.onEntered(a)})):(this.props.onEnter(a,i),this.safeSetState({status:fl},(function(){t.props.onEntering(a,i),t.onTransitionEnd(l,(function(){t.safeSetState({status:ml},(function(){t.props.onEntered(a,i)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:dl.findDOMNode(this);t&&!ul?(this.props.onExit(r),this.safeSetState({status:gl},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:pl},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:pl},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:dl.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=o[0],i=o[1];this.props.addEndListener(a,i)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===hl)return null;var t=this.props,n=t.children,o=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,(0,nr.A)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return r.createElement(ji.Provider,{value:null},"function"===typeof n?n(e,o):r.cloneElement(r.Children.only(n),o))},t}(r.Component);function bl(){}xl.contextType=ji,xl.propTypes={},xl.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:bl,onEntering:bl,onEntered:bl,onExit:bl,onExiting:bl,onExited:bl},xl.UNMOUNTED=hl,xl.EXITED=pl,xl.ENTERING=fl,xl.ENTERED=ml,xl.EXITING=gl;const vl=xl;var yl=n(5170);function wl(){const e=Va(yl.A);return e[Ta.A]||e}const kl=e=>e.scrollTop;function Sl(e,t){var n,r;const{timeout:o,easing:a,style:i={}}=e;return{duration:null!=(n=i.transitionDuration)?n:"number"===typeof o?o:o[t.mode]||0,easing:null!=(r=i.transitionTimingFunction)?r:"object"===typeof a?a[t.mode]:a,delay:i.transitionDelay}}const jl=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function Al(e){return"scale(".concat(e,", ").concat(e**2,")")}const Cl={entering:{opacity:1,transform:Al(1)},entered:{opacity:1,transform:"none"}},_l="undefined"!==typeof navigator&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),El=r.forwardRef((function(e,t){const{addEndListener:n,appear:o=!0,children:a,easing:i,in:s,onEnter:l,onEntered:c,onEntering:d,onExit:u,onExited:h,onExiting:p,style:f,timeout:m="auto",TransitionComponent:g=vl}=e,x=(0,nr.A)(e,jl),b=(0,Pi.A)(),v=r.useRef(),y=wl(),w=r.useRef(null),k=(0,bi.A)(w,Ts(a),t),S=e=>t=>{if(e){const n=w.current;void 0===t?e(n):e(n,t)}},j=S(d),A=S(((e,t)=>{kl(e);const{duration:n,delay:r,easing:o}=Sl({style:f,timeout:m,easing:i},{mode:"enter"});let a;"auto"===m?(a=y.transitions.getAutoHeightDuration(e.clientHeight),v.current=a):a=n,e.style.transition=[y.transitions.create("opacity",{duration:a,delay:r}),y.transitions.create("transform",{duration:_l?a:.666*a,delay:r,easing:o})].join(","),l&&l(e,t)})),C=S(c),_=S(p),E=S((e=>{const{duration:t,delay:n,easing:r}=Sl({style:f,timeout:m,easing:i},{mode:"exit"});let o;"auto"===m?(o=y.transitions.getAutoHeightDuration(e.clientHeight),v.current=o):o=t,e.style.transition=[y.transitions.create("opacity",{duration:o,delay:n}),y.transitions.create("transform",{duration:_l?o:.666*o,delay:_l?n:n||.333*o,easing:r})].join(","),e.style.opacity=0,e.style.transform=Al(.75),u&&u(e)})),M=S(h);return(0,ka.jsx)(g,(0,ba.A)({appear:o,in:s,nodeRef:w,onEnter:A,onEntered:C,onEntering:j,onExit:E,onExited:M,onExiting:_,addEndListener:e=>{"auto"===m&&b.start(v.current||0,e),n&&n(w.current,e)},timeout:"auto"===m?null:m},x,{children:(e,t)=>r.cloneElement(a,(0,ba.A)({style:(0,ba.A)({opacity:0,transform:Al(.75),visibility:"exited"!==e||s?void 0:"hidden"},Cl[e],f,a.props.style),ref:k},t))}))}));El.muiSupportAuto=!0;const Ml=El;var Nl=n(1668);const Rl=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Pl(e){const t=[],n=[];return Array.from(e.querySelectorAll(Rl)).forEach(((e,r)=>{const o=function(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?"true"===e.contentEditable||("AUDIO"===e.nodeName||"VIDEO"===e.nodeName||"DETAILS"===e.nodeName)&&null===e.getAttribute("tabindex")?0:e.tabIndex:t}(e);-1!==o&&function(e){return!(e.disabled||"INPUT"===e.tagName&&"hidden"===e.type||function(e){if("INPUT"!==e.tagName||"radio"!==e.type)return!1;if(!e.name)return!1;const t=t=>e.ownerDocument.querySelector('input[type="radio"]'.concat(t));let n=t('[name="'.concat(e.name,'"]:checked'));return n||(n=t('[name="'.concat(e.name,'"]'))),n!==e}(e))}(e)&&(0===o?t.push(e):n.push({documentOrder:r,tabIndex:o,node:e}))})),n.sort(((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex)).map((e=>e.node)).concat(t)}function Ol(){return!0}const Tl=function(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:o=!1,disableRestoreFocus:a=!1,getTabbable:i=Pl,isEnabled:s=Ol,open:l}=e,c=r.useRef(!1),d=r.useRef(null),u=r.useRef(null),h=r.useRef(null),p=r.useRef(null),f=r.useRef(!1),m=r.useRef(null),g=(0,Ds.A)(Ts(t),m),x=r.useRef(null);r.useEffect((()=>{l&&m.current&&(f.current=!n)}),[n,l]),r.useEffect((()=>{if(!l||!m.current)return;const e=(0,Nl.A)(m.current);return m.current.contains(e.activeElement)||(m.current.hasAttribute("tabIndex")||m.current.setAttribute("tabIndex","-1"),f.current&&m.current.focus()),()=>{a||(h.current&&h.current.focus&&(c.current=!0,h.current.focus()),h.current=null)}}),[l]),r.useEffect((()=>{if(!l||!m.current)return;const e=(0,Nl.A)(m.current),t=t=>{x.current=t,!o&&s()&&"Tab"===t.key&&e.activeElement===m.current&&t.shiftKey&&(c.current=!0,u.current&&u.current.focus())},n=()=>{const t=m.current;if(null===t)return;if(!e.hasFocus()||!s()||c.current)return void(c.current=!1);if(t.contains(e.activeElement))return;if(o&&e.activeElement!==d.current&&e.activeElement!==u.current)return;if(e.activeElement!==p.current)p.current=null;else if(null!==p.current)return;if(!f.current)return;let n=[];if(e.activeElement!==d.current&&e.activeElement!==u.current||(n=i(m.current)),n.length>0){var r,a;const e=Boolean((null==(r=x.current)?void 0:r.shiftKey)&&"Tab"===(null==(a=x.current)?void 0:a.key)),t=n[0],o=n[n.length-1];"string"!==typeof t&&"string"!==typeof o&&(e?o.focus():t.focus())}else t.focus()};e.addEventListener("focusin",n),e.addEventListener("keydown",t,!0);const r=setInterval((()=>{e.activeElement&&"BODY"===e.activeElement.tagName&&n()}),50);return()=>{clearInterval(r),e.removeEventListener("focusin",n),e.removeEventListener("keydown",t,!0)}}),[n,o,a,s,l,i]);const b=e=>{null===h.current&&(h.current=e.relatedTarget),f.current=!0};return(0,ka.jsxs)(r.Fragment,{children:[(0,ka.jsx)("div",{tabIndex:l?0:-1,onFocus:b,ref:d,"data-testid":"sentinelStart"}),r.cloneElement(t,{ref:g,onFocus:e=>{null===h.current&&(h.current=e.relatedTarget),f.current=!0,p.current=e.target;const n=t.props.onFocus;n&&n(e)}}),(0,ka.jsx)("div",{tabIndex:l?0:-1,onFocus:b,ref:u,"data-testid":"sentinelEnd"})]})};var Ll=n(4440),Il=n(6564);const zl=r.forwardRef((function(e,t){const{children:n,container:o,disablePortal:a=!1}=e,[i,s]=r.useState(null),l=(0,Ds.A)(r.isValidElement(n)?Ts(n):null,t);if((0,Ll.A)((()=>{a||s(function(e){return"function"===typeof e?e():e}(o)||document.body)}),[o,a]),(0,Ll.A)((()=>{if(i&&!a)return(0,Il.A)(t,i),()=>{(0,Il.A)(t,null)}}),[t,i,a]),a){if(r.isValidElement(n)){const e={ref:l};return r.cloneElement(n,e)}return(0,ka.jsx)(r.Fragment,{children:n})}return(0,ka.jsx)(r.Fragment,{children:i?dl.createPortal(n,i):i})})),Dl=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],Fl={entering:{opacity:1},entered:{opacity:1}},Bl=r.forwardRef((function(e,t){const n=wl(),o={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:a,appear:i=!0,children:s,easing:l,in:c,onEnter:d,onEntered:u,onEntering:h,onExit:p,onExited:f,onExiting:m,style:g,timeout:x=o,TransitionComponent:b=vl}=e,v=(0,nr.A)(e,Dl),y=r.useRef(null),w=(0,bi.A)(y,Ts(s),t),k=e=>t=>{if(e){const n=y.current;void 0===t?e(n):e(n,t)}},S=k(h),j=k(((e,t)=>{kl(e);const r=Sl({style:g,timeout:x,easing:l},{mode:"enter"});e.style.webkitTransition=n.transitions.create("opacity",r),e.style.transition=n.transitions.create("opacity",r),d&&d(e,t)})),A=k(u),C=k(m),_=k((e=>{const t=Sl({style:g,timeout:x,easing:l},{mode:"exit"});e.style.webkitTransition=n.transitions.create("opacity",t),e.style.transition=n.transitions.create("opacity",t),p&&p(e)})),E=k(f);return(0,ka.jsx)(b,(0,ba.A)({appear:i,in:c,nodeRef:y,onEnter:j,onEntered:A,onEntering:S,onExit:_,onExited:E,onExiting:C,addEndListener:e=>{a&&a(y.current,e)},timeout:x},v,{children:(e,t)=>r.cloneElement(s,(0,ba.A)({style:(0,ba.A)({opacity:0,visibility:"exited"!==e||c?void 0:"hidden"},Fl[e],g,s.props.style),ref:w},t))}))})),Wl=Bl;function Hl(e){return(0,ni.Ay)("MuiBackdrop",e)}(0,$a.A)("MuiBackdrop",["root","invisible"]);const Vl=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],Ul=(0,Qa.Ay)("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})((e=>{let{ownerState:t}=e;return(0,ba.A)({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},t.invisible&&{backgroundColor:"transparent"})})),ql=r.forwardRef((function(e,t){var n,r,o;const a=(0,ti.b)({props:e,name:"MuiBackdrop"}),{children:i,className:s,component:l="div",components:c={},componentsProps:d={},invisible:u=!1,open:h,slotProps:p={},slots:f={},TransitionComponent:m=Wl,transitionDuration:g}=a,x=(0,nr.A)(a,Vl),b=(0,ba.A)({},a,{component:l,invisible:u}),v=(e=>{const{classes:t,invisible:n}=e,r={root:["root",n&&"invisible"]};return(0,Za.A)(r,Hl,t)})(b),y=null!=(n=p.root)?n:d.root;return(0,ka.jsx)(m,(0,ba.A)({in:h,timeout:g},x,{children:(0,ka.jsx)(Ul,(0,ba.A)({"aria-hidden":!0},y,{as:null!=(r=null!=(o=f.root)?o:c.Root)?r:l,className:(0,za.A)(v.root,s,null==y?void 0:y.className),ownerState:(0,ba.A)({},b,null==y?void 0:y.ownerState),classes:v,ref:t,children:i}))}))}));var $l=n(1782),Kl=n(2456),Xl=n(3940);function Yl(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function Gl(e){return parseInt((0,Xl.A)(e).getComputedStyle(e).paddingRight,10)||0}function Zl(e,t,n,r,o){const a=[t,n,...r];[].forEach.call(e.children,(e=>{const t=-1===a.indexOf(e),n=!function(e){const t=-1!==["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName),n="INPUT"===e.tagName&&"hidden"===e.getAttribute("type");return t||n}(e);t&&n&&Yl(e,o)}))}function Jl(e,t){let n=-1;return e.some(((e,r)=>!!t(e)&&(n=r,!0))),n}function Ql(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(function(e){const t=(0,Nl.A)(e);return t.body===e?(0,Xl.A)(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(r)){const e=Js((0,Nl.A)(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight="".concat(Gl(r)+e,"px");const t=(0,Nl.A)(r).querySelectorAll(".mui-fixed");[].forEach.call(t,(t=>{n.push({value:t.style.paddingRight,property:"padding-right",el:t}),t.style.paddingRight="".concat(Gl(t)+e,"px")}))}let e;if(r.parentNode instanceof DocumentFragment)e=(0,Nl.A)(r).body;else{const t=r.parentElement,n=(0,Xl.A)(r);e="HTML"===(null==t?void 0:t.nodeName)&&"scroll"===n.getComputedStyle(t).overflowY?t:r}n.push({value:e.style.overflow,property:"overflow",el:e},{value:e.style.overflowX,property:"overflow-x",el:e},{value:e.style.overflowY,property:"overflow-y",el:e}),e.style.overflow="hidden"}return()=>{n.forEach((e=>{let{value:t,el:n,property:r}=e;t?n.style.setProperty(r,t):n.style.removeProperty(r)}))}}const ec=new class{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,t){let n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&Yl(e.modalRef,!1);const r=function(e){const t=[];return[].forEach.call(e.children,(e=>{"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);Zl(t,e.mount,e.modalRef,r,!0);const o=Jl(this.containers,(e=>e.container===t));return-1!==o?(this.containers[o].modals.push(e),n):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:r}),n)}mount(e,t){const n=Jl(this.containers,(t=>-1!==t.modals.indexOf(e))),r=this.containers[n];r.restore||(r.restore=Ql(r,t))}remove(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.modals.indexOf(e);if(-1===n)return n;const r=Jl(this.containers,(t=>-1!==t.modals.indexOf(e))),o=this.containers[r];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(n,1),0===o.modals.length)o.restore&&o.restore(),e.modalRef&&Yl(e.modalRef,t),Zl(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(r,1);else{const e=o.modals[o.modals.length-1];e.modalRef&&Yl(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}};const tc=function(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:o=!1,manager:a=ec,closeAfterTransition:i=!1,onTransitionEnter:s,onTransitionExited:l,children:c,onClose:d,open:u,rootRef:h}=e,p=r.useRef({}),f=r.useRef(null),m=r.useRef(null),g=(0,Ds.A)(m,h),[x,b]=r.useState(!u),v=function(e){return!!e&&e.props.hasOwnProperty("in")}(c);let y=!0;"false"!==e["aria-hidden"]&&!1!==e["aria-hidden"]||(y=!1);const w=()=>(p.current.modalRef=m.current,p.current.mount=f.current,p.current),k=()=>{a.mount(w(),{disableScrollLock:o}),m.current&&(m.current.scrollTop=0)},S=(0,$l.A)((()=>{const e=function(e){return"function"===typeof e?e():e}(t)||(0,Nl.A)(f.current).body;a.add(w(),e),m.current&&k()})),j=r.useCallback((()=>a.isTopModal(w())),[a]),A=(0,$l.A)((e=>{f.current=e,e&&(u&&j()?k():m.current&&Yl(m.current,y))})),C=r.useCallback((()=>{a.remove(w(),y)}),[y,a]);r.useEffect((()=>()=>{C()}),[C]),r.useEffect((()=>{u?S():v&&i||C()}),[u,C,v,i,S]);const _=e=>t=>{var r;null==(r=e.onKeyDown)||r.call(e,t),"Escape"===t.key&&229!==t.which&&j()&&(n||(t.stopPropagation(),d&&d(t,"escapeKeyDown")))},E=e=>t=>{var n;null==(n=e.onClick)||n.call(e,t),t.target===t.currentTarget&&d&&d(t,"backdropClick")};return{getRootProps:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=Ws(e);delete n.onTransitionEnter,delete n.onTransitionExited;const r=(0,ba.A)({},n,t);return(0,ba.A)({role:"presentation"},r,{onKeyDown:_(r),ref:g})},getBackdropProps:function(){const e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,ba.A)({"aria-hidden":!0},e,{onClick:E(e),open:u})},getTransitionProps:()=>({onEnter:(0,Kl.A)((()=>{b(!1),s&&s()}),null==c?void 0:c.props.onEnter),onExited:(0,Kl.A)((()=>{b(!0),l&&l(),i&&C()}),null==c?void 0:c.props.onExited)}),rootRef:g,portalRef:A,isTopModal:j,exited:x,hasTransition:v}};function nc(e){return(0,ni.Ay)("MuiModal",e)}(0,$a.A)("MuiModal",["root","hidden","backdrop"]);const rc=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],oc=(0,Qa.Ay)("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0},!n.open&&n.exited&&{visibility:"hidden"})})),ac=(0,Qa.Ay)(ql,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),ic=r.forwardRef((function(e,t){var n,o,a,i,s,l;const c=(0,ti.b)({name:"MuiModal",props:e}),{BackdropComponent:d=ac,BackdropProps:u,className:h,closeAfterTransition:p=!1,children:f,container:m,component:g,components:x={},componentsProps:b={},disableAutoFocus:v=!1,disableEnforceFocus:y=!1,disableEscapeKeyDown:w=!1,disablePortal:k=!1,disableRestoreFocus:S=!1,disableScrollLock:j=!1,hideBackdrop:A=!1,keepMounted:C=!1,onBackdropClick:_,open:E,slotProps:M,slots:N}=c,R=(0,nr.A)(c,rc),P=(0,ba.A)({},c,{closeAfterTransition:p,disableAutoFocus:v,disableEnforceFocus:y,disableEscapeKeyDown:w,disablePortal:k,disableRestoreFocus:S,disableScrollLock:j,hideBackdrop:A,keepMounted:C}),{getRootProps:O,getBackdropProps:T,getTransitionProps:L,portalRef:I,isTopModal:z,exited:D,hasTransition:F}=tc((0,ba.A)({},P,{rootRef:t})),B=(0,ba.A)({},P,{exited:D}),W=(e=>{const{open:t,exited:n,classes:r}=e,o={root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]};return(0,Za.A)(o,nc,r)})(B),H={};if(void 0===f.props.tabIndex&&(H.tabIndex="-1"),F){const{onEnter:e,onExited:t}=L();H.onEnter=e,H.onExited=t}const V=null!=(n=null!=(o=null==N?void 0:N.root)?o:x.Root)?n:oc,U=null!=(a=null!=(i=null==N?void 0:N.backdrop)?i:x.Backdrop)?a:d,q=null!=(s=null==M?void 0:M.root)?s:b.root,$=null!=(l=null==M?void 0:M.backdrop)?l:b.backdrop,K=$s({elementType:V,externalSlotProps:q,externalForwardedProps:R,getSlotProps:O,additionalProps:{ref:t,as:g},ownerState:B,className:(0,za.A)(h,null==q?void 0:q.className,null==W?void 0:W.root,!B.open&&B.exited&&(null==W?void 0:W.hidden))}),X=$s({elementType:U,externalSlotProps:$,additionalProps:u,getSlotProps:e=>T((0,ba.A)({},e,{onClick:t=>{_&&_(t),null!=e&&e.onClick&&e.onClick(t)}})),className:(0,za.A)(null==$?void 0:$.className,null==u?void 0:u.className,null==W?void 0:W.backdrop),ownerState:B});return C||E||F&&!D?(0,ka.jsx)(zl,{ref:I,container:m,disablePortal:k,children:(0,ka.jsxs)(V,(0,ba.A)({},K,{children:[!A&&d?(0,ka.jsx)(U,(0,ba.A)({},X)):null,(0,ka.jsx)(Tl,{disableEnforceFocus:y,disableAutoFocus:v,disableRestoreFocus:S,isEnabled:z,open:E,children:r.cloneElement(f,H)})]}))}):null})),sc=ic;function lc(e){return(0,ni.Ay)("MuiPopover",e)}(0,$a.A)("MuiPopover",["root","paper"]);const cc=["onEntering"],dc=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],uc=["slotProps"];function hc(e,t){let n=0;return"number"===typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function pc(e,t){let n=0;return"number"===typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function fc(e){return[e.horizontal,e.vertical].map((e=>"number"===typeof e?"".concat(e,"px"):e)).join(" ")}function mc(e){return"function"===typeof e?e():e}const gc=(0,Qa.Ay)(sc,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),xc=(0,Qa.Ay)(ii,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),bc=r.forwardRef((function(e,t){var n,o,a;const i=(0,ti.b)({props:e,name:"MuiPopover"}),{action:s,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:d,anchorReference:u="anchorEl",children:h,className:p,container:f,elevation:m=8,marginThreshold:g=16,open:x,PaperProps:b={},slots:v,slotProps:y,transformOrigin:w={vertical:"top",horizontal:"left"},TransitionComponent:k=Ml,transitionDuration:S="auto",TransitionProps:{onEntering:j}={},disableScrollLock:A=!1}=i,C=(0,nr.A)(i.TransitionProps,cc),_=(0,nr.A)(i,dc),E=null!=(n=null==y?void 0:y.paper)?n:b,M=r.useRef(),N=(0,bi.A)(M,E.ref),R=(0,ba.A)({},i,{anchorOrigin:c,anchorReference:u,elevation:m,marginThreshold:g,externalPaperSlotProps:E,transformOrigin:w,TransitionComponent:k,transitionDuration:S,TransitionProps:C}),P=(e=>{const{classes:t}=e;return(0,Za.A)({root:["root"],paper:["paper"]},lc,t)})(R),O=r.useCallback((()=>{if("anchorPosition"===u)return d;const e=mc(l),t=(e&&1===e.nodeType?e:(0,zs.A)(M.current).body).getBoundingClientRect();return{top:t.top+hc(t,c.vertical),left:t.left+pc(t,c.horizontal)}}),[l,c.horizontal,c.vertical,d,u]),T=r.useCallback((e=>({vertical:hc(e,w.vertical),horizontal:pc(e,w.horizontal)})),[w.horizontal,w.vertical]),L=r.useCallback((e=>{const t={width:e.offsetWidth,height:e.offsetHeight},n=T(t);if("none"===u)return{top:null,left:null,transformOrigin:fc(n)};const r=O();let o=r.top-n.vertical,a=r.left-n.horizontal;const i=o+t.height,s=a+t.width,c=(0,cl.A)(mc(l)),d=c.innerHeight-g,h=c.innerWidth-g;if(null!==g&&o<g){const e=o-g;o-=e,n.vertical+=e}else if(null!==g&&i>d){const e=i-d;o-=e,n.vertical+=e}if(null!==g&&a<g){const e=a-g;a-=e,n.horizontal+=e}else if(s>h){const e=s-h;a-=e,n.horizontal+=e}return{top:"".concat(Math.round(o),"px"),left:"".concat(Math.round(a),"px"),transformOrigin:fc(n)}}),[l,u,O,T,g]),[I,z]=r.useState(x),D=r.useCallback((()=>{const e=M.current;if(!e)return;const t=L(e);null!==t.top&&(e.style.top=t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,z(!0)}),[L]);r.useEffect((()=>(A&&window.addEventListener("scroll",D),()=>window.removeEventListener("scroll",D))),[l,A,D]);r.useEffect((()=>{x&&D()})),r.useImperativeHandle(s,(()=>x?{updatePosition:()=>{D()}}:null),[x,D]),r.useEffect((()=>{if(!x)return;const e=(0,ll.A)((()=>{D()})),t=(0,cl.A)(l);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}}),[l,x,D]);let F=S;"auto"!==S||k.muiSupportAuto||(F=void 0);const B=f||(l?(0,zs.A)(mc(l)).body:void 0),W=null!=(o=null==v?void 0:v.root)?o:gc,H=null!=(a=null==v?void 0:v.paper)?a:xc,V=$s({elementType:H,externalSlotProps:(0,ba.A)({},E,{style:I?E.style:(0,ba.A)({},E.style,{opacity:0})}),additionalProps:{elevation:m,ref:N},ownerState:R,className:(0,za.A)(P.paper,null==E?void 0:E.className)}),U=$s({elementType:W,externalSlotProps:(null==y?void 0:y.root)||{},externalForwardedProps:_,additionalProps:{ref:t,slotProps:{backdrop:{invisible:!0}},container:B,open:x},ownerState:R,className:(0,za.A)(P.root,p)}),{slotProps:q}=U,$=(0,nr.A)(U,uc);return(0,ka.jsx)(W,(0,ba.A)({},$,!Fs(W)&&{slotProps:q,disableScrollLock:A},{children:(0,ka.jsx)(k,(0,ba.A)({appear:!0,in:x,onEntering:(e,t)=>{j&&j(e,t),D()},onExited:()=>{z(!1)},timeout:F},C,{children:(0,ka.jsx)(H,(0,ba.A)({},V,{children:h}))}))}))})),vc=bc;function yc(e){return(0,ni.Ay)("MuiMenu",e)}(0,$a.A)("MuiMenu",["root","paper","list"]);const wc=["onEntering"],kc=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],Sc={vertical:"top",horizontal:"right"},jc={vertical:"top",horizontal:"left"},Ac=(0,Qa.Ay)(vc,{shouldForwardProp:e=>(0,xi.A)(e)||"classes"===e,name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Cc=(0,Qa.Ay)(xc,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),_c=(0,Qa.Ay)(sl,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),Ec=r.forwardRef((function(e,t){var n,o;const a=(0,ti.b)({props:e,name:"MuiMenu"}),{autoFocus:i=!0,children:s,className:l,disableAutoFocusItem:c=!1,MenuListProps:d={},onClose:u,open:h,PaperProps:p={},PopoverClasses:f,transitionDuration:m="auto",TransitionProps:{onEntering:g}={},variant:x="selectedMenu",slots:b={},slotProps:v={}}=a,y=(0,nr.A)(a.TransitionProps,wc),w=(0,nr.A)(a,kc),k=Ea(),S=(0,ba.A)({},a,{autoFocus:i,disableAutoFocusItem:c,MenuListProps:d,onEntering:g,PaperProps:p,transitionDuration:m,TransitionProps:y,variant:x}),j=(e=>{const{classes:t}=e;return(0,Za.A)({root:["root"],paper:["paper"],list:["list"]},yc,t)})(S),A=i&&!c&&h,C=r.useRef(null);let _=-1;r.Children.map(s,((e,t)=>{r.isValidElement(e)&&(e.props.disabled||("selectedMenu"===x&&e.props.selected||-1===_)&&(_=t))}));const E=null!=(n=b.paper)?n:Cc,M=null!=(o=v.paper)?o:p,N=$s({elementType:b.root,externalSlotProps:v.root,ownerState:S,className:[j.root,l]}),R=$s({elementType:E,externalSlotProps:M,ownerState:S,className:j.paper});return(0,ka.jsx)(Ac,(0,ba.A)({onClose:u,anchorOrigin:{vertical:"bottom",horizontal:k?"right":"left"},transformOrigin:k?Sc:jc,slots:{paper:E,root:b.root},slotProps:{root:N,paper:R},open:h,ref:t,transitionDuration:m,TransitionProps:(0,ba.A)({onEntering:(e,t)=>{C.current&&C.current.adjustStyleForScrollbar(e,{direction:k?"rtl":"ltr"}),g&&g(e,t)}},y),ownerState:S},w,{classes:f,children:(0,ka.jsx)(_c,(0,ba.A)({onKeyDown:e=>{"Tab"===e.key&&(e.preventDefault(),u&&u(e,"tabKeyDown"))},actions:C,autoFocus:i&&(-1===_||c),autoFocusItem:A,variant:x},d,{className:(0,za.A)(j.list,d.className),children:s}))}))})),Mc=Ec;function Nc(e){return(0,ni.Ay)("MuiNativeSelect",e)}const Rc=(0,$a.A)("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Pc=["className","disabled","error","IconComponent","inputRef","variant"],Oc=e=>{let{ownerState:t,theme:n}=e;return(0,ba.A)({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":(0,ba.A)({},n.vars?{backgroundColor:"rgba(".concat(n.vars.palette.common.onBackgroundChannel," / 0.05)")}:{backgroundColor:"light"===n.palette.mode?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},["&.".concat(Rc.disabled)]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(n.vars||n).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},"filled"===t.variant&&{"&&&":{paddingRight:32}},"outlined"===t.variant&&{borderRadius:(n.vars||n).shape.borderRadius,"&:focus":{borderRadius:(n.vars||n).shape.borderRadius},"&&&":{paddingRight:32}})},Tc=(0,Qa.Ay)("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:xi.A,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{["&.".concat(Rc.multiple)]:t.multiple}]}})(Oc),Lc=e=>{let{ownerState:t,theme:n}=e;return(0,ba.A)({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(n.vars||n).palette.action.active,["&.".concat(Rc.disabled)]:{color:(n.vars||n).palette.action.disabled}},t.open&&{transform:"rotate(180deg)"},"filled"===t.variant&&{right:7},"outlined"===t.variant&&{right:7})},Ic=(0,Qa.Ay)("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t["icon".concat((0,si.A)(n.variant))],n.open&&t.iconOpen]}})(Lc),zc=r.forwardRef((function(e,t){const{className:n,disabled:o,error:a,IconComponent:i,inputRef:s,variant:l="standard"}=e,c=(0,nr.A)(e,Pc),d=(0,ba.A)({},e,{disabled:o,variant:l,error:a}),u=(e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:a,error:i}=e,s={select:["select",n,r&&"disabled",o&&"multiple",i&&"error"],icon:["icon","icon".concat((0,si.A)(n)),a&&"iconOpen",r&&"disabled"]};return(0,Za.A)(s,Nc,t)})(d);return(0,ka.jsxs)(r.Fragment,{children:[(0,ka.jsx)(Tc,(0,ba.A)({ownerState:d,className:(0,za.A)(u.select,n),disabled:o,ref:s||t},c)),e.multiple?null:(0,ka.jsx)(Ic,{as:i,ownerState:d,className:u.icon})]})}));var Dc=n(7123),Fc=n(5420);function Bc(e){return(0,ni.Ay)("MuiSelect",e)}const Wc=(0,$a.A)("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Hc;const Vc=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],Uc=(0,Qa.Ay)("div",{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{["&.".concat(Wc.select)]:t.select},{["&.".concat(Wc.select)]:t[n.variant]},{["&.".concat(Wc.error)]:t.error},{["&.".concat(Wc.multiple)]:t.multiple}]}})(Oc,{["&.".concat(Wc.select)]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),qc=(0,Qa.Ay)("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t["icon".concat((0,si.A)(n.variant))],n.open&&t.iconOpen]}})(Lc),$c=(0,Qa.Ay)("input",{shouldForwardProp:e=>(0,Dc.A)(e)&&"classes"!==e,name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function Kc(e,t){return"object"===typeof t&&null!==t?e===t:String(e)===String(t)}function Xc(e){return null==e||"string"===typeof e&&!e.trim()}const Yc=r.forwardRef((function(e,t){var n;const{"aria-describedby":o,"aria-label":a,autoFocus:i,autoWidth:s,children:l,className:c,defaultOpen:d,defaultValue:u,disabled:h,displayEmpty:p,error:f=!1,IconComponent:m,inputRef:g,labelId:x,MenuProps:b={},multiple:v,name:y,onBlur:w,onChange:k,onClose:S,onFocus:j,onOpen:A,open:C,readOnly:_,renderValue:E,SelectDisplayProps:M={},tabIndex:N,value:R,variant:P="standard"}=e,O=(0,nr.A)(e,Vc),[T,L]=(0,Fc.A)({controlled:R,default:u,name:"Select"}),[I,z]=(0,Fc.A)({controlled:C,default:d,name:"Select"}),D=r.useRef(null),F=r.useRef(null),[B,W]=r.useState(null),{current:H}=r.useRef(null!=C),[V,U]=r.useState(),q=(0,bi.A)(t,g),$=r.useCallback((e=>{F.current=e,e&&W(e)}),[]),K=null==B?void 0:B.parentNode;r.useImperativeHandle(q,(()=>({focus:()=>{F.current.focus()},node:D.current,value:T})),[T]),r.useEffect((()=>{d&&I&&B&&!H&&(U(s?null:K.clientWidth),F.current.focus())}),[B,s]),r.useEffect((()=>{i&&F.current.focus()}),[i]),r.useEffect((()=>{if(!x)return;const e=(0,zs.A)(F.current).getElementById(x);if(e){const t=()=>{getSelection().isCollapsed&&F.current.focus()};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}}),[x]);const X=(e,t)=>{e?A&&A(t):S&&S(t),H||(U(s?null:K.clientWidth),z(e))},Y=r.Children.toArray(l),G=e=>t=>{let n;if(t.currentTarget.hasAttribute("tabindex")){if(v){n=Array.isArray(T)?T.slice():[];const t=T.indexOf(e.props.value);-1===t?n.push(e.props.value):n.splice(t,1)}else n=e.props.value;if(e.props.onClick&&e.props.onClick(t),T!==n&&(L(n),k)){const r=t.nativeEvent||t,o=new r.constructor(r.type,r);Object.defineProperty(o,"target",{writable:!0,value:{value:n,name:y}}),k(o,e)}v||X(!1,t)}},Z=null!==B&&I;let J,Q;delete O["aria-invalid"];const ee=[];let te=!1,ne=!1;(hs({value:T})||p)&&(E?J=E(T):te=!0);const re=Y.map((e=>{if(!r.isValidElement(e))return null;let t;if(v){if(!Array.isArray(T))throw new Error((0,Ls.A)(2));t=T.some((t=>Kc(t,e.props.value))),t&&te&&ee.push(e.props.children)}else t=Kc(T,e.props.value),t&&te&&(Q=e.props.children);return t&&(ne=!0),r.cloneElement(e,{"aria-selected":t?"true":"false",onClick:G(e),onKeyUp:t=>{" "===t.key&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:"option",selected:t,value:void 0,"data-value":e.props.value})}));te&&(J=v?0===ee.length?null:ee.reduce(((e,t,n)=>(e.push(t),n<ee.length-1&&e.push(", "),e)),[]):Q);let oe,ae=V;!s&&H&&B&&(ae=K.clientWidth),oe="undefined"!==typeof N?N:h?null:0;const ie=M.id||(y?"mui-component-select-".concat(y):void 0),se=(0,ba.A)({},e,{variant:P,value:T,open:Z,error:f}),le=(e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:a,error:i}=e,s={select:["select",n,r&&"disabled",o&&"multiple",i&&"error"],icon:["icon","icon".concat((0,si.A)(n)),a&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return(0,Za.A)(s,Bc,t)})(se),ce=(0,ba.A)({},b.PaperProps,null==(n=b.slotProps)?void 0:n.paper),de=(0,Is.A)();return(0,ka.jsxs)(r.Fragment,{children:[(0,ka.jsx)(Uc,(0,ba.A)({ref:$,tabIndex:oe,role:"combobox","aria-controls":de,"aria-disabled":h?"true":void 0,"aria-expanded":Z?"true":"false","aria-haspopup":"listbox","aria-label":a,"aria-labelledby":[x,ie].filter(Boolean).join(" ")||void 0,"aria-describedby":o,onKeyDown:e=>{if(!_){-1!==[" ","ArrowUp","ArrowDown","Enter"].indexOf(e.key)&&(e.preventDefault(),X(!0,e))}},onMouseDown:h||_?null:e=>{0===e.button&&(e.preventDefault(),F.current.focus(),X(!0,e))},onBlur:e=>{!Z&&w&&(Object.defineProperty(e,"target",{writable:!0,value:{value:T,name:y}}),w(e))},onFocus:j},M,{ownerState:se,className:(0,za.A)(M.className,le.select,c),id:ie,children:Xc(J)?Hc||(Hc=(0,ka.jsx)("span",{className:"notranslate",children:"\u200b"})):J})),(0,ka.jsx)($c,(0,ba.A)({"aria-invalid":f,value:Array.isArray(T)?T.join(","):T,name:y,ref:D,"aria-hidden":!0,onChange:e=>{const t=Y.find((t=>t.props.value===e.target.value));void 0!==t&&(L(t.props.value),k&&k(e,t))},tabIndex:-1,disabled:h,className:le.nativeInput,autoFocus:i,ownerState:se},O)),(0,ka.jsx)(qc,{as:m,className:le.icon,ownerState:se}),(0,ka.jsx)(Mc,(0,ba.A)({id:"menu-".concat(y||""),anchorEl:K,open:Z,onClose:e=>{X(!1,e)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},b,{MenuListProps:(0,ba.A)({"aria-labelledby":x,role:"listbox","aria-multiselectable":v?"true":void 0,disableListWrap:!0,id:de},b.MenuListProps),slotProps:(0,ba.A)({},b.slotProps,{paper:(0,ba.A)({},ce,{style:(0,ba.A)({minWidth:ae},null!=ce?ce.style:null)})}),children:re}))]})})),Gc=Yc;var Zc=n(9662);const Jc=(0,Zc.A)((0,ka.jsx)("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");var Qc=n(3468);const ed=["onChange","maxRows","minRows","style","value"];function td(e){return parseInt(e,10)||0}const nd={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"};function rd(e){return function(e){for(const t in e)return!1;return!0}(e)||0===e.outerHeightStyle&&!e.overflowing}const od=r.forwardRef((function(e,t){const{onChange:n,maxRows:o,minRows:a=1,style:i,value:s}=e,l=(0,nr.A)(e,ed),{current:c}=r.useRef(null!=s),d=r.useRef(null),u=(0,Ds.A)(t,d),h=r.useRef(null),p=r.useRef(null),f=r.useCallback((()=>{const t=d.current,n=p.current;if(!t||!n)return;const r=(0,Xl.A)(t).getComputedStyle(t);if("0px"===r.width)return{outerHeightStyle:0,overflowing:!1};n.style.width=r.width,n.value=t.value||e.placeholder||"x","\n"===n.value.slice(-1)&&(n.value+=" ");const i=r.boxSizing,s=td(r.paddingBottom)+td(r.paddingTop),l=td(r.borderBottomWidth)+td(r.borderTopWidth),c=n.scrollHeight;n.value="x";const u=n.scrollHeight;let h=c;a&&(h=Math.max(Number(a)*u,h)),o&&(h=Math.min(Number(o)*u,h)),h=Math.max(h,u);return{outerHeightStyle:h+("border-box"===i?s+l:0),overflowing:Math.abs(h-c)<=1}}),[o,a,e.placeholder]),m=(0,$l.A)((()=>{const e=d.current,t=f();if(!e||!t||rd(t))return!1;const n=t.outerHeightStyle;return null!=h.current&&h.current!==n})),g=r.useCallback((()=>{const e=d.current,t=f();if(!e||!t||rd(t))return;const n=t.outerHeightStyle;h.current!==n&&(h.current=n,e.style.height="".concat(n,"px")),e.style.overflow=t.overflowing?"hidden":""}),[f]),x=r.useRef(-1);(0,Ll.A)((()=>{const e=(0,Qc.A)(g),t=null==d?void 0:d.current;if(!t)return;const n=(0,Xl.A)(t);let r;return n.addEventListener("resize",e),"undefined"!==typeof ResizeObserver&&(r=new ResizeObserver((()=>{m()&&(r.unobserve(t),cancelAnimationFrame(x.current),g(),x.current=requestAnimationFrame((()=>{r.observe(t)})))})),r.observe(t)),()=>{e.clear(),cancelAnimationFrame(x.current),n.removeEventListener("resize",e),r&&r.disconnect()}}),[f,g,m]),(0,Ll.A)((()=>{g()}));return(0,ka.jsxs)(r.Fragment,{children:[(0,ka.jsx)("textarea",(0,ba.A)({value:s,onChange:e=>{c||g(),n&&n(e)},ref:u,rows:a,style:i},l)),(0,ka.jsx)("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:p,tabIndex:-1,style:(0,ba.A)({},nd,i,{paddingTop:0,paddingBottom:0})})]})})),ad=od;var id=n(869);const sd=function(e){let{styles:t,themeId:n,defaultTheme:r={}}=e;const o=Va(r),a="function"===typeof t?t(n&&o[n]||o):t;return(0,ka.jsx)(id.A,{styles:a})};const ld=function(e){return(0,ka.jsx)(sd,(0,ba.A)({},e,{defaultTheme:yl.A,themeId:Ta.A}))};function cd(e){return(0,ni.Ay)("MuiInputBase",e)}const dd=(0,$a.A)("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),ud=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],hd=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,"small"===n.size&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t["color".concat((0,si.A)(n.color))],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},pd=(e,t)=>{const{ownerState:n}=e;return[t.input,"small"===n.size&&t.inputSizeSmall,n.multiline&&t.inputMultiline,"search"===n.type&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},fd=(0,Qa.Ay)("div",{name:"MuiInputBase",slot:"Root",overridesResolver:hd})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({},t.typography.body1,{color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",["&.".concat(dd.disabled)]:{color:(t.vars||t).palette.text.disabled,cursor:"default"}},n.multiline&&(0,ba.A)({padding:"4px 0 5px"},"small"===n.size&&{paddingTop:1}),n.fullWidth&&{width:"100%"})})),md=(0,Qa.Ay)("input",{name:"MuiInputBase",slot:"Input",overridesResolver:pd})((e=>{let{theme:t,ownerState:n}=e;const r="light"===t.palette.mode,o=(0,ba.A)({color:"currentColor"},t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5},{transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})}),a={opacity:"0 !important"},i=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5};return(0,ba.A)({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":o,"&::-moz-placeholder":o,"&:-ms-input-placeholder":o,"&::-ms-input-placeholder":o,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},["label[data-shrink=false] + .".concat(dd.formControl," &")]:{"&::-webkit-input-placeholder":a,"&::-moz-placeholder":a,"&:-ms-input-placeholder":a,"&::-ms-input-placeholder":a,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus:-ms-input-placeholder":i,"&:focus::-ms-input-placeholder":i},["&.".concat(dd.disabled)]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},"small"===n.size&&{paddingTop:1},n.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},"search"===n.type&&{MozAppearance:"textfield"})})),gd=(0,ka.jsx)(ld,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),xd=r.forwardRef((function(e,t){var n;const o=(0,ti.b)({props:e,name:"MuiInputBase"}),{"aria-describedby":a,autoComplete:i,autoFocus:s,className:l,components:c={},componentsProps:d={},defaultValue:u,disabled:h,disableInjectingGlobalStyles:p,endAdornment:f,fullWidth:m=!1,id:g,inputComponent:x="input",inputProps:b={},inputRef:v,maxRows:y,minRows:w,multiline:k=!1,name:S,onBlur:j,onChange:A,onClick:C,onFocus:_,onKeyDown:E,onKeyUp:M,placeholder:N,readOnly:R,renderSuffix:P,rows:O,slotProps:T={},slots:L={},startAdornment:I,type:z="text",value:D}=o,F=(0,nr.A)(o,ud),B=null!=b.value?b.value:D,{current:W}=r.useRef(null!=B),H=r.useRef(),V=r.useCallback((e=>{0}),[]),U=(0,bi.A)(H,v,b.ref,V),[q,$]=r.useState(!1),K=ws();const X=ys({props:o,muiFormControl:K,states:["color","disabled","error","hiddenLabel","size","required","filled"]});X.focused=K?K.focused:q,r.useEffect((()=>{!K&&h&&q&&($(!1),j&&j())}),[K,h,q,j]);const Y=K&&K.onFilled,G=K&&K.onEmpty,Z=r.useCallback((e=>{hs(e)?Y&&Y():G&&G()}),[Y,G]);(0,el.A)((()=>{W&&Z({value:B})}),[B,Z,W]);r.useEffect((()=>{Z(H.current)}),[]);let J=x,Q=b;k&&"input"===J&&(Q=O?(0,ba.A)({type:void 0,minRows:O,maxRows:O},Q):(0,ba.A)({type:void 0,maxRows:y,minRows:w},Q),J=ad);r.useEffect((()=>{K&&K.setAdornedStart(Boolean(I))}),[K,I]);const ee=(0,ba.A)({},o,{color:X.color||"primary",disabled:X.disabled,endAdornment:f,error:X.error,focused:X.focused,formControl:K,fullWidth:m,hiddenLabel:X.hiddenLabel,multiline:k,size:X.size,startAdornment:I,type:z}),te=(e=>{const{classes:t,color:n,disabled:r,error:o,endAdornment:a,focused:i,formControl:s,fullWidth:l,hiddenLabel:c,multiline:d,readOnly:u,size:h,startAdornment:p,type:f}=e,m={root:["root","color".concat((0,si.A)(n)),r&&"disabled",o&&"error",l&&"fullWidth",i&&"focused",s&&"formControl",h&&"medium"!==h&&"size".concat((0,si.A)(h)),d&&"multiline",p&&"adornedStart",a&&"adornedEnd",c&&"hiddenLabel",u&&"readOnly"],input:["input",r&&"disabled","search"===f&&"inputTypeSearch",d&&"inputMultiline","small"===h&&"inputSizeSmall",c&&"inputHiddenLabel",p&&"inputAdornedStart",a&&"inputAdornedEnd",u&&"readOnly"]};return(0,Za.A)(m,cd,t)})(ee),ne=L.root||c.Root||fd,re=T.root||d.root||{},oe=L.input||c.Input||md;return Q=(0,ba.A)({},Q,null!=(n=T.input)?n:d.input),(0,ka.jsxs)(r.Fragment,{children:[!p&&gd,(0,ka.jsxs)(ne,(0,ba.A)({},re,!Fs(ne)&&{ownerState:(0,ba.A)({},ee,re.ownerState)},{ref:t,onClick:e=>{H.current&&e.currentTarget===e.target&&H.current.focus(),C&&C(e)}},F,{className:(0,za.A)(te.root,re.className,l,R&&"MuiInputBase-readOnly"),children:[I,(0,ka.jsx)(fs.Provider,{value:null,children:(0,ka.jsx)(oe,(0,ba.A)({ownerState:ee,"aria-invalid":X.error,"aria-describedby":a,autoComplete:i,autoFocus:s,defaultValue:u,disabled:X.disabled,id:g,onAnimationStart:e=>{Z("mui-auto-fill-cancel"===e.animationName?H.current:{value:"x"})},name:S,placeholder:N,readOnly:R,required:X.required,rows:O,value:B,onKeyDown:E,onKeyUp:M,type:z},Q,!Fs(oe)&&{as:J,ownerState:(0,ba.A)({},ee,Q.ownerState)},{ref:U,className:(0,za.A)(te.input,Q.className,R&&"MuiInputBase-readOnly"),onBlur:e=>{j&&j(e),b.onBlur&&b.onBlur(e),K&&K.onBlur?K.onBlur(e):$(!1)},onChange:function(e){if(!W){const t=e.target||H.current;if(null==t)throw new Error((0,Ls.A)(1));Z({value:t.value})}for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];b.onChange&&b.onChange(e,...n),A&&A(e,...n)},onFocus:e=>{X.disabled?e.stopPropagation():(_&&_(e),b.onFocus&&b.onFocus(e),K&&K.onFocus?K.onFocus(e):$(!0))}}))}),f,P?P((0,ba.A)({},X,{startAdornment:I})):null]}))]})})),bd=xd;function vd(e){return(0,ni.Ay)("MuiInput",e)}const yd=(0,ba.A)({},dd,(0,$a.A)("MuiInput",["root","underline","input"])),wd=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],kd=(0,Qa.Ay)(fd,{shouldForwardProp:e=>(0,xi.A)(e)||"classes"===e,name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...hd(e,t),!n.disableUnderline&&t.underline]}})((e=>{let{theme:t,ownerState:n}=e;let r="light"===t.palette.mode?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(r="rgba(".concat(t.vars.palette.common.onBackgroundChannel," / ").concat(t.vars.opacity.inputUnderline,")")),(0,ba.A)({position:"relative"},n.formControl&&{"label + &":{marginTop:16}},!n.disableUnderline&&{"&::after":{borderBottom:"2px solid ".concat((t.vars||t).palette[n.color].main),left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},["&.".concat(yd.focused,":after")]:{transform:"scaleX(1) translateX(0)"},["&.".concat(yd.error)]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:"1px solid ".concat(r),left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},["&:hover:not(.".concat(yd.disabled,", .").concat(yd.error,"):before")]:{borderBottom:"2px solid ".concat((t.vars||t).palette.text.primary),"@media (hover: none)":{borderBottom:"1px solid ".concat(r)}},["&.".concat(yd.disabled,":before")]:{borderBottomStyle:"dotted"}})})),Sd=(0,Qa.Ay)(md,{name:"MuiInput",slot:"Input",overridesResolver:pd})({}),jd=r.forwardRef((function(e,t){var n,r,o,a;const i=(0,ti.b)({props:e,name:"MuiInput"}),{disableUnderline:s,components:l={},componentsProps:c,fullWidth:d=!1,inputComponent:u="input",multiline:h=!1,slotProps:p,slots:f={},type:m="text"}=i,g=(0,nr.A)(i,wd),x=(e=>{const{classes:t,disableUnderline:n}=e,r={root:["root",!n&&"underline"],input:["input"]},o=(0,Za.A)(r,vd,t);return(0,ba.A)({},t,o)})(i),b={root:{ownerState:{disableUnderline:s}}},v=(null!=p?p:c)?(0,Os.A)(null!=p?p:c,b):b,y=null!=(n=null!=(r=f.root)?r:l.Root)?n:kd,w=null!=(o=null!=(a=f.input)?a:l.Input)?o:Sd;return(0,ka.jsx)(bd,(0,ba.A)({slots:{root:y,input:w},slotProps:v,fullWidth:d,inputComponent:u,multiline:h,ref:t,type:m},g,{classes:x}))}));jd.muiName="Input";const Ad=jd;function Cd(e){return(0,ni.Ay)("MuiFilledInput",e)}const _d=(0,ba.A)({},dd,(0,$a.A)("MuiFilledInput",["root","underline","input"])),Ed=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],Md=(0,Qa.Ay)(fd,{shouldForwardProp:e=>(0,xi.A)(e)||"classes"===e,name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...hd(e,t),!n.disableUnderline&&t.underline]}})((e=>{let{theme:t,ownerState:n}=e;var r;const o="light"===t.palette.mode,a=o?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",i=o?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",s=o?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",l=o?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return(0,ba.A)({position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:i,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:s,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:i}},["&.".concat(_d.focused)]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:i},["&.".concat(_d.disabled)]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:l}},!n.disableUnderline&&{"&::after":{borderBottom:"2px solid ".concat(null==(r=(t.vars||t).palette[n.color||"primary"])?void 0:r.main),left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},["&.".concat(_d.focused,":after")]:{transform:"scaleX(1) translateX(0)"},["&.".concat(_d.error)]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:"1px solid ".concat(t.vars?"rgba(".concat(t.vars.palette.common.onBackgroundChannel," / ").concat(t.vars.opacity.inputUnderline,")"):a),left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},["&:hover:not(.".concat(_d.disabled,", .").concat(_d.error,"):before")]:{borderBottom:"1px solid ".concat((t.vars||t).palette.text.primary)},["&.".concat(_d.disabled,":before")]:{borderBottomStyle:"dotted"}},n.startAdornment&&{paddingLeft:12},n.endAdornment&&{paddingRight:12},n.multiline&&(0,ba.A)({padding:"25px 12px 8px"},"small"===n.size&&{paddingTop:21,paddingBottom:4},n.hiddenLabel&&{paddingTop:16,paddingBottom:17},n.hiddenLabel&&"small"===n.size&&{paddingTop:8,paddingBottom:9}))})),Nd=(0,Qa.Ay)(md,{name:"MuiFilledInput",slot:"Input",overridesResolver:pd})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===t.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===t.palette.mode?null:"#fff",caretColor:"light"===t.palette.mode?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},"small"===n.size&&{paddingTop:21,paddingBottom:4},n.hiddenLabel&&{paddingTop:16,paddingBottom:17},n.startAdornment&&{paddingLeft:0},n.endAdornment&&{paddingRight:0},n.hiddenLabel&&"small"===n.size&&{paddingTop:8,paddingBottom:9},n.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})})),Rd=r.forwardRef((function(e,t){var n,r,o,a;const i=(0,ti.b)({props:e,name:"MuiFilledInput"}),{components:s={},componentsProps:l,fullWidth:c=!1,inputComponent:d="input",multiline:u=!1,slotProps:h,slots:p={},type:f="text"}=i,m=(0,nr.A)(i,Ed),g=(0,ba.A)({},i,{fullWidth:c,inputComponent:d,multiline:u,type:f}),x=(e=>{const{classes:t,disableUnderline:n}=e,r={root:["root",!n&&"underline"],input:["input"]},o=(0,Za.A)(r,Cd,t);return(0,ba.A)({},t,o)})(i),b={root:{ownerState:g},input:{ownerState:g}},v=(null!=h?h:l)?(0,Os.A)(b,null!=h?h:l):b,y=null!=(n=null!=(r=p.root)?r:s.Root)?n:Md,w=null!=(o=null!=(a=p.input)?a:s.Input)?o:Nd;return(0,ka.jsx)(bd,(0,ba.A)({slots:{root:y,input:w},componentsProps:v,fullWidth:c,inputComponent:d,multiline:u,ref:t,type:f},m,{classes:x}))}));Rd.muiName="Input";const Pd=Rd;var Od;const Td=["children","classes","className","label","notched"],Ld=(0,Qa.Ay)("fieldset",{shouldForwardProp:xi.A})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),Id=(0,Qa.Ay)("legend",{shouldForwardProp:xi.A})((e=>{let{ownerState:t,theme:n}=e;return(0,ba.A)({float:"unset",width:"auto",overflow:"hidden"},!t.withLabel&&{padding:0,lineHeight:"11px",transition:n.transitions.create("width",{duration:150,easing:n.transitions.easing.easeOut})},t.withLabel&&(0,ba.A)({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:n.transitions.create("max-width",{duration:50,easing:n.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},t.notched&&{maxWidth:"100%",transition:n.transitions.create("max-width",{duration:100,easing:n.transitions.easing.easeOut,delay:50})}))}));function zd(e){return(0,ni.Ay)("MuiOutlinedInput",e)}const Dd=(0,ba.A)({},dd,(0,$a.A)("MuiOutlinedInput",["root","notchedOutline","input"])),Fd=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],Bd=(0,Qa.Ay)(fd,{shouldForwardProp:e=>(0,xi.A)(e)||"classes"===e,name:"MuiOutlinedInput",slot:"Root",overridesResolver:hd})((e=>{let{theme:t,ownerState:n}=e;const r="light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return(0,ba.A)({position:"relative",borderRadius:(t.vars||t).shape.borderRadius,["&:hover .".concat(Dd.notchedOutline)]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{["&:hover .".concat(Dd.notchedOutline)]:{borderColor:t.vars?"rgba(".concat(t.vars.palette.common.onBackgroundChannel," / 0.23)"):r}},["&.".concat(Dd.focused," .").concat(Dd.notchedOutline)]:{borderColor:(t.vars||t).palette[n.color].main,borderWidth:2},["&.".concat(Dd.error," .").concat(Dd.notchedOutline)]:{borderColor:(t.vars||t).palette.error.main},["&.".concat(Dd.disabled," .").concat(Dd.notchedOutline)]:{borderColor:(t.vars||t).palette.action.disabled}},n.startAdornment&&{paddingLeft:14},n.endAdornment&&{paddingRight:14},n.multiline&&(0,ba.A)({padding:"16.5px 14px"},"small"===n.size&&{padding:"8.5px 14px"}))})),Wd=(0,Qa.Ay)((function(e){const{className:t,label:n,notched:r}=e,o=(0,nr.A)(e,Td),a=null!=n&&""!==n,i=(0,ba.A)({},e,{notched:r,withLabel:a});return(0,ka.jsx)(Ld,(0,ba.A)({"aria-hidden":!0,className:t,ownerState:i},o,{children:(0,ka.jsx)(Id,{ownerState:i,children:a?(0,ka.jsx)("span",{children:n}):Od||(Od=(0,ka.jsx)("span",{className:"notranslate",children:"\u200b"}))})}))}),{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})((e=>{let{theme:t}=e;const n="light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?"rgba(".concat(t.vars.palette.common.onBackgroundChannel," / 0.23)"):n}})),Hd=(0,Qa.Ay)(md,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:pd})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({padding:"16.5px 14px"},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===t.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===t.palette.mode?null:"#fff",caretColor:"light"===t.palette.mode?null:"#fff",borderRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},"small"===n.size&&{padding:"8.5px 14px"},n.multiline&&{padding:0},n.startAdornment&&{paddingLeft:0},n.endAdornment&&{paddingRight:0})})),Vd=r.forwardRef((function(e,t){var n,o,a,i,s;const l=(0,ti.b)({props:e,name:"MuiOutlinedInput"}),{components:c={},fullWidth:d=!1,inputComponent:u="input",label:h,multiline:p=!1,notched:f,slots:m={},type:g="text"}=l,x=(0,nr.A)(l,Fd),b=(e=>{const{classes:t}=e,n=(0,Za.A)({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},zd,t);return(0,ba.A)({},t,n)})(l),v=ws(),y=ys({props:l,muiFormControl:v,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),w=(0,ba.A)({},l,{color:y.color||"primary",disabled:y.disabled,error:y.error,focused:y.focused,formControl:v,fullWidth:d,hiddenLabel:y.hiddenLabel,multiline:p,size:y.size,type:g}),k=null!=(n=null!=(o=m.root)?o:c.Root)?n:Bd,S=null!=(a=null!=(i=m.input)?i:c.Input)?a:Hd;return(0,ka.jsx)(bd,(0,ba.A)({slots:{root:k,input:S},renderSuffix:e=>(0,ka.jsx)(Wd,{ownerState:w,className:b.notchedOutline,label:null!=h&&""!==h&&y.required?s||(s=(0,ka.jsxs)(r.Fragment,{children:[h,"\u2009","*"]})):h,notched:"undefined"!==typeof f?f:Boolean(e.startAdornment||e.filled||e.focused)}),fullWidth:d,inputComponent:u,multiline:p,ref:t,type:g},x,{classes:(0,ba.A)({},b,{notchedOutline:null})}))}));Vd.muiName="Input";const Ud=Vd,qd=["autoWidth","children","classes","className","defaultOpen","displayEmpty","IconComponent","id","input","inputProps","label","labelId","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"],$d=["root"],Kd={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>(0,xi.A)(e)&&"variant"!==e,slot:"Root"},Xd=(0,Qa.Ay)(Ad,Kd)(""),Yd=(0,Qa.Ay)(Ud,Kd)(""),Gd=(0,Qa.Ay)(Pd,Kd)(""),Zd=r.forwardRef((function(e,t){const n=(0,ti.b)({name:"MuiSelect",props:e}),{autoWidth:o=!1,children:a,classes:i={},className:s,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:d=Jc,id:u,input:h,inputProps:p,label:f,labelId:m,MenuProps:g,multiple:x=!1,native:b=!1,onClose:v,onOpen:y,open:w,renderValue:k,SelectDisplayProps:S,variant:j="outlined"}=n,A=(0,nr.A)(n,qd),C=b?zc:Gc,_=ys({props:n,muiFormControl:ws(),states:["variant","error"]}),E=_.variant||j,M=(0,ba.A)({},n,{variant:E,classes:i}),N=(e=>{const{classes:t}=e;return t})(M),R=(0,nr.A)(N,$d),P=h||{standard:(0,ka.jsx)(Xd,{ownerState:M}),outlined:(0,ka.jsx)(Yd,{label:f,ownerState:M}),filled:(0,ka.jsx)(Gd,{ownerState:M})}[E],O=(0,bi.A)(t,Ts(P));return(0,ka.jsx)(r.Fragment,{children:r.cloneElement(P,(0,ba.A)({inputComponent:C,inputProps:(0,ba.A)({children:a,error:_.error,IconComponent:d,variant:E,type:void 0,multiple:x},b?{id:u}:{autoWidth:o,defaultOpen:l,displayEmpty:c,labelId:m,MenuProps:g,onClose:v,onOpen:y,open:w,renderValue:k,SelectDisplayProps:(0,ba.A)({id:u},S)},p,{classes:p?(0,Os.A)(R,p.classes):R},h?h.props.inputProps:{})},(x&&b||c)&&"outlined"===E?{notched:!0}:{},{ref:O,className:(0,za.A)(P.props.className,s,N.root)},!h&&{variant:E},A))})}));Zd.muiName="Select";const Jd=Zd;function Qd(e){return(0,ni.Ay)("MuiDivider",e)}const eu=(0,$a.A)("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);function tu(e){return(0,ni.Ay)("MuiListItemIcon",e)}const nu=(0,$a.A)("MuiListItemIcon",["root","alignItemsFlexStart"]);function ru(e){return(0,ni.Ay)("MuiListItemText",e)}const ou=(0,$a.A)("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]);function au(e){return(0,ni.Ay)("MuiMenuItem",e)}const iu=(0,$a.A)("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),su=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],lu=(0,Qa.Ay)(ts,{shouldForwardProp:e=>(0,xi.A)(e)||"classes"===e,name:"MuiMenuItem",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({},t.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!n.disableGutters&&{paddingLeft:16,paddingRight:16},n.divider&&{borderBottom:"1px solid ".concat((t.vars||t).palette.divider),backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},["&.".concat(iu.selected)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / ").concat(t.vars.palette.action.selectedOpacity,")"):(0,Ja.X4)(t.palette.primary.main,t.palette.action.selectedOpacity),["&.".concat(iu.focusVisible)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.focusOpacity,"))"):(0,Ja.X4)(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},["&.".concat(iu.selected,":hover")]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.hoverOpacity,"))"):(0,Ja.X4)(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / ").concat(t.vars.palette.action.selectedOpacity,")"):(0,Ja.X4)(t.palette.primary.main,t.palette.action.selectedOpacity)}},["&.".concat(iu.focusVisible)]:{backgroundColor:(t.vars||t).palette.action.focus},["&.".concat(iu.disabled)]:{opacity:(t.vars||t).palette.action.disabledOpacity},["& + .".concat(eu.root)]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},["& + .".concat(eu.inset)]:{marginLeft:52},["& .".concat(ou.root)]:{marginTop:0,marginBottom:0},["& .".concat(ou.inset)]:{paddingLeft:36},["& .".concat(nu.root)]:{minWidth:36}},!n.dense&&{[t.breakpoints.up("sm")]:{minHeight:"auto"}},n.dense&&(0,ba.A)({minHeight:32,paddingTop:4,paddingBottom:4},t.typography.body2,{["& .".concat(nu.root," svg")]:{fontSize:"1.25rem"}}))})),cu=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiMenuItem"}),{autoFocus:o=!1,component:a="li",dense:i=!1,divider:s=!1,disableGutters:l=!1,focusVisibleClassName:c,role:d="menuitem",tabIndex:u,className:h}=n,p=(0,nr.A)(n,su),f=r.useContext(Ks),m=r.useMemo((()=>({dense:i||f.dense||!1,disableGutters:l})),[f.dense,i,l]),g=r.useRef(null);(0,el.A)((()=>{o&&g.current&&g.current.focus()}),[o]);const x=(0,ba.A)({},n,{dense:m.dense,divider:s,disableGutters:l}),b=(e=>{const{disabled:t,dense:n,divider:r,disableGutters:o,selected:a,classes:i}=e,s={root:["root",n&&"dense",t&&"disabled",!o&&"gutters",r&&"divider",a&&"selected"]},l=(0,Za.A)(s,au,i);return(0,ba.A)({},i,l)})(n),v=(0,bi.A)(g,t);let y;return n.disabled||(y=void 0!==u?u:-1),(0,ka.jsx)(Ks.Provider,{value:m,children:(0,ka.jsx)(lu,(0,ba.A)({ref:v,role:d,tabIndex:y,component:a,focusVisibleClassName:(0,za.A)(b.focusVisible,c),className:(0,za.A)(b.root,h)},p,{ownerState:x,classes:b}))})}));var du=n(2374);function uu(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function hu(e){return e instanceof uu(e).Element||e instanceof Element}function pu(e){return e instanceof uu(e).HTMLElement||e instanceof HTMLElement}function fu(e){return"undefined"!==typeof ShadowRoot&&(e instanceof uu(e).ShadowRoot||e instanceof ShadowRoot)}var mu=Math.max,gu=Math.min,xu=Math.round;function bu(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function vu(){return!/^((?!chrome|android).)*safari/i.test(bu())}function yu(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,a=1;t&&pu(e)&&(o=e.offsetWidth>0&&xu(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&xu(r.height)/e.offsetHeight||1);var i=(hu(e)?uu(e):window).visualViewport,s=!vu()&&n,l=(r.left+(s&&i?i.offsetLeft:0))/o,c=(r.top+(s&&i?i.offsetTop:0))/a,d=r.width/o,u=r.height/a;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l,x:l,y:c}}function wu(e){var t=uu(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ku(e){return e?(e.nodeName||"").toLowerCase():null}function Su(e){return((hu(e)?e.ownerDocument:e.document)||window.document).documentElement}function ju(e){return yu(Su(e)).left+wu(e).scrollLeft}function Au(e){return uu(e).getComputedStyle(e)}function Cu(e){var t=Au(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function _u(e,t,n){void 0===n&&(n=!1);var r=pu(t),o=pu(t)&&function(e){var t=e.getBoundingClientRect(),n=xu(t.width)/e.offsetWidth||1,r=xu(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),a=Su(t),i=yu(e,o,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&(("body"!==ku(t)||Cu(a))&&(s=function(e){return e!==uu(e)&&pu(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:wu(e);var t}(t)),pu(t)?((l=yu(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):a&&(l.x=ju(a))),{x:i.left+s.scrollLeft-l.x,y:i.top+s.scrollTop-l.y,width:i.width,height:i.height}}function Eu(e){var t=yu(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Mu(e){return"html"===ku(e)?e:e.assignedSlot||e.parentNode||(fu(e)?e.host:null)||Su(e)}function Nu(e){return["html","body","#document"].indexOf(ku(e))>=0?e.ownerDocument.body:pu(e)&&Cu(e)?e:Nu(Mu(e))}function Ru(e,t){var n;void 0===t&&(t=[]);var r=Nu(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),a=uu(r),i=o?[a].concat(a.visualViewport||[],Cu(r)?r:[]):r,s=t.concat(i);return o?s:s.concat(Ru(Mu(i)))}function Pu(e){return["table","td","th"].indexOf(ku(e))>=0}function Ou(e){return pu(e)&&"fixed"!==Au(e).position?e.offsetParent:null}function Tu(e){for(var t=uu(e),n=Ou(e);n&&Pu(n)&&"static"===Au(n).position;)n=Ou(n);return n&&("html"===ku(n)||"body"===ku(n)&&"static"===Au(n).position)?t:n||function(e){var t=/firefox/i.test(bu());if(/Trident/i.test(bu())&&pu(e)&&"fixed"===Au(e).position)return null;var n=Mu(e);for(fu(n)&&(n=n.host);pu(n)&&["html","body"].indexOf(ku(n))<0;){var r=Au(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var Lu="top",Iu="bottom",zu="right",Du="left",Fu="auto",Bu=[Lu,Iu,zu,Du],Wu="start",Hu="end",Vu="viewport",Uu="popper",qu=Bu.reduce((function(e,t){return e.concat([t+"-"+Wu,t+"-"+Hu])}),[]),$u=[].concat(Bu,[Fu]).reduce((function(e,t){return e.concat([t,t+"-"+Wu,t+"-"+Hu])}),[]),Ku=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Xu(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function Yu(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}var Gu={placement:"bottom",modifiers:[],strategy:"absolute"};function Zu(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"===typeof e.getBoundingClientRect)}))}function Ju(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,a=void 0===o?Gu:o;return function(e,t,n){void 0===n&&(n=a);var o={placement:"bottom",orderedModifiers:[],options:Object.assign({},Gu,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},i=[],s=!1,l={state:o,setOptions:function(n){var s="function"===typeof n?n(o.options):n;c(),o.options=Object.assign({},a,o.options,s),o.scrollParents={reference:hu(e)?Ru(e):e.contextElement?Ru(e.contextElement):[],popper:Ru(t)};var d=function(e){var t=Xu(e);return Ku.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(r,o.options.modifiers)));return o.orderedModifiers=d.filter((function(e){return e.enabled})),o.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,a=e.effect;if("function"===typeof a){var s=a({state:o,name:t,instance:l,options:r}),c=function(){};i.push(s||c)}})),l.update()},forceUpdate:function(){if(!s){var e=o.elements,t=e.reference,n=e.popper;if(Zu(t,n)){o.rects={reference:_u(t,Tu(n),"fixed"===o.options.strategy),popper:Eu(n)},o.reset=!1,o.placement=o.options.placement,o.orderedModifiers.forEach((function(e){return o.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<o.orderedModifiers.length;r++)if(!0!==o.reset){var a=o.orderedModifiers[r],i=a.fn,c=a.options,d=void 0===c?{}:c,u=a.name;"function"===typeof i&&(o=i({state:o,options:d,name:u,instance:l})||o)}else o.reset=!1,r=-1}}},update:Yu((function(){return new Promise((function(e){l.forceUpdate(),e(o)}))})),destroy:function(){c(),s=!0}};if(!Zu(e,t))return l;function c(){i.forEach((function(e){return e()})),i=[]}return l.setOptions(n).then((function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)})),l}}var Qu={passive:!0};function eh(e){return e.split("-")[0]}function th(e){return e.split("-")[1]}function nh(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function rh(e){var t,n=e.reference,r=e.element,o=e.placement,a=o?eh(o):null,i=o?th(o):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(a){case Lu:t={x:s,y:n.y-r.height};break;case Iu:t={x:s,y:n.y+n.height};break;case zu:t={x:n.x+n.width,y:l};break;case Du:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=a?nh(a):null;if(null!=c){var d="y"===c?"height":"width";switch(i){case Wu:t[c]=t[c]-(n[d]/2-r[d]/2);break;case Hu:t[c]=t[c]+(n[d]/2-r[d]/2)}}return t}var oh={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ah(e){var t,n=e.popper,r=e.popperRect,o=e.placement,a=e.variation,i=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,u=e.isFixed,h=i.x,p=void 0===h?0:h,f=i.y,m=void 0===f?0:f,g="function"===typeof d?d({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var x=i.hasOwnProperty("x"),b=i.hasOwnProperty("y"),v=Du,y=Lu,w=window;if(c){var k=Tu(n),S="clientHeight",j="clientWidth";if(k===uu(n)&&"static"!==Au(k=Su(n)).position&&"absolute"===s&&(S="scrollHeight",j="scrollWidth"),o===Lu||(o===Du||o===zu)&&a===Hu)y=Iu,m-=(u&&k===w&&w.visualViewport?w.visualViewport.height:k[S])-r.height,m*=l?1:-1;if(o===Du||(o===Lu||o===Iu)&&a===Hu)v=zu,p-=(u&&k===w&&w.visualViewport?w.visualViewport.width:k[j])-r.width,p*=l?1:-1}var A,C=Object.assign({position:s},c&&oh),_=!0===d?function(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:xu(n*o)/o||0,y:xu(r*o)/o||0}}({x:p,y:m},uu(n)):{x:p,y:m};return p=_.x,m=_.y,l?Object.assign({},C,((A={})[y]=b?"0":"",A[v]=x?"0":"",A.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",A)):Object.assign({},C,((t={})[y]=b?m+"px":"",t[v]=x?p+"px":"",t.transform="",t))}const ih={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];pu(o)&&ku(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});pu(r)&&ku(r)&&(Object.assign(r.style,a),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};const sh={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,a=void 0===o?[0,0]:o,i=$u.reduce((function(e,n){return e[n]=function(e,t,n){var r=eh(e),o=[Du,Lu].indexOf(r)>=0?-1:1,a="function"===typeof n?n(Object.assign({},t,{placement:e})):n,i=a[0],s=a[1];return i=i||0,s=(s||0)*o,[Du,zu].indexOf(r)>=0?{x:s,y:i}:{x:i,y:s}}(n,t.rects,a),e}),{}),s=i[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=i}};var lh={left:"right",right:"left",bottom:"top",top:"bottom"};function ch(e){return e.replace(/left|right|bottom|top/g,(function(e){return lh[e]}))}var dh={start:"end",end:"start"};function uh(e){return e.replace(/start|end/g,(function(e){return dh[e]}))}function hh(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&fu(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ph(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function fh(e,t,n){return t===Vu?ph(function(e,t){var n=uu(e),r=Su(e),o=n.visualViewport,a=r.clientWidth,i=r.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;var c=vu();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s+ju(e),y:l}}(e,n)):hu(t)?function(e,t){var n=yu(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):ph(function(e){var t,n=Su(e),r=wu(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=mu(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=mu(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+ju(e),l=-r.scrollTop;return"rtl"===Au(o||n).direction&&(s+=mu(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:i,x:s,y:l}}(Su(e)))}function mh(e,t,n,r){var o="clippingParents"===t?function(e){var t=Ru(Mu(e)),n=["absolute","fixed"].indexOf(Au(e).position)>=0&&pu(e)?Tu(e):e;return hu(n)?t.filter((function(e){return hu(e)&&hh(e,n)&&"body"!==ku(e)})):[]}(e):[].concat(t),a=[].concat(o,[n]),i=a[0],s=a.reduce((function(t,n){var o=fh(e,n,r);return t.top=mu(o.top,t.top),t.right=gu(o.right,t.right),t.bottom=gu(o.bottom,t.bottom),t.left=mu(o.left,t.left),t}),fh(e,i,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function gh(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function xh(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function bh(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,a=n.strategy,i=void 0===a?e.strategy:a,s=n.boundary,l=void 0===s?"clippingParents":s,c=n.rootBoundary,d=void 0===c?Vu:c,u=n.elementContext,h=void 0===u?Uu:u,p=n.altBoundary,f=void 0!==p&&p,m=n.padding,g=void 0===m?0:m,x=gh("number"!==typeof g?g:xh(g,Bu)),b=h===Uu?"reference":Uu,v=e.rects.popper,y=e.elements[f?b:h],w=mh(hu(y)?y:y.contextElement||Su(e.elements.popper),l,d,i),k=yu(e.elements.reference),S=rh({reference:k,element:v,strategy:"absolute",placement:o}),j=ph(Object.assign({},v,S)),A=h===Uu?j:k,C={top:w.top-A.top+x.top,bottom:A.bottom-w.bottom+x.bottom,left:w.left-A.left+x.left,right:A.right-w.right+x.right},_=e.modifiersData.offset;if(h===Uu&&_){var E=_[o];Object.keys(C).forEach((function(e){var t=[zu,Iu].indexOf(e)>=0?1:-1,n=[Lu,Iu].indexOf(e)>=0?"y":"x";C[e]+=E[n]*t}))}return C}function vh(e,t,n){return mu(e,gu(t,n))}const yh={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,a=void 0===o||o,i=n.altAxis,s=void 0!==i&&i,l=n.boundary,c=n.rootBoundary,d=n.altBoundary,u=n.padding,h=n.tether,p=void 0===h||h,f=n.tetherOffset,m=void 0===f?0:f,g=bh(t,{boundary:l,rootBoundary:c,padding:u,altBoundary:d}),x=eh(t.placement),b=th(t.placement),v=!b,y=nh(x),w="x"===y?"y":"x",k=t.modifiersData.popperOffsets,S=t.rects.reference,j=t.rects.popper,A="function"===typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,C="number"===typeof A?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),_=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,E={x:0,y:0};if(k){if(a){var M,N="y"===y?Lu:Du,R="y"===y?Iu:zu,P="y"===y?"height":"width",O=k[y],T=O+g[N],L=O-g[R],I=p?-j[P]/2:0,z=b===Wu?S[P]:j[P],D=b===Wu?-j[P]:-S[P],F=t.elements.arrow,B=p&&F?Eu(F):{width:0,height:0},W=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},H=W[N],V=W[R],U=vh(0,S[P],B[P]),q=v?S[P]/2-I-U-H-C.mainAxis:z-U-H-C.mainAxis,$=v?-S[P]/2+I+U+V+C.mainAxis:D+U+V+C.mainAxis,K=t.elements.arrow&&Tu(t.elements.arrow),X=K?"y"===y?K.clientTop||0:K.clientLeft||0:0,Y=null!=(M=null==_?void 0:_[y])?M:0,G=O+$-Y,Z=vh(p?gu(T,O+q-Y-X):T,O,p?mu(L,G):L);k[y]=Z,E[y]=Z-O}if(s){var J,Q="x"===y?Lu:Du,ee="x"===y?Iu:zu,te=k[w],ne="y"===w?"height":"width",re=te+g[Q],oe=te-g[ee],ae=-1!==[Lu,Du].indexOf(x),ie=null!=(J=null==_?void 0:_[w])?J:0,se=ae?re:te-S[ne]-j[ne]-ie+C.altAxis,le=ae?te+S[ne]+j[ne]-ie-C.altAxis:oe,ce=p&&ae?function(e,t,n){var r=vh(e,t,n);return r>n?n:r}(se,te,le):vh(p?se:re,te,p?le:oe);k[w]=ce,E[w]=ce-te}t.modifiersData[r]=E}},requiresIfExists:["offset"]};const wh={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,a=n.elements.arrow,i=n.modifiersData.popperOffsets,s=eh(n.placement),l=nh(s),c=[Du,zu].indexOf(s)>=0?"height":"width";if(a&&i){var d=function(e,t){return gh("number"!==typeof(e="function"===typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:xh(e,Bu))}(o.padding,n),u=Eu(a),h="y"===l?Lu:Du,p="y"===l?Iu:zu,f=n.rects.reference[c]+n.rects.reference[l]-i[l]-n.rects.popper[c],m=i[l]-n.rects.reference[l],g=Tu(a),x=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=f/2-m/2,v=d[h],y=x-u[c]-d[p],w=x/2-u[c]/2+b,k=vh(v,w,y),S=l;n.modifiersData[r]=((t={})[S]=k,t.centerOffset=k-w,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!==typeof r||(r=t.elements.popper.querySelector(r)))&&hh(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function kh(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Sh(e){return[Lu,zu,Iu,Du].some((function(t){return e[t]>=0}))}var jh=Ju({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,a=void 0===o||o,i=r.resize,s=void 0===i||i,l=uu(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&c.forEach((function(e){e.addEventListener("scroll",n.update,Qu)})),s&&l.addEventListener("resize",n.update,Qu),function(){a&&c.forEach((function(e){e.removeEventListener("scroll",n.update,Qu)})),s&&l.removeEventListener("resize",n.update,Qu)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=rh({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,a=n.adaptive,i=void 0===a||a,s=n.roundOffsets,l=void 0===s||s,c={placement:eh(t.placement),variation:th(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ah(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ah(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},ih,sh,{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,a=void 0===o||o,i=n.altAxis,s=void 0===i||i,l=n.fallbackPlacements,c=n.padding,d=n.boundary,u=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,f=void 0===p||p,m=n.allowedAutoPlacements,g=t.options.placement,x=eh(g),b=l||(x===g||!f?[ch(g)]:function(e){if(eh(e)===Fu)return[];var t=ch(e);return[uh(e),t,uh(t)]}(g)),v=[g].concat(b).reduce((function(e,n){return e.concat(eh(n)===Fu?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,a=n.rootBoundary,i=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?$u:l,d=th(r),u=d?s?qu:qu.filter((function(e){return th(e)===d})):Bu,h=u.filter((function(e){return c.indexOf(e)>=0}));0===h.length&&(h=u);var p=h.reduce((function(t,n){return t[n]=bh(e,{placement:n,boundary:o,rootBoundary:a,padding:i})[eh(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:d,rootBoundary:u,padding:c,flipVariations:f,allowedAutoPlacements:m}):n)}),[]),y=t.rects.reference,w=t.rects.popper,k=new Map,S=!0,j=v[0],A=0;A<v.length;A++){var C=v[A],_=eh(C),E=th(C)===Wu,M=[Lu,Iu].indexOf(_)>=0,N=M?"width":"height",R=bh(t,{placement:C,boundary:d,rootBoundary:u,altBoundary:h,padding:c}),P=M?E?zu:Du:E?Iu:Lu;y[N]>w[N]&&(P=ch(P));var O=ch(P),T=[];if(a&&T.push(R[_]<=0),s&&T.push(R[P]<=0,R[O]<=0),T.every((function(e){return e}))){j=C,S=!1;break}k.set(C,T)}if(S)for(var L=function(e){var t=v.find((function(t){var n=k.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return j=t,"break"},I=f?3:1;I>0;I--){if("break"===L(I))break}t.placement!==j&&(t.modifiersData[r]._skip=!0,t.placement=j,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},yh,wh,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,a=t.modifiersData.preventOverflow,i=bh(t,{elementContext:"reference"}),s=bh(t,{altBoundary:!0}),l=kh(i,r),c=kh(s,o,a),d=Sh(l),u=Sh(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}}]});function Ah(e){return(0,ni.Ay)("MuiPopper",e)}(0,$a.A)("MuiPopper",["root"]);const Ch=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],_h=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function Eh(e){return"function"===typeof e?e():e}function Mh(e){return void 0!==e.nodeType}const Nh={},Rh=r.forwardRef((function(e,t){var n;const{anchorEl:o,children:a,direction:i,disablePortal:s,modifiers:l,open:c,placement:d,popperOptions:u,popperRef:h,slotProps:p={},slots:f={},TransitionProps:m}=e,g=(0,nr.A)(e,Ch),x=r.useRef(null),b=(0,Ds.A)(x,t),v=r.useRef(null),y=(0,Ds.A)(v,h),w=r.useRef(y);(0,Ll.A)((()=>{w.current=y}),[y]),r.useImperativeHandle(h,(()=>v.current),[]);const k=function(e,t){if("ltr"===t)return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(d,i),[S,j]=r.useState(k),[A,C]=r.useState(Eh(o));r.useEffect((()=>{v.current&&v.current.forceUpdate()})),r.useEffect((()=>{o&&C(Eh(o))}),[o]),(0,Ll.A)((()=>{if(!A||!c)return;let e=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:e=>{let{state:t}=e;(e=>{j(e.placement)})(t)}}];null!=l&&(e=e.concat(l)),u&&null!=u.modifiers&&(e=e.concat(u.modifiers));const t=jh(A,x.current,(0,ba.A)({placement:k},u,{modifiers:e}));return w.current(t),()=>{t.destroy(),w.current(null)}}),[A,s,l,c,u,k]);const _={placement:S};null!==m&&(_.TransitionProps=m);const E=(e=>{const{classes:t}=e;return(0,Za.A)({root:["root"]},Ah,t)})(e),M=null!=(n=f.root)?n:"div",N=$s({elementType:M,externalSlotProps:p.root,externalForwardedProps:g,additionalProps:{role:"tooltip",ref:b},ownerState:e,className:E.root});return(0,ka.jsx)(M,(0,ba.A)({},N,{children:"function"===typeof a?a(_):a}))})),Ph=r.forwardRef((function(e,t){const{anchorEl:n,children:o,container:a,direction:i="ltr",disablePortal:s=!1,keepMounted:l=!1,modifiers:c,open:d,placement:u="bottom",popperOptions:h=Nh,popperRef:p,style:f,transition:m=!1,slotProps:g={},slots:x={}}=e,b=(0,nr.A)(e,_h),[v,y]=r.useState(!0);if(!l&&!d&&(!m||v))return null;let w;if(a)w=a;else if(n){const e=Eh(n);w=e&&Mh(e)?(0,Nl.A)(e).body:(0,Nl.A)(null).body}const k=d||!l||m&&!v?void 0:"none",S=m?{in:d,onEnter:()=>{y(!1)},onExited:()=>{y(!0)}}:void 0;return(0,ka.jsx)(zl,{disablePortal:s,container:w,children:(0,ka.jsx)(Rh,(0,ba.A)({anchorEl:n,direction:i,disablePortal:s,modifiers:c,ref:t,open:m?!v:d,placement:u,popperOptions:h,popperRef:p,slotProps:g,slots:x},b,{style:(0,ba.A)({position:"fixed",top:0,left:0,display:k},f),TransitionProps:S,children:o}))})})),Oh=Ph,Th=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],Lh=(0,Qa.Ay)(Oh,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Ih=r.forwardRef((function(e,t){var n;const r=(0,du.A)(),o=(0,ti.b)({props:e,name:"MuiPopper"}),{anchorEl:a,component:i,components:s,componentsProps:l,container:c,disablePortal:d,keepMounted:u,modifiers:h,open:p,placement:f,popperOptions:m,popperRef:g,transition:x,slots:b,slotProps:v}=o,y=(0,nr.A)(o,Th),w=null!=(n=null==b?void 0:b.root)?n:null==s?void 0:s.Root,k=(0,ba.A)({anchorEl:a,container:c,disablePortal:d,keepMounted:u,modifiers:h,open:p,placement:f,popperOptions:m,popperRef:g,transition:x},y);return(0,ka.jsx)(Lh,(0,ba.A)({as:i,direction:null==r?void 0:r.direction,slots:{root:w},slotProps:null!=v?v:l},k,{ref:t}))}));var zh=n(5879);function Dh(e){return(0,ni.Ay)("MuiTooltip",e)}const Fh=(0,$a.A)("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),Bh=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function Wh(e){return Math.round(1e5*e)/1e5}const Hh=(0,Qa.Ay)(Ih,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})((e=>{let{theme:t,ownerState:n,open:r}=e;return(0,ba.A)({zIndex:(t.vars||t).zIndex.tooltip,pointerEvents:"none"},!n.disableInteractive&&{pointerEvents:"auto"},!r&&{pointerEvents:"none"},n.arrow&&{['&[data-popper-placement*="bottom"] .'.concat(Fh.arrow)]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},['&[data-popper-placement*="top"] .'.concat(Fh.arrow)]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},['&[data-popper-placement*="right"] .'.concat(Fh.arrow)]:(0,ba.A)({},n.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),['&[data-popper-placement*="left"] .'.concat(Fh.arrow)]:(0,ba.A)({},n.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})})),Vh=(0,Qa.Ay)("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t["tooltipPlacement".concat((0,si.A)(n.placement.split("-")[0]))]]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({backgroundColor:t.vars?t.vars.palette.Tooltip.bg:(0,Ja.X4)(t.palette.grey[700],.92),borderRadius:(t.vars||t).shape.borderRadius,color:(t.vars||t).palette.common.white,fontFamily:t.typography.fontFamily,padding:"4px 8px",fontSize:t.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:t.typography.fontWeightMedium},n.arrow&&{position:"relative",margin:0},n.touch&&{padding:"8px 16px",fontSize:t.typography.pxToRem(14),lineHeight:"".concat(Wh(16/14),"em"),fontWeight:t.typography.fontWeightRegular},{[".".concat(Fh.popper,'[data-popper-placement*="left"] &')]:(0,ba.A)({transformOrigin:"right center"},n.isRtl?(0,ba.A)({marginLeft:"14px"},n.touch&&{marginLeft:"24px"}):(0,ba.A)({marginRight:"14px"},n.touch&&{marginRight:"24px"})),[".".concat(Fh.popper,'[data-popper-placement*="right"] &')]:(0,ba.A)({transformOrigin:"left center"},n.isRtl?(0,ba.A)({marginRight:"14px"},n.touch&&{marginRight:"24px"}):(0,ba.A)({marginLeft:"14px"},n.touch&&{marginLeft:"24px"})),[".".concat(Fh.popper,'[data-popper-placement*="top"] &')]:(0,ba.A)({transformOrigin:"center bottom",marginBottom:"14px"},n.touch&&{marginBottom:"24px"}),[".".concat(Fh.popper,'[data-popper-placement*="bottom"] &')]:(0,ba.A)({transformOrigin:"center top",marginTop:"14px"},n.touch&&{marginTop:"24px"})})})),Uh=(0,Qa.Ay)("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})((e=>{let{theme:t}=e;return{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t.vars?t.vars.palette.Tooltip.bg:(0,Ja.X4)(t.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}}));let qh=!1;const $h=new Pi.E;let Kh={x:0,y:0};function Xh(e,t){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];t&&t(n,...o),e(n,...o)}}const Yh=r.forwardRef((function(e,t){var n,o,a,i,s,l,c,d,u,h,p,f,m,g,x,b,v,y,w;const k=(0,ti.b)({props:e,name:"MuiTooltip"}),{arrow:S=!1,children:j,components:A={},componentsProps:C={},describeChild:_=!1,disableFocusListener:E=!1,disableHoverListener:M=!1,disableInteractive:N=!1,disableTouchListener:R=!1,enterDelay:P=100,enterNextDelay:O=0,enterTouchDelay:T=700,followCursor:L=!1,id:I,leaveDelay:z=0,leaveTouchDelay:D=1500,onClose:F,onOpen:B,open:W,placement:H="bottom",PopperComponent:V,PopperProps:U={},slotProps:q={},slots:$={},title:K,TransitionComponent:X=Ml,TransitionProps:Y}=k,G=(0,nr.A)(k,Bh),Z=r.isValidElement(j)?j:(0,ka.jsx)("span",{children:j}),J=wl(),Q=Ea(),[ee,te]=r.useState(),[ne,re]=r.useState(null),oe=r.useRef(!1),ae=N||L,ie=(0,Pi.A)(),se=(0,Pi.A)(),le=(0,Pi.A)(),ce=(0,Pi.A)(),[de,ue]=(0,Fc.A)({controlled:W,default:!1,name:"Tooltip",state:"open"});let he=de;const pe=(0,zh.A)(I),fe=r.useRef(),me=(0,vi.A)((()=>{void 0!==fe.current&&(document.body.style.WebkitUserSelect=fe.current,fe.current=void 0),ce.clear()}));r.useEffect((()=>me),[me]);const ge=e=>{$h.clear(),qh=!0,ue(!0),B&&!he&&B(e)},xe=(0,vi.A)((e=>{$h.start(800+z,(()=>{qh=!1})),ue(!1),F&&he&&F(e),ie.start(J.transitions.duration.shortest,(()=>{oe.current=!1}))})),be=e=>{oe.current&&"touchstart"!==e.type||(ee&&ee.removeAttribute("title"),se.clear(),le.clear(),P||qh&&O?se.start(qh?O:P,(()=>{ge(e)})):ge(e))},ve=e=>{se.clear(),le.start(z,(()=>{xe(e)}))},{isFocusVisibleRef:ye,onBlur:we,onFocus:ke,ref:Se}=(0,yi.A)(),[,je]=r.useState(!1),Ae=e=>{we(e),!1===ye.current&&(je(!1),ve(e))},Ce=e=>{ee||te(e.currentTarget),ke(e),!0===ye.current&&(je(!0),be(e))},_e=e=>{oe.current=!0;const t=Z.props;t.onTouchStart&&t.onTouchStart(e)},Ee=e=>{_e(e),le.clear(),ie.clear(),me(),fe.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",ce.start(T,(()=>{document.body.style.WebkitUserSelect=fe.current,be(e)}))},Me=e=>{Z.props.onTouchEnd&&Z.props.onTouchEnd(e),me(),le.start(D,(()=>{xe(e)}))};r.useEffect((()=>{if(he)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){"Escape"!==e.key&&"Esc"!==e.key||xe(e)}}),[xe,he]);const Ne=(0,bi.A)(Ts(Z),Se,te,t);K||0===K||(he=!1);const Re=r.useRef(),Pe={},Oe="string"===typeof K;_?(Pe.title=he||!Oe||M?null:K,Pe["aria-describedby"]=he?pe:null):(Pe["aria-label"]=Oe?K:null,Pe["aria-labelledby"]=he&&!Oe?pe:null);const Te=(0,ba.A)({},Pe,G,Z.props,{className:(0,za.A)(G.className,Z.props.className),onTouchStart:_e,ref:Ne},L?{onMouseMove:e=>{const t=Z.props;t.onMouseMove&&t.onMouseMove(e),Kh={x:e.clientX,y:e.clientY},Re.current&&Re.current.update()}}:{});const Le={};R||(Te.onTouchStart=Ee,Te.onTouchEnd=Me),M||(Te.onMouseOver=Xh(be,Te.onMouseOver),Te.onMouseLeave=Xh(ve,Te.onMouseLeave),ae||(Le.onMouseOver=be,Le.onMouseLeave=ve)),E||(Te.onFocus=Xh(Ce,Te.onFocus),Te.onBlur=Xh(Ae,Te.onBlur),ae||(Le.onFocus=Ce,Le.onBlur=Ae));const Ie=r.useMemo((()=>{var e;let t=[{name:"arrow",enabled:Boolean(ne),options:{element:ne,padding:4}}];return null!=(e=U.popperOptions)&&e.modifiers&&(t=t.concat(U.popperOptions.modifiers)),(0,ba.A)({},U.popperOptions,{modifiers:t})}),[ne,U]),ze=(0,ba.A)({},k,{isRtl:Q,arrow:S,disableInteractive:ae,placement:H,PopperComponentProp:V,touch:oe.current}),De=(e=>{const{classes:t,disableInteractive:n,arrow:r,touch:o,placement:a}=e,i={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",o&&"touch","tooltipPlacement".concat((0,si.A)(a.split("-")[0]))],arrow:["arrow"]};return(0,Za.A)(i,Dh,t)})(ze),Fe=null!=(n=null!=(o=$.popper)?o:A.Popper)?n:Hh,Be=null!=(a=null!=(i=null!=(s=$.transition)?s:A.Transition)?i:X)?a:Ml,We=null!=(l=null!=(c=$.tooltip)?c:A.Tooltip)?l:Vh,He=null!=(d=null!=(u=$.arrow)?u:A.Arrow)?d:Uh,Ve=Bs(Fe,(0,ba.A)({},U,null!=(h=q.popper)?h:C.popper,{className:(0,za.A)(De.popper,null==U?void 0:U.className,null==(p=null!=(f=q.popper)?f:C.popper)?void 0:p.className)}),ze),Ue=Bs(Be,(0,ba.A)({},Y,null!=(m=q.transition)?m:C.transition),ze),qe=Bs(We,(0,ba.A)({},null!=(g=q.tooltip)?g:C.tooltip,{className:(0,za.A)(De.tooltip,null==(x=null!=(b=q.tooltip)?b:C.tooltip)?void 0:x.className)}),ze),$e=Bs(He,(0,ba.A)({},null!=(v=q.arrow)?v:C.arrow,{className:(0,za.A)(De.arrow,null==(y=null!=(w=q.arrow)?w:C.arrow)?void 0:y.className)}),ze);return(0,ka.jsxs)(r.Fragment,{children:[r.cloneElement(Z,Te),(0,ka.jsx)(Fe,(0,ba.A)({as:null!=V?V:Ih,placement:H,anchorEl:L?{getBoundingClientRect:()=>({top:Kh.y,left:Kh.x,right:Kh.x,bottom:Kh.y,width:0,height:0})}:ee,popperRef:Re,open:!!ee&&he,id:pe,transition:!0},Le,Ve,{popperOptions:Ie,children:e=>{let{TransitionProps:t}=e;return(0,ka.jsx)(Be,(0,ba.A)({timeout:J.transitions.duration.shorter},t,Ue,{children:(0,ka.jsxs)(We,(0,ba.A)({},qe,{children:[K,S?(0,ka.jsx)(He,(0,ba.A)({},$e,{ref:re})):null]}))}))}}))]})})),Gh=Yh,Zh=(0,Zc.A)((0,ka.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function Jh(e){return(0,ni.Ay)("MuiChip",e)}const Qh=(0,$a.A)("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),ep=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],tp=(0,Qa.Ay)("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:o,clickable:a,onDelete:i,size:s,variant:l}=n;return[{["& .".concat(Qh.avatar)]:t.avatar},{["& .".concat(Qh.avatar)]:t["avatar".concat((0,si.A)(s))]},{["& .".concat(Qh.avatar)]:t["avatarColor".concat((0,si.A)(r))]},{["& .".concat(Qh.icon)]:t.icon},{["& .".concat(Qh.icon)]:t["icon".concat((0,si.A)(s))]},{["& .".concat(Qh.icon)]:t["iconColor".concat((0,si.A)(o))]},{["& .".concat(Qh.deleteIcon)]:t.deleteIcon},{["& .".concat(Qh.deleteIcon)]:t["deleteIcon".concat((0,si.A)(s))]},{["& .".concat(Qh.deleteIcon)]:t["deleteIconColor".concat((0,si.A)(r))]},{["& .".concat(Qh.deleteIcon)]:t["deleteIcon".concat((0,si.A)(l),"Color").concat((0,si.A)(r))]},t.root,t["size".concat((0,si.A)(s))],t["color".concat((0,si.A)(r))],a&&t.clickable,a&&"default"!==r&&t["clickableColor".concat((0,si.A)(r),")")],i&&t.deletable,i&&"default"!==r&&t["deletableColor".concat((0,si.A)(r))],t[l],t["".concat(l).concat((0,si.A)(r))]]}})((e=>{let{theme:t,ownerState:n}=e;const r="light"===t.palette.mode?t.palette.grey[700]:t.palette.grey[300];return(0,ba.A)({maxWidth:"100%",fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(t.vars||t).palette.text.primary,backgroundColor:(t.vars||t).palette.action.selected,borderRadius:16,whiteSpace:"nowrap",transition:t.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",["&.".concat(Qh.disabled)]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},["& .".concat(Qh.avatar)]:{marginLeft:5,marginRight:-6,width:24,height:24,color:t.vars?t.vars.palette.Chip.defaultAvatarColor:r,fontSize:t.typography.pxToRem(12)},["& .".concat(Qh.avatarColorPrimary)]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.dark},["& .".concat(Qh.avatarColorSecondary)]:{color:(t.vars||t).palette.secondary.contrastText,backgroundColor:(t.vars||t).palette.secondary.dark},["& .".concat(Qh.avatarSmall)]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:t.typography.pxToRem(10)},["& .".concat(Qh.icon)]:(0,ba.A)({marginLeft:5,marginRight:-6},"small"===n.size&&{fontSize:18,marginLeft:4,marginRight:-4},n.iconColor===n.color&&(0,ba.A)({color:t.vars?t.vars.palette.Chip.defaultIconColor:r},"default"!==n.color&&{color:"inherit"})),["& .".concat(Qh.deleteIcon)]:(0,ba.A)({WebkitTapHighlightColor:"transparent",color:t.vars?"rgba(".concat(t.vars.palette.text.primaryChannel," / 0.26)"):(0,Ja.X4)(t.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:t.vars?"rgba(".concat(t.vars.palette.text.primaryChannel," / 0.4)"):(0,Ja.X4)(t.palette.text.primary,.4)}},"small"===n.size&&{fontSize:16,marginRight:4,marginLeft:-4},"default"!==n.color&&{color:t.vars?"rgba(".concat(t.vars.palette[n.color].contrastTextChannel," / 0.7)"):(0,Ja.X4)(t.palette[n.color].contrastText,.7),"&:hover, &:active":{color:(t.vars||t).palette[n.color].contrastText}})},"small"===n.size&&{height:24},"default"!==n.color&&{backgroundColor:(t.vars||t).palette[n.color].main,color:(t.vars||t).palette[n.color].contrastText},n.onDelete&&{["&.".concat(Qh.focusVisible)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.action.selectedChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.focusOpacity,"))"):(0,Ja.X4)(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},n.onDelete&&"default"!==n.color&&{["&.".concat(Qh.focusVisible)]:{backgroundColor:(t.vars||t).palette[n.color].dark}})}),(e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({},n.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.action.selectedChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.hoverOpacity,"))"):(0,Ja.X4)(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)},["&.".concat(Qh.focusVisible)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.action.selectedChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.focusOpacity,"))"):(0,Ja.X4)(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)},"&:active":{boxShadow:(t.vars||t).shadows[1]}},n.clickable&&"default"!==n.color&&{["&:hover, &.".concat(Qh.focusVisible)]:{backgroundColor:(t.vars||t).palette[n.color].dark}})}),(e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({},"outlined"===n.variant&&{backgroundColor:"transparent",border:t.vars?"1px solid ".concat(t.vars.palette.Chip.defaultBorder):"1px solid ".concat("light"===t.palette.mode?t.palette.grey[400]:t.palette.grey[700]),["&.".concat(Qh.clickable,":hover")]:{backgroundColor:(t.vars||t).palette.action.hover},["&.".concat(Qh.focusVisible)]:{backgroundColor:(t.vars||t).palette.action.focus},["& .".concat(Qh.avatar)]:{marginLeft:4},["& .".concat(Qh.avatarSmall)]:{marginLeft:2},["& .".concat(Qh.icon)]:{marginLeft:4},["& .".concat(Qh.iconSmall)]:{marginLeft:2},["& .".concat(Qh.deleteIcon)]:{marginRight:5},["& .".concat(Qh.deleteIconSmall)]:{marginRight:3}},"outlined"===n.variant&&"default"!==n.color&&{color:(t.vars||t).palette[n.color].main,border:"1px solid ".concat(t.vars?"rgba(".concat(t.vars.palette[n.color].mainChannel," / 0.7)"):(0,Ja.X4)(t.palette[n.color].main,.7)),["&.".concat(Qh.clickable,":hover")]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette[n.color].mainChannel," / ").concat(t.vars.palette.action.hoverOpacity,")"):(0,Ja.X4)(t.palette[n.color].main,t.palette.action.hoverOpacity)},["&.".concat(Qh.focusVisible)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette[n.color].mainChannel," / ").concat(t.vars.palette.action.focusOpacity,")"):(0,Ja.X4)(t.palette[n.color].main,t.palette.action.focusOpacity)},["& .".concat(Qh.deleteIcon)]:{color:t.vars?"rgba(".concat(t.vars.palette[n.color].mainChannel," / 0.7)"):(0,Ja.X4)(t.palette[n.color].main,.7),"&:hover, &:active":{color:(t.vars||t).palette[n.color].main}}})})),np=(0,Qa.Ay)("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t["label".concat((0,si.A)(r))]]}})((e=>{let{ownerState:t}=e;return(0,ba.A)({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},"outlined"===t.variant&&{paddingLeft:11,paddingRight:11},"small"===t.size&&{paddingLeft:8,paddingRight:8},"small"===t.size&&"outlined"===t.variant&&{paddingLeft:7,paddingRight:7})}));function rp(e){return"Backspace"===e.key||"Delete"===e.key}const op=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiChip"}),{avatar:o,className:a,clickable:i,color:s="default",component:l,deleteIcon:c,disabled:d=!1,icon:u,label:h,onClick:p,onDelete:f,onKeyDown:m,onKeyUp:g,size:x="medium",variant:b="filled",tabIndex:v,skipFocusWhenDisabled:y=!1}=n,w=(0,nr.A)(n,ep),k=r.useRef(null),S=(0,bi.A)(k,t),j=e=>{e.stopPropagation(),f&&f(e)},A=!(!1===i||!p)||i,C=A||f?ts:l||"div",_=(0,ba.A)({},n,{component:C,disabled:d,size:x,color:s,iconColor:r.isValidElement(u)&&u.props.color||s,onDelete:!!f,clickable:A,variant:b}),E=(e=>{const{classes:t,disabled:n,size:r,color:o,iconColor:a,onDelete:i,clickable:s,variant:l}=e,c={root:["root",l,n&&"disabled","size".concat((0,si.A)(r)),"color".concat((0,si.A)(o)),s&&"clickable",s&&"clickableColor".concat((0,si.A)(o)),i&&"deletable",i&&"deletableColor".concat((0,si.A)(o)),"".concat(l).concat((0,si.A)(o))],label:["label","label".concat((0,si.A)(r))],avatar:["avatar","avatar".concat((0,si.A)(r)),"avatarColor".concat((0,si.A)(o))],icon:["icon","icon".concat((0,si.A)(r)),"iconColor".concat((0,si.A)(a))],deleteIcon:["deleteIcon","deleteIcon".concat((0,si.A)(r)),"deleteIconColor".concat((0,si.A)(o)),"deleteIcon".concat((0,si.A)(l),"Color").concat((0,si.A)(o))]};return(0,Za.A)(c,Jh,t)})(_),M=C===ts?(0,ba.A)({component:l||"div",focusVisibleClassName:E.focusVisible},f&&{disableRipple:!0}):{};let N=null;f&&(N=c&&r.isValidElement(c)?r.cloneElement(c,{className:(0,za.A)(c.props.className,E.deleteIcon),onClick:j}):(0,ka.jsx)(Zh,{className:(0,za.A)(E.deleteIcon),onClick:j}));let R=null;o&&r.isValidElement(o)&&(R=r.cloneElement(o,{className:(0,za.A)(E.avatar,o.props.className)}));let P=null;return u&&r.isValidElement(u)&&(P=r.cloneElement(u,{className:(0,za.A)(E.icon,u.props.className)})),(0,ka.jsxs)(tp,(0,ba.A)({as:C,className:(0,za.A)(E.root,a),disabled:!(!A||!d)||void 0,onClick:p,onKeyDown:e=>{e.currentTarget===e.target&&rp(e)&&e.preventDefault(),m&&m(e)},onKeyUp:e=>{e.currentTarget===e.target&&(f&&rp(e)?f(e):"Escape"===e.key&&k.current&&k.current.blur()),g&&g(e)},ref:S,tabIndex:y&&d?-1:v,ownerState:_},M,w,{children:[R||P,(0,ka.jsx)(np,{className:(0,za.A)(E.label),ownerState:_,children:h}),N]}))})),ap=op,ip=["ownerState"],sp=["variants"],lp=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function cp(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}const dp=(0,Wa.A)(),up=e=>e?e.charAt(0).toLowerCase()+e.slice(1):e;function hp(e){let{defaultTheme:t,theme:n,themeId:r}=e;return o=n,0===Object.keys(o).length?t:n[r]||n;var o}function pp(e){return e?(t,n)=>n[e]:null}function fp(e,t){let{ownerState:n}=t,r=(0,nr.A)(t,ip);const o="function"===typeof e?e((0,ba.A)({ownerState:n},r)):e;if(Array.isArray(o))return o.flatMap((e=>fp(e,(0,ba.A)({ownerState:n},r))));if(o&&"object"===typeof o&&Array.isArray(o.variants)){const{variants:e=[]}=o;let t=(0,nr.A)(o,sp);return e.forEach((e=>{let o=!0;"function"===typeof e.props?o=e.props((0,ba.A)({ownerState:n},r,n)):Object.keys(e.props).forEach((t=>{(null==n?void 0:n[t])!==e.props[t]&&r[t]!==e.props[t]&&(o=!1)})),o&&(Array.isArray(t)||(t=[t]),t.push("function"===typeof e.style?e.style((0,ba.A)({ownerState:n},r,n)):e.style))})),t}return o}const mp=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:t,defaultTheme:n=dp,rootShouldForwardProp:r=cp,slotShouldForwardProp:o=cp}=e,a=e=>(0,Fa.A)((0,ba.A)({},e,{theme:hp((0,ba.A)({},e,{defaultTheme:n,themeId:t}))}));return a.__mui_systemSx=!0,function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,Da.internal_processStyles)(e,(e=>e.filter((e=>!(null!=e&&e.__mui_systemSx)))));const{name:s,slot:l,skipVariantsResolver:c,skipSx:d,overridesResolver:u=pp(up(l))}=i,h=(0,nr.A)(i,lp),p=void 0!==c?c:l&&"Root"!==l&&"root"!==l||!1,f=d||!1;let m=cp;"Root"===l||"root"===l?m=r:l?m=o:function(e){return"string"===typeof e&&e.charCodeAt(0)>96}(e)&&(m=void 0);const g=(0,Da.default)(e,(0,ba.A)({shouldForwardProp:m,label:undefined},h)),x=e=>"function"===typeof e&&e.__emotion_real!==e||(0,Os.Q)(e)?r=>fp(e,(0,ba.A)({},r,{theme:hp({theme:r.theme,defaultTheme:n,themeId:t})})):e,b=function(r){let o=x(r);for(var i=arguments.length,l=new Array(i>1?i-1:0),c=1;c<i;c++)l[c-1]=arguments[c];const d=l?l.map(x):[];s&&u&&d.push((e=>{const r=hp((0,ba.A)({},e,{defaultTheme:n,themeId:t}));if(!r.components||!r.components[s]||!r.components[s].styleOverrides)return null;const o=r.components[s].styleOverrides,a={};return Object.entries(o).forEach((t=>{let[n,o]=t;a[n]=fp(o,(0,ba.A)({},e,{theme:r}))})),u(e,a)})),s&&!p&&d.push((e=>{var r;const o=hp((0,ba.A)({},e,{defaultTheme:n,themeId:t}));return fp({variants:null==o||null==(r=o.components)||null==(r=r[s])?void 0:r.variants},(0,ba.A)({},e,{theme:o}))})),f||d.push(a);const h=d.length-l.length;if(Array.isArray(r)&&h>0){const e=new Array(h).fill("");o=[...r,...e],o.raw=[...r.raw,...e]}const m=g(o,...d);return e.muiName&&(m.muiName=e.muiName),m};return g.withConfig&&(b.withConfig=g.withConfig),b}}(),gp=mp;function xp(e){let{props:t,name:n,defaultTheme:r,themeId:o}=e,a=Va(r);o&&(a=a[o]||a);const i=function(e){const{theme:t,name:n,props:r}=e;return t&&t.components&&t.components[n]&&t.components[n].defaultProps?(0,gi.A)(t.components[n].defaultProps,r):r}({theme:a,name:n,props:t});return i}var bp=n(9751),vp=n(8604);const yp=["component","direction","spacing","divider","children","className","useFlexGap"],wp=(0,Wa.A)(),kp=gp("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function Sp(e){return xp({props:e,name:"MuiStack",defaultTheme:wp})}function jp(e,t){const n=r.Children.toArray(e).filter(Boolean);return n.reduce(((e,o,a)=>(e.push(o),a<n.length-1&&e.push(r.cloneElement(t,{key:"separator-".concat(a)})),e)),[])}const Ap=e=>{let{ownerState:t,theme:n}=e,r=(0,ba.A)({display:"flex",flexDirection:"column"},(0,bp.NI)({theme:n},(0,bp.kW)({values:t.direction,breakpoints:n.breakpoints.values}),(e=>({flexDirection:e}))));if(t.spacing){const e=(0,vp.LX)(n),o=Object.keys(n.breakpoints.values).reduce(((e,n)=>(("object"===typeof t.spacing&&null!=t.spacing[n]||"object"===typeof t.direction&&null!=t.direction[n])&&(e[n]=!0),e)),{}),a=(0,bp.kW)({values:t.direction,base:o}),i=(0,bp.kW)({values:t.spacing,base:o});"object"===typeof a&&Object.keys(a).forEach(((e,t,n)=>{if(!a[e]){const r=t>0?a[n[t-1]]:"column";a[e]=r}}));const s=(n,r)=>{return t.useFlexGap?{gap:(0,vp._W)(e,n)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{["margin".concat((o=r?a[r]:t.direction,{row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"}[o]))]:(0,vp._W)(e,n)}};var o};r=(0,Os.A)(r,(0,bp.NI)({theme:n},i,s))}return r=(0,bp.iZ)(n.breakpoints,r),r};const Cp=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createStyledComponent:t=kp,useThemeProps:n=Sp,componentName:o="MuiStack"}=e,a=t(Ap),i=r.forwardRef((function(e,t){const r=n(e),i=(0,Ba.A)(r),{component:s="div",direction:l="column",spacing:c=0,divider:d,children:u,className:h,useFlexGap:p=!1}=i,f=(0,nr.A)(i,yp),m={direction:l,spacing:c,useFlexGap:p},g=(0,Za.A)({root:["root"]},(e=>(0,ni.Ay)(o,e)),{});return(0,ka.jsx)(a,(0,ba.A)({as:s,ownerState:m,ref:t,className:(0,za.A)(g.root,h)},f,{children:d?jp(u,d):u}))}));return i}({createStyledComponent:(0,Qa.Ay)("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>(0,ti.b)({props:e,name:"MuiStack"})}),_p=Cp;function Ep(e){return(0,ni.Ay)("MuiTypography",e)}(0,$a.A)("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const Mp=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],Np=(0,Qa.Ay)("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],"inherit"!==n.align&&t["align".concat((0,si.A)(n.align))],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({margin:0},"inherit"===n.variant&&{font:"inherit"},"inherit"!==n.variant&&t.typography[n.variant],"inherit"!==n.align&&{textAlign:n.align},n.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n.gutterBottom&&{marginBottom:"0.35em"},n.paragraph&&{marginBottom:16})})),Rp={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Pp={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Op=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiTypography"}),r=(e=>Pp[e]||e)(n.color),o=(0,Ba.A)((0,ba.A)({},n,{color:r})),{align:a="inherit",className:i,component:s,gutterBottom:l=!1,noWrap:c=!1,paragraph:d=!1,variant:u="body1",variantMapping:h=Rp}=o,p=(0,nr.A)(o,Mp),f=(0,ba.A)({},o,{align:a,color:r,className:i,component:s,gutterBottom:l,noWrap:c,paragraph:d,variant:u,variantMapping:h}),m=s||(d?"p":h[u]||Rp[u])||"span",g=(e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:a,classes:i}=e,s={root:["root",a,"inherit"!==e.align&&"align".concat((0,si.A)(t)),n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]};return(0,Za.A)(s,Ep,i)})(f);return(0,ka.jsx)(Np,(0,ba.A)({as:m,ref:t,ownerState:f,className:(0,za.A)(g.root,i)},p))})),Tp=Op;function Lp(e){return(0,ni.Ay)("MuiFormControlLabel",e)}const Ip=(0,$a.A)("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),zp=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],Dp=(0,Qa.Ay)("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{["& .".concat(Ip.label)]:t.label},t.root,t["labelPlacement".concat((0,si.A)(n.labelPlacement))]]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,["&.".concat(Ip.disabled)]:{cursor:"default"}},"start"===n.labelPlacement&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},"top"===n.labelPlacement&&{flexDirection:"column-reverse",marginLeft:16},"bottom"===n.labelPlacement&&{flexDirection:"column",marginLeft:16},{["& .".concat(Ip.label)]:{["&.".concat(Ip.disabled)]:{color:(t.vars||t).palette.text.disabled}}})})),Fp=(0,Qa.Ay)("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})((e=>{let{theme:t}=e;return{["&.".concat(Ip.error)]:{color:(t.vars||t).palette.error.main}}})),Bp=r.forwardRef((function(e,t){var n,o;const a=(0,ti.b)({props:e,name:"MuiFormControlLabel"}),{className:i,componentsProps:s={},control:l,disabled:c,disableTypography:d,label:u,labelPlacement:h="end",required:p,slotProps:f={}}=a,m=(0,nr.A)(a,zp),g=ws(),x=null!=(n=null!=c?c:l.props.disabled)?n:null==g?void 0:g.disabled,b=null!=p?p:l.props.required,v={disabled:x,required:b};["checked","name","onChange","value","inputRef"].forEach((e=>{"undefined"===typeof l.props[e]&&"undefined"!==typeof a[e]&&(v[e]=a[e])}));const y=ys({props:a,muiFormControl:g,states:["error"]}),w=(0,ba.A)({},a,{disabled:x,labelPlacement:h,required:b,error:y.error}),k=(e=>{const{classes:t,disabled:n,labelPlacement:r,error:o,required:a}=e,i={root:["root",n&&"disabled","labelPlacement".concat((0,si.A)(r)),o&&"error",a&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",o&&"error"]};return(0,Za.A)(i,Lp,t)})(w),S=null!=(o=f.typography)?o:s.typography;let j=u;return null==j||j.type===Tp||d||(j=(0,ka.jsx)(Tp,(0,ba.A)({component:"span"},S,{className:(0,za.A)(k.label,null==S?void 0:S.className),children:j}))),(0,ka.jsxs)(Dp,(0,ba.A)({className:(0,za.A)(k.root,i),ownerState:w,ref:t},m,{children:[r.cloneElement(l,v),b?(0,ka.jsxs)(_p,{display:"block",children:[j,(0,ka.jsxs)(Fp,{ownerState:w,"aria-hidden":!0,className:k.asterisk,children:["\u2009","*"]})]}):j]}))}));function Wp(e){return(0,ni.Ay)("PrivateSwitchBase",e)}(0,$a.A)("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Hp=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],Vp=(0,Qa.Ay)(ts)((e=>{let{ownerState:t}=e;return(0,ba.A)({padding:9,borderRadius:"50%"},"start"===t.edge&&{marginLeft:"small"===t.size?-3:-12},"end"===t.edge&&{marginRight:"small"===t.size?-3:-12})})),Up=(0,Qa.Ay)("input",{shouldForwardProp:xi.A})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),qp=r.forwardRef((function(e,t){const{autoFocus:n,checked:r,checkedIcon:o,className:a,defaultChecked:i,disabled:s,disableFocusRipple:l=!1,edge:c=!1,icon:d,id:u,inputProps:h,inputRef:p,name:f,onBlur:m,onChange:g,onFocus:x,readOnly:b,required:v=!1,tabIndex:y,type:w,value:k}=e,S=(0,nr.A)(e,Hp),[j,A]=(0,Fc.A)({controlled:r,default:Boolean(i),name:"SwitchBase",state:"checked"}),C=ws();let _=s;C&&"undefined"===typeof _&&(_=C.disabled);const E="checkbox"===w||"radio"===w,M=(0,ba.A)({},e,{checked:j,disabled:_,disableFocusRipple:l,edge:c}),N=(e=>{const{classes:t,checked:n,disabled:r,edge:o}=e,a={root:["root",n&&"checked",r&&"disabled",o&&"edge".concat((0,si.A)(o))],input:["input"]};return(0,Za.A)(a,Wp,t)})(M);return(0,ka.jsxs)(Vp,(0,ba.A)({component:"span",className:(0,za.A)(N.root,a),centerRipple:!0,focusRipple:!l,disabled:_,tabIndex:null,role:void 0,onFocus:e=>{x&&x(e),C&&C.onFocus&&C.onFocus(e)},onBlur:e=>{m&&m(e),C&&C.onBlur&&C.onBlur(e)},ownerState:M,ref:t},S,{children:[(0,ka.jsx)(Up,(0,ba.A)({autoFocus:n,checked:r,defaultChecked:i,className:N.input,disabled:_,id:E?u:void 0,name:f,onChange:e=>{if(e.nativeEvent.defaultPrevented)return;const t=e.target.checked;A(t),g&&g(e,t)},readOnly:b,ref:p,required:v,ownerState:M,tabIndex:y,type:w},"checkbox"===w&&void 0===k?{}:{value:k},h)),j?o:d]}))})),$p=qp,Kp=(0,Zc.A)((0,ka.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),Xp=(0,Zc.A)((0,ka.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),Yp=(0,Zc.A)((0,ka.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function Gp(e){return(0,ni.Ay)("MuiCheckbox",e)}const Zp=(0,$a.A)("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),Jp=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],Qp=(0,Qa.Ay)($p,{shouldForwardProp:e=>(0,xi.A)(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t["size".concat((0,si.A)(n.size))],"default"!==n.color&&t["color".concat((0,si.A)(n.color))]]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({color:(t.vars||t).palette.text.secondary},!n.disableRipple&&{"&:hover":{backgroundColor:t.vars?"rgba(".concat("default"===n.color?t.vars.palette.action.activeChannel:t.vars.palette[n.color].mainChannel," / ").concat(t.vars.palette.action.hoverOpacity,")"):(0,Ja.X4)("default"===n.color?t.palette.action.active:t.palette[n.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"default"!==n.color&&{["&.".concat(Zp.checked,", &.").concat(Zp.indeterminate)]:{color:(t.vars||t).palette[n.color].main},["&.".concat(Zp.disabled)]:{color:(t.vars||t).palette.action.disabled}})})),ef=(0,ka.jsx)(Xp,{}),tf=(0,ka.jsx)(Kp,{}),nf=(0,ka.jsx)(Yp,{}),rf=r.forwardRef((function(e,t){var n,o;const a=(0,ti.b)({props:e,name:"MuiCheckbox"}),{checkedIcon:i=ef,color:s="primary",icon:l=tf,indeterminate:c=!1,indeterminateIcon:d=nf,inputProps:u,size:h="medium",className:p}=a,f=(0,nr.A)(a,Jp),m=c?d:l,g=c?d:i,x=(0,ba.A)({},a,{color:s,indeterminate:c,size:h}),b=(e=>{const{classes:t,indeterminate:n,color:r,size:o}=e,a={root:["root",n&&"indeterminate","color".concat((0,si.A)(r)),"size".concat((0,si.A)(o))]},i=(0,Za.A)(a,Gp,t);return(0,ba.A)({},t,i)})(x);return(0,ka.jsx)(Qp,(0,ba.A)({type:"checkbox",inputProps:(0,ba.A)({"data-indeterminate":c},u),icon:r.cloneElement(m,{fontSize:null!=(n=m.props.fontSize)?n:h}),checkedIcon:r.cloneElement(g,{fontSize:null!=(o=g.props.fontSize)?o:h}),ownerState:x,ref:t,className:(0,za.A)(b.root,p)},f,{classes:b}))})),of=rf,af=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],sf=["component","slots","slotProps"],lf=["component"];function cf(e,t){const{className:n,elementType:r,ownerState:o,externalForwardedProps:a,getSlotOwnerState:i,internalForwardedProps:s}=t,l=(0,nr.A)(t,af),{component:c,slots:d={[e]:void 0},slotProps:u={[e]:void 0}}=a,h=(0,nr.A)(a,sf),p=d[e]||r,f=Us(u[e],o),m=Vs((0,ba.A)({className:n},l,{externalForwardedProps:"root"===e?h:void 0,externalSlotProps:f})),{props:{component:g},internalRef:x}=m,b=(0,nr.A)(m.props,lf),v=(0,Ds.A)(x,null==f?void 0:f.ref,t.ref),y=i?i(b):{},w=(0,ba.A)({},o,y),k="root"===e?g||c:g,S=Bs(p,(0,ba.A)({},"root"===e&&!c&&!d[e]&&s,"root"!==e&&!d[e]&&s,b,k&&{as:k},{ref:v}),w);return Object.keys(y).forEach((e=>{delete S[e]})),[p,S]}function df(e){return(0,ni.Ay)("MuiAlert",e)}const uf=(0,$a.A)("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function hf(e){return(0,ni.Ay)("MuiIconButton",e)}const pf=(0,$a.A)("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),ff=["edge","children","className","color","disabled","disableFocusRipple","size"],mf=(0,Qa.Ay)(ts,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t["color".concat((0,si.A)(n.color))],n.edge&&t["edge".concat((0,si.A)(n.edge))],t["size".concat((0,si.A)(n.size))]]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest})},!n.disableRipple&&{"&:hover":{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.action.activeChannel," / ").concat(t.vars.palette.action.hoverOpacity,")"):(0,Ja.X4)(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"start"===n.edge&&{marginLeft:"small"===n.size?-3:-12},"end"===n.edge&&{marginRight:"small"===n.size?-3:-12})}),(e=>{let{theme:t,ownerState:n}=e;var r;const o=null==(r=(t.vars||t).palette)?void 0:r[n.color];return(0,ba.A)({},"inherit"===n.color&&{color:"inherit"},"inherit"!==n.color&&"default"!==n.color&&(0,ba.A)({color:null==o?void 0:o.main},!n.disableRipple&&{"&:hover":(0,ba.A)({},o&&{backgroundColor:t.vars?"rgba(".concat(o.mainChannel," / ").concat(t.vars.palette.action.hoverOpacity,")"):(0,Ja.X4)(o.main,t.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),"small"===n.size&&{padding:5,fontSize:t.typography.pxToRem(18)},"large"===n.size&&{padding:12,fontSize:t.typography.pxToRem(28)},{["&.".concat(pf.disabled)]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled}})})),gf=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiIconButton"}),{edge:r=!1,children:o,className:a,color:i="default",disabled:s=!1,disableFocusRipple:l=!1,size:c="medium"}=n,d=(0,nr.A)(n,ff),u=(0,ba.A)({},n,{edge:r,color:i,disabled:s,disableFocusRipple:l,size:c}),h=(e=>{const{classes:t,disabled:n,color:r,edge:o,size:a}=e,i={root:["root",n&&"disabled","default"!==r&&"color".concat((0,si.A)(r)),o&&"edge".concat((0,si.A)(o)),"size".concat((0,si.A)(a))]};return(0,Za.A)(i,hf,t)})(u);return(0,ka.jsx)(mf,(0,ba.A)({className:(0,za.A)(h.root,a),centerRipple:!0,focusRipple:!l,disabled:s,ref:t},d,{ownerState:u,children:o}))})),xf=gf,bf=(0,Zc.A)((0,ka.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),vf=(0,Zc.A)((0,ka.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),yf=(0,Zc.A)((0,ka.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),wf=(0,Zc.A)((0,ka.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),kf=(0,Zc.A)((0,ka.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Sf=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],jf=(0,Qa.Ay)(ii,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t["".concat(n.variant).concat((0,si.A)(n.color||n.severity))]]}})((e=>{let{theme:t}=e;const n="light"===t.palette.mode?Ja.e$:Ja.a,r="light"===t.palette.mode?Ja.a:Ja.e$;return(0,ba.A)({},t.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(t.palette).filter((e=>{let[,t]=e;return t.main&&t.light})).map((e=>{let[o]=e;return{props:{colorSeverity:o,variant:"standard"},style:{color:t.vars?t.vars.palette.Alert["".concat(o,"Color")]:n(t.palette[o].light,.6),backgroundColor:t.vars?t.vars.palette.Alert["".concat(o,"StandardBg")]:r(t.palette[o].light,.9),["& .".concat(uf.icon)]:t.vars?{color:t.vars.palette.Alert["".concat(o,"IconColor")]}:{color:t.palette[o].main}}}})),...Object.entries(t.palette).filter((e=>{let[,t]=e;return t.main&&t.light})).map((e=>{let[r]=e;return{props:{colorSeverity:r,variant:"outlined"},style:{color:t.vars?t.vars.palette.Alert["".concat(r,"Color")]:n(t.palette[r].light,.6),border:"1px solid ".concat((t.vars||t).palette[r].light),["& .".concat(uf.icon)]:t.vars?{color:t.vars.palette.Alert["".concat(r,"IconColor")]}:{color:t.palette[r].main}}}})),...Object.entries(t.palette).filter((e=>{let[,t]=e;return t.main&&t.dark})).map((e=>{let[n]=e;return{props:{colorSeverity:n,variant:"filled"},style:(0,ba.A)({fontWeight:t.typography.fontWeightMedium},t.vars?{color:t.vars.palette.Alert["".concat(n,"FilledColor")],backgroundColor:t.vars.palette.Alert["".concat(n,"FilledBg")]}:{backgroundColor:"dark"===t.palette.mode?t.palette[n].dark:t.palette[n].main,color:t.palette.getContrastText(t.palette[n].main)})}}))]})})),Af=(0,Qa.Ay)("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Cf=(0,Qa.Ay)("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),_f=(0,Qa.Ay)("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),Ef={success:(0,ka.jsx)(bf,{fontSize:"inherit"}),warning:(0,ka.jsx)(vf,{fontSize:"inherit"}),error:(0,ka.jsx)(yf,{fontSize:"inherit"}),info:(0,ka.jsx)(wf,{fontSize:"inherit"})},Mf=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiAlert"}),{action:r,children:o,className:a,closeText:i="Close",color:s,components:l={},componentsProps:c={},icon:d,iconMapping:u=Ef,onClose:h,role:p="alert",severity:f="success",slotProps:m={},slots:g={},variant:x="standard"}=n,b=(0,nr.A)(n,Sf),v=(0,ba.A)({},n,{color:s,severity:f,variant:x,colorSeverity:s||f}),y=(e=>{const{variant:t,color:n,severity:r,classes:o}=e,a={root:["root","color".concat((0,si.A)(n||r)),"".concat(t).concat((0,si.A)(n||r)),"".concat(t)],icon:["icon"],message:["message"],action:["action"]};return(0,Za.A)(a,df,o)})(v),w={slots:(0,ba.A)({closeButton:l.CloseButton,closeIcon:l.CloseIcon},g),slotProps:(0,ba.A)({},c,m)},[k,S]=cf("closeButton",{elementType:xf,externalForwardedProps:w,ownerState:v}),[j,A]=cf("closeIcon",{elementType:kf,externalForwardedProps:w,ownerState:v});return(0,ka.jsxs)(jf,(0,ba.A)({role:p,elevation:0,ownerState:v,className:(0,za.A)(y.root,a),ref:t},b,{children:[!1!==d?(0,ka.jsx)(Af,{ownerState:v,className:y.icon,children:d||u[f]||Ef[f]}):null,(0,ka.jsx)(Cf,{ownerState:v,className:y.message,children:o}),null!=r?(0,ka.jsx)(_f,{ownerState:v,className:y.action,children:r}):null,null==r&&h?(0,ka.jsx)(_f,{ownerState:v,className:y.action,children:(0,ka.jsx)(k,(0,ba.A)({size:"small","aria-label":i,title:i,color:"inherit",onClick:h},S,{children:(0,ka.jsx)(j,(0,ba.A)({fontSize:"small"},A))}))}):null]}))})),Nf=Mf;function Rf(e){return(0,ni.Ay)("MuiCircularProgress",e)}(0,$a.A)("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);var Pf,Of,Tf,Lf;const If=["className","color","disableShrink","size","style","thickness","value","variant"];let zf,Df,Ff,Bf;const Wf=44,Hf=(0,Ri.i7)(zf||(zf=Pf||(Pf=wi(["\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n"])))),Vf=(0,Ri.i7)(Df||(Df=Of||(Of=wi(["\n 0% {\n stroke-dasharray: 1px, 200px;\n stroke-dashoffset: 0;\n }\n\n 50% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -15px;\n }\n\n 100% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -125px;\n }\n"])))),Uf=(0,Qa.Ay)("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t["color".concat((0,si.A)(n.color))]]}})((e=>{let{ownerState:t,theme:n}=e;return(0,ba.A)({display:"inline-block"},"determinate"===t.variant&&{transition:n.transitions.create("transform")},"inherit"!==t.color&&{color:(n.vars||n).palette[t.color].main})}),(e=>{let{ownerState:t}=e;return"indeterminate"===t.variant&&(0,Ri.AH)(Ff||(Ff=Tf||(Tf=wi(["\n animation: "," 1.4s linear infinite;\n "]))),Hf)})),qf=(0,Qa.Ay)("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),$f=(0,Qa.Ay)("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t["circle".concat((0,si.A)(n.variant))],n.disableShrink&&t.circleDisableShrink]}})((e=>{let{ownerState:t,theme:n}=e;return(0,ba.A)({stroke:"currentColor"},"determinate"===t.variant&&{transition:n.transitions.create("stroke-dashoffset")},"indeterminate"===t.variant&&{strokeDasharray:"80px, 200px",strokeDashoffset:0})}),(e=>{let{ownerState:t}=e;return"indeterminate"===t.variant&&!t.disableShrink&&(0,Ri.AH)(Bf||(Bf=Lf||(Lf=wi(["\n animation: "," 1.4s ease-in-out infinite;\n "]))),Vf)})),Kf=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiCircularProgress"}),{className:r,color:o="primary",disableShrink:a=!1,size:i=40,style:s,thickness:l=3.6,value:c=0,variant:d="indeterminate"}=n,u=(0,nr.A)(n,If),h=(0,ba.A)({},n,{color:o,disableShrink:a,size:i,thickness:l,value:c,variant:d}),p=(e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e,a={root:["root",n,"color".concat((0,si.A)(r))],svg:["svg"],circle:["circle","circle".concat((0,si.A)(n)),o&&"circleDisableShrink"]};return(0,Za.A)(a,Rf,t)})(h),f={},m={},g={};if("determinate"===d){const e=2*Math.PI*((Wf-l)/2);f.strokeDasharray=e.toFixed(3),g["aria-valuenow"]=Math.round(c),f.strokeDashoffset="".concat(((100-c)/100*e).toFixed(3),"px"),m.transform="rotate(-90deg)"}return(0,ka.jsx)(Uf,(0,ba.A)({className:(0,za.A)(p.root,r),style:(0,ba.A)({width:i,height:i},m,s),ownerState:h,ref:t,role:"progressbar"},g,u,{children:(0,ka.jsx)(qf,{className:p.svg,ownerState:h,viewBox:"".concat(22," ").concat(22," ").concat(Wf," ").concat(Wf),children:(0,ka.jsx)($f,{className:p.circle,style:f,ownerState:h,cx:Wf,cy:Wf,r:(Wf-l)/2,fill:"none",strokeWidth:l})})}))})),Xf=Kf;var Yf=n(1132),Gf=n(8625);const Zf=[{label:"100 lines",value:100},{label:"500 lines",value:500},{label:"1 000 lines",value:1e3},{label:"All",value:0}],Jf=e=>{let{processId:t,processName:n,connectionId:o}=e;const[a,i]=(0,r.useState)([]),[s,l]=(0,r.useState)(!0),[c,d]=(0,r.useState)(""),[u,h]=(0,r.useState)(!0),[p,f]=(0,r.useState)("all"),[m,g]=(0,r.useState)(!0),[x,b]=(0,r.useState)(200),[v,y]=(0,r.useState)({out:0,err:0}),[w,k]=(0,r.useState)({out:"",err:""}),S=(0,r.useRef)(null),j=(0,r.useCallback)((function(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(o){const r="/api/remote/".concat(o,"/logs/").concat(t,"/").concat(e);return n?"".concat(r,"/download"):"".concat(r,"?lines=").concat(x)}const r="/api/logs/".concat(t,"/").concat(e);return n?"".concat(r,"/download"):"".concat(r,"?lines=").concat(x)}),[o,t,x]),A=(0,r.useCallback)((async()=>{try{l(!0);const[e,t]=await Promise.all([tr.get(j("out")),tr.get(j("err"))]),n=e.data,r=t.data,o=(n.logs||[]).map((e=>({type:"out",content:e,timestamp:""}))),a=(r.logs||[]).map((e=>({type:"err",content:e,timestamp:""})));i([...o,...a]),y({out:n.totalLines||0,err:r.totalLines||0}),k({out:n.logPath||"",err:r.logPath||""}),d("")}catch(NR){console.error("Error fetching logs:",NR),d("Failed to fetch logs: ".concat(NR instanceof Error?NR.message:"Unknown error"))}finally{l(!1)}}),[j]);(0,r.useEffect)((()=>{if(A(),!u)return;const e=setInterval(A,5e3);return()=>clearInterval(e)}),[A,u]),(0,r.useEffect)((()=>{m&&S.current&&(S.current.scrollTop=S.current.scrollHeight)}),[a,m]);const C=async e=>{try{const t=j(e,!0),r=await tr.get(t,{responseType:"blob"}),o=new Blob([r.data],{type:"text/plain; charset=utf-8"}),a=URL.createObjectURL(o),i=document.createElement("a");i.href=a,i.download="".concat(n,"-").concat(e,".log"),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a)}catch(NR){console.error("Download failed:",NR)}},_=a.filter((e=>"all"===p||e.type===p)),E="err"===p?w.err:w.out;return(0,ka.jsxs)(Ga,{sx:{width:"100%"},children:[(0,ka.jsxs)(ii,{elevation:0,variant:"outlined",sx:{p:1.5,mb:1.5,display:"flex",flexWrap:"wrap",gap:1.5,alignItems:"center"},children:[(0,ka.jsxs)(mi,{size:"small",variant:"outlined",children:[(0,ka.jsx)(ds,{variant:"all"===p?"contained":"outlined",onClick:()=>f("all"),children:"All"}),(0,ka.jsx)(ds,{variant:"out"===p?"contained":"outlined",onClick:()=>f("out"),children:"stdout"}),(0,ka.jsx)(ds,{variant:"err"===p?"contained":"outlined",color:"error",onClick:()=>f("err"),children:"stderr"})]}),(0,ka.jsxs)(vs,{size:"small",sx:{minWidth:130},children:[(0,ka.jsx)(Ps,{children:"Lines to load"}),(0,ka.jsx)(Jd,{label:"Lines to load",value:x,onChange:e=>b(Number(e.target.value)),children:Zf.map((e=>(0,ka.jsx)(cu,{value:e.value,children:e.label},e.value)))})]}),v.out>0&&(0,ka.jsx)(Gh,{title:"Total lines in stdout log file",children:(0,ka.jsx)(ap,{label:"stdout: ".concat(v.out.toLocaleString()," lines"),size:"small",variant:"outlined"})}),v.err>0&&(0,ka.jsx)(Gh,{title:"Total lines in stderr log file",children:(0,ka.jsx)(ap,{label:"stderr: ".concat(v.err.toLocaleString()," lines"),size:"small",variant:"outlined",color:"error"})}),(0,ka.jsx)(Ga,{sx:{flex:1}}),(0,ka.jsxs)(_p,{direction:"row",spacing:.5,alignItems:"center",children:[(0,ka.jsx)(Bp,{control:(0,ka.jsx)(of,{checked:m,onChange:()=>g((e=>!e)),size:"small"}),label:(0,ka.jsx)(Tp,{variant:"caption",children:"Auto-scroll"}),sx:{m:0}}),(0,ka.jsx)(Bp,{control:(0,ka.jsx)(of,{checked:u,onChange:()=>h((e=>!e)),size:"small"}),label:(0,ka.jsx)(Tp,{variant:"caption",children:"Auto-refresh"}),sx:{m:0}}),(0,ka.jsx)(Gh,{title:"Refresh now",children:(0,ka.jsx)("span",{children:(0,ka.jsx)(ds,{size:"small",variant:"outlined",onClick:A,sx:{minWidth:32,px:.5},children:(0,ka.jsx)(Gf.A,{fontSize:"small"})})})})]})]}),(0,ka.jsxs)(ii,{elevation:0,variant:"outlined",sx:{px:1.5,py:1,mb:1.5,display:"flex",flexWrap:"wrap",gap:1,alignItems:"center"},children:[E&&(0,ka.jsx)(Tp,{variant:"caption",sx:{fontFamily:"monospace",opacity:.65,flex:1,wordBreak:"break-all"},children:E}),(0,ka.jsxs)(_p,{direction:"row",spacing:1,children:[(0,ka.jsx)(Gh,{title:"Download full stdout log",children:(0,ka.jsx)(ds,{size:"small",variant:"outlined",startIcon:(0,ka.jsx)(Yf.A,{fontSize:"small"}),onClick:()=>C("out"),children:"stdout"})}),(0,ka.jsx)(Gh,{title:"Download full stderr log",children:(0,ka.jsx)(ds,{size:"small",variant:"outlined",color:"error",startIcon:(0,ka.jsx)(Yf.A,{fontSize:"small"}),onClick:()=>C("err"),children:"stderr"})})]})]}),c&&(0,ka.jsx)(Nf,{severity:"error",sx:{mb:1.5},children:c}),s&&0===a.length?(0,ka.jsxs)(Ga,{sx:{display:"flex",justifyContent:"center",alignItems:"center",py:8},children:[(0,ka.jsx)(Xf,{size:24,sx:{mr:1.5}}),(0,ka.jsx)(Tp,{variant:"body2",children:"Loading logs\u2026"})]}):0===_.length?(0,ka.jsx)(Ga,{sx:{textAlign:"center",py:8,bgcolor:"background.paper",borderRadius:1,border:"1px solid",borderColor:"divider"},children:(0,ka.jsx)(Tp,{variant:"body2",color:"text.secondary",children:"No log entries for this filter."})}):(0,ka.jsx)(ii,{variant:"outlined",ref:S,sx:{height:400,overflow:"auto",p:1.5,bgcolor:e=>"dark"===e.palette.mode?"#0d1117":"#f6f8fa",fontFamily:"monospace",fontSize:"0.8rem",lineHeight:1.6},children:_.map(((e,t)=>(0,ka.jsx)(Ga,{sx:{color:"err"===e.type?"error.main":"text.primary",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:e.content},t)))}),_.length>0&&(0,ka.jsxs)(Tp,{variant:"caption",color:"text.secondary",sx:{mt:.5,display:"block",textAlign:"right"},children:["Showing ",_.length.toLocaleString()," ",0===x?"":"of last ".concat(x.toLocaleString()," requested")," lines","err"!==p&&v.out>0&&"out"!==p?" \xb7 stdout total: ".concat(v.out.toLocaleString()):"","out"!==p&&v.err>0&&"err"!==p?" \xb7 stderr total: ".concat(v.err.toLocaleString()):""]})]})};function Qf(e){return(0,ni.Ay)("MuiTableContainer",e)}(0,$a.A)("MuiTableContainer",["root"]);const em=["className","component"],tm=(0,Qa.Ay)("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(e,t)=>t.root})({width:"100%",overflowX:"auto"}),nm=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiTableContainer"}),{className:r,component:o="div"}=n,a=(0,nr.A)(n,em),i=(0,ba.A)({},n,{component:o}),s=(e=>{const{classes:t}=e;return(0,Za.A)({root:["root"]},Qf,t)})(i);return(0,ka.jsx)(tm,(0,ba.A)({ref:t,as:o,className:(0,za.A)(s.root,r),ownerState:i},a))}));const rm=r.createContext();function om(e){return(0,ni.Ay)("MuiTable",e)}(0,$a.A)("MuiTable",["root","stickyHeader"]);const am=["className","component","padding","size","stickyHeader"],im=(0,Qa.Ay)("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.stickyHeader&&t.stickyHeader]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":(0,ba.A)({},t.typography.body2,{padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},n.stickyHeader&&{borderCollapse:"separate"})})),sm="table",lm=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiTable"}),{className:o,component:a=sm,padding:i="normal",size:s="medium",stickyHeader:l=!1}=n,c=(0,nr.A)(n,am),d=(0,ba.A)({},n,{component:a,padding:i,size:s,stickyHeader:l}),u=(e=>{const{classes:t,stickyHeader:n}=e,r={root:["root",n&&"stickyHeader"]};return(0,Za.A)(r,om,t)})(d),h=r.useMemo((()=>({padding:i,size:s,stickyHeader:l})),[i,s,l]);return(0,ka.jsx)(rm.Provider,{value:h,children:(0,ka.jsx)(im,(0,ba.A)({as:a,role:a===sm?null:"table",ref:t,className:(0,za.A)(u.root,o),ownerState:d},c))})}));const cm=r.createContext();function dm(e){return(0,ni.Ay)("MuiTableHead",e)}(0,$a.A)("MuiTableHead",["root"]);const um=["className","component"],hm=(0,Qa.Ay)("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),pm={variant:"head"},fm="thead",mm=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiTableHead"}),{className:r,component:o=fm}=n,a=(0,nr.A)(n,um),i=(0,ba.A)({},n,{component:o}),s=(e=>{const{classes:t}=e;return(0,Za.A)({root:["root"]},dm,t)})(i);return(0,ka.jsx)(cm.Provider,{value:pm,children:(0,ka.jsx)(hm,(0,ba.A)({as:o,className:(0,za.A)(s.root,r),ref:t,role:o===fm?null:"rowgroup",ownerState:i},a))})}));function gm(e){return(0,ni.Ay)("MuiTableRow",e)}const xm=(0,$a.A)("MuiTableRow",["root","selected","hover","head","footer"]),bm=["className","component","hover","selected"],vm=(0,Qa.Ay)("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.head&&t.head,n.footer&&t.footer]}})((e=>{let{theme:t}=e;return{color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,["&.".concat(xm.hover,":hover")]:{backgroundColor:(t.vars||t).palette.action.hover},["&.".concat(xm.selected)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / ").concat(t.vars.palette.action.selectedOpacity,")"):(0,Ja.X4)(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.hoverOpacity,"))"):(0,Ja.X4)(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}}})),ym="tr",wm=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiTableRow"}),{className:o,component:a=ym,hover:i=!1,selected:s=!1}=n,l=(0,nr.A)(n,bm),c=r.useContext(cm),d=(0,ba.A)({},n,{component:a,hover:i,selected:s,head:c&&"head"===c.variant,footer:c&&"footer"===c.variant}),u=(e=>{const{classes:t,selected:n,hover:r,head:o,footer:a}=e,i={root:["root",n&&"selected",r&&"hover",o&&"head",a&&"footer"]};return(0,Za.A)(i,gm,t)})(d);return(0,ka.jsx)(vm,(0,ba.A)({as:a,ref:t,className:(0,za.A)(u.root,o),role:a===ym?null:"row",ownerState:d},l))})),km=wm;function Sm(e){return(0,ni.Ay)("MuiTableCell",e)}const jm=(0,$a.A)("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),Am=["align","className","component","padding","scope","size","sortDirection","variant"],Cm=(0,Qa.Ay)("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t["size".concat((0,si.A)(n.size))],"normal"!==n.padding&&t["padding".concat((0,si.A)(n.padding))],"inherit"!==n.align&&t["align".concat((0,si.A)(n.align))],n.stickyHeader&&t.stickyHeader]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({},t.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?"1px solid ".concat(t.vars.palette.TableCell.border):"1px solid\n ".concat("light"===t.palette.mode?(0,Ja.a)((0,Ja.X4)(t.palette.divider,1),.88):(0,Ja.e$)((0,Ja.X4)(t.palette.divider,1),.68)),textAlign:"left",padding:16},"head"===n.variant&&{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium},"body"===n.variant&&{color:(t.vars||t).palette.text.primary},"footer"===n.variant&&{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)},"small"===n.size&&{padding:"6px 16px",["&.".concat(jm.paddingCheckbox)]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},"checkbox"===n.padding&&{width:48,padding:"0 0 0 4px"},"none"===n.padding&&{padding:0},"left"===n.align&&{textAlign:"left"},"center"===n.align&&{textAlign:"center"},"right"===n.align&&{textAlign:"right",flexDirection:"row-reverse"},"justify"===n.align&&{textAlign:"justify"},n.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default})})),_m=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiTableCell"}),{align:o="inherit",className:a,component:i,padding:s,scope:l,size:c,sortDirection:d,variant:u}=n,h=(0,nr.A)(n,Am),p=r.useContext(rm),f=r.useContext(cm),m=f&&"head"===f.variant;let g;g=i||(m?"th":"td");let x=l;"td"===g?x=void 0:!x&&m&&(x="col");const b=u||f&&f.variant,v=(0,ba.A)({},n,{align:o,component:g,padding:s||(p&&p.padding?p.padding:"normal"),size:c||(p&&p.size?p.size:"medium"),sortDirection:d,stickyHeader:"head"===b&&p&&p.stickyHeader,variant:b}),y=(e=>{const{classes:t,variant:n,align:r,padding:o,size:a,stickyHeader:i}=e,s={root:["root",n,i&&"stickyHeader","inherit"!==r&&"align".concat((0,si.A)(r)),"normal"!==o&&"padding".concat((0,si.A)(o)),"size".concat((0,si.A)(a))]};return(0,Za.A)(s,Sm,t)})(v);let w=null;return d&&(w="asc"===d?"ascending":"descending"),(0,ka.jsx)(Cm,(0,ba.A)({as:g,ref:t,className:(0,za.A)(y.root,a),"aria-sort":w,scope:x,ownerState:v},h))})),Em=_m;function Mm(e){return(0,ni.Ay)("MuiTableBody",e)}(0,$a.A)("MuiTableBody",["root"]);const Nm=["className","component"],Rm=(0,Qa.Ay)("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-row-group"}),Pm={variant:"body"},Om="tbody",Tm=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiTableBody"}),{className:r,component:o=Om}=n,a=(0,nr.A)(n,Nm),i=(0,ba.A)({},n,{component:o}),s=(e=>{const{classes:t}=e;return(0,Za.A)({root:["root"]},Mm,t)})(i);return(0,ka.jsx)(cm.Provider,{value:Pm,children:(0,ka.jsx)(Rm,(0,ba.A)({className:(0,za.A)(s.root,r),as:o,ref:t,role:o===Om?null:"rowgroup",ownerState:i},a))})}));var Lm=n(4318);function Im(e){return(0,ni.Ay)("MuiCollapse",e)}(0,$a.A)("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const zm=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],Dm=(0,Qa.Ay)("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],"entered"===n.state&&t.entered,"exited"===n.state&&!n.in&&"0px"===n.collapsedSize&&t.hidden]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({height:0,overflow:"hidden",transition:t.transitions.create("height")},"horizontal"===n.orientation&&{height:"auto",width:0,transition:t.transitions.create("width")},"entered"===n.state&&(0,ba.A)({height:"auto",overflow:"visible"},"horizontal"===n.orientation&&{width:"auto"}),"exited"===n.state&&!n.in&&"0px"===n.collapsedSize&&{visibility:"hidden"})})),Fm=(0,Qa.Ay)("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})((e=>{let{ownerState:t}=e;return(0,ba.A)({display:"flex",width:"100%"},"horizontal"===t.orientation&&{width:"auto",height:"100%"})})),Bm=(0,Qa.Ay)("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(e,t)=>t.wrapperInner})((e=>{let{ownerState:t}=e;return(0,ba.A)({width:"100%"},"horizontal"===t.orientation&&{width:"auto",height:"100%"})})),Wm=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiCollapse"}),{addEndListener:o,children:a,className:i,collapsedSize:s="0px",component:l,easing:c,in:d,onEnter:u,onEntered:h,onEntering:p,onExit:f,onExited:m,onExiting:g,orientation:x="vertical",style:b,timeout:v=Lm.p0.standard,TransitionComponent:y=vl}=n,w=(0,nr.A)(n,zm),k=(0,ba.A)({},n,{orientation:x,collapsedSize:s}),S=(e=>{const{orientation:t,classes:n}=e,r={root:["root","".concat(t)],entered:["entered"],hidden:["hidden"],wrapper:["wrapper","".concat(t)],wrapperInner:["wrapperInner","".concat(t)]};return(0,Za.A)(r,Im,n)})(k),j=wl(),A=(0,Pi.A)(),C=r.useRef(null),_=r.useRef(),E="number"===typeof s?"".concat(s,"px"):s,M="horizontal"===x,N=M?"width":"height",R=r.useRef(null),P=(0,bi.A)(t,R),O=e=>t=>{if(e){const n=R.current;void 0===t?e(n):e(n,t)}},T=()=>C.current?C.current[M?"clientWidth":"clientHeight"]:0,L=O(((e,t)=>{C.current&&M&&(C.current.style.position="absolute"),e.style[N]=E,u&&u(e,t)})),I=O(((e,t)=>{const n=T();C.current&&M&&(C.current.style.position="");const{duration:r,easing:o}=Sl({style:b,timeout:v,easing:c},{mode:"enter"});if("auto"===v){const t=j.transitions.getAutoHeightDuration(n);e.style.transitionDuration="".concat(t,"ms"),_.current=t}else e.style.transitionDuration="string"===typeof r?r:"".concat(r,"ms");e.style[N]="".concat(n,"px"),e.style.transitionTimingFunction=o,p&&p(e,t)})),z=O(((e,t)=>{e.style[N]="auto",h&&h(e,t)})),D=O((e=>{e.style[N]="".concat(T(),"px"),f&&f(e)})),F=O(m),B=O((e=>{const t=T(),{duration:n,easing:r}=Sl({style:b,timeout:v,easing:c},{mode:"exit"});if("auto"===v){const n=j.transitions.getAutoHeightDuration(t);e.style.transitionDuration="".concat(n,"ms"),_.current=n}else e.style.transitionDuration="string"===typeof n?n:"".concat(n,"ms");e.style[N]=E,e.style.transitionTimingFunction=r,g&&g(e)}));return(0,ka.jsx)(y,(0,ba.A)({in:d,onEnter:L,onEntered:z,onEntering:I,onExit:D,onExited:F,onExiting:B,addEndListener:e=>{"auto"===v&&A.start(_.current||0,e),o&&o(R.current,e)},nodeRef:R,timeout:"auto"===v?null:v},w,{children:(e,t)=>(0,ka.jsx)(Dm,(0,ba.A)({as:l,className:(0,za.A)(S.root,i,{entered:S.entered,exited:!d&&"0px"===E&&S.hidden}[e]),style:(0,ba.A)({[M?"minWidth":"minHeight"]:E},b),ref:P},t,{ownerState:(0,ba.A)({},k,{state:e}),children:(0,ka.jsx)(Fm,{ownerState:(0,ba.A)({},k,{state:e}),className:S.wrapper,ref:C,children:(0,ka.jsx)(Bm,{ownerState:(0,ba.A)({},k,{state:e}),className:S.wrapperInner,children:a})})}))}))}));Wm.muiSupportAuto=!0;const Hm=Wm;var Vm=n(1337),Um=n(5473),qm=n(3664);const $m=[{label:"100 lines",value:100},{label:"500 lines",value:500},{label:"1 000 lines",value:1e3},{label:"All",value:0}],Km=e=>{if(0===e)return"\u2014";const t=["B","KB","MB","GB"],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1);return"".concat((e/Math.pow(1024,n)).toFixed(1)," ").concat(t[n])},Xm=e=>{const t=e.match(/__(\d{4}-\d{2}-\d{2}[_-]\d{2}[:-]\d{2}[:-]\d{2})/);return t?t[1]:"current"},Ym=e=>{if("current"===e)return"Current";const t=e.replace(/_(\d{2})-(\d{2})-(\d{2})$/,"T$1:$2:$3"),n=new Date(t);return isNaN(n.getTime())?e:n.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},Gm=e=>{const t=new Map;for(const n of e){const e=Xm(n.name);t.has(e)||t.set(e,{dateKey:e,displayDate:Ym(e)});const r=t.get(e);"out"===n.type?r.stdout=n:"err"===n.type||r.stdout?r.stderr=n:r.stdout=n}return Array.from(t.values()).sort(((e,t)=>"current"===e.dateKey?-1:"current"===t.dateKey?1:t.dateKey.localeCompare(e.dateKey)))},Zm=e=>{let{processId:t,processName:n,connectionId:o}=e;const[a,i]=(0,r.useState)([]),[s,l]=(0,r.useState)(!0),[d,u]=(0,r.useState)(""),[h,p]=(0,r.useState)(null),[f,m]=(0,r.useState)("out"),[g,x]=(0,r.useState)({}),[b,v]=(0,r.useState)({}),[y,w]=(0,r.useState)({}),[k,S]=(0,r.useState)({}),[j,A]=(0,r.useState)(200),[C,_]=(0,r.useState)(""),E=o?"/api/remote/".concat(o,"/log-files/").concat(t):"/api/log-files/".concat(t),M=(0,r.useCallback)((e=>{const t=encodeURIComponent(e);return o?"/api/remote/".concat(o,"/log-file?path=").concat(t,"&lines=").concat(j):"/api/log-file?path=".concat(t,"&lines=").concat(j)}),[o,j]),N=(0,r.useCallback)((async()=>{l(!0),u("");try{const e=await tr.get(E);i(e.data.files||[])}catch(NR){var e,t;u((null===(e=NR.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||NR.message||"Failed to list log files")}finally{l(!1)}}),[E]);(0,r.useEffect)((()=>{N()}),[N]);const R=(0,r.useCallback)((async e=>{if(!y[e]){w((t=>c(c({},t),{},{[e]:!0}))),S((t=>c(c({},t),{},{[e]:""})));try{const t=await tr.get(M(e));x((n=>c(c({},n),{},{[e]:t.data.logs||[]}))),v((n=>c(c({},n),{},{[e]:t.data.totalLines||0})))}catch(NR){S((n=>{var r,o;return c(c({},n),{},{[e]:(null===(r=NR.response)||void 0===r||null===(o=r.data)||void 0===o?void 0:o.error)||NR.message||"Failed to read file"})}))}finally{w((t=>c(c({},t),{},{[e]:!1})))}}}),[M]);(0,r.useEffect)((()=>{if(!h)return;const e=Gm(a).find((e=>e.dateKey===h));if(!e)return;const t="out"===f?e.stdout:e.stderr;t&&R(t.path)}),[j]);const P=(e,t)=>{m(t);const n="out"===t?e.stdout:e.stderr;n&&!g[n.path]&&R(n.path)},O=(0,r.useCallback)((async e=>{_("");try{const t=encodeURIComponent(e.path),n=o?"/api/remote/".concat(o,"/log-file/download?path=").concat(t):"/api/log-file/download?path=".concat(t),r=await tr.get(n,{responseType:"blob"}),a=new Blob([r.data],{type:"text/plain; charset=utf-8"}),i=URL.createObjectURL(a),s=document.createElement("a");s.href=i,s.download=e.name.replace(/\.gz$/,""),document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)}catch(NR){var t,n;const o=(null===(t=NR.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||NR.message||"Download failed";_("".concat(e.name,": ").concat(o))}}),[o]),T=(0,r.useCallback)((async e=>{e.stdout&&await O(e.stdout),e.stderr&&await O(e.stderr)}),[O]),L=Gm(a);return s?(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:1.5,py:6,justifyContent:"center"},children:[(0,ka.jsx)(Xf,{size:20}),(0,ka.jsx)(Tp,{variant:"body2",color:"text.secondary",children:"Scanning log directory\u2026"})]}):d?(0,ka.jsx)(Nf,{severity:"error",sx:{mt:1},children:d}):0===L.length?(0,ka.jsxs)(Ga,{sx:{textAlign:"center",py:6,border:"1px solid",borderColor:"divider",borderRadius:1},children:[(0,ka.jsx)(qm.A,{sx:{fontSize:40,opacity:.3,mb:1}}),(0,ka.jsxs)(Tp,{variant:"body2",color:"text.secondary",children:["No log files found for ",(0,ka.jsx)("strong",{children:n}),"."]}),(0,ka.jsxs)(Tp,{variant:"caption",color:"text.secondary",display:"block",sx:{mt:.5},children:["Log rotation may not be enabled. Run ",(0,ka.jsx)("code",{children:"pm2 install pm2-logrotate"})," to get daily archives."]})]}):(0,ka.jsxs)(Ga,{children:[C&&(0,ka.jsx)(Nf,{severity:"error",sx:{mb:1.5},onClose:()=>_(""),children:C}),(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:1.5,flexWrap:"wrap"},children:[(0,ka.jsxs)(Tp,{variant:"body2",color:"text.secondary",sx:{flex:1},children:[L.length," date",1!==L.length?"s":""," \xb7 ",a.length," file",1!==a.length?"s":""]}),(0,ka.jsxs)(vs,{size:"small",sx:{minWidth:130},children:[(0,ka.jsx)(Ps,{children:"Lines to load"}),(0,ka.jsx)(Jd,{label:"Lines to load",value:j,onChange:e=>A(Number(e.target.value)),children:$m.map((e=>(0,ka.jsx)(cu,{value:e.value,children:e.label},e.value)))})]}),(0,ka.jsx)(Gh,{title:"Refresh file list",children:(0,ka.jsx)(xf,{size:"small",onClick:N,children:(0,ka.jsx)(Gf.A,{fontSize:"small"})})})]}),(0,ka.jsx)(nm,{component:ii,variant:"outlined",children:(0,ka.jsxs)(lm,{size:"small",children:[(0,ka.jsx)(mm,{children:(0,ka.jsxs)(km,{children:[(0,ka.jsx)(Em,{sx:{width:36}}),(0,ka.jsx)(Em,{children:"Date"}),(0,ka.jsx)(Em,{align:"right",children:"stdout"}),(0,ka.jsx)(Em,{align:"right",children:"stderr"}),(0,ka.jsx)(Em,{align:"right",children:"Download"})]})}),(0,ka.jsx)(Tm,{children:L.map((e=>{const t=h===e.dateKey,n="out"===f?e.stdout:e.stderr;return(0,ka.jsxs)(r.Fragment,{children:[(0,ka.jsxs)(km,{hover:!0,sx:{cursor:"pointer","& td":{borderBottom:t?0:void 0}},onClick:()=>(e=>{if(h===e.dateKey)return void p(null);p(e.dateKey);const t=e.stdout?"out":"err";m(t);const n="out"===t?e.stdout:e.stderr;n&&!g[n.path]&&R(n.path)})(e),children:[(0,ka.jsx)(Em,{padding:"checkbox",children:(0,ka.jsx)(xf,{size:"small",children:t?(0,ka.jsx)(Um.A,{fontSize:"small"}):(0,ka.jsx)(Vm.A,{fontSize:"small"})})}),(0,ka.jsx)(Em,{children:(0,ka.jsx)(Tp,{variant:"body2",fontWeight:"current"===e.dateKey?600:400,children:e.displayDate})}),(0,ka.jsx)(Em,{align:"right",children:e.stdout?(0,ka.jsx)(Tp,{variant:"caption",color:"text.secondary",children:Km(e.stdout.size)}):(0,ka.jsx)(Tp,{variant:"caption",sx:{opacity:.3},children:"\u2014"})}),(0,ka.jsx)(Em,{align:"right",children:e.stderr?(0,ka.jsx)(Tp,{variant:"caption",color:"error.main",children:Km(e.stderr.size)}):(0,ka.jsx)(Tp,{variant:"caption",sx:{opacity:.3},children:"\u2014"})}),(0,ka.jsx)(Em,{align:"right",onClick:e=>e.stopPropagation(),children:(0,ka.jsxs)(Ga,{sx:{display:"flex",gap:.5,justifyContent:"flex-end",alignItems:"center"},children:[e.stdout&&(0,ka.jsx)(Gh,{title:"Download stdout",children:(0,ka.jsxs)(ds,{size:"small",variant:"outlined",sx:{minWidth:0,px:1,fontSize:"0.7rem"},onClick:()=>O(e.stdout),children:[(0,ka.jsx)(Yf.A,{sx:{fontSize:13,mr:.4}}),"out"]})}),e.stderr&&(0,ka.jsx)(Gh,{title:"Download stderr",children:(0,ka.jsxs)(ds,{size:"small",variant:"outlined",color:"error",sx:{minWidth:0,px:1,fontSize:"0.7rem"},onClick:()=>O(e.stderr),children:[(0,ka.jsx)(Yf.A,{sx:{fontSize:13,mr:.4}}),"err"]})}),e.stdout&&e.stderr&&(0,ka.jsx)(Gh,{title:"Download both files",children:(0,ka.jsxs)(ds,{size:"small",variant:"contained",disableElevation:!0,sx:{minWidth:0,px:1,fontSize:"0.7rem"},onClick:()=>T(e),children:[(0,ka.jsx)(Yf.A,{sx:{fontSize:13,mr:.4}}),"both"]})})]})})]}),(0,ka.jsx)(km,{children:(0,ka.jsx)(Em,{colSpan:5,sx:{p:0,border:0},children:(0,ka.jsx)(Hm,{in:t,timeout:"auto",unmountOnExit:!0,children:(0,ka.jsxs)(Ga,{sx:{p:1.5,borderBottom:"1px solid",borderColor:"divider"},children:[(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5},children:[(0,ka.jsxs)(mi,{size:"small",variant:"outlined",children:[e.stdout&&(0,ka.jsxs)(ds,{variant:"out"===f?"contained":"outlined",disableElevation:!0,onClick:()=>P(e,"out"),children:["stdout \xb7 ",Km(e.stdout.size)]}),e.stderr&&(0,ka.jsxs)(ds,{variant:"err"===f?"contained":"outlined",color:"error",disableElevation:!0,onClick:()=>P(e,"err"),children:["stderr \xb7 ",Km(e.stderr.size)]})]}),(0,ka.jsx)(Ga,{sx:{flex:1}}),n&&(0,ka.jsx)(ds,{size:"small",variant:"outlined",startIcon:(0,ka.jsx)(Yf.A,{fontSize:"small"}),onClick:()=>O(n),children:"Download full file"})]}),n&&(0,ka.jsxs)(ka.Fragment,{children:[y[n.path]&&(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:1,py:2},children:[(0,ka.jsx)(Xf,{size:16}),(0,ka.jsx)(Tp,{variant:"caption",children:"Loading\u2026"})]}),k[n.path]&&(0,ka.jsx)(Nf,{severity:"error",children:k[n.path]}),!y[n.path]&&!k[n.path]&&g[n.path]&&(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsxs)(Tp,{variant:"caption",color:"text.secondary",display:"block",sx:{mb:.5},children:[g[n.path].length.toLocaleString(),j>0?" of last ".concat(j.toLocaleString()):""," lines shown",b[n.path]?" \xb7 ".concat(b[n.path].toLocaleString()," total"):"",(0,ka.jsx)(Ga,{component:"span",sx:{fontFamily:"monospace",opacity:.5,ml:1},children:n.path})]}),(0,ka.jsx)(ii,{variant:"outlined",sx:{maxHeight:380,overflow:"auto",p:1.5,bgcolor:e=>"dark"===e.palette.mode?"#0d1117":"#f6f8fa",fontFamily:"monospace",fontSize:"0.78rem",lineHeight:1.6},children:0===g[n.path].length?(0,ka.jsx)(Tp,{variant:"caption",color:"text.secondary",children:"File is empty."}):g[n.path].map(((e,t)=>(0,ka.jsx)(Ga,{sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:e},t)))})]})]})]})})})})]},e.dateKey)}))})]})})]})};function Jm(e){return e+.5|0}const Qm=(e,t,n)=>Math.max(Math.min(e,n),t);function eg(e){return Qm(Jm(2.55*e),0,255)}function tg(e){return Qm(Jm(255*e),0,255)}function ng(e){return Qm(Jm(e/2.55)/100,0,1)}function rg(e){return Qm(Jm(100*e),0,100)}const og={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ag=[..."0123456789ABCDEF"],ig=e=>ag[15&e],sg=e=>ag[(240&e)>>4]+ag[15&e],lg=e=>(240&e)>>4===(15&e);function cg(e){var t=(e=>lg(e.r)&&lg(e.g)&&lg(e.b)&&lg(e.a))(e)?ig:sg;return e?"#"+t(e.r)+t(e.g)+t(e.b)+((e,t)=>e<255?t(e):"")(e.a,t):void 0}const dg=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ug(e,t,n){const r=t*Math.min(n,1-n),o=function(t){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t+e/30)%12;return n-r*Math.max(Math.min(o-3,9-o,1),-1)};return[o(0),o(8),o(4)]}function hg(e,t,n){const r=function(r){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(r+e/60)%6;return n-n*t*Math.max(Math.min(o,4-o,1),0)};return[r(5),r(3),r(1)]}function pg(e,t,n){const r=ug(e,1,.5);let o;for(t+n>1&&(o=1/(t+n),t*=o,n*=o),o=0;o<3;o++)r[o]*=1-t-n,r[o]+=t;return r}function fg(e){const t=e.r/255,n=e.g/255,r=e.b/255,o=Math.max(t,n,r),a=Math.min(t,n,r),i=(o+a)/2;let s,l,c;return o!==a&&(c=o-a,l=i>.5?c/(2-o-a):c/(o+a),s=function(e,t,n,r,o){return e===o?(t-n)/r+(t<n?6:0):t===o?(n-e)/r+2:(e-t)/r+4}(t,n,r,c,o),s=60*s+.5),[0|s,l||0,i]}function mg(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(tg)}function gg(e,t,n){return mg(ug,e,t,n)}function xg(e){return(e%360+360)%360}function bg(e){const t=dg.exec(e);let n,r=255;if(!t)return;t[5]!==n&&(r=t[6]?eg(+t[5]):tg(+t[5]));const o=xg(+t[2]),a=+t[3]/100,i=+t[4]/100;return n="hwb"===t[1]?function(e,t,n){return mg(pg,e,t,n)}(o,a,i):"hsv"===t[1]?function(e,t,n){return mg(hg,e,t,n)}(o,a,i):gg(o,a,i),{r:n[0],g:n[1],b:n[2],a:r}}const vg={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},yg={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let wg;function kg(e){wg||(wg=function(){const e={},t=Object.keys(yg),n=Object.keys(vg);let r,o,a,i,s;for(r=0;r<t.length;r++){for(i=s=t[r],o=0;o<n.length;o++)a=n[o],s=s.replace(a,vg[a]);a=parseInt(yg[i],16),e[s]=[a>>16&255,a>>8&255,255&a]}return e}(),wg.transparent=[0,0,0,0]);const t=wg[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:4===t.length?t[3]:255}}const Sg=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const jg=e=>e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,Ag=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Cg(e,t,n){if(e){let r=fg(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,0===t?360:1)),r=gg(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function _g(e,t){return e?Object.assign(t||{},e):e}function Eg(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=tg(e[3]))):(t=_g(e,{r:0,g:0,b:0,a:1})).a=tg(t.a),t}function Mg(e){return"r"===e.charAt(0)?function(e){const t=Sg.exec(e);let n,r,o,a=255;if(t){if(t[7]!==n){const e=+t[7];a=t[8]?eg(e):Qm(255*e,0,255)}return n=+t[1],r=+t[3],o=+t[5],n=255&(t[2]?eg(n):Qm(n,0,255)),r=255&(t[4]?eg(r):Qm(r,0,255)),o=255&(t[6]?eg(o):Qm(o,0,255)),{r:n,g:r,b:o,a:a}}}(e):bg(e)}class Ng{constructor(e){if(e instanceof Ng)return e;const t=typeof e;let n;"object"===t?n=Eg(e):"string"===t&&(n=function(e){var t,n=e.length;return"#"===e[0]&&(4===n||5===n?t={r:255&17*og[e[1]],g:255&17*og[e[2]],b:255&17*og[e[3]],a:5===n?17*og[e[4]]:255}:7!==n&&9!==n||(t={r:og[e[1]]<<4|og[e[2]],g:og[e[3]]<<4|og[e[4]],b:og[e[5]]<<4|og[e[6]],a:9===n?og[e[7]]<<4|og[e[8]]:255})),t}(e)||kg(e)||Mg(e)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var e=_g(this._rgb);return e&&(e.a=ng(e.a)),e}set rgb(e){this._rgb=Eg(e)}rgbString(){return this._valid?(e=this._rgb)&&(e.a<255?"rgba(".concat(e.r,", ").concat(e.g,", ").concat(e.b,", ").concat(ng(e.a),")"):"rgb(".concat(e.r,", ").concat(e.g,", ").concat(e.b,")")):void 0;var e}hexString(){return this._valid?cg(this._rgb):void 0}hslString(){return this._valid?function(e){if(!e)return;const t=fg(e),n=t[0],r=rg(t[1]),o=rg(t[2]);return e.a<255?"hsla(".concat(n,", ").concat(r,"%, ").concat(o,"%, ").concat(ng(e.a),")"):"hsl(".concat(n,", ").concat(r,"%, ").concat(o,"%)")}(this._rgb):void 0}mix(e,t){if(e){const n=this.rgb,r=e.rgb;let o;const a=t===o?.5:t,i=2*a-1,s=n.a-r.a,l=((i*s===-1?i:(i+s)/(1+i*s))+1)/2;o=1-l,n.r=255&l*n.r+o*r.r+.5,n.g=255&l*n.g+o*r.g+.5,n.b=255&l*n.b+o*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=function(e,t,n){const r=Ag(ng(e.r)),o=Ag(ng(e.g)),a=Ag(ng(e.b));return{r:tg(jg(r+n*(Ag(ng(t.r))-r))),g:tg(jg(o+n*(Ag(ng(t.g))-o))),b:tg(jg(a+n*(Ag(ng(t.b))-a))),a:e.a+n*(t.a-e.a)}}(this._rgb,e._rgb,t)),this}clone(){return new Ng(this.rgb)}alpha(e){return this._rgb.a=tg(e),this}clearer(e){return this._rgb.a*=1-e,this}greyscale(){const e=this._rgb,t=Jm(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=t,this}opaquer(e){return this._rgb.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Cg(this._rgb,2,e),this}darken(e){return Cg(this._rgb,2,-e),this}saturate(e){return Cg(this._rgb,1,e),this}desaturate(e){return Cg(this._rgb,1,-e),this}rotate(e){return function(e,t){var n=fg(e);n[0]=xg(n[0]+t),n=gg(n),e.r=n[0],e.g=n[1],e.b=n[2]}(this._rgb,e),this}}function Rg(){}const Pg=(()=>{let e=0;return()=>e++})();function Og(e){return null===e||void 0===e}function Tg(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return"[object"===t.slice(0,7)&&"Array]"===t.slice(-6)}function Lg(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}function Ig(e){return("number"===typeof e||e instanceof Number)&&isFinite(+e)}function zg(e,t){return Ig(e)?e:t}function Dg(e,t){return"undefined"===typeof e?t:e}const Fg=(e,t)=>"string"===typeof e&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Bg(e,t,n){if(e&&"function"===typeof e.call)return e.apply(n,t)}function Wg(e,t,n,r){let o,a,i;if(Tg(e))if(a=e.length,r)for(o=a-1;o>=0;o--)t.call(n,e[o],o);else for(o=0;o<a;o++)t.call(n,e[o],o);else if(Lg(e))for(i=Object.keys(e),a=i.length,o=0;o<a;o++)t.call(n,e[i[o]],i[o])}function Hg(e,t){let n,r,o,a;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(o=e[n],a=t[n],o.datasetIndex!==a.datasetIndex||o.index!==a.index)return!1;return!0}function Vg(e){if(Tg(e))return e.map(Vg);if(Lg(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let o=0;for(;o<r;++o)t[n[o]]=Vg(e[n[o]]);return t}return e}function Ug(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}function qg(e,t,n,r){if(!Ug(e))return;const o=t[e],a=n[e];Lg(o)&&Lg(a)?$g(o,a,r):t[e]=Vg(a)}function $g(e,t,n){const r=Tg(t)?t:[t],o=r.length;if(!Lg(e))return e;const a=(n=n||{}).merger||qg;let i;for(let s=0;s<o;++s){if(i=r[s],!Lg(i))continue;const t=Object.keys(i);for(let r=0,o=t.length;r<o;++r)a(t[r],e,i,n)}return e}function Kg(e,t){return $g(e,t,{merger:Xg})}function Xg(e,t,n){if(!Ug(e))return;const r=t[e],o=n[e];Lg(r)&&Lg(o)?Kg(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Vg(o))}const Yg={"":e=>e,x:e=>e.x,y:e=>e.y};function Gg(e,t){const n=Yg[t]||(Yg[t]=function(e){const t=function(e){const t=e.split("."),n=[];let r="";for(const o of t)r+=o,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}(e);return e=>{for(const n of t){if(""===n)break;e=e&&e[n]}return e}}(t));return n(e)}function Zg(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Jg=e=>"undefined"!==typeof e,Qg=e=>"function"===typeof e,ex=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};const tx=Math.PI,nx=2*tx,rx=nx+tx,ox=Number.POSITIVE_INFINITY,ax=tx/180,ix=tx/2,sx=tx/4,lx=2*tx/3,cx=Math.log10,dx=Math.sign;function ux(e,t,n){return Math.abs(e-t)<n}function hx(e){const t=Math.round(e);e=ux(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(cx(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function px(e){return!function(e){return"symbol"===typeof e||"object"===typeof e&&null!==e&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function fx(e,t,n){let r,o,a;for(r=0,o=e.length;r<o;r++)a=e[r][n],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function mx(e){return e*(tx/180)}function gx(e){return e*(180/tx)}function xx(e){if(!Ig(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function bx(e,t){const n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);let a=Math.atan2(r,n);return a<-.5*tx&&(a+=nx),{angle:a,distance:o}}function vx(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function yx(e,t){return(e-t+rx)%nx-tx}function wx(e){return(e%nx+nx)%nx}function kx(e,t,n,r){const o=wx(e),a=wx(t),i=wx(n),s=wx(a-o),l=wx(i-o),c=wx(o-a),d=wx(o-i);return o===a||o===i||r&&a===i||s>l&&c<d}function Sx(e,t,n){return Math.max(t,Math.min(n,e))}function jx(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e-6;return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function Ax(e,t,n){n=n||(n=>e[n]<t);let r,o=e.length-1,a=0;for(;o-a>1;)r=a+o>>1,n(r)?a=r:o=r;return{lo:a,hi:o}}const Cx=(e,t,n,r)=>Ax(e,n,r?r=>{const o=e[r][t];return o<n||o===n&&e[r+1][t]===n}:r=>e[r][t]<n),_x=(e,t,n)=>Ax(e,n,(r=>e[r][t]>=n));const Ex=["push","pop","shift","splice","unshift"];function Mx(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,o=r.indexOf(t);-1!==o&&r.splice(o,1),r.length>0||(Ex.forEach((t=>{delete e[t]})),delete e._chartjs)}function Nx(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const Rx="undefined"===typeof window?function(e){return e()}:window.requestAnimationFrame;function Px(e,t){let n=[],r=!1;return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];n=a,r||(r=!0,Rx.call(window,(()=>{r=!1,e.apply(t,n)})))}}const Ox=e=>"start"===e?"left":"end"===e?"right":"center",Tx=(e,t,n)=>"start"===e?t:"end"===e?n:(t+n)/2;function Lx(e,t,n){const r=t.length;let o=0,a=r;if(e._sorted){const{iScale:i,vScale:s,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,d=i.axis,{min:u,max:h,minDefined:p,maxDefined:f}=i.getUserBounds();if(p){if(o=Math.min(Cx(l,d,u).lo,n?r:Cx(t,d,i.getPixelForValue(u)).lo),c){const e=l.slice(0,o+1).reverse().findIndex((e=>!Og(e[s.axis])));o-=Math.max(0,e)}o=Sx(o,0,r-1)}if(f){let e=Math.max(Cx(l,i.axis,h,!0).hi+1,n?0:Cx(t,d,i.getPixelForValue(h),!0).hi+1);if(c){const t=l.slice(e-1).findIndex((e=>!Og(e[s.axis])));e+=Math.max(0,t)}a=Sx(e,o,r)-o}else a=r-o}return{start:o,count:a}}function Ix(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,o={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=o,!0;const a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,o),a}const zx=e=>0===e||1===e,Dx=(e,t,n)=>-Math.pow(2,10*(e-=1))*Math.sin((e-t)*nx/n),Fx=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*nx/n)+1,Bx={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>1-Math.cos(e*ix),easeOutSine:e=>Math.sin(e*ix),easeInOutSine:e=>-.5*(Math.cos(tx*e)-1),easeInExpo:e=>0===e?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>zx(e)?e:e<.5?.5*Math.pow(2,10*(2*e-1)):.5*(2-Math.pow(2,-10*(2*e-1))),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>zx(e)?e:Dx(e,.075,.3),easeOutElastic:e=>zx(e)?e:Fx(e,.075,.3),easeInOutElastic(e){const t=.1125;return zx(e)?e:e<.5?.5*Dx(2*e,t,.45):.5+.5*Fx(2*e-1,t,.45)},easeInBack(e){const t=1.70158;return e*e*((t+1)*e-t)},easeOutBack(e){const t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:e=>1-Bx.easeOutBounce(1-e),easeOutBounce(e){const t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?.5*Bx.easeInBounce(2*e):.5*Bx.easeOutBounce(2*e-1)+.5};function Wx(e){if(e&&"object"===typeof e){const t=e.toString();return"[object CanvasPattern]"===t||"[object CanvasGradient]"===t}return!1}function Hx(e){return Wx(e)?e:new Ng(e)}function Vx(e){return Wx(e)?e:new Ng(e).saturate(.5).darken(.1).hexString()}const Ux=["x","y","borderWidth","radius","tension"],qx=["color","borderColor","backgroundColor"];const $x=new Map;function Kx(e,t,n){return function(e,t){t=t||{};const n=e+JSON.stringify(t);let r=$x.get(n);return r||(r=new Intl.NumberFormat(e,t),$x.set(n,r)),r}(t,n).format(e)}const Xx={values:e=>Tg(e)?e:""+e,numeric(e,t,n){if(0===e)return"0";const r=this.chart.options.locale;let o,a=e;if(n.length>1){const t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>1e15)&&(o="scientific"),a=function(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e));return n}(e,n)}const i=cx(Math.abs(a)),s=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),l={notation:o,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),Kx(e,r,l)},logarithmic(e,t,n){if(0===e)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(cx(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?Xx.numeric.call(this,e,t,n):""}};var Yx={formatters:Xx};const Gx=Object.create(null),Zx=Object.create(null);function Jx(e,t){if(!t)return e;const n=t.split(".");for(let r=0,o=n.length;r<o;++r){const t=n[r];e=e[t]||(e[t]=Object.create(null))}return e}function Qx(e,t,n){return"string"===typeof t?$g(Jx(e,t),n):$g(Jx(e,""),t)}class eb{constructor(e,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=e=>e.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,t)=>Vx(t.backgroundColor),this.hoverBorderColor=(e,t)=>Vx(t.borderColor),this.hoverColor=(e,t)=>Vx(t.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return Qx(this,e,t)}get(e){return Jx(this,e)}describe(e,t){return Qx(Zx,e,t)}override(e,t){return Qx(Gx,e,t)}route(e,t,n,r){const o=Jx(this,e),a=Jx(this,n),i="_"+t;Object.defineProperties(o,{[i]:{value:o[t],writable:!0},[t]:{enumerable:!0,get(){const e=this[i],t=a[r];return Lg(e)?Object.assign({},t,e):Dg(e,t)},set(e){this[i]=e}}})}apply(e){e.forEach((e=>e(this)))}}var tb=new eb({_scriptable:e=>!e.startsWith("on"),_indexable:e=>"events"!==e,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>"onProgress"!==e&&"onComplete"!==e&&"fn"!==e}),e.set("animations",{colors:{type:"color",properties:qx},numbers:{type:"number",properties:Ux}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>0|e}}}})},function(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Yx.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&"callback"!==e&&"parser"!==e,_indexable:e=>"borderDash"!==e&&"tickBorderDash"!==e&&"dash"!==e}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:e=>"backdropPadding"!==e&&"callback"!==e,_indexable:e=>"backdropPadding"!==e})}]);function nb(e,t,n,r,o){let a=t[o];return a||(a=t[o]=e.measureText(o).width,n.push(o)),a>r&&(r=a),r}function rb(e,t,n,r){let o=(r=r||{}).data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(o=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let i=0;const s=n.length;let l,c,d,u,h;for(l=0;l<s;l++)if(u=n[l],void 0===u||null===u||Tg(u)){if(Tg(u))for(c=0,d=u.length;c<d;c++)h=u[c],void 0===h||null===h||Tg(h)||(i=nb(e,o,a,i,h))}else i=nb(e,o,a,i,u);e.restore();const p=a.length/2;if(p>n.length){for(l=0;l<p;l++)delete o[a[l]];a.splice(0,p)}return i}function ob(e,t,n){const r=e.currentDevicePixelRatio,o=0!==n?Math.max(n/2,.5):0;return Math.round((t-o)*r)/r+o}function ab(e,t){(t||e)&&((t=t||e.getContext("2d")).save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function ib(e,t,n,r){sb(e,t,n,r,null)}function sb(e,t,n,r,o){let a,i,s,l,c,d,u,h;const p=t.pointStyle,f=t.rotation,m=t.radius;let g=(f||0)*ax;if(p&&"object"===typeof p&&(a=p.toString(),"[object HTMLImageElement]"===a||"[object HTMLCanvasElement]"===a))return e.save(),e.translate(n,r),e.rotate(g),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),void e.restore();if(!(isNaN(m)||m<=0)){switch(e.beginPath(),p){default:o?e.ellipse(n,r,o/2,m,0,0,nx):e.arc(n,r,m,0,nx),e.closePath();break;case"triangle":d=o?o/2:m,e.moveTo(n+Math.sin(g)*d,r-Math.cos(g)*m),g+=lx,e.lineTo(n+Math.sin(g)*d,r-Math.cos(g)*m),g+=lx,e.lineTo(n+Math.sin(g)*d,r-Math.cos(g)*m),e.closePath();break;case"rectRounded":c=.516*m,l=m-c,i=Math.cos(g+sx)*l,u=Math.cos(g+sx)*(o?o/2-c:l),s=Math.sin(g+sx)*l,h=Math.sin(g+sx)*(o?o/2-c:l),e.arc(n-u,r-s,c,g-tx,g-ix),e.arc(n+h,r-i,c,g-ix,g),e.arc(n+u,r+s,c,g,g+ix),e.arc(n-h,r+i,c,g+ix,g+tx),e.closePath();break;case"rect":if(!f){l=Math.SQRT1_2*m,d=o?o/2:l,e.rect(n-d,r-l,2*d,2*l);break}g+=sx;case"rectRot":u=Math.cos(g)*(o?o/2:m),i=Math.cos(g)*m,s=Math.sin(g)*m,h=Math.sin(g)*(o?o/2:m),e.moveTo(n-u,r-s),e.lineTo(n+h,r-i),e.lineTo(n+u,r+s),e.lineTo(n-h,r+i),e.closePath();break;case"crossRot":g+=sx;case"cross":u=Math.cos(g)*(o?o/2:m),i=Math.cos(g)*m,s=Math.sin(g)*m,h=Math.sin(g)*(o?o/2:m),e.moveTo(n-u,r-s),e.lineTo(n+u,r+s),e.moveTo(n+h,r-i),e.lineTo(n-h,r+i);break;case"star":u=Math.cos(g)*(o?o/2:m),i=Math.cos(g)*m,s=Math.sin(g)*m,h=Math.sin(g)*(o?o/2:m),e.moveTo(n-u,r-s),e.lineTo(n+u,r+s),e.moveTo(n+h,r-i),e.lineTo(n-h,r+i),g+=sx,u=Math.cos(g)*(o?o/2:m),i=Math.cos(g)*m,s=Math.sin(g)*m,h=Math.sin(g)*(o?o/2:m),e.moveTo(n-u,r-s),e.lineTo(n+u,r+s),e.moveTo(n+h,r-i),e.lineTo(n-h,r+i);break;case"line":i=o?o/2:Math.cos(g)*m,s=Math.sin(g)*m,e.moveTo(n-i,r-s),e.lineTo(n+i,r+s);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(g)*(o?o/2:m),r+Math.sin(g)*m);break;case!1:e.closePath()}e.fill(),t.borderWidth>0&&e.stroke()}}function lb(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function cb(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function db(e){e.restore()}function ub(e,t,n,r,o){if(!t)return e.lineTo(n.x,n.y);if("middle"===o){const r=(t.x+n.x)/2;e.lineTo(r,t.y),e.lineTo(r,n.y)}else"after"===o!==!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function hb(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function pb(e,t,n,r,o){if(o.strikethrough||o.underline){const a=e.measureText(r),i=t-a.actualBoundingBoxLeft,s=t+a.actualBoundingBoxRight,l=n-a.actualBoundingBoxAscent,c=n+a.actualBoundingBoxDescent,d=o.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=o.decorationWidth||2,e.moveTo(i,d),e.lineTo(s,d),e.stroke()}}function fb(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function mb(e,t,n,r,o){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};const i=Tg(t)?t:[t],s=a.strokeWidth>0&&""!==a.strokeColor;let l,c;for(e.save(),e.font=o.string,function(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Og(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}(e,a),l=0;l<i.length;++l)c=i[l],a.backdrop&&fb(e,a.backdrop),s&&(a.strokeColor&&(e.strokeStyle=a.strokeColor),Og(a.strokeWidth)||(e.lineWidth=a.strokeWidth),e.strokeText(c,n,r,a.maxWidth)),e.fillText(c,n,r,a.maxWidth),pb(e,n,r,c,a),r+=Number(o.lineHeight);e.restore()}function gb(e,t){const{x:n,y:r,w:o,h:a,radius:i}=t;e.arc(n+i.topLeft,r+i.topLeft,i.topLeft,1.5*tx,tx,!0),e.lineTo(n,r+a-i.bottomLeft),e.arc(n+i.bottomLeft,r+a-i.bottomLeft,i.bottomLeft,tx,ix,!0),e.lineTo(n+o-i.bottomRight,r+a),e.arc(n+o-i.bottomRight,r+a-i.bottomRight,i.bottomRight,ix,0,!0),e.lineTo(n+o,r+i.topRight),e.arc(n+o-i.topRight,r+i.topRight,i.topRight,0,-ix,!0),e.lineTo(n+i.topLeft,r)}const xb=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,bb=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function vb(e,t){const n=(""+e).match(xb);if(!n||"normal"===n[1])return 1.2*t;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100}return t*e}function yb(e,t){const n={},r=Lg(t),o=r?Object.keys(t):t,a=Lg(e)?r?n=>Dg(e[n],e[t[n]]):t=>e[t]:()=>e;for(const i of o)n[i]=+a(i)||0;return n}function wb(e){return yb(e,{top:"y",right:"x",bottom:"y",left:"x"})}function kb(e){return yb(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Sb(e){const t=wb(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function jb(e,t){e=e||{},t=t||tb.font;let n=Dg(e.size,t.size);"string"===typeof n&&(n=parseInt(n,10));let r=Dg(e.style,t.style);r&&!(""+r).match(bb)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:Dg(e.family,t.family),lineHeight:vb(Dg(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Dg(e.weight,t.weight),string:""};return o.string=function(e){return!e||Og(e.size)||Og(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}(o),o}function Ab(e,t,n,r){let o,a,i,s=!0;for(o=0,a=e.length;o<a;++o)if(i=e[o],void 0!==i&&(void 0!==t&&"function"===typeof i&&(i=i(t),s=!1),void 0!==n&&Tg(i)&&(i=i[n%i.length],s=!1),void 0!==i))return r&&!s&&(r.cacheable=!1),i}function Cb(e,t){return Object.assign(Object.create(e),t)}function _b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[""],n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:()=>e[0];const o=(arguments.length>2?arguments[2]:void 0)||e;"undefined"===typeof n&&(n=Db("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:n,_getTarget:r,override:r=>_b([r,...e],t,o,n)};return new Proxy(a,{deleteProperty:(t,n)=>(delete t[n],delete t._keys,delete e[0][n],!0),get:(n,r)=>Pb(n,r,(()=>function(e,t,n,r){let o;for(const a of t)if(o=Db(Nb(a,e),n),"undefined"!==typeof o)return Rb(e,o)?Ib(n,r,e,o):o}(r,t,e,n))),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(e._scopes[0],t),getPrototypeOf:()=>Reflect.getPrototypeOf(e[0]),has:(e,t)=>Fb(e).includes(t),ownKeys:e=>Fb(e),set(e,t,n){const o=e._storage||(e._storage=r());return e[t]=o[t]=n,delete e._keys,!0}})}function Eb(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Mb(e,r),setContext:t=>Eb(e,t,n,r),override:o=>Eb(e.override(o),t,n,r)};return new Proxy(o,{deleteProperty:(t,n)=>(delete t[n],delete e[n],!0),get:(e,t,n)=>Pb(e,t,(()=>function(e,t,n){const{_proxy:r,_context:o,_subProxy:a,_descriptors:i}=e;let s=r[t];Qg(s)&&i.isScriptable(t)&&(s=function(e,t,n,r){const{_proxy:o,_context:a,_subProxy:i,_stack:s}=n;if(s.has(e))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+e);s.add(e);let l=t(a,i||r);s.delete(e),Rb(e,l)&&(l=Ib(o._scopes,o,e,l));return l}(t,s,e,n));Tg(s)&&s.length&&(s=function(e,t,n,r){const{_proxy:o,_context:a,_subProxy:i,_descriptors:s}=n;if("undefined"!==typeof a.index&&r(e))return t[a.index%t.length];if(Lg(t[0])){const n=t,r=o._scopes.filter((e=>e!==n));t=[];for(const l of n){const n=Ib(r,o,e,l);t.push(Eb(n,a,i&&i[e],s))}}return t}(t,s,e,i.isIndexable));Rb(t,s)&&(s=Eb(s,o,a&&a[t],i));return s}(e,t,n))),getOwnPropertyDescriptor:(t,n)=>t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n),getPrototypeOf:()=>Reflect.getPrototypeOf(e),has:(t,n)=>Reflect.has(e,n),ownKeys:()=>Reflect.ownKeys(e),set:(t,n,r)=>(e[n]=r,delete t[n],!0)})}function Mb(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{scriptable:!0,indexable:!0};const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:o=t.allKeys}=e;return{allKeys:o,scriptable:n,indexable:r,isScriptable:Qg(n)?n:()=>n,isIndexable:Qg(r)?r:()=>r}}const Nb=(e,t)=>e?e+Zg(t):t,Rb=(e,t)=>Lg(t)&&"adapters"!==e&&(null===Object.getPrototypeOf(t)||t.constructor===Object);function Pb(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||"constructor"===t)return e[t];const r=n();return e[t]=r,r}function Ob(e,t,n){return Qg(e)?e(t,n):e}const Tb=(e,t)=>!0===e?t:"string"===typeof e?Gg(t,e):void 0;function Lb(e,t,n,r,o){for(const a of t){const t=Tb(n,a);if(t){e.add(t);const a=Ob(t._fallback,n,o);if("undefined"!==typeof a&&a!==n&&a!==r)return a}else if(!1===t&&"undefined"!==typeof r&&n!==r)return null}return!1}function Ib(e,t,n,r){const o=t._rootScopes,a=Ob(t._fallback,n,r),i=[...e,...o],s=new Set;s.add(r);let l=zb(s,i,n,a||n,r);return null!==l&&(("undefined"===typeof a||a===n||(l=zb(s,i,a,l,r),null!==l))&&_b(Array.from(s),[""],o,a,(()=>function(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];if(Tg(o)&&Lg(n))return n;return o||{}}(t,n,r))))}function zb(e,t,n,r,o){for(;n;)n=Lb(e,t,n,r,o);return n}function Db(e,t){for(const n of t){if(!n)continue;const t=n[e];if("undefined"!==typeof t)return t}}function Fb(e){let t=e._keys;return t||(t=e._keys=function(e){const t=new Set;for(const n of e)for(const e of Object.keys(n).filter((e=>!e.startsWith("_"))))t.add(e);return Array.from(t)}(e._scopes)),t}function Bb(e,t,n,r){const{iScale:o}=e,{key:a="r"}=this._parsing,i=new Array(r);let s,l,c,d;for(s=0,l=r;s<l;++s)c=s+n,d=t[c],i[s]={r:o.parse(Gg(d,a),c)};return i}const Wb=Number.EPSILON||1e-14,Hb=(e,t)=>t<e.length&&!e[t].skip&&e[t],Vb=e=>"x"===e?"y":"x";function Ub(e,t,n,r){const o=e.skip?t:e,a=t,i=n.skip?t:n,s=vx(a,o),l=vx(i,a);let c=s/(s+l),d=l/(s+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;const u=r*c,h=r*d;return{previous:{x:a.x-u*(i.x-o.x),y:a.y-u*(i.y-o.y)},next:{x:a.x+h*(i.x-o.x),y:a.y+h*(i.y-o.y)}}}function qb(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x";const n=Vb(t),r=e.length,o=Array(r).fill(0),a=Array(r);let i,s,l,c=Hb(e,0);for(i=0;i<r;++i)if(s=l,l=c,c=Hb(e,i+1),l){if(c){const e=c[t]-l[t];o[i]=0!==e?(c[n]-l[n])/e:0}a[i]=s?c?dx(o[i-1])!==dx(o[i])?0:(o[i-1]+o[i])/2:o[i-1]:o[i]}!function(e,t,n){const r=e.length;let o,a,i,s,l,c=Hb(e,0);for(let d=0;d<r-1;++d)l=c,c=Hb(e,d+1),l&&c&&(ux(t[d],0,Wb)?n[d]=n[d+1]=0:(o=n[d]/t[d],a=n[d+1]/t[d],s=Math.pow(o,2)+Math.pow(a,2),s<=9||(i=3/Math.sqrt(s),n[d]=o*i*t[d],n[d+1]=a*i*t[d])))}(e,o,a),function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"x";const r=Vb(n),o=e.length;let a,i,s,l=Hb(e,0);for(let c=0;c<o;++c){if(i=s,s=l,l=Hb(e,c+1),!s)continue;const o=s[n],d=s[r];i&&(a=(o-i[n])/3,s["cp1".concat(n)]=o-a,s["cp1".concat(r)]=d-a*t[c]),l&&(a=(l[n]-o)/3,s["cp2".concat(n)]=o+a,s["cp2".concat(r)]=d+a*t[c])}}(e,a,t)}function $b(e,t,n){return Math.max(Math.min(e,n),t)}function Kb(e,t,n,r,o){let a,i,s,l;if(t.spanGaps&&(e=e.filter((e=>!e.skip))),"monotone"===t.cubicInterpolationMode)qb(e,o);else{let n=r?e[e.length-1]:e[0];for(a=0,i=e.length;a<i;++a)s=e[a],l=Ub(n,s,e[Math.min(a+1,i-(r?0:1))%i],t.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,n=s}t.capBezierPoints&&function(e,t){let n,r,o,a,i,s=lb(e[0],t);for(n=0,r=e.length;n<r;++n)i=a,a=s,s=n<r-1&&lb(e[n+1],t),a&&(o=e[n],i&&(o.cp1x=$b(o.cp1x,t.left,t.right),o.cp1y=$b(o.cp1y,t.top,t.bottom)),s&&(o.cp2x=$b(o.cp2x,t.left,t.right),o.cp2y=$b(o.cp2y,t.top,t.bottom)))}(e,n)}function Xb(){return"undefined"!==typeof window&&"undefined"!==typeof document}function Yb(e){let t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t}function Gb(e,t,n){let r;return"string"===typeof e?(r=parseInt(e,10),-1!==e.indexOf("%")&&(r=r/100*t.parentNode[n])):r=e,r}const Zb=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);const Jb=["top","right","bottom","left"];function Qb(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const a=Jb[o];r[a]=parseFloat(e[t+"-"+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}function ev(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,o=Zb(n),a="border-box"===o.boxSizing,i=Qb(o,"padding"),s=Qb(o,"border","width"),{x:l,y:c,box:d}=function(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:o,offsetY:a}=r;let i,s,l=!1;if(((e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot))(o,a,e.target))i=o,s=a;else{const e=t.getBoundingClientRect();i=r.clientX-e.left,s=r.clientY-e.top,l=!0}return{x:i,y:s,box:l}}(e,n),u=i.left+(d&&s.left),h=i.top+(d&&s.top);let{width:p,height:f}=t;return a&&(p-=i.width+s.width,f-=i.height+s.height),{x:Math.round((l-u)/p*n.width/r),y:Math.round((c-h)/f*n.height/r)}}const tv=e=>Math.round(10*e)/10;function nv(e,t,n,r){const o=Zb(e),a=Qb(o,"margin"),i=Gb(o.maxWidth,e,"clientWidth")||ox,s=Gb(o.maxHeight,e,"clientHeight")||ox,l=function(e,t,n){let r,o;if(void 0===t||void 0===n){const a=e&&Yb(e);if(a){const e=a.getBoundingClientRect(),i=Zb(a),s=Qb(i,"border","width"),l=Qb(i,"padding");t=e.width-l.width-s.width,n=e.height-l.height-s.height,r=Gb(i.maxWidth,a,"clientWidth"),o=Gb(i.maxHeight,a,"clientHeight")}else t=e.clientWidth,n=e.clientHeight}return{width:t,height:n,maxWidth:r||ox,maxHeight:o||ox}}(e,t,n);let{width:c,height:d}=l;if("content-box"===o.boxSizing){const e=Qb(o,"border","width"),t=Qb(o,"padding");c-=t.width+e.width,d-=t.height+e.height}c=Math.max(0,c-a.width),d=Math.max(0,r?c/r:d-a.height),c=tv(Math.min(c,i,l.maxWidth)),d=tv(Math.min(d,s,l.maxHeight)),c&&!d&&(d=tv(c/2));return(void 0!==t||void 0!==n)&&r&&l.height&&d>l.height&&(d=l.height,c=tv(Math.floor(d*r))),{width:c,height:d}}function rv(e,t,n){const r=t||1,o=Math.floor(e.height*r),a=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const i=e.canvas;return i.style&&(n||!i.style.height&&!i.style.width)&&(i.style.height="".concat(e.height,"px"),i.style.width="".concat(e.width,"px")),(e.currentDevicePixelRatio!==r||i.height!==o||i.width!==a)&&(e.currentDevicePixelRatio=r,i.height=o,i.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0)}const ov=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Xb()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch(RR){}return e}();function av(e,t){const n=function(e,t){return Zb(e).getPropertyValue(t)}(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function iv(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function sv(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:"middle"===r?n<.5?e.y:t.y:"after"===r?n<1?e.y:t.y:n>0?t.y:e.y}}function lv(e,t,n,r){const o={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},i=iv(e,o,n),s=iv(o,a,n),l=iv(a,t,n),c=iv(i,s,n),d=iv(s,l,n);return iv(c,d,n)}function cv(e,t,n){return e?function(e,t){return{x:n=>e+e+t-n,setWidth(e){t=e},textAlign:e=>"center"===e?e:"right"===e?"left":"right",xPlus:(e,t)=>e-t,leftForLtr:(e,t)=>e-t}}(t,n):{x:e=>e,setWidth(e){},textAlign:e=>e,xPlus:(e,t)=>e+t,leftForLtr:(e,t)=>e}}function dv(e,t){let n,r;"ltr"!==t&&"rtl"!==t||(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function uv(e,t){void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function hv(e){return"angle"===e?{between:kx,compare:yx,normalize:wx}:{between:jx,compare:(e,t)=>e-t,normalize:e=>e}}function pv(e){let{start:t,end:n,count:r,loop:o,style:a}=e;return{start:t%r,end:n%r,loop:o&&(n-t+1)%r===0,style:a}}function fv(e,t,n){if(!n)return[e];const{property:r,start:o,end:a}=n,i=t.length,{compare:s,between:l,normalize:c}=hv(r),{start:d,end:u,loop:h,style:p}=function(e,t,n){const{property:r,start:o,end:a}=n,{between:i,normalize:s}=hv(r),l=t.length;let c,d,{start:u,end:h,loop:p}=e;if(p){for(u+=l,h+=l,c=0,d=l;c<d&&i(s(t[u%l][r]),o,a);++c)u--,h--;u%=l,h%=l}return h<u&&(h+=l),{start:u,end:h,loop:p,style:e.style}}(e,t,n),f=[];let m,g,x,b=!1,v=null;const y=()=>b||l(o,x,m)&&0!==s(o,x),w=()=>!b||0===s(a,m)||l(a,x,m);for(let k=d,S=d;k<=u;++k)g=t[k%i],g.skip||(m=c(g[r]),m!==x&&(b=l(m,o,a),null===v&&y()&&(v=0===s(m,o)?k:S),null!==v&&w()&&(f.push(pv({start:v,end:k,loop:h,count:i,style:p})),v=null),S=k,x=m));return null!==v&&f.push(pv({start:v,end:u,loop:h,count:i,style:p})),f}function mv(e,t){const n=[],r=e.segments;for(let o=0;o<r.length;o++){const a=fv(r[o],e.points,t);a.length&&n.push(...a)}return n}function gv(e,t,n,r){return r&&r.setContext&&n?function(e,t,n,r){const o=e._chart.getContext(),a=xv(e.options),{_datasetIndex:i,options:{spanGaps:s}}=e,l=n.length,c=[];let d=a,u=t[0].start,h=u;function p(e,t,r,o){const a=s?-1:1;if(e!==t){for(e+=l;n[e%l].skip;)e-=a;for(;n[t%l].skip;)t+=a;e%l!==t%l&&(c.push({start:e%l,end:t%l,loop:r,style:o}),d=o,u=t%l)}}for(const f of t){u=s?u:f.start;let e,t=n[u%l];for(h=u+1;h<=f.end;h++){const a=n[h%l];e=xv(r.setContext(Cb(o,{type:"segment",p0:t,p1:a,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:i}))),bv(e,d)&&p(u,h-1,f.loop,d),t=a,d=e}u<h-1&&p(u,h-1,f.loop,d)}return c}(e,t,n,r):t}function xv(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function bv(e,t){if(!t)return!1;const n=[],r=function(e,t){return Wx(t)?(n.includes(t)||n.push(t),n.indexOf(t)):t};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function vv(e,t,n){return e.options.clip?e[n]:t[n]}function yv(e,t){const n=t._clip;if(n.disabled)return!1;const r=function(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:vv(n,t,"left"),right:vv(n,t,"right"),top:vv(r,t,"top"),bottom:vv(r,t,"bottom")}:t}(t,e.chartArea);return{left:!1===n.left?0:r.left-(!0===n.left?0:n.left),right:!1===n.right?e.width:r.right+(!0===n.right?0:n.right),top:!1===n.top?0:r.top-(!0===n.top?0:n.top),bottom:!1===n.bottom?e.height:r.bottom+(!0===n.bottom?0:n.bottom)}}class wv{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,r){const o=t.listeners[r],a=t.duration;o.forEach((r=>r({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)})))}_refresh(){this._request||(this._running=!0,this._request=Rx.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now(),t=0;this._charts.forEach(((n,r)=>{if(!n.running||!n.items.length)return;const o=n.items;let a,i=o.length-1,s=!1;for(;i>=0;--i)a=o[i],a._active?(a._total>n.duration&&(n.duration=a._total),a.tick(e),s=!0):(o[i]=o[o.length-1],o.pop());s&&(r.draw(),this._notify(r,n,e,"progress")),o.length||(n.running=!1,this._notify(r,n,e,"complete"),n.initial=!1),t+=o.length})),this._lastDate=e,0===t&&(this._running=!1)}_getAnims(e){const t=this._charts;let n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){t&&t.length&&this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce(((e,t)=>Math.max(e,t._duration)),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!!(t&&t.running&&t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const n=t.items;let r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var kv=new wv;const Sv="transparent",jv={boolean:(e,t,n)=>n>.5?t:e,color(e,t,n){const r=Hx(e||Sv),o=r.valid&&Hx(t||Sv);return o&&o.valid?o.mix(r,n).hexString():t},number:(e,t,n)=>e+(t-e)*n};class Av{constructor(e,t,n,r){const o=t[n];r=Ab([e.to,r,o,e.from]);const a=Ab([e.from,o,r]);this._active=!0,this._fn=e.fn||jv[e.type||typeof a],this._easing=Bx[e.easing]||Bx.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);const r=this._target[this._prop],o=n-this._start,a=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=Ab([e.to,t,r,e.from]),this._from=Ab([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,n=this._duration,r=this._prop,o=this._from,a=this._loop,i=this._to;let s;if(this._active=o!==i&&(a||t<n),!this._active)return this._target[r]=i,void this._notify(!0);t<0?this._target[r]=o:(s=t/n%2,s=a&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(o,i,s))}wait(){const e=this._promises||(this._promises=[]);return new Promise(((t,n)=>{e.push({res:t,rej:n})}))}_notify(e){const t=e?"res":"rej",n=this._promises||[];for(let r=0;r<n.length;r++)n[r][t]()}}class Cv{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!Lg(e))return;const t=Object.keys(tb.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach((r=>{const o=e[r];if(!Lg(o))return;const a={};for(const e of t)a[e]=o[e];(Tg(o.properties)&&o.properties||[r]).forEach((e=>{e!==r&&n.has(e)||n.set(e,a)}))}))}_animateOptions(e,t){const n=t.options,r=function(e,t){if(!t)return;let n=e.options;if(!n)return void(e.options=t);n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}}));return n}(e,n);if(!r)return[];const o=this._createAnimations(r,n);return n.$shared&&function(e,t){const n=[],r=Object.keys(t);for(let o=0;o<r.length;o++){const t=e[r[o]];t&&t.active()&&n.push(t.wait())}return Promise.all(n)}(e.options.$animations,n).then((()=>{e.options=n}),(()=>{})),o}_createAnimations(e,t){const n=this._properties,r=[],o=e.$animations||(e.$animations={}),a=Object.keys(t),i=Date.now();let s;for(s=a.length-1;s>=0;--s){const l=a[s];if("$"===l.charAt(0))continue;if("options"===l){r.push(...this._animateOptions(e,t));continue}const c=t[l];let d=o[l];const u=n.get(l);if(d){if(u&&d.active()){d.update(u,c,i);continue}d.cancel()}u&&u.duration?(o[l]=d=new Av(u,e,l,c),r.push(d)):e[l]=c}return r}update(e,t){if(0===this._properties.size)return void Object.assign(e,t);const n=this._createAnimations(e,t);return n.length?(kv.add(this._chart,n),!0):void 0}}function _v(e,t){const n=e&&e.options||{},r=n.reverse,o=void 0===n.min?t:0,a=void 0===n.max?t:0;return{start:r?a:o,end:r?o:a}}function Ev(e,t){const n=[],r=e._getSortedDatasetMetas(t);let o,a;for(o=0,a=r.length;o<a;++o)n.push(r[o].index);return n}function Mv(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=e.keys,a="single"===r.mode;let i,s,l,c;if(null===t)return;let d=!1;for(i=0,s=o.length;i<s;++i){if(l=+o[i],l===n){if(d=!0,r.all)continue;break}c=e.values[l],Ig(c)&&(a||0===t||dx(t)===dx(c))&&(t+=c)}return d||r.all?t:0}function Nv(e,t){const n=e&&e.options.stacked;return n||void 0===n&&void 0!==t.stack}function Rv(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Pv(e,t,n,r){for(const o of t.getMatchingVisibleMetas(r).reverse()){const t=e[o.index];if(n&&t>0||!n&&t<0)return o.index}return null}function Ov(e,t){const{chart:n,_cachedMeta:r}=e,o=n._stacks||(n._stacks={}),{iScale:a,vScale:i,index:s}=r,l=a.axis,c=i.axis,d=function(e,t,n){return"".concat(e.id,".").concat(t.id,".").concat(n.stack||n.type)}(a,i,r),u=t.length;let h;for(let p=0;p<u;++p){const e=t[p],{[l]:n,[c]:a}=e;h=(e._stacks||(e._stacks={}))[c]=Rv(o,d,n),h[s]=a,h._top=Pv(h,i,!0,r.type),h._bottom=Pv(h,i,!1,r.type);(h._visualValues||(h._visualValues={}))[s]=a}}function Tv(e,t){const n=e.scales;return Object.keys(n).filter((e=>n[e].axis===t)).shift()}function Lv(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const e of t){const t=e._stacks;if(!t||void 0===t[r]||void 0===t[r][n])return;delete t[r][n],void 0!==t[r]._visualValues&&void 0!==t[r]._visualValues[n]&&delete t[r]._visualValues[n]}}}const Iv=e=>"reset"===e||"none"===e,zv=(e,t)=>t?e:Object.assign({},e);class Dv{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Nv(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&Lv(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>"x"===e?t:"r"===e?r:n,o=t.xAxisID=Dg(n.xAxisID,Tv(e,"x")),a=t.yAxisID=Dg(n.yAxisID,Tv(e,"y")),i=t.rAxisID=Dg(n.rAxisID,Tv(e,"r")),s=t.indexAxis,l=t.iAxisID=r(s,o,a,i),c=t.vAxisID=r(s,a,o,i);t.xScale=this.getScaleForId(o),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(i),t.iScale=this.getScaleForId(l),t.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Mx(this._data,this),e._stacked&&Lv(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),n=this._data;if(Lg(t)){const e=this._cachedMeta;this._data=function(e,t){const{iScale:n,vScale:r}=t,o="x"===n.axis?"x":"y",a="x"===r.axis?"x":"y",i=Object.keys(e),s=new Array(i.length);let l,c,d;for(l=0,c=i.length;l<c;++l)d=i[l],s[l]={[o]:d,[a]:e[d]};return s}(t,e)}else if(n!==t){if(n){Mx(n,this);const e=this._cachedMeta;Lv(e),e._parsed=[]}t&&Object.isExtensible(t)&&(o=this,(r=t)._chartjs?r._chartjs.listeners.push(o):(Object.defineProperty(r,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[o]}}),Ex.forEach((e=>{const t="_onData"+Zg(e),n=r[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,value(){for(var e=arguments.length,o=new Array(e),a=0;a<e;a++)o[a]=arguments[a];const i=n.apply(this,o);return r._chartjs.listeners.forEach((e=>{"function"===typeof e[t]&&e[t](...o)})),i}})})))),this._syncList=[],this._data=t}var r,o}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,n=this.getDataset();let r=!1;this._dataCheck();const o=t._stacked;t._stacked=Nv(t.vScale,t),t.stack!==n.stack&&(r=!0,Lv(t),t.stack=n.stack),this._resyncElements(e),(r||o!==t._stacked)&&(Ov(this,t._parsed),t._stacked=Nv(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:n,_data:r}=this,{iScale:o,_stacked:a}=n,i=o.axis;let s,l,c,d=0===e&&t===r.length||n._sorted,u=e>0&&n._parsed[e-1];if(!1===this._parsing)n._parsed=r,n._sorted=!0,c=r;else{c=Tg(r[e])?this.parseArrayData(n,r,e,t):Lg(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);const o=()=>null===l[i]||u&&l[i]<u[i];for(s=0;s<t;++s)n._parsed[s+e]=l=c[s],d&&(o()&&(d=!1),u=l);n._sorted=d}a&&Ov(this,c)}parsePrimitiveData(e,t,n,r){const{iScale:o,vScale:a}=e,i=o.axis,s=a.axis,l=o.getLabels(),c=o===a,d=new Array(r);let u,h,p;for(u=0,h=r;u<h;++u)p=u+n,d[u]={[i]:c||o.parse(l[p],p),[s]:a.parse(t[p],p)};return d}parseArrayData(e,t,n,r){const{xScale:o,yScale:a}=e,i=new Array(r);let s,l,c,d;for(s=0,l=r;s<l;++s)c=s+n,d=t[c],i[s]={x:o.parse(d[0],c),y:a.parse(d[1],c)};return i}parseObjectData(e,t,n,r){const{xScale:o,yScale:a}=e,{xAxisKey:i="x",yAxisKey:s="y"}=this._parsing,l=new Array(r);let c,d,u,h;for(c=0,d=r;c<d;++c)u=c+n,h=t[u],l[c]={x:o.parse(Gg(h,i),u),y:a.parse(Gg(h,s),u)};return l}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){const r=this.chart,o=this._cachedMeta,a=t[e.axis];return Mv({keys:Ev(r,!0),values:t._stacks[e.axis]._visualValues},a,o.index,{mode:n})}updateRangeFromParsed(e,t,n,r){const o=n[t.axis];let a=null===o?NaN:o;const i=r&&n._stacks[t.axis];r&&i&&(r.values=i,a=Mv(r,o,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,t){const n=this._cachedMeta,r=n._parsed,o=n._sorted&&e===n.iScale,a=r.length,i=this._getOtherScale(e),s=((e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Ev(n,!0),values:null})(t,n,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=function(e){const{min:t,max:n,minDefined:r,maxDefined:o}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:o?n:Number.POSITIVE_INFINITY}}(i);let u,h;function p(){h=r[u];const t=h[i.axis];return!Ig(h[e.axis])||c>t||d<t}for(u=0;u<a&&(p()||(this.updateRangeFromParsed(l,e,h,s),!o));++u);if(o)for(u=a-1;u>=0;--u)if(!p()){this.updateRangeFromParsed(l,e,h,s);break}return l}getAllParsedValues(e){const t=this._cachedMeta._parsed,n=[];let r,o,a;for(r=0,o=t.length;r<o;++r)a=t[r][e.axis],Ig(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,n=t.iScale,r=t.vScale,o=this.getParsed(e);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:r?""+r.getLabelForValue(o[r.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=function(e){let t,n,r,o;return Lg(e)?(t=e.top,n=e.right,r=e.bottom,o=e.left):t=n=r=o=e,{top:t,right:n,bottom:r,left:o,disabled:!1===e}}(Dg(this.options.clip,function(e,t,n){if(!1===n)return!1;const r=_v(e,n),o=_v(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,n=this._cachedMeta,r=n.data||[],o=t.chartArea,a=[],i=this._drawStart||0,s=this._drawCount||r.length-i,l=this.options.drawActiveElementsOnTop;let c;for(n.dataset&&n.dataset.draw(e,o,i,s),c=i;c<i+s;++c){const t=r[c];t.hidden||(t.active&&l?a.push(t):t.draw(e,o))}for(c=0;c<a.length;++c)a[c].draw(e,o)}getStyle(e,t){const n=t?"active":"default";return void 0===e&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){const r=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const t=this._cachedMeta.data[e];o=t.$context||(t.$context=function(e,t,n){return Cb(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}(this.getContext(),e,t)),o.parsed=this.getParsed(e),o.raw=r.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=function(e,t){return Cb(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),o.dataset=r,o.index=o.datasetIndex=this.index;return o.active=!!t,o.mode=n,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",n=arguments.length>2?arguments[2]:void 0;const r="active"===t,o=this._cachedDataOpts,a=e+"-"+t,i=o[a],s=this.enableOptionSharing&&Jg(n);if(i)return zv(i,s);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,e),d=r?["".concat(e,"Hover"),"hover",e,""]:[e,""],u=l.getOptionScopes(this.getDataset(),c),h=Object.keys(tb.elements[e]),p=l.resolveNamedOptions(u,h,(()=>this.getContext(n,r,t)),d);return p.$shared&&(p.$shared=s,o[a]=Object.freeze(zv(p,s))),p}_resolveAnimations(e,t,n){const r=this.chart,o=this._cachedDataOpts,a="animation-".concat(t),i=o[a];if(i)return i;let s;if(!1!==r.options.animation){const r=this.chart.config,o=r.datasetAnimationScopeKeys(this._type,t),a=r.getOptionScopes(this.getDataset(),o);s=r.createResolver(a,this.getContext(e,n,t))}const l=new Cv(r,s&&s.animations);return s&&s._cacheable&&(o[a]=Object.freeze(l)),l}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||Iv(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,o=this.getSharedOptions(n),a=this.includeOptions(t,o)||o!==r;return this.updateSharedOptions(o,t,n),{sharedOptions:o,includeOptions:a}}updateElement(e,t,n,r){Iv(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!Iv(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;const o=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(o)||o})}removeHoverStyle(e,t,n){this._setStyle(e,n,"active",!1)}setHoverStyle(e,t,n){this._setStyle(e,n,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,n=this._cachedMeta.data;for(const[i,s,l]of this._syncList)this[i](s,l);this._syncList=[];const r=n.length,o=t.length,a=Math.min(o,r);a&&this.parse(0,a),o>r?this._insertElements(r,o-r,e):o<r&&this._removeElements(o,r-o)}_insertElements(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=this._cachedMeta,o=r.data,a=e+t;let i;const s=e=>{for(e.length+=t,i=e.length-1;i>=a;i--)e[i]=e[i-t]};for(s(o),i=e;i<a;++i)o[i]=new this.dataElementType;this._parsing&&s(r._parsed),this.parse(e,t),n&&this.updateElements(o,e,t,"reset")}updateElements(e,t,n,r){}_removeElements(e,t){const n=this._cachedMeta;if(this._parsing){const r=n._parsed.splice(e,t);n._stacked&&Lv(n,r)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,n,r]=e;this[t](n,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const n=arguments.length-2;n&&this._sync(["_insertElements",e,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Fv(e){const t=e.iScale,n=function(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let t=0,o=n.length;t<o;t++)r=r.concat(n[t].controller.getAllParsedValues(e));e._cache.$bar=Nx(r.sort(((e,t)=>e-t)))}return e._cache.$bar}(t,e.type);let r,o,a,i,s=t._length;const l=()=>{32767!==a&&-32768!==a&&(Jg(i)&&(s=Math.min(s,Math.abs(a-i)||s)),i=a)};for(r=0,o=n.length;r<o;++r)a=t.getPixelForValue(n[r]),l();for(i=void 0,r=0,o=t.ticks.length;r<o;++r)a=t.getPixelForTick(r),l();return s}function Bv(e,t,n,r){return Tg(e)?function(e,t,n,r){const o=n.parse(e[0],r),a=n.parse(e[1],r),i=Math.min(o,a),s=Math.max(o,a);let l=i,c=s;Math.abs(i)>Math.abs(s)&&(l=s,c=i),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:o,end:a,min:i,max:s}}(e,t,n,r):t[n.axis]=n.parse(e,r),t}function Wv(e,t,n,r){const o=e.iScale,a=e.vScale,i=o.getLabels(),s=o===a,l=[];let c,d,u,h;for(c=n,d=n+r;c<d;++c)h=t[c],u={},u[o.axis]=s||o.parse(i[c],c),l.push(Bv(h,u,a,c));return l}function Hv(e){return e&&void 0!==e.barStart&&void 0!==e.barEnd}function Vv(e,t,n,r){let o=t.borderSkipped;const a={};if(!o)return void(e.borderSkipped=a);if(!0===o)return void(e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:i,end:s,reverse:l,top:c,bottom:d}=function(e){let t,n,r,o,a;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(o="end",a="start"):(o="start",a="end"),{start:n,end:r,reverse:t,top:o,bottom:a}}(e);"middle"===o&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=d:(a[Uv(d,i,s,l)]=!0,o=c)),a[Uv(o,i,s,l)]=!0,e.borderSkipped=a}function Uv(e,t,n,r){var o,a,i;return r?(i=n,e=qv(e=(o=e)===(a=t)?i:o===i?a:o,n,t)):e=qv(e,t,n),e}function qv(e,t,n){return"start"===e?t:"end"===e?n:e}function $v(e,t,n){let{inflateAmount:r}=t;e.inflateAmount="auto"===r?1===n?.33:0:r}s(Dv,"defaults",{}),s(Dv,"datasetElementType",null),s(Dv,"dataElementType",null);class Kv extends Dv{parsePrimitiveData(e,t,n,r){return Wv(e,t,n,r)}parseArrayData(e,t,n,r){return Wv(e,t,n,r)}parseObjectData(e,t,n,r){const{iScale:o,vScale:a}=e,{xAxisKey:i="x",yAxisKey:s="y"}=this._parsing,l="x"===o.axis?i:s,c="x"===a.axis?i:s,d=[];let u,h,p,f;for(u=n,h=n+r;u<h;++u)f=t[u],p={},p[o.axis]=o.parse(Gg(f,l),u),d.push(Bv(Gg(f,c),p,a,u));return d}updateRangeFromParsed(e,t,n,r){super.updateRangeFromParsed(e,t,n,r);const o=n._custom;o&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:n,vScale:r}=t,o=this.getParsed(e),a=o._custom,i=Hv(a)?"["+a.start+", "+a.end+"]":""+r.getLabelForValue(o[r.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:i}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,n,r){const o="reset"===r,{index:a,_cachedMeta:{vScale:i}}=this,s=i.getBasePixel(),l=i.isHorizontal(),c=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(t,r);for(let h=t;h<t+n;h++){const t=this.getParsed(h),n=o||Og(t[i.axis])?{base:s,head:s}:this._calculateBarValuePixels(h),p=this._calculateBarIndexPixels(h,c),f=(t._stacks||{})[i.axis],m={horizontal:l,base:n.base,enableBorderRadius:!f||Hv(t._custom)||a===f._top||a===f._bottom,x:l?n.head:p.center,y:l?p.center:n.head,height:l?p.size:Math.abs(n.size),width:l?Math.abs(n.size):p.size};u&&(m.options=d||this.resolveDataElementOptions(h,e[h].active?"active":r));const g=m.options||e[h].options;Vv(m,g,f,a),$v(m,g,c.ratio),this.updateElement(e[h],h,m,r)}}_getStacks(e,t){const{iScale:n}=this._cachedMeta,r=n.getMatchingVisibleMetas(this._type).filter((e=>e.controller.options.grouped)),o=n.options.stacked,a=[],i=this._cachedMeta.controller.getParsed(t),s=i&&i[n.axis],l=e=>{const t=e._parsed.find((e=>e[n.axis]===s)),r=t&&t[e.vScale.axis];if(Og(r)||isNaN(r))return!0};for(const c of r)if((void 0===t||!l(c))&&((!1===o||-1===a.indexOf(c.stack)||void 0===o&&void 0===c.stack)&&a.push(c.stack),c.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,n){const r=this._getStacks(e,n),o=void 0!==t?r.indexOf(t):-1;return-1===o?r.length-1:o}_getRuler(){const e=this.options,t=this._cachedMeta,n=t.iScale,r=[];let o,a;for(o=0,a=t.data.length;o<a;++o)r.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));const i=e.barThickness;return{min:i||Fv(t),pixels:r,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:i?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:n,index:r},options:{base:o,minBarLength:a}}=this,i=o||0,s=this.getParsed(e),l=s._custom,c=Hv(l);let d,u,h=s[t.axis],p=0,f=n?this.applyStack(t,s,n):h;f!==h&&(p=f-h,f=h),c&&(h=l.barStart,f=l.barEnd-l.barStart,0!==h&&dx(h)!==dx(l.barEnd)&&(p=0),p+=h);const m=Og(o)||c?p:o;let g=t.getPixelForValue(m);if(d=this.chart.getDataVisibility(e)?t.getPixelForValue(p+f):g,u=d-g,Math.abs(u)<a){u=function(e,t,n){return 0!==e?dx(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}(u,t,i)*a,h===i&&(g-=u/2);const e=t.getPixelForDecimal(0),o=t.getPixelForDecimal(1),l=Math.min(e,o),p=Math.max(e,o);g=Math.max(Math.min(g,p),l),d=g+u,n&&!c&&(s._stacks[t.axis]._visualValues[r]=t.getValueForPixel(d)-t.getValueForPixel(g))}if(g===t.getPixelForValue(i)){const e=dx(u)*t.getLineWidthForValue(i)/2;g+=e,u-=e}return{size:u,base:g,head:d,center:d+u/2}}_calculateBarIndexPixels(e,t){const n=t.scale,r=this.options,o=r.skipNull,a=Dg(r.maxBarThickness,1/0);let i,s;if(t.grouped){const n=o?this._getStackCount(e):t.stackCount,l="flex"===r.barThickness?function(e,t,n,r){const o=t.pixels,a=o[e];let i=e>0?o[e-1]:null,s=e<o.length-1?o[e+1]:null;const l=n.categoryPercentage;null===i&&(i=a-(null===s?t.end-t.start:s-a)),null===s&&(s=a+a-i);const c=a-(a-Math.min(i,s))/2*l;return{chunk:Math.abs(s-i)/2*l/r,ratio:n.barPercentage,start:c}}(e,t,r,n):function(e,t,n,r){const o=n.barThickness;let a,i;return Og(o)?(a=t.min*n.categoryPercentage,i=n.barPercentage):(a=o*r,i=1),{chunk:a/r,ratio:i,start:t.pixels[e]-a/2}}(e,t,r,n),c=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0);i=l.start+l.chunk*c+l.chunk/2,s=Math.min(a,l.chunk*l.ratio)}else i=n.getPixelForValue(this.getParsed(e)[n.axis],e),s=Math.min(a,t.min*t.ratio);return{base:i-s/2,head:i+s/2,center:i,size:s}}draw(){const e=this._cachedMeta,t=e.vScale,n=e.data,r=n.length;let o=0;for(;o<r;++o)null===this.getParsed(o)[t.axis]||n[o].hidden||n[o].draw(this._ctx)}}s(Kv,"id","bar"),s(Kv,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),s(Kv,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Xv extends Dv{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,n,r){const o=super.parsePrimitiveData(e,t,n,r);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+n).radius;return o}parseArrayData(e,t,n,r){const o=super.parseArrayData(e,t,n,r);for(let a=0;a<o.length;a++){const e=t[n+a];o[a]._custom=Dg(e[2],this.resolveDataElementOptions(a+n).radius)}return o}parseObjectData(e,t,n,r){const o=super.parseObjectData(e,t,n,r);for(let a=0;a<o.length;a++){const e=t[n+a];o[a]._custom=Dg(e&&e.r&&+e.r,this.resolveDataElementOptions(a+n).radius)}return o}getMaxOverflow(){const e=this._cachedMeta.data;let t=0;for(let n=e.length-1;n>=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:o}=t,a=this.getParsed(e),i=r.getLabelForValue(a.x),s=o.getLabelForValue(a.y),l=a._custom;return{label:n[e]||"",value:"("+i+", "+s+(l?", "+l:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,n,r){const o="reset"===r,{iScale:a,vScale:i}=this._cachedMeta,{sharedOptions:s,includeOptions:l}=this._getSharedOptions(t,r),c=a.axis,d=i.axis;for(let u=t;u<t+n;u++){const t=e[u],n=!o&&this.getParsed(u),h={},p=h[c]=o?a.getPixelForDecimal(.5):a.getPixelForValue(n[c]),f=h[d]=o?i.getBasePixel():i.getPixelForValue(n[d]);h.skip=isNaN(p)||isNaN(f),l&&(h.options=s||this.resolveDataElementOptions(u,t.active?"active":r),o&&(h.options.radius=0)),this.updateElement(t,u,h,r)}}resolveDataElementOptions(e,t){const n=this.getParsed(e);let r=super.resolveDataElementOptions(e,t);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const o=r.radius;return"active"!==t&&(r.radius=0),r.radius+=Dg(n&&n._custom,o),r}}s(Xv,"id","bubble"),s(Xv,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),s(Xv,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});class Yv extends Dv{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const n=this.getDataset().data,r=this._cachedMeta;if(!1===this._parsing)r._parsed=n;else{let o,a,i=e=>+n[e];if(Lg(n[e])){const{key:e="value"}=this._parsing;i=t=>+Gg(n[t],e)}for(o=e,a=e+t;o<a;++o)r._parsed[o]=i(o)}}_getRotation(){return mx(this.options.rotation-90)}_getCircumference(){return mx(this.options.circumference)}_getRotationExtents(){let e=nx,t=-nx;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const r=this.chart.getDatasetMeta(n).controller,o=r._getRotation(),a=r._getCircumference();e=Math.min(e,o),t=Math.max(t,o+a)}return{rotation:e,circumference:t-e}}update(e){const t=this.chart,{chartArea:n}=t,r=this._cachedMeta,o=r.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,i=Math.max((Math.min(n.width,n.height)-a)/2,0),s=Math.min(((e,t)=>"string"===typeof e&&e.endsWith("%")?parseFloat(e)/100:+e/t)(this.options.cutout,i),1),l=this._getRingWeight(this.index),{circumference:c,rotation:d}=this._getRotationExtents(),{ratioX:u,ratioY:h,offsetX:p,offsetY:f}=function(e,t,n){let r=1,o=1,a=0,i=0;if(t<nx){const s=e,l=s+t,c=Math.cos(s),d=Math.sin(s),u=Math.cos(l),h=Math.sin(l),p=(e,t,r)=>kx(e,s,l,!0)?1:Math.max(t,t*n,r,r*n),f=(e,t,r)=>kx(e,s,l,!0)?-1:Math.min(t,t*n,r,r*n),m=p(0,c,u),g=p(ix,d,h),x=f(tx,c,u),b=f(tx+ix,d,h);r=(m-x)/2,o=(g-b)/2,a=-(m+x)/2,i=-(g+b)/2}return{ratioX:r,ratioY:o,offsetX:a,offsetY:i}}(d,c,s),m=(n.width-a)/u,g=(n.height-a)/h,x=Math.max(Math.min(m,g)/2,0),b=Fg(this.options.radius,x),v=(b-Math.max(b*s,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*b,this.offsetY=f*b,r.total=this.calculateTotal(),this.outerRadius=b-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*l,0),this.updateElements(o,0,o.length,e)}_circumference(e,t){const n=this.options,r=this._cachedMeta,o=this._getCircumference();return t&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||null===r._parsed[e]||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*o/nx)}updateElements(e,t,n,r){const o="reset"===r,a=this.chart,i=a.chartArea,s=a.options.animation,l=(i.left+i.right)/2,c=(i.top+i.bottom)/2,d=o&&s.animateScale,u=d?0:this.innerRadius,h=d?0:this.outerRadius,{sharedOptions:p,includeOptions:f}=this._getSharedOptions(t,r);let m,g=this._getRotation();for(m=0;m<t;++m)g+=this._circumference(m,o);for(m=t;m<t+n;++m){const t=this._circumference(m,o),n=e[m],a={x:l+this.offsetX,y:c+this.offsetY,startAngle:g,endAngle:g+t,circumference:t,outerRadius:h,innerRadius:u};f&&(a.options=p||this.resolveDataElementOptions(m,n.active?"active":r)),g+=t,this.updateElement(n,m,a,r)}}calculateTotal(){const e=this._cachedMeta,t=e.data;let n,r=0;for(n=0;n<t.length;n++){const o=e._parsed[n];null===o||isNaN(o)||!this.chart.getDataVisibility(n)||t[n].hidden||(r+=Math.abs(o))}return r}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?nx*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,n=this.chart,r=n.data.labels||[],o=Kx(t._parsed[e],n.options.locale);return{label:r[e]||"",value:o}}getMaxBorderWidth(e){let t=0;const n=this.chart;let r,o,a,i,s;if(!e)for(r=0,o=n.data.datasets.length;r<o;++r)if(n.isDatasetVisible(r)){a=n.getDatasetMeta(r),e=a.data,i=a.controller;break}if(!e)return 0;for(r=0,o=e.length;r<o;++r)s=i.resolveDataElementOptions(r),"inner"!==s.borderAlign&&(t=Math.max(t,s.borderWidth||0,s.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let n=0,r=e.length;n<r;++n){const e=this.resolveDataElementOptions(n);t=Math.max(t,e.offset||0,e.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t}_getRingWeight(e){return Math.max(Dg(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}s(Yv,"id","doughnut"),s(Yv,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),s(Yv,"descriptors",{_scriptable:e=>"spacing"!==e,_indexable:e=>"spacing"!==e&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),s(Yv,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n,color:r}}=e.legend.options;return t.labels.map(((t,o)=>{const a=e.getDatasetMeta(0).controller.getStyle(o);return{text:t,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:r,lineWidth:a.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(o),index:o}}))}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}});class Gv extends Dv{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:n,data:r=[],_dataset:o}=t,a=this.chart._animationsDisabled;let{start:i,count:s}=Lx(t,r,a);this._drawStart=i,this._drawCount=s,Ix(t)&&(i=0,s=r.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=r;const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:l},e),this.updateElements(r,i,s,e)}updateElements(e,t,n,r){const o="reset"===r,{iScale:a,vScale:i,_stacked:s,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(t,r),u=a.axis,h=i.axis,{spanGaps:p,segment:f}=this.options,m=px(p)?p:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||o||"none"===r,x=t+n,b=e.length;let v=t>0&&this.getParsed(t-1);for(let y=0;y<b;++y){const n=e[y],p=g?n:{};if(y<t||y>=x){p.skip=!0;continue}const b=this.getParsed(y),w=Og(b[h]),k=p[u]=a.getPixelForValue(b[u],y),S=p[h]=o||w?i.getBasePixel():i.getPixelForValue(s?this.applyStack(i,b,s):b[h],y);p.skip=isNaN(k)||isNaN(S)||w,p.stop=y>0&&Math.abs(b[u]-v[u])>m,f&&(p.parsed=b,p.raw=l.data[y]),d&&(p.options=c||this.resolveDataElementOptions(y,n.active?"active":r)),g||this.updateElement(n,y,p,r),v=b}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;const o=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,o,a)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}s(Gv,"id","line"),s(Gv,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),s(Gv,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Zv extends Dv{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,n=this.chart,r=n.data.labels||[],o=Kx(t._parsed[e].r,n.options.locale);return{label:r[e]||"",value:o}}parseObjectData(e,t,n,r){return Bb.bind(this)(e,t,n,r)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach(((e,n)=>{const r=this.getParsed(n).r;!isNaN(r)&&this.chart.getDataVisibility(n)&&(r<t.min&&(t.min=r),r>t.max&&(t.max=r))})),t}_updateRadius(){const e=this.chart,t=e.chartArea,n=e.options,r=Math.min(t.right-t.left,t.bottom-t.top),o=Math.max(r/2,0),a=(o-Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0))/e.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,t,n,r){const o="reset"===r,a=this.chart,i=a.options.animation,s=this._cachedMeta.rScale,l=s.xCenter,c=s.yCenter,d=s.getIndexAngle(0)-.5*tx;let u,h=d;const p=360/this.countVisibleElements();for(u=0;u<t;++u)h+=this._computeAngle(u,r,p);for(u=t;u<t+n;u++){const t=e[u];let n=h,f=h+this._computeAngle(u,r,p),m=a.getDataVisibility(u)?s.getDistanceFromCenterForValue(this.getParsed(u).r):0;h=f,o&&(i.animateScale&&(m=0),i.animateRotate&&(n=f=d));const g={x:l,y:c,innerRadius:0,outerRadius:m,startAngle:n,endAngle:f,options:this.resolveDataElementOptions(u,t.active?"active":r)};this.updateElement(t,u,g,r)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach(((e,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&t++})),t}_computeAngle(e,t,n){return this.chart.getDataVisibility(e)?mx(this.resolveDataElementOptions(e,t).angle||n):0}}s(Zv,"id","polarArea"),s(Zv,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),s(Zv,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n,color:r}}=e.legend.options;return t.labels.map(((t,o)=>{const a=e.getDatasetMeta(0).controller.getStyle(o);return{text:t,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:r,lineWidth:a.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(o),index:o}}))}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Jv extends Yv{}s(Jv,"id","pie"),s(Jv,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Qv extends Dv{getLabelAndValue(e){const t=this._cachedMeta.vScale,n=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(n[t.axis])}}parseObjectData(e,t,n,r){return Bb.bind(this)(e,t,n,r)}update(e){const t=this._cachedMeta,n=t.dataset,r=t.data||[],o=t.iScale.getLabels();if(n.points=r,"resize"!==e){const t=this.resolveDatasetElementOptions(e);this.options.showLine||(t.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===r.length,options:t};this.updateElement(n,void 0,a,e)}this.updateElements(r,0,r.length,e)}updateElements(e,t,n,r){const o=this._cachedMeta.rScale,a="reset"===r;for(let i=t;i<t+n;i++){const t=e[i],n=this.resolveDataElementOptions(i,t.active?"active":r),s=o.getPointPositionForValue(i,this.getParsed(i).r),l=a?o.xCenter:s.x,c=a?o.yCenter:s.y,d={x:l,y:c,angle:s.angle,skip:isNaN(l)||isNaN(c),options:n};this.updateElement(t,i,d,r)}}}s(Qv,"id","radar"),s(Qv,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),s(Qv,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class ey extends Dv{getLabelAndValue(e){const t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:o}=t,a=this.getParsed(e),i=r.getLabelForValue(a.x),s=o.getLabelForValue(a.y);return{label:n[e]||"",value:"("+i+", "+s+")"}}update(e){const t=this._cachedMeta,{data:n=[]}=t,r=this.chart._animationsDisabled;let{start:o,count:a}=Lx(t,n,r);if(this._drawStart=o,this._drawCount=a,Ix(t)&&(o=0,a=n.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:a}=t;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!a._decimated,o.points=n;const i=this.resolveDatasetElementOptions(e);i.segment=this.options.segment,this.updateElement(o,void 0,{animated:!r,options:i},e)}else this.datasetElementType&&(delete t.dataset,this.datasetElementType=!1);this.updateElements(n,o,a,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,t,n,r){const o="reset"===r,{iScale:a,vScale:i,_stacked:s,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(t,r),d=this.getSharedOptions(c),u=this.includeOptions(r,d),h=a.axis,p=i.axis,{spanGaps:f,segment:m}=this.options,g=px(f)?f:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||"none"===r;let b=t>0&&this.getParsed(t-1);for(let v=t;v<t+n;++v){const t=e[v],n=this.getParsed(v),c=x?t:{},f=Og(n[p]),y=c[h]=a.getPixelForValue(n[h],v),w=c[p]=o||f?i.getBasePixel():i.getPixelForValue(s?this.applyStack(i,n,s):n[p],v);c.skip=isNaN(y)||isNaN(w)||f,c.stop=v>0&&Math.abs(n[h]-b[h])>g,m&&(c.parsed=n,c.raw=l.data[v]),u&&(c.options=d||this.resolveDataElementOptions(v,t.active?"active":r)),x||this.updateElement(t,v,c,r),b=n}this.updateSharedOptions(d,r,c)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}const n=e.dataset,r=n.options&&n.options.borderWidth||0;if(!t.length)return r;const o=t[0].size(this.resolveDataElementOptions(0)),a=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(r,o,a)/2}}s(ey,"id","scatter"),s(ey,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),s(ey,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});function ty(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ny{static override(e){Object.assign(ny.prototype,e)}constructor(e){s(this,"options",void 0),this.options=e||{}}init(){}formats(){return ty()}parse(){return ty()}format(){return ty()}add(){return ty()}diff(){return ty()}startOf(){return ty()}endOf(){return ty()}}var ry=ny;function oy(e,t,n,r){const{controller:o,data:a,_sorted:i}=e,s=o._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&"r"!==t&&i&&a.length){const i=s._reversePixels?_x:Cx;if(!r){const r=i(a,t,n);if(l){const{vScale:t}=o._cachedMeta,{_parsed:n}=e,a=n.slice(0,r.lo+1).reverse().findIndex((e=>!Og(e[t.axis])));r.lo-=Math.max(0,a);const i=n.slice(r.hi).findIndex((e=>!Og(e[t.axis])));r.hi+=Math.max(0,i)}return r}if(o._sharedOptions){const e=a[0],r="function"===typeof e.getRange&&e.getRange(t);if(r){const e=i(a,t,n-r),o=i(a,t,n+r);return{lo:e.lo,hi:o.hi}}}}return{lo:0,hi:a.length-1}}function ay(e,t,n,r,o){const a=e.getSortedVisibleDatasetMetas(),i=n[t];for(let s=0,l=a.length;s<l;++s){const{index:e,data:n}=a[s],{lo:l,hi:c}=oy(a[s],t,i,o);for(let t=l;t<=c;++t){const o=n[t];o.skip||r(o,e,t)}}}function iy(e,t,n,r,o){const a=[];if(!o&&!e.isPointInArea(t))return a;return ay(e,n,t,(function(n,i,s){(o||lb(n,e.chartArea,0))&&n.inRange(t.x,t.y,r)&&a.push({element:n,datasetIndex:i,index:s})}),!0),a}function sy(e,t,n,r,o,a){let i=[];const s=function(e){const t=-1!==e.indexOf("x"),n=-1!==e.indexOf("y");return function(e,r){const o=t?Math.abs(e.x-r.x):0,a=n?Math.abs(e.y-r.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}(n);let l=Number.POSITIVE_INFINITY;return ay(e,n,t,(function(n,c,d){const u=n.inRange(t.x,t.y,o);if(r&&!u)return;const h=n.getCenterPoint(o);if(!(!!a||e.isPointInArea(h))&&!u)return;const p=s(t,h);p<l?(i=[{element:n,datasetIndex:c,index:d}],l=p):p===l&&i.push({element:n,datasetIndex:c,index:d})})),i}function ly(e,t,n,r,o,a){return a||e.isPointInArea(t)?"r"!==n||r?sy(e,t,n,r,o,a):function(e,t,n,r){let o=[];return ay(e,n,t,(function(e,n,a){const{startAngle:i,endAngle:s}=e.getProps(["startAngle","endAngle"],r),{angle:l}=bx(e,{x:t.x,y:t.y});kx(l,i,s)&&o.push({element:e,datasetIndex:n,index:a})})),o}(e,t,n,o):[]}function cy(e,t,n,r,o){const a=[],i="x"===n?"inXRange":"inYRange";let s=!1;return ay(e,n,t,((e,r,l)=>{e[i]&&e[i](t[n],o)&&(a.push({element:e,datasetIndex:r,index:l}),s=s||e.inRange(t.x,t.y,o))})),r&&!s?[]:a}var dy={evaluateInteractionItems:ay,modes:{index(e,t,n,r){const o=ev(t,e),a=n.axis||"x",i=n.includeInvisible||!1,s=n.intersect?iy(e,o,a,r,i):ly(e,o,a,!1,r,i),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach((e=>{const t=s[0].index,n=e.data[t];n&&!n.skip&&l.push({element:n,datasetIndex:e.index,index:t})})),l):[]},dataset(e,t,n,r){const o=ev(t,e),a=n.axis||"xy",i=n.includeInvisible||!1;let s=n.intersect?iy(e,o,a,r,i):ly(e,o,a,!1,r,i);if(s.length>0){const t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;e<n.length;++e)s.push({element:n[e],datasetIndex:t,index:e})}return s},point:(e,t,n,r)=>iy(e,ev(t,e),n.axis||"xy",r,n.includeInvisible||!1),nearest(e,t,n,r){const o=ev(t,e),a=n.axis||"xy",i=n.includeInvisible||!1;return ly(e,o,a,n.intersect,r,i)},x:(e,t,n,r)=>cy(e,ev(t,e),"x",n.intersect,r),y:(e,t,n,r)=>cy(e,ev(t,e),"y",n.intersect,r)}};const uy=["left","top","right","bottom"];function hy(e,t){return e.filter((e=>e.pos===t))}function py(e,t){return e.filter((e=>-1===uy.indexOf(e.pos)&&e.box.axis===t))}function fy(e,t){return e.sort(((e,n)=>{const r=t?n:e,o=t?e:n;return r.weight===o.weight?r.index-o.index:r.weight-o.weight}))}function my(e,t){const n=function(e){const t={};for(const n of e){const{stack:e,pos:r,stackWeight:o}=n;if(!e||!uy.includes(r))continue;const a=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}(e),{vBoxMaxWidth:r,hBoxMaxHeight:o}=t;let a,i,s;for(a=0,i=e.length;a<i;++a){s=e[a];const{fullSize:i}=s.box,l=n[s.stack],c=l&&s.stackWeight/l.weight;s.horizontal?(s.width=c?c*r:i&&t.availableWidth,s.height=o):(s.width=r,s.height=c?c*o:i&&t.availableHeight)}return n}function gy(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function xy(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function by(e,t,n,r){const{pos:o,box:a}=n,i=e.maxPadding;if(!Lg(o)){n.size&&(e[o]-=n.size);const t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?a.height:a.width),n.size=t.size/t.count,e[o]+=n.size}a.getPadding&&xy(i,a.getPadding());const s=Math.max(0,t.outerWidth-gy(i,e,"left","right")),l=Math.max(0,t.outerHeight-gy(i,e,"top","bottom")),c=s!==e.w,d=l!==e.h;return e.w=s,e.h=l,n.horizontal?{same:c,other:d}:{same:d,other:c}}function vy(e,t){const n=t.maxPadding;function r(e){const r={left:0,top:0,right:0,bottom:0};return e.forEach((e=>{r[e]=Math.max(t[e],n[e])})),r}return r(e?["left","right"]:["top","bottom"])}function yy(e,t,n,r){const o=[];let a,i,s,l,c,d;for(a=0,i=e.length,c=0;a<i;++a){s=e[a],l=s.box,l.update(s.width||t.w,s.height||t.h,vy(s.horizontal,t));const{same:i,other:u}=by(t,n,s,r);c|=i&&o.length,d=d||u,l.fullSize||o.push(s)}return c&&yy(o,t,n,r)||d}function wy(e,t,n,r,o){e.top=n,e.left=t,e.right=t+r,e.bottom=n+o,e.width=r,e.height=o}function ky(e,t,n,r){const o=n.padding;let{x:a,y:i}=t;for(const s of e){const e=s.box,l=r[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/l.weight||1;if(s.horizontal){const r=t.w*c,a=l.size||e.height;Jg(l.start)&&(i=l.start),e.fullSize?wy(e,o.left,i,n.outerWidth-o.right-o.left,a):wy(e,t.left+l.placed,i,r,a),l.start=i,l.placed+=r,i=e.bottom}else{const r=t.h*c,i=l.size||e.width;Jg(l.start)&&(a=l.start),e.fullSize?wy(e,a,o.top,i,n.outerHeight-o.bottom-o.top):wy(e,a,t.top+l.placed,i,r),l.start=a,l.placed+=r,a=e.right}}t.x=a,t.y=i}var Sy={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;-1!==n&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const o=Sb(e.options.layout.padding),a=Math.max(t-o.width,0),i=Math.max(n-o.height,0),s=function(e){const t=function(e){const t=[];let n,r,o,a,i,s;for(n=0,r=(e||[]).length;n<r;++n)o=e[n],({position:a,options:{stack:i,stackWeight:s=1}}=o),t.push({index:n,box:o,pos:a,horizontal:o.isHorizontal(),weight:o.weight,stack:i&&a+i,stackWeight:s});return t}(e),n=fy(t.filter((e=>e.box.fullSize)),!0),r=fy(hy(t,"left"),!0),o=fy(hy(t,"right")),a=fy(hy(t,"top"),!0),i=fy(hy(t,"bottom")),s=py(t,"x"),l=py(t,"y");return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:o.concat(l).concat(i).concat(s),chartArea:hy(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:a.concat(i).concat(s)}}(e.boxes),l=s.vertical,c=s.horizontal;Wg(e.boxes,(e=>{"function"===typeof e.beforeLayout&&e.beforeLayout()}));const d=l.reduce(((e,t)=>t.box.options&&!1===t.box.options.display?e:e+1),0)||1,u=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:a,availableHeight:i,vBoxMaxWidth:a/2/d,hBoxMaxHeight:i/2}),h=Object.assign({},o);xy(h,Sb(r));const p=Object.assign({maxPadding:h,w:a,h:i,x:o.left,y:o.top},o),f=my(l.concat(c),u);yy(s.fullSize,p,u,f),yy(l,p,u,f),yy(c,p,u,f)&&yy(l,p,u,f),function(e){const t=e.maxPadding;function n(n){const r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}(p),ky(s.leftAndTop,p,u,f),p.x+=p.w,p.y+=p.h,ky(s.rightAndBottom,p,u,f),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Wg(s.chartArea,(t=>{const n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})}))}};class jy{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n=n||e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}}class Ay extends jy{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Cy="$chartjs",_y={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ey=e=>null===e||""===e;const My=!!ov&&{passive:!0};function Ny(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,My)}function Ry(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Py(e,t,n){const r=e.canvas,o=new MutationObserver((e=>{let t=!1;for(const n of e)t=t||Ry(n.addedNodes,r),t=t&&!Ry(n.removedNodes,r);t&&n()}));return o.observe(document,{childList:!0,subtree:!0}),o}function Oy(e,t,n){const r=e.canvas,o=new MutationObserver((e=>{let t=!1;for(const n of e)t=t||Ry(n.removedNodes,r),t=t&&!Ry(n.addedNodes,r);t&&n()}));return o.observe(document,{childList:!0,subtree:!0}),o}const Ty=new Map;let Ly=0;function Iy(){const e=window.devicePixelRatio;e!==Ly&&(Ly=e,Ty.forEach(((t,n)=>{n.currentDevicePixelRatio!==e&&t()})))}function zy(e,t,n){const r=e.canvas,o=r&&Yb(r);if(!o)return;const a=Px(((e,t)=>{const r=o.clientWidth;n(e,t),r<o.clientWidth&&n()}),window),i=new ResizeObserver((e=>{const t=e[0],n=t.contentRect.width,r=t.contentRect.height;0===n&&0===r||a(n,r)}));return i.observe(o),function(e,t){Ty.size||window.addEventListener("resize",Iy),Ty.set(e,t)}(e,a),i}function Dy(e,t,n){n&&n.disconnect(),"resize"===t&&function(e){Ty.delete(e),Ty.size||window.removeEventListener("resize",Iy)}(e)}function Fy(e,t,n){const r=e.canvas,o=Px((t=>{null!==e.ctx&&n(function(e,t){const n=_y[e.type]||e.type,{x:r,y:o}=ev(e,t);return{type:n,chart:t,native:e,x:void 0!==r?r:null,y:void 0!==o?o:null}}(t,e))}),e);return function(e,t,n){e&&e.addEventListener(t,n,My)}(r,t,o),o}class By extends jy{acquireContext(e,t){const n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(function(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[Cy]={initial:{height:r,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Ey(o)){const t=av(e,"width");void 0!==t&&(e.width=t)}if(Ey(r))if(""===e.style.height)e.height=e.width/(t||2);else{const t=av(e,"height");void 0!==t&&(e.height=t)}}(e,t),n):null}releaseContext(e){const t=e.canvas;if(!t[Cy])return!1;const n=t[Cy].initial;["height","width"].forEach((e=>{const r=n[e];Og(r)?t.removeAttribute(e):t.setAttribute(e,r)}));const r=n.style||{};return Object.keys(r).forEach((e=>{t.style[e]=r[e]})),t.width=t.width,delete t[Cy],!0}addEventListener(e,t,n){this.removeEventListener(e,t);const r=e.$proxies||(e.$proxies={}),o={attach:Py,detach:Oy,resize:zy}[t]||Fy;r[t]=o(e,t,n)}removeEventListener(e,t){const n=e.$proxies||(e.$proxies={}),r=n[t];if(!r)return;({attach:Dy,detach:Dy,resize:Dy}[t]||Ny)(e,t,r),n[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return nv(e,t,n,r)}isAttached(e){const t=e&&Yb(e);return!(!t||!t.isConnected)}}class Wy{constructor(){s(this,"x",void 0),s(this,"y",void 0),s(this,"active",!1),s(this,"options",void 0),s(this,"$animations",void 0)}tooltipPosition(e){const{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}hasValue(){return px(this.x)&&px(this.y)}getProps(e,t){const n=this.$animations;if(!t||!n)return this;const r={};return e.forEach((e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]})),r}}function Hy(e,t){const n=e.options.ticks,r=function(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),o=e._maxLength/n;return Math.floor(Math.min(r,o))}(e),o=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?function(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}(t):[],i=a.length,s=a[0],l=a[i-1],c=[];if(i>o)return function(e,t,n,r){let o,a=0,i=n[0];for(r=Math.ceil(r),o=0;o<e.length;o++)o===i&&(t.push(e[o]),a++,i=n[a*r])}(t,c,a,i/o),c;const d=function(e,t,n){const r=function(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}(e),o=t.length/n;if(!r)return Math.max(o,1);const a=function(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(0|n)&&t.push(n),t.sort(((e,t)=>e-t)).pop(),t}(r);for(let i=0,s=a.length-1;i<s;i++){const e=a[i];if(e>o)return e}return Math.max(o,1)}(a,t,o);if(i>0){let e,n;const r=i>1?Math.round((l-s)/(i-1)):null;for(Vy(t,c,d,Og(r)?0:s-r,s),e=0,n=i-1;e<n;e++)Vy(t,c,d,a[e],a[e+1]);return Vy(t,c,d,l,Og(r)?t.length:l+r),c}return Vy(t,c,d),c}function Vy(e,t,n,r,o){const a=Dg(r,0),i=Math.min(Dg(o,e.length),e.length);let s,l,c,d=0;for(n=Math.ceil(n),o&&(s=o-r,n=s/Math.floor(s/n)),c=a;c<0;)d++,c=Math.round(a+d*n);for(l=Math.max(a,0);l<i;l++)l===c&&(t.push(e[l]),d++,c=Math.round(a+d*n))}s(Wy,"defaults",{}),s(Wy,"defaultRoutes",void 0);const Uy=(e,t,n)=>"top"===t||"left"===t?e[t]+n:e[t]-n,qy=(e,t)=>Math.min(t||e,e);function $y(e,t){const n=[],r=e.length/t,o=e.length;let a=0;for(;a<o;a+=r)n.push(e[Math.floor(a)]);return n}function Ky(e,t,n){const r=e.ticks.length,o=Math.min(t,r-1),a=e._startPixel,i=e._endPixel,s=1e-6;let l,c=e.getPixelForTick(o);if(!(n&&(l=1===r?Math.max(c-a,i-c):0===t?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(o-1))/2,c+=o<t?l:-l,c<a-s||c>i+s)))return c}function Xy(e){return e.drawTicks?e.tickLength:0}function Yy(e,t){if(!e.display)return 0;const n=jb(e.font,t),r=Sb(e.padding);return(Tg(e.text)?e.text.length:1)*n.lineHeight+r.height}function Gy(e,t,n){let r=Ox(e);return(n&&"right"!==t||!n&&"right"===t)&&(r=(e=>"left"===e?"right":"right"===e?"left":e)(r)),r}class Zy extends Wy{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:r}=this;return e=zg(e,Number.POSITIVE_INFINITY),t=zg(t,Number.NEGATIVE_INFINITY),n=zg(n,Number.POSITIVE_INFINITY),r=zg(r,Number.NEGATIVE_INFINITY),{min:zg(e,n),max:zg(t,r),minDefined:Ig(e),maxDefined:Ig(t)}}getMinMax(e){let t,{min:n,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();if(o&&a)return{min:n,max:r};const i=this.getMatchingVisibleMetas();for(let s=0,l=i.length;s<l;++s)t=i[s].controller.getMinMax(this,e),o||(n=Math.min(n,t.min)),a||(r=Math.max(r,t.max));return n=a&&n>r?r:n,r=o&&n>r?n:r,{min:zg(n,zg(r,n)),max:zg(r,zg(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.chart.chartArea;return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Bg(this.options.beforeUpdate,[this])}update(e,t,n){const{beginAtZero:r,grace:o,ticks:a}=this.options,i=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(e,t,n){const{min:r,max:o}=e,a=Fg(t,(o-r)/2),i=(e,t)=>n&&0===e?0:e+t;return{min:i(r,-Math.abs(a)),max:i(o,a)}}(this,o,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const s=i<this.ticks.length;this._convertTicksToLabels(s?$y(this.ticks,i):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||"auto"===a.source)&&(this.ticks=Hy(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e,t,n=this.options.reverse;this.isHorizontal()?(e=this.left,t=this.right):(e=this.top,t=this.bottom,n=!n),this._startPixel=e,this._endPixel=t,this._reversePixels=n,this._length=t-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Bg(this.options.afterUpdate,[this])}beforeSetDimensions(){Bg(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Bg(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Bg(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Bg(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let n,r,o;for(n=0,r=e.length;n<r;n++)o=e[n],o.label=Bg(t.callback,[o.value,n,e],this)}afterTickToLabelConversion(){Bg(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Bg(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,n=qy(this.ticks.length,e.ticks.maxTicksLimit),r=t.minRotation||0,o=t.maxRotation;let a,i,s,l=r;if(!this._isVisible()||!t.display||r>=o||n<=1||!this.isHorizontal())return void(this.labelRotation=r);const c=this._getLabelSizes(),d=c.widest.width,u=c.highest.height,h=Sx(this.chart.width-d,0,this.maxWidth);a=e.offset?this.maxWidth/n:h/(n-1),d+6>a&&(a=h/(n-(e.offset?.5:1)),i=this.maxHeight-Xy(e.grid)-t.padding-Yy(e.title,this.chart.options.font),s=Math.sqrt(d*d+u*u),l=gx(Math.min(Math.asin(Sx((c.highest.height+6)/a,-1,1)),Math.asin(Sx(i/s,-1,1))-Math.asin(Sx(u/s,-1,1)))),l=Math.max(r,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){Bg(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Bg(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:o}}=this,a=this._isVisible(),i=this.isHorizontal();if(a){const a=Yy(r,t.options.font);if(i?(e.width=this.maxWidth,e.height=Xy(o)+a):(e.height=this.maxHeight,e.width=Xy(o)+a),n.display&&this.ticks.length){const{first:t,last:r,widest:o,highest:a}=this._getLabelSizes(),s=2*n.padding,l=mx(this.labelRotation),c=Math.cos(l),d=Math.sin(l);if(i){const t=n.mirror?0:d*o.width+c*a.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{const t=n.mirror?0:c*o.width+d*a.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,d,c)}}this._handleMargins(),i?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){const{ticks:{align:o,padding:a},position:i}=this.options,s=0!==this.labelRotation,l="top"!==i&&"x"===this.axis;if(this.isHorizontal()){const i=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,u=0;s?l?(d=r*e.width,u=n*t.height):(d=n*e.height,u=r*t.width):"start"===o?u=t.width:"end"===o?d=e.width:"inner"!==o&&(d=e.width/2,u=t.width/2),this.paddingLeft=Math.max((d-i+a)*this.width/(this.width-i),0),this.paddingRight=Math.max((u-c+a)*this.width/(this.width-c),0)}else{let n=t.height/2,r=e.height/2;"start"===o?(n=0,r=e.height):"end"===o&&(n=t.height,r=0),this.paddingTop=n+a,this.paddingBottom=r+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Bg(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return"top"===t||"bottom"===t||"x"===e}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){let t,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),t=0,n=e.length;t<n;t++)Og(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let n=this.ticks;t<n.length&&(n=$y(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){const{ctx:r,_longestTextCache:o}=this,a=[],i=[],s=Math.floor(t/qy(t,n));let l,c,d,u,h,p,f,m,g,x,b,v=0,y=0;for(l=0;l<t;l+=s){if(u=e[l].label,h=this._resolveTickFontOptions(l),r.font=p=h.string,f=o[p]=o[p]||{data:{},gc:[]},m=h.lineHeight,g=x=0,Og(u)||Tg(u)){if(Tg(u))for(c=0,d=u.length;c<d;++c)b=u[c],Og(b)||Tg(b)||(g=nb(r,f.data,f.gc,g,b),x+=m)}else g=nb(r,f.data,f.gc,g,u),x=m;a.push(g),i.push(x),v=Math.max(g,v),y=Math.max(x,y)}!function(e,t){Wg(e,(e=>{const n=e.gc,r=n.length/2;let o;if(r>t){for(o=0;o<r;++o)delete e.data[n[o]];n.splice(0,r)}}))}(o,t);const w=a.indexOf(v),k=i.indexOf(y),S=e=>({width:a[e]||0,height:i[e]||0});return{first:S(0),last:S(t-1),widest:S(w),highest:S(k),widths:a,heights:i}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return function(e){return Sx(e,-32768,32767)}(this._alignToPixels?ob(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const n=t[e];return n.$context||(n.$context=function(e,t,n){return Cb(e,{tick:n,index:t,type:"tick"})}(this.getContext(),e,n))}return this.$context||(this.$context=Cb(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const e=this.options.ticks,t=mx(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),o=this._getLabelSizes(),a=e.autoSkipPadding||0,i=o?o.widest.width+a:0,s=o?o.highest.height+a:0;return this.isHorizontal()?s*n>i*r?i/n:s/r:s*r<i*n?s/n:i/r}_isVisible(){const e=this.options.display;return"auto"!==e?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,n=this.chart,r=this.options,{grid:o,position:a,border:i}=r,s=o.offset,l=this.isHorizontal(),c=this.ticks.length+(s?1:0),d=Xy(o),u=[],h=i.setContext(this.getContext()),p=h.display?h.width:0,f=p/2,m=function(e){return ob(n,e,p)};let g,x,b,v,y,w,k,S,j,A,C,_;if("top"===a)g=m(this.bottom),w=this.bottom-d,S=g-f,A=m(e.top)+f,_=e.bottom;else if("bottom"===a)g=m(this.top),A=e.top,_=m(e.bottom)-f,w=g+f,S=this.top+d;else if("left"===a)g=m(this.right),y=this.right-d,k=g-f,j=m(e.left)+f,C=e.right;else if("right"===a)g=m(this.left),j=e.left,C=m(e.right)-f,y=g+f,k=this.left+d;else if("x"===t){if("center"===a)g=m((e.top+e.bottom)/2+.5);else if(Lg(a)){const e=Object.keys(a)[0],t=a[e];g=m(this.chart.scales[e].getPixelForValue(t))}A=e.top,_=e.bottom,w=g+f,S=w+d}else if("y"===t){if("center"===a)g=m((e.left+e.right)/2);else if(Lg(a)){const e=Object.keys(a)[0],t=a[e];g=m(this.chart.scales[e].getPixelForValue(t))}y=g-f,k=y-d,j=e.left,C=e.right}const E=Dg(r.ticks.maxTicksLimit,c),M=Math.max(1,Math.ceil(c/E));for(x=0;x<c;x+=M){const e=this.getContext(x),t=o.setContext(e),r=i.setContext(e),a=t.lineWidth,c=t.color,d=r.dash||[],h=r.dashOffset,p=t.tickWidth,f=t.tickColor,m=t.tickBorderDash||[],g=t.tickBorderDashOffset;b=Ky(this,x,s),void 0!==b&&(v=ob(n,b,a),l?y=k=j=C=v:w=S=A=_=v,u.push({tx1:y,ty1:w,tx2:k,ty2:S,x1:j,y1:A,x2:C,y2:_,width:a,color:c,borderDash:d,borderDashOffset:h,tickWidth:p,tickColor:f,tickBorderDash:m,tickBorderDashOffset:g}))}return this._ticksLength=c,this._borderValue=g,u}_computeLabelItems(e){const t=this.axis,n=this.options,{position:r,ticks:o}=n,a=this.isHorizontal(),i=this.ticks,{align:s,crossAlign:l,padding:c,mirror:d}=o,u=Xy(n.grid),h=u+c,p=d?-c:h,f=-mx(this.labelRotation),m=[];let g,x,b,v,y,w,k,S,j,A,C,_,E="middle";if("top"===r)w=this.bottom-p,k=this._getXAxisLabelAlignment();else if("bottom"===r)w=this.top+p,k=this._getXAxisLabelAlignment();else if("left"===r){const e=this._getYAxisLabelAlignment(u);k=e.textAlign,y=e.x}else if("right"===r){const e=this._getYAxisLabelAlignment(u);k=e.textAlign,y=e.x}else if("x"===t){if("center"===r)w=(e.top+e.bottom)/2+h;else if(Lg(r)){const e=Object.keys(r)[0],t=r[e];w=this.chart.scales[e].getPixelForValue(t)+h}k=this._getXAxisLabelAlignment()}else if("y"===t){if("center"===r)y=(e.left+e.right)/2-h;else if(Lg(r)){const e=Object.keys(r)[0],t=r[e];y=this.chart.scales[e].getPixelForValue(t)}k=this._getYAxisLabelAlignment(u).textAlign}"y"===t&&("start"===s?E="top":"end"===s&&(E="bottom"));const M=this._getLabelSizes();for(g=0,x=i.length;g<x;++g){b=i[g],v=b.label;const e=o.setContext(this.getContext(g));S=this.getPixelForTick(g)+o.labelOffset,j=this._resolveTickFontOptions(g),A=j.lineHeight,C=Tg(v)?v.length:1;const t=C/2,n=e.color,s=e.textStrokeColor,c=e.textStrokeWidth;let u,h=k;if(a?(y=S,"inner"===k&&(h=g===x-1?this.options.reverse?"left":"right":0===g?this.options.reverse?"right":"left":"center"),_="top"===r?"near"===l||0!==f?-C*A+A/2:"center"===l?-M.highest.height/2-t*A+A:-M.highest.height+A/2:"near"===l||0!==f?A/2:"center"===l?M.highest.height/2-t*A:M.highest.height-C*A,d&&(_*=-1),0===f||e.showLabelBackdrop||(y+=A/2*Math.sin(f))):(w=S,_=(1-C)*A/2),e.showLabelBackdrop){const t=Sb(e.backdropPadding),n=M.heights[g],r=M.widths[g];let o=_-t.top,a=0-t.left;switch(E){case"middle":o-=n/2;break;case"bottom":o-=n}switch(k){case"center":a-=r/2;break;case"right":a-=r;break;case"inner":g===x-1?a-=r:g>0&&(a-=r/2)}u={left:a,top:o,width:r+t.width,height:n+t.height,color:e.backdropColor}}m.push({label:v,font:j,textOffset:_,options:{rotation:f,color:n,strokeColor:s,strokeWidth:c,textAlign:h,textBaseline:E,translation:[y,w],backdrop:u}})}return m}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-mx(this.labelRotation))return"top"===e?"left":"right";let n="center";return"start"===t.align?n="left":"end"===t.align?n="right":"inner"===t.align&&(n="inner"),n}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:n,mirror:r,padding:o}}=this.options,a=e+o,i=this._getLabelSizes().widest.width;let s,l;return"left"===t?r?(l=this.right+o,"near"===n?s="left":"center"===n?(s="center",l+=i/2):(s="right",l+=i)):(l=this.right-a,"near"===n?s="right":"center"===n?(s="center",l-=i/2):(s="left",l=this.left)):"right"===t?r?(l=this.left+o,"near"===n?s="right":"center"===n?(s="center",l-=i/2):(s="left",l-=i)):(l=this.left+a,"near"===n?s="left":"center"===n?(s="center",l+=i/2):(s="right",l=this.right)):s="right",{textAlign:s,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;return"left"===t||"right"===t?{top:0,left:this.left,bottom:e.height,right:this.right}:"top"===t||"bottom"===t?{top:this.top,left:0,bottom:this.bottom,right:e.width}:void 0}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:n,top:r,width:o,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,o,a),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const n=this.ticks.findIndex((t=>t.value===e));if(n>=0){return t.setContext(this.getContext(n)).lineWidth}return 0}drawGrid(e){const t=this.options.grid,n=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,a;const i=(e,t,r)=>{r.width&&r.color&&(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(o=0,a=r.length;o<a;++o){const e=r[o];t.drawOnChartArea&&i({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&i({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{border:n,grid:r}}=this,o=n.setContext(this.getContext()),a=n.display?o.width:0;if(!a)return;const i=r.setContext(this.getContext(0)).lineWidth,s=this._borderValue;let l,c,d,u;this.isHorizontal()?(l=ob(e,this.left,a)-a/2,c=ob(e,this.right,i)+i/2,d=u=s):(d=ob(e,this.top,a)-a/2,u=ob(e,this.bottom,i)+i/2,l=c=s),t.save(),t.lineWidth=o.width,t.strokeStyle=o.color,t.beginPath(),t.moveTo(l,d),t.lineTo(c,u),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const t=this.ctx,n=this._computeLabelArea();n&&cb(t,n);const r=this.getLabelItems(e);for(const o of r){const e=o.options,n=o.font;mb(t,o.label,0,o.textOffset,n,e)}n&&db(t)}drawTitle(){const{ctx:e,options:{position:t,title:n,reverse:r}}=this;if(!n.display)return;const o=jb(n.font),a=Sb(n.padding),i=n.align;let s=o.lineHeight/2;"bottom"===t||"center"===t||Lg(t)?(s+=a.bottom,Tg(n.text)&&(s+=o.lineHeight*(n.text.length-1))):s+=a.top;const{titleX:l,titleY:c,maxWidth:d,rotation:u}=function(e,t,n,r){const{top:o,left:a,bottom:i,right:s,chart:l}=e,{chartArea:c,scales:d}=l;let u,h,p,f=0;const m=i-o,g=s-a;if(e.isHorizontal()){if(h=Tx(r,a,s),Lg(n)){const e=Object.keys(n)[0],r=n[e];p=d[e].getPixelForValue(r)+m-t}else p="center"===n?(c.bottom+c.top)/2+m-t:Uy(e,n,t);u=s-a}else{if(Lg(n)){const e=Object.keys(n)[0],r=n[e];h=d[e].getPixelForValue(r)-g+t}else h="center"===n?(c.left+c.right)/2-g+t:Uy(e,n,t);p=Tx(r,i,o),f="left"===n?-ix:ix}return{titleX:h,titleY:p,maxWidth:u,rotation:f}}(this,s,t,i);mb(e,n.text,0,0,o,{color:n.color,maxWidth:d,rotation:u,textAlign:Gy(i,t,r),textBaseline:"middle",translation:[l,c]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,n=Dg(e.grid&&e.grid.z,-1),r=Dg(e.border&&e.border.z,0);return this._isVisible()&&this.draw===Zy.prototype.draw?[{z:n,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:t,draw:e=>{this.drawLabels(e)}}]:[{z:t,draw:e=>{this.draw(e)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",r=[];let o,a;for(o=0,a=t.length;o<a;++o){const a=t[o];a[n]!==this.id||e&&a.type!==e||r.push(a)}return r}_resolveTickFontOptions(e){return jb(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Jy{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let n;(function(e){return"id"in e&&"defaults"in e})(t)&&(n=this.register(t));const r=this.items,o=e.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in r||(r[o]=e,function(e,t,n){const r=$g(Object.create(null),[n?tb.get(n):{},tb.get(t),e.defaults]);tb.set(t,r),e.defaultRoutes&&function(e,t){Object.keys(t).forEach((n=>{const r=n.split("."),o=r.pop(),a=[e].concat(r).join("."),i=t[n].split("."),s=i.pop(),l=i.join(".");tb.route(a,o,l,s)}))}(t,e.defaultRoutes);e.descriptors&&tb.describe(t,e.descriptors)}(e,a,n),this.override&&tb.override(e.id,e.overrides)),a}get(e){return this.items[e]}unregister(e){const t=this.items,n=e.id,r=this.scope;n in t&&delete t[n],r&&n in tb[r]&&(delete tb[r][n],this.override&&delete Gx[n])}}class Qy{constructor(){this.controllers=new Jy(Dv,"datasets",!0),this.elements=new Jy(Wy,"elements"),this.plugins=new Jy(Object,"plugins"),this.scales=new Jy(Zy,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("register",t)}remove(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("unregister",t)}addControllers(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("register",t,this.controllers)}addElements(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("register",t,this.elements)}addPlugins(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("register",t,this.plugins)}addScales(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("register",t,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("unregister",t,this.controllers)}removeElements(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("unregister",t,this.elements)}removePlugins(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("unregister",t,this.plugins)}removeScales(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("unregister",t,this.scales)}_each(e,t,n){[...t].forEach((t=>{const r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):Wg(t,(t=>{const r=n||this._getRegistryForType(t);this._exec(e,r,t)}))}))}_exec(e,t,n){const r=Zg(e);Bg(n["before"+r],[],n),t[e](n),Bg(n["after"+r],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){const r=t.get(e);if(void 0===r)throw new Error('"'+e+'" is not a registered '+n+".");return r}}var ew=new Qy;class tw{constructor(){this._init=[]}notify(e,t,n,r){"beforeInit"===t&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const o=r?this._descriptors(e).filter(r):this._descriptors(e),a=this._notify(o,e,t,n);return"afterDestroy"===t&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall")),a}_notify(e,t,n,r){r=r||{};for(const o of e){const e=o.plugin;if(!1===Bg(e[n],[t,r,o.options],e)&&r.cancelable)return!1}return!0}invalidate(){Og(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const n=e&&e.config,r=Dg(n.options&&n.options.plugins,{}),o=function(e){const t={},n=[],r=Object.keys(ew.plugins.items);for(let a=0;a<r.length;a++)n.push(ew.getPlugin(r[a]));const o=e.plugins||[];for(let a=0;a<o.length;a++){const e=o[a];-1===n.indexOf(e)&&(n.push(e),t[e.id]=!0)}return{plugins:n,localIds:t}}(n);return!1!==r||t?function(e,t,n,r){let{plugins:o,localIds:a}=t;const i=[],s=e.getContext();for(const l of o){const t=l.id,o=nw(n[t],r);null!==o&&i.push({plugin:l,options:rw(e.config,{plugin:l,local:a[t]},o,s)})}return i}(e,o,r,t):[]}_notifyStateChanges(e){const t=this._oldCache||[],n=this._cache,r=(e,t)=>e.filter((e=>!t.some((t=>e.plugin.id===t.plugin.id))));this._notify(r(t,n),e,"stop"),this._notify(r(n,t),e,"start")}}function nw(e,t){return t||!1!==e?!0===e?{}:e:null}function rw(e,t,n,r){let{plugin:o,local:a}=t;const i=e.pluginScopeKeys(o),s=e.getOptionScopes(n,i);return a&&o.defaults&&s.push(o.defaults),e.createResolver(s,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ow(e,t){const n=tb.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function aw(e){if("x"===e||"y"===e||"r"===e)return e}function iw(e){if(aw(e))return e;for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(const a of n){const t=a.axis||("top"===(o=a.position)||"bottom"===o?"x":"left"===o||"right"===o?"y":void 0)||e.length>1&&aw(e[0].toLowerCase());if(t)return t}var o;throw new Error("Cannot determine type of '".concat(e,"' axis. Please provide 'axis' or 'position' option."))}function sw(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function lw(e,t){const n=Gx[e.type]||{scales:{}},r=t.scales||{},o=ow(e.type,t),a=Object.create(null);return Object.keys(r).forEach((t=>{const i=r[t];if(!Lg(i))return console.error("Invalid scale configuration for scale: ".concat(t));if(i._proxy)return console.warn("Ignoring resolver passed as options for scale: ".concat(t));const s=iw(t,i,function(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter((t=>t.xAxisID===e||t.yAxisID===e));if(n.length)return sw(e,"x",n[0])||sw(e,"y",n[0])}return{}}(t,e),tb.scales[i.type]),l=function(e,t){return e===t?"_index_":"_value_"}(s,o),c=n.scales||{};a[t]=Kg(Object.create(null),[{axis:s},i,c[s],c[l]])})),e.data.datasets.forEach((n=>{const o=n.type||e.type,i=n.indexAxis||ow(o,t),s=(Gx[o]||{}).scales||{};Object.keys(s).forEach((e=>{const t=function(e,t){let n=e;return"_index_"===e?n=t:"_value_"===e&&(n="x"===t?"y":"x"),n}(e,i),o=n[t+"AxisID"]||t;a[o]=a[o]||Object.create(null),Kg(a[o],[{axis:t},r[o],s[e]])}))})),Object.keys(a).forEach((e=>{const t=a[e];Kg(t,[tb.scales[t.type],tb.scale])})),a}function cw(e){const t=e.options||(e.options={});t.plugins=Dg(t.plugins,{}),t.scales=lw(e,t)}function dw(e){return(e=e||{}).datasets=e.datasets||[],e.labels=e.labels||[],e}const uw=new Map,hw=new Set;function pw(e,t){let n=uw.get(e);return n||(n=t(),uw.set(e,n),hw.add(n)),n}const fw=(e,t,n)=>{const r=Gg(t,n);void 0!==r&&e.add(r)};class mw{constructor(e){this._config=function(e){return(e=e||{}).data=dw(e.data),cw(e),e}(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=dw(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),cw(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return pw(e,(()=>[["datasets.".concat(e),""]]))}datasetAnimationScopeKeys(e,t){return pw("".concat(e,".transition.").concat(t),(()=>[["datasets.".concat(e,".transitions.").concat(t),"transitions.".concat(t)],["datasets.".concat(e),""]]))}datasetElementScopeKeys(e,t){return pw("".concat(e,"-").concat(t),(()=>[["datasets.".concat(e,".elements.").concat(t),"datasets.".concat(e),"elements.".concat(t),""]]))}pluginScopeKeys(e){const t=e.id,n=this.type;return pw("".concat(n,"-plugin-").concat(t),(()=>[["plugins.".concat(t),...e.additionalOptionScopes||[]]]))}_cachedScopes(e,t){const n=this._scopeCache;let r=n.get(e);return r&&!t||(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){const{options:r,type:o}=this,a=this._cachedScopes(e,n),i=a.get(t);if(i)return i;const s=new Set;t.forEach((t=>{e&&(s.add(e),t.forEach((t=>fw(s,e,t)))),t.forEach((e=>fw(s,r,e))),t.forEach((e=>fw(s,Gx[o]||{},e))),t.forEach((e=>fw(s,tb,e))),t.forEach((e=>fw(s,Zx,e)))}));const l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),hw.has(t)&&a.set(t,l),l}chartOptionScopes(){const{options:e,type:t}=this;return[e,Gx[t]||{},tb.datasets[t]||{},{type:t},tb,Zx]}resolveNamedOptions(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[""];const o={$shared:!0},{resolver:a,subPrefixes:i}=gw(this._resolverCache,e,r);let s=a;if(function(e,t){const{isScriptable:n,isIndexable:r}=Mb(e);for(const o of t){const t=n(o),a=r(o),i=(a||t)&&e[o];if(t&&(Qg(i)||xw(i))||a&&Tg(i))return!0}return!1}(a,t)){o.$shared=!1;s=Eb(a,n=Qg(n)?n():n,this.createResolver(e,n,i))}for(const l of t)o[l]=s[l];return o}createResolver(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""],r=arguments.length>3?arguments[3]:void 0;const{resolver:o}=gw(this._resolverCache,e,n);return Lg(t)?Eb(o,t,void 0,r):o}}function gw(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const o=n.join();let a=r.get(o);if(!a){a={resolver:_b(t,n),subPrefixes:n.filter((e=>!e.toLowerCase().includes("hover")))},r.set(o,a)}return a}const xw=e=>Lg(e)&&Object.getOwnPropertyNames(e).some((t=>Qg(e[t])));const bw=["top","bottom","left","right","chartArea"];function vw(e,t){return"top"===e||"bottom"===e||-1===bw.indexOf(e)&&"x"===t}function yw(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function ww(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Bg(n&&n.onComplete,[e],t)}function kw(e){const t=e.chart,n=t.options.animation;Bg(n&&n.onProgress,[e],t)}function Sw(e){return Xb()&&"string"===typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const jw={},Aw=e=>{const t=Sw(e);return Object.values(jw).filter((e=>e.canvas===t)).pop()};function Cw(e,t,n){const r=Object.keys(e);for(const o of r){const r=+o;if(r>=t){const a=e[o];delete e[o],(n>0||r>t)&&(e[r+n]=a)}}}class _w{static register(){ew.add(...arguments),Ew()}static unregister(){ew.remove(...arguments),Ew()}constructor(e,t){const n=this.config=new mw(t),r=Sw(e),o=Aw(r);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||function(e){return!Xb()||"undefined"!==typeof OffscreenCanvas&&e instanceof OffscreenCanvas?Ay:By}(r)),this.platform.updateConfig(n);const i=this.platform.acquireContext(r,a.aspectRatio),s=i&&i.canvas,l=s&&s.height,c=s&&s.width;this.id=Pg(),this.ctx=i,this.canvas=s,this.width=c,this.height=l,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new tw,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(e,t){let n;return function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return t?(clearTimeout(n),n=setTimeout(e,t,o)):e.apply(this,o),t}}((e=>this.update(e)),a.resizeDelay||0),this._dataChanges=[],jw[this.id]=this,i&&s?(kv.listen(this,"complete",ww),kv.listen(this,"progress",kw),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:o}=this;return Og(e)?t&&o?o:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return ew}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rv(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ab(this.canvas,this.ctx),this}stop(){return kv.stop(this),this}resize(e,t){kv.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const n=this.options,r=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,e,t,o),i=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,rv(this,i,!0)&&(this.notifyPlugins("resize",{size:a}),Bg(n.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){Wg(this.options.scales||{},((e,t)=>{e.id=t}))}buildOrUpdateScales(){const e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce(((e,t)=>(e[t]=!1,e)),{});let o=[];t&&(o=o.concat(Object.keys(t).map((e=>{const n=t[e],r=iw(e,n),o="r"===r,a="x"===r;return{options:n,dposition:o?"chartArea":a?"bottom":"left",dtype:o?"radialLinear":a?"category":"linear"}})))),Wg(o,(t=>{const o=t.options,a=o.id,i=iw(a,o),s=Dg(o.type,t.dtype);void 0!==o.position&&vw(o.position,i)===vw(t.dposition)||(o.position=t.dposition),r[a]=!0;let l=null;if(a in n&&n[a].type===s)l=n[a];else{l=new(ew.getScale(s))({id:a,type:s,ctx:this.ctx,chart:this}),n[l.id]=l}l.init(o,e)})),Wg(r,((e,t)=>{e||delete n[t]})),Wg(n,(e=>{Sy.configure(this,e,e.options),Sy.addBox(this,e)}))}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort(((e,t)=>e.index-t.index)),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(yw("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach(((e,n)=>{0===t.filter((t=>t===e._dataset)).length&&this._destroyDatasetMeta(n)}))}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n<r;n++){const r=t[n];let o=this.getDatasetMeta(n);const a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(n),o=this.getDatasetMeta(n)),o.type=a,o.indexAxis=r.indexAxis||ow(a,this.options),o.order=r.order||0,o.index=n,o.label=""+r.label,o.visible=this.isDatasetVisible(n),o.controller)o.controller.updateIndex(n),o.controller.linkScales();else{const t=ew.getController(a),{datasetElementType:r,dataElementType:i}=tb.datasets[a];Object.assign(t,{dataElementType:ew.getElement(i),datasetElementType:r&&ew.getElement(r)}),o.controller=new t(this,n),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){Wg(this.data.datasets,((e,t)=>{this.getDatasetMeta(t).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let l=0,c=this.data.datasets.length;l<c;l++){const{controller:e}=this.getDatasetMeta(l),t=!r&&-1===o.indexOf(e);e.buildOrUpdateElements(t),a=Math.max(+e.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),r||Wg(o,(e=>{e.reset()})),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(yw("z","_idx"));const{_active:i,_lastEvent:s}=this;s?this._eventHandler(s,!0):i.length&&this._updateHoverStyles(i,i,!0),this.render()}_updateScales(){Wg(this.scales,(e=>{Sy.removeBox(this,e)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),n=new Set(e.events);ex(t,n)&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:n,start:r,count:o}of t){Cw(e,r,"_removeElements"===n?-o:o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,n=t=>new Set(e.filter((e=>e[0]===t)).map(((e,t)=>t+","+e.splice(1).join(",")))),r=n(0);for(let o=1;o<t;o++)if(!ex(r,n(o)))return;return Array.from(r).map((e=>e.split(","))).map((e=>({method:e[1],start:+e[2],count:+e[3]})))}_updateLayout(e){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Sy.update(this,this.width,this.height,e);const t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],Wg(this.boxes,(e=>{n&&"chartArea"===e.position||(e.configure&&e.configure(),this._layers.push(...e._layers()))}),this),this._layers.forEach(((e,t)=>{e._idx=t})),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,Qg(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const n=this.getDatasetMeta(e),r={meta:n,index:e,mode:t,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",r)&&(n.controller._update(t),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(kv.has(this)?this.attached&&!kv.running(this)&&kv.start(this):(this.draw(),ww({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:e,height:t}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(e,t)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,n=[];let r,o;for(r=0,o=t.length;r<o;++r){const o=t[r];e&&!o.visible||n.push(o)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,n={meta:e,index:e.index,cancelable:!0},r=yv(this,e);!1!==this.notifyPlugins("beforeDatasetDraw",n)&&(r&&cb(t,r),e.controller.draw(),r&&db(t),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(e){return lb(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){const o=dy.modes[t];return"function"===typeof o?o(this,e,n,r):[]}getDatasetMeta(e){const t=this.data.datasets[e],n=this._metasets;let r=n.filter((e=>e&&e._dataset===t)).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||(this.$context=Cb(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const n=this.getDatasetMeta(e);return"boolean"===typeof n.hidden?!n.hidden:!t.hidden}setDatasetVisibility(e,t){this.getDatasetMeta(e).hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){const r=n?"show":"hide",o=this.getDatasetMeta(e),a=o.controller._resolveAnimations(void 0,r);Jg(t)?(o.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(o,{visible:n}),this.update((t=>t.datasetIndex===e?r:void 0)))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),kv.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),ab(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete jw[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(){return this.canvas.toDataURL(...arguments)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};Wg(this.options.events,(e=>n(e,r)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},o=(e,t)=>{this.canvas&&this.resize(e,t)};let a;const i=()=>{r("attach",i),this.attached=!0,this.resize(),n("resize",o),n("detach",a)};a=()=>{this.attached=!1,r("resize",o),this._stop(),this._resize(0,0),n("attach",i)},t.isAttached(this.canvas)?i():a()}unbindEvents(){Wg(this._listeners,((e,t)=>{this.platform.removeEventListener(this,t,e)})),this._listeners={},Wg(this._responsiveListeners,((e,t)=>{this.platform.removeEventListener(this,t,e)})),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){const r=n?"set":"remove";let o,a,i,s;for("dataset"===t&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+r+"DatasetHoverStyle"]()),i=0,s=e.length;i<s;++i){a=e[i];const t=a&&this.getDatasetMeta(a.datasetIndex).controller;t&&t[r+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],n=e.map((e=>{let{datasetIndex:t,index:n}=e;const r=this.getDatasetMeta(t);if(!r)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:r.data[n],index:n}}));!Hg(n,t)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return 1===this._plugins._cache.filter((t=>t.plugin.id===e)).length}_updateHoverStyles(e,t,n){const r=this.options.hover,o=(e,t)=>e.filter((e=>!t.some((t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)))),a=o(t,e),i=n?e:o(e,t);a.length&&this.updateHoverStyle(a,r.mode,!1),i.length&&r.mode&&this.updateHoverStyle(i,r.mode,!0)}_eventHandler(e,t){const n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(!1===this.notifyPlugins("beforeEvent",n,r))return;const o=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,r),(o||n.changed)&&this.render(),this}_handleEvent(e,t,n){const{_active:r=[],options:o}=this,a=t,i=this._getActiveElements(e,r,n,a),s=function(e){return"mouseup"===e.type||"click"===e.type||"contextmenu"===e.type}(e),l=function(e,t,n,r){return n&&"mouseout"!==e.type?r?t:e:null}(e,this._lastEvent,n,s);n&&(this._lastEvent=null,Bg(o.onHover,[e,i,this],this),s&&Bg(o.onClick,[e,i,this],this));const c=!Hg(i,r);return(c||t)&&(this._active=i,this._updateHoverStyles(i,r,t)),this._lastEvent=l,c}_getActiveElements(e,t,n,r){if("mouseout"===e.type)return[];if(!n)return t;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,r)}}function Ew(){return Wg(_w.instances,(e=>e._plugins.invalidate()))}function Mw(e,t,n,r){const o=function(e){return yb(e,["outerStart","outerEnd","innerStart","innerEnd"])}(e.options.borderRadius),a=(n-t)/2,i=Math.min(a,r*t/2),s=e=>{const t=(n-Math.min(a,e))*r/2;return Sx(e,0,Math.min(a,t))};return{outerStart:s(o.outerStart),outerEnd:s(o.outerEnd),innerStart:Sx(o.innerStart,0,i),innerEnd:Sx(o.innerEnd,0,i)}}function Nw(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Rw(e,t,n,r,o,a){const{x:i,y:s,startAngle:l,pixelMargin:c,innerRadius:d}=t,u=Math.max(t.outerRadius+r+n-c,0),h=d>0?d+r+n+c:0;let p=0;const f=o-l;if(r){const e=((d>0?d-r:0)+(u>0?u-r:0))/2;p=(f-(0!==e?f*e/(e+r):f))/2}const m=(f-Math.max(.001,f*u-n/tx)/u)/2,g=l+m+p,x=o-m-p,{outerStart:b,outerEnd:v,innerStart:y,innerEnd:w}=Mw(t,h,u,x-g),k=u-b,S=u-v,j=g+b/k,A=x-v/S,C=h+y,_=h+w,E=g+y/C,M=x-w/_;if(e.beginPath(),a){const t=(j+A)/2;if(e.arc(i,s,u,j,t),e.arc(i,s,u,t,A),v>0){const t=Nw(S,A,i,s);e.arc(t.x,t.y,v,A,x+ix)}const n=Nw(_,x,i,s);if(e.lineTo(n.x,n.y),w>0){const t=Nw(_,M,i,s);e.arc(t.x,t.y,w,x+ix,M+Math.PI)}const r=(x-w/h+(g+y/h))/2;if(e.arc(i,s,h,x-w/h,r,!0),e.arc(i,s,h,r,g+y/h,!0),y>0){const t=Nw(C,E,i,s);e.arc(t.x,t.y,y,E+Math.PI,g-ix)}const o=Nw(k,g,i,s);if(e.lineTo(o.x,o.y),b>0){const t=Nw(k,j,i,s);e.arc(t.x,t.y,b,g-ix,j)}}else{e.moveTo(i,s);const t=Math.cos(j)*u+i,n=Math.sin(j)*u+s;e.lineTo(t,n);const r=Math.cos(A)*u+i,o=Math.sin(A)*u+s;e.lineTo(r,o)}e.closePath()}function Pw(e,t,n,r,o){const{fullCircles:a,startAngle:i,circumference:s,options:l}=t,{borderWidth:c,borderJoinStyle:d,borderDash:u,borderDashOffset:h}=l,p="inner"===l.borderAlign;if(!c)return;e.setLineDash(u||[]),e.lineDashOffset=h,p?(e.lineWidth=2*c,e.lineJoin=d||"round"):(e.lineWidth=c,e.lineJoin=d||"bevel");let f=t.endAngle;if(a){Rw(e,t,n,r,f,o);for(let t=0;t<a;++t)e.stroke();isNaN(s)||(f=i+(s%nx||nx))}p&&function(e,t,n){const{startAngle:r,pixelMargin:o,x:a,y:i,outerRadius:s,innerRadius:l}=t;let c=o/s;e.beginPath(),e.arc(a,i,s,r-c,n+c),l>o?(c=o/l,e.arc(a,i,l,n+c,r-c,!0)):e.arc(a,i,o,n+ix,r-ix),e.closePath(),e.clip()}(e,t,f),a||(Rw(e,t,n,r,f,o),e.stroke())}s(_w,"defaults",tb),s(_w,"instances",jw),s(_w,"overrides",Gx),s(_w,"registry",ew),s(_w,"version","4.4.9"),s(_w,"getChart",Aw);class Ow extends Wy{constructor(e){super(),s(this,"circumference",void 0),s(this,"endAngle",void 0),s(this,"fullCircles",void 0),s(this,"innerRadius",void 0),s(this,"outerRadius",void 0),s(this,"pixelMargin",void 0),s(this,"startAngle",void 0),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,n){const r=this.getProps(["x","y"],n),{angle:o,distance:a}=bx(r,{x:e,y:t}),{startAngle:i,endAngle:s,innerRadius:l,outerRadius:c,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),u=(this.options.spacing+this.options.borderWidth)/2,h=Dg(d,s-i),p=kx(o,i,s)&&i!==s,f=h>=nx||p,m=jx(a,l+u,c+u);return f&&m}getCenterPoint(e){const{x:t,y:n,startAngle:r,endAngle:o,innerRadius:a,outerRadius:i}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:s,spacing:l}=this.options,c=(r+o)/2,d=(a+i+l+s)/2;return{x:t+Math.cos(c)*d,y:n+Math.sin(c)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:n}=this,r=(t.offset||0)/4,o=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin="inner"===t.borderAlign?.33:0,this.fullCircles=n>nx?Math.floor(n/nx):0,0===n||this.innerRadius<0||this.outerRadius<0)return;e.save();const i=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(i)*r,Math.sin(i)*r);const s=r*(1-Math.sin(Math.min(tx,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,function(e,t,n,r,o){const{fullCircles:a,startAngle:i,circumference:s}=t;let l=t.endAngle;if(a){Rw(e,t,n,r,l,o);for(let t=0;t<a;++t)e.fill();isNaN(s)||(l=i+(s%nx||nx))}Rw(e,t,n,r,l,o),e.fill()}(e,this,s,o,a),Pw(e,this,s,o,a),e.restore()}}function Tw(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;e.lineCap=Dg(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Dg(n.borderDash,t.borderDash)),e.lineDashOffset=Dg(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Dg(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Dg(n.borderWidth,t.borderWidth),e.strokeStyle=Dg(n.borderColor,t.borderColor)}function Lw(e,t,n){e.lineTo(n.x,n.y)}function Iw(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=e.length,{start:o=0,end:a=r-1}=n,{start:i,end:s}=t,l=Math.max(o,i),c=Math.min(a,s),d=o<i&&a<i||o>s&&a>s;return{count:r,start:l,loop:t.loop,ilen:c<l&&!d?r+c-l:c-l}}function zw(e,t,n,r){const{points:o,options:a}=t,{count:i,start:s,loop:l,ilen:c}=Iw(o,n,r),d=function(e){return e.stepped?ub:e.tension||"monotone"===e.cubicInterpolationMode?hb:Lw}(a);let u,h,p,{move:f=!0,reverse:m}=r||{};for(u=0;u<=c;++u)h=o[(s+(m?c-u:u))%i],h.skip||(f?(e.moveTo(h.x,h.y),f=!1):d(e,p,h,m,a.stepped),p=h);return l&&(h=o[(s+(m?c:0))%i],d(e,p,h,m,a.stepped)),!!l}function Dw(e,t,n,r){const o=t.points,{count:a,start:i,ilen:s}=Iw(o,n,r),{move:l=!0,reverse:c}=r||{};let d,u,h,p,f,m,g=0,x=0;const b=e=>(i+(c?s-e:e))%a,v=()=>{p!==f&&(e.lineTo(g,f),e.lineTo(g,p),e.lineTo(g,m))};for(l&&(u=o[b(0)],e.moveTo(u.x,u.y)),d=0;d<=s;++d){if(u=o[b(d)],u.skip)continue;const t=u.x,n=u.y,r=0|t;r===h?(n<p?p=n:n>f&&(f=n),g=(x*g+t)/++x):(v(),e.lineTo(t,n),h=r,x=0,p=f=n),m=n}v()}function Fw(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&"monotone"!==t.cubicInterpolationMode&&!t.stepped&&!n?Dw:zw}s(Ow,"id","arc"),s(Ow,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),s(Ow,"defaultRoutes",{backgroundColor:"backgroundColor"}),s(Ow,"descriptors",{_scriptable:!0,_indexable:e=>"borderDash"!==e});const Bw="function"===typeof Path2D;function Ww(e,t,n,r){Bw&&!t.options.segment?function(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),Tw(e,t.options),e.stroke(o)}(e,t,n,r):function(e,t,n,r){const{segments:o,options:a}=t,i=Fw(t);for(const s of o)Tw(e,a,s.style),e.beginPath(),i(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}(e,t,n,r)}class Hw extends Wy{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){const r=n.spanGaps?this._loop:this._fullLoop;Kb(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const a=!!e._loop,{start:i,end:s}=function(e,t,n,r){let o=0,a=t-1;if(n&&!r)for(;o<t&&!e[o].skip;)o++;for(;o<t&&e[o].skip;)o++;for(o%=t,n&&(a+=o);a>o&&e[a%t].skip;)a--;return a%=t,{start:o,end:a}}(n,o,a,r);return gv(e,!0===r?[{start:i,end:s,loop:a}]:function(e,t,n,r){const o=e.length,a=[];let i,s=t,l=e[t];for(i=t+1;i<=n;++i){const n=e[i%o];n.skip||n.stop?l.skip||(r=!1,a.push({start:t%o,end:(i-1)%o,loop:r}),t=s=n.stop?i:null):(s=i,l.skip&&(t=i)),l=n}return null!==s&&a.push({start:t%o,end:s%o,loop:r}),a}(n,i,s<i?s+o:s,!!e._fullLoop&&0===i&&s===o-1),n,t)}(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){const n=this.options,r=e[t],o=this.points,a=mv(this,{property:t,start:r,end:r});if(!a.length)return;const i=[],s=function(e){return e.stepped?sv:e.tension||"monotone"===e.cubicInterpolationMode?lv:iv}(n);let l,c;for(l=0,c=a.length;l<c;++l){const{start:c,end:d}=a[l],u=o[c],h=o[d];if(u===h){i.push(u);continue}const p=s(u,h,Math.abs((r-u[t])/(h[t]-u[t])),n.stepped);p[t]=e[t],i.push(p)}return 1===i.length?i[0]:i}pathSegment(e,t,n){return Fw(this)(e,this,t,n)}path(e,t,n){const r=this.segments,o=Fw(this);let a=this._loop;t=t||0,n=n||this.points.length-t;for(const i of r)a&=o(e,this,i,{start:t,end:t+n-1});return!!a}draw(e,t,n,r){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(e.save(),Ww(e,this,n,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Vw(e,t,n,r){const o=e.options,{[n]:a}=e.getProps([n],r);return Math.abs(t-a)<o.radius+o.hitRadius}s(Hw,"id","line"),s(Hw,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),s(Hw,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),s(Hw,"descriptors",{_scriptable:!0,_indexable:e=>"borderDash"!==e&&"fill"!==e});class Uw extends Wy{constructor(e){super(),s(this,"parsed",void 0),s(this,"skip",void 0),s(this,"stop",void 0),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,n){const r=this.options,{x:o,y:a}=this.getProps(["x","y"],n);return Math.pow(e-o,2)+Math.pow(t-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,t){return Vw(this,e,"x",t)}inYRange(e,t){return Vw(this,e,"y",t)}getCenterPoint(e){const{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}size(e){let t=(e=e||this.options||{}).radius||0;t=Math.max(t,t&&e.hoverRadius||0);return 2*(t+(t&&e.borderWidth||0))}draw(e,t){const n=this.options;this.skip||n.radius<.1||!lb(this,t,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,ib(e,n,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}function qw(e,t){const{x:n,y:r,base:o,width:a,height:i}=e.getProps(["x","y","base","width","height"],t);let s,l,c,d,u;return e.horizontal?(u=i/2,s=Math.min(n,o),l=Math.max(n,o),c=r-u,d=r+u):(u=a/2,s=n-u,l=n+u,c=Math.min(r,o),d=Math.max(r,o)),{left:s,top:c,right:l,bottom:d}}function $w(e,t,n,r){return e?0:Sx(t,n,r)}function Kw(e){const t=qw(e),n=t.right-t.left,r=t.bottom-t.top,o=function(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,a=wb(r);return{t:$w(o.top,a.top,0,n),r:$w(o.right,a.right,0,t),b:$w(o.bottom,a.bottom,0,n),l:$w(o.left,a.left,0,t)}}(e,n/2,r/2),a=function(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,a=kb(o),i=Math.min(t,n),s=e.borderSkipped,l=r||Lg(o);return{topLeft:$w(!l||s.top||s.left,a.topLeft,0,i),topRight:$w(!l||s.top||s.right,a.topRight,0,i),bottomLeft:$w(!l||s.bottom||s.left,a.bottomLeft,0,i),bottomRight:$w(!l||s.bottom||s.right,a.bottomRight,0,i)}}(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:a},inner:{x:t.left+o.l,y:t.top+o.t,w:n-o.l-o.r,h:r-o.t-o.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,a.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(o.b,o.r))}}}}function Xw(e,t,n,r){const o=null===t,a=null===n,i=e&&!(o&&a)&&qw(e,r);return i&&(o||jx(t,i.left,i.right))&&(a||jx(n,i.top,i.bottom))}function Yw(e,t){e.rect(t.x,t.y,t.w,t.h)}function Gw(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=e.x!==n.x?-t:0,o=e.y!==n.y?-t:0,a=(e.x+e.w!==n.x+n.w?t:0)-r,i=(e.y+e.h!==n.y+n.h?t:0)-o;return{x:e.x+r,y:e.y+o,w:e.w+a,h:e.h+i,radius:e.radius}}s(Uw,"id","point"),s(Uw,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),s(Uw,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});class Zw extends Wy{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:n,backgroundColor:r}}=this,{inner:o,outer:a}=Kw(this),i=(s=a.radius).topLeft||s.topRight||s.bottomLeft||s.bottomRight?gb:Yw;var s;e.save(),a.w===o.w&&a.h===o.h||(e.beginPath(),i(e,Gw(a,t,o)),e.clip(),i(e,Gw(o,-t,a)),e.fillStyle=n,e.fill("evenodd")),e.beginPath(),i(e,Gw(o,t)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,t,n){return Xw(this,e,t,n)}inXRange(e,t){return Xw(this,e,null,t)}inYRange(e,t){return Xw(this,null,e,t)}getCenterPoint(e){const{x:t,y:n,base:r,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(t+r)/2:t,y:o?n:(n+r)/2}}getRange(e){return"x"===e?this.width/2:this.height/2}}s(Zw,"id","bar"),s(Zw,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),s(Zw,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Jw(e,t,n,r){if(r)return;let o=t[e],a=n[e];return"angle"===e&&(o=wx(o),a=wx(a)),{property:e,start:o,end:a}}function Qw(e,t,n){for(;t>e;t--){const e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function ek(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function tk(e,t){let n=[],r=!1;return Tg(e)?(r=!0,n=e):n=function(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,a=[];return t.segments.forEach((e=>{let{start:t,end:i}=e;i=Qw(t,i,o);const s=o[t],l=o[i];null!==r?(a.push({x:s.x,y:r}),a.push({x:l.x,y:r})):null!==n&&(a.push({x:n,y:s.y}),a.push({x:n,y:l.y}))})),a}(e,t),n.length?new Hw({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function nk(e){return e&&!1!==e.fill}function rk(e,t,n){let r=e[t].fill;const o=[t];let a;if(!n)return r;for(;!1!==r&&-1===o.indexOf(r);){if(!Ig(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;o.push(r),r=a.fill}return!1}function ok(e,t,n){const r=function(e){const t=e.options,n=t.fill;let r=Dg(n&&n.target,n);void 0===r&&(r=!!t.backgroundColor);if(!1===r||null===r)return!1;if(!0===r)return"origin";return r}(e);if(Lg(r))return!isNaN(r.value)&&r;let o=parseFloat(r);return Ig(o)&&Math.floor(o)===o?function(e,t,n,r){"-"!==e&&"+"!==e||(n=t+n);if(n===t||n<0||n>=r)return!1;return n}(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function ak(e,t,n){const r=[];for(let o=0;o<n.length;o++){const a=n[o],{first:i,last:s,point:l}=ik(a,t,"x");if(!(!l||i&&s))if(i)r.unshift(l);else if(e.push(l),!s)break}e.push(...r)}function ik(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const o=r[n],a=e.segments,i=e.points;let s=!1,l=!1;for(let c=0;c<a.length;c++){const e=a[c],t=i[e.start][n],r=i[e.end][n];if(jx(o,t,r)){s=o===t,l=o===r;break}}return{first:s,last:l,point:r}}class sk{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,n){const{x:r,y:o,radius:a}=this;return t=t||{start:0,end:nx},e.arc(r,o,a,t.end,t.start,!0),!n.bounds}interpolate(e){const{x:t,y:n,radius:r}=this,o=e.angle;return{x:t+Math.cos(o)*r,y:n+Math.sin(o)*r,angle:o}}}function lk(e){const{chart:t,fill:n,line:r}=e;if(Ig(n))return function(e,t){const n=e.getDatasetMeta(t),r=n&&e.isDatasetVisible(t);return r?n.dataset:null}(t,n);if("stack"===n)return function(e){const{scale:t,index:n,line:r}=e,o=[],a=r.segments,i=r.points,s=function(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let o=0;o<r.length;o++){const e=r[o];if(e.index===t)break;e.hidden||n.unshift(e.dataset)}return n}(t,n);s.push(tk({x:null,y:t.bottom},r));for(let l=0;l<a.length;l++){const e=a[l];for(let t=e.start;t<=e.end;t++)ak(o,i[t],s)}return new Hw({points:o,options:{}})}(e);if("shape"===n)return!0;const o=function(e){const t=e.scale||{};if(t.getPointPositionForValue)return function(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,a=r.reverse?t.max:t.min,i=function(e,t,n){let r;return r="start"===e?n:"end"===e?t.options.reverse?t.min:t.max:Lg(e)?e.value:t.getBaseValue(),r}(n,t,a),s=[];if(r.grid.circular){const e=t.getPointPositionForValue(0,a);return new sk({x:e.x,y:e.y,radius:t.getDistanceFromCenterForValue(i)})}for(let l=0;l<o;++l)s.push(t.getPointPositionForValue(l,i));return s}(e);return function(e){const{scale:t={},fill:n}=e,r=function(e,t){let n=null;return"start"===e?n=t.bottom:"end"===e?n=t.top:Lg(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}(n,t);if(Ig(r)){const e=t.isHorizontal();return{x:e?r:null,y:e?null:r}}return null}(e)}(e);return o instanceof sk?o:tk(o,r)}function ck(e,t,n){const r=lk(t),{chart:o,index:a,line:i,scale:s,axis:l}=t,c=i.options,d=c.fill,u=c.backgroundColor,{above:h=u,below:p=u}=d||{},f=o.getDatasetMeta(a),m=yv(o,f);r&&i.points.length&&(cb(e,n),function(e,t){const{line:n,target:r,above:o,below:a,area:i,scale:s,clip:l}=t,c=n._loop?"angle":t.axis;e.save(),"x"===c&&a!==o&&(dk(e,r,i.top),uk(e,{line:n,target:r,color:o,scale:s,property:c,clip:l}),e.restore(),e.save(),dk(e,r,i.bottom));uk(e,{line:n,target:r,color:a,scale:s,property:c,clip:l}),e.restore()}(e,{line:i,target:r,above:h,below:p,area:n,scale:s,axis:l,clip:m}),db(e))}function dk(e,t,n){const{segments:r,points:o}=t;let a=!0,i=!1;e.beginPath();for(const s of r){const{start:r,end:l}=s,c=o[r],d=o[Qw(r,l,o)];a?(e.moveTo(c.x,c.y),a=!1):(e.lineTo(c.x,n),e.lineTo(c.x,c.y)),i=!!t.pathSegment(e,s,{move:i}),i?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function uk(e,t){const{line:n,target:r,property:o,color:a,scale:i,clip:s}=t,l=function(e,t,n){const r=e.segments,o=e.points,a=t.points,i=[];for(const s of r){let{start:e,end:r}=s;r=Qw(e,r,o);const l=Jw(n,o[e],o[r],s.loop);if(!t.segments){i.push({source:s,target:l,start:o[e],end:o[r]});continue}const c=mv(t,l);for(const t of c){const e=Jw(n,a[t.start],a[t.end],t.loop),r=fv(s,o,e);for(const o of r)i.push({source:o,target:t,start:{[n]:ek(l,e,"start",Math.max)},end:{[n]:ek(l,e,"end",Math.min)}})}}return i}(n,r,o);for(const{source:c,target:d,start:u,end:h}of l){const{style:{backgroundColor:t=a}={}}=c,l=!0!==r;e.save(),e.fillStyle=t,hk(e,i,s,l&&Jw(o,u,h)),e.beginPath();const p=!!n.pathSegment(e,c);let f;if(l){p?e.closePath():pk(e,r,h,o);const t=!!r.pathSegment(e,d,{move:p,reverse:!0});f=p&&t,f||pk(e,r,u,o)}e.closePath(),e.fill(f?"evenodd":"nonzero"),e.restore()}}function hk(e,t,n,r){const o=t.chart.chartArea,{property:a,start:i,end:s}=r||{};if("x"===a||"y"===a){let t,r,l,c;"x"===a?(t=i,r=o.top,l=s,c=o.bottom):(t=o.left,r=i,l=o.right,c=s),e.beginPath(),n&&(t=Math.max(t,n.left),l=Math.min(l,n.right),r=Math.max(r,n.top),c=Math.min(c,n.bottom)),e.rect(t,r,l-t,c-r),e.clip()}}function pk(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var fk={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,o=[];let a,i,s,l;for(i=0;i<r;++i)a=e.getDatasetMeta(i),s=a.dataset,l=null,s&&s.options&&s instanceof Hw&&(l={visible:e.isDatasetVisible(i),index:i,fill:ok(s,i,r),chart:e,axis:a.controller.options.indexAxis,scale:a.vScale,line:s}),a.$filler=l,o.push(l);for(i=0;i<r;++i)l=o[i],l&&!1!==l.fill&&(l.fill=rk(o,i,n.propagate))},beforeDraw(e,t,n){const r="beforeDraw"===n.drawTime,o=e.getSortedVisibleDatasetMetas(),a=e.chartArea;for(let i=o.length-1;i>=0;--i){const t=o[i].$filler;t&&(t.line.updateControlPoints(a,t.axis),r&&t.fill&&ck(e.ctx,t,a))}},beforeDatasetsDraw(e,t,n){if("beforeDatasetsDraw"!==n.drawTime)return;const r=e.getSortedVisibleDatasetMetas();for(let o=r.length-1;o>=0;--o){const t=r[o].$filler;nk(t)&&ck(e.ctx,t,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;nk(r)&&"beforeDatasetDraw"===n.drawTime&&ck(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const mk=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}};class gk extends Wy{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let t=Bg(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter((t=>e.filter(t,this.chart.data)))),e.sort&&(t=t.sort(((t,n)=>e.sort(t,n,this.chart.data)))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:e,ctx:t}=this;if(!e.display)return void(this.width=this.height=0);const n=e.labels,r=jb(n.font),o=r.size,a=this._computeTitleHeight(),{boxWidth:i,itemHeight:s}=mk(n,o);let l,c;t.font=r.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(a,o,i,s)+10):(c=this.maxHeight,l=this._fitCols(a,r,i,s)+10),this.width=Math.min(l,e.maxWidth||this.maxWidth),this.height=Math.min(c,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){const{ctx:o,maxWidth:a,options:{labels:{padding:i}}}=this,s=this.legendHitBoxes=[],l=this.lineWidths=[0],c=r+i;let d=e;o.textAlign="left",o.textBaseline="middle";let u=-1,h=-c;return this.legendItems.forEach(((e,p)=>{const f=n+t/2+o.measureText(e.text).width;(0===p||l[l.length-1]+f+2*i>a)&&(d+=c,l[l.length-(p>0?0:1)]=0,h+=c,u++),s[p]={left:0,top:h,row:u,width:f,height:r},l[l.length-1]+=f+i})),d}_fitCols(e,t,n,r){const{ctx:o,maxHeight:a,options:{labels:{padding:i}}}=this,s=this.legendHitBoxes=[],l=this.columnSizes=[],c=a-e;let d=i,u=0,h=0,p=0,f=0;return this.legendItems.forEach(((e,a)=>{const{itemWidth:m,itemHeight:g}=function(e,t,n,r,o){const a=function(e,t,n,r){let o=e.text;o&&"string"!==typeof o&&(o=o.reduce(((e,t)=>e.length>t.length?e:t)));return t+n.size/2+r.measureText(o).width}(r,e,t,n),i=function(e,t,n){let r=e;"string"!==typeof t.text&&(r=xk(t,n));return r}(o,r,t.lineHeight);return{itemWidth:a,itemHeight:i}}(n,t,o,e,r);a>0&&h+g+2*i>c&&(d+=u+i,l.push({width:u,height:h}),p+=u+i,f++,u=h=0),s[a]={left:p,top:h,col:f,width:m,height:g},u=Math.max(u,m),h+=g+i})),d+=u,l.push({width:u,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:o}}=this,a=cv(o,this.left,this.width);if(this.isHorizontal()){let o=0,i=Tx(n,this.left+r,this.right-this.lineWidths[o]);for(const s of t)o!==s.row&&(o=s.row,i=Tx(n,this.left+r,this.right-this.lineWidths[o])),s.top+=this.top+e+r,s.left=a.leftForLtr(a.x(i),s.width),i+=s.width+r}else{let o=0,i=Tx(n,this.top+e+r,this.bottom-this.columnSizes[o].height);for(const s of t)s.col!==o&&(o=s.col,i=Tx(n,this.top+e+r,this.bottom-this.columnSizes[o].height)),s.top=i,s.left+=this.left+r,s.left=a.leftForLtr(a.x(s.left),s.width),i+=s.height+r}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const e=this.ctx;cb(e,this),this._draw(),db(e)}}_draw(){const{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:o,labels:a}=e,i=tb.color,s=cv(e.rtl,this.left,this.width),l=jb(a.font),{padding:c}=a,d=l.size,u=d/2;let h;this.drawTitle(),r.textAlign=s.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=l.string;const{boxWidth:p,boxHeight:f,itemHeight:m}=mk(a,d),g=this.isHorizontal(),x=this._computeTitleHeight();h=g?{x:Tx(o,this.left+c,this.right-n[0]),y:this.top+c+x,line:0}:{x:this.left+c,y:Tx(o,this.top+x+c,this.bottom-t[0].height),line:0},dv(this.ctx,e.textDirection);const b=m+c;this.legendItems.forEach(((v,y)=>{r.strokeStyle=v.fontColor,r.fillStyle=v.fontColor;const w=r.measureText(v.text).width,k=s.textAlign(v.textAlign||(v.textAlign=a.textAlign)),S=p+u+w;let j=h.x,A=h.y;s.setWidth(this.width),g?y>0&&j+S+c>this.right&&(A=h.y+=b,h.line++,j=h.x=Tx(o,this.left+c,this.right-n[h.line])):y>0&&A+b>this.bottom&&(j=h.x=j+t[h.line].width+c,h.line++,A=h.y=Tx(o,this.top+x+c,this.bottom-t[h.line].height));if(function(e,t,n){if(isNaN(p)||p<=0||isNaN(f)||f<0)return;r.save();const o=Dg(n.lineWidth,1);if(r.fillStyle=Dg(n.fillStyle,i),r.lineCap=Dg(n.lineCap,"butt"),r.lineDashOffset=Dg(n.lineDashOffset,0),r.lineJoin=Dg(n.lineJoin,"miter"),r.lineWidth=o,r.strokeStyle=Dg(n.strokeStyle,i),r.setLineDash(Dg(n.lineDash,[])),a.usePointStyle){const i={radius:f*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:o},l=s.xPlus(e,p/2);sb(r,i,l,t+u,a.pointStyleWidth&&p)}else{const a=t+Math.max((d-f)/2,0),i=s.leftForLtr(e,p),l=kb(n.borderRadius);r.beginPath(),Object.values(l).some((e=>0!==e))?gb(r,{x:i,y:a,w:p,h:f,radius:l}):r.rect(i,a,p,f),r.fill(),0!==o&&r.stroke()}r.restore()}(s.x(j),A,v),j=((e,t,n,r)=>e===(r?"left":"right")?n:"center"===e?(t+n)/2:t)(k,j+p+u,g?j+S:this.right,e.rtl),function(e,t,n){mb(r,n.text,e,t+m/2,l,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})}(s.x(j),A,v),g)h.x+=S+c;else if("string"!==typeof v.text){const e=l.lineHeight;h.y+=xk(v,e)+c}else h.y+=b})),uv(this.ctx,e.textDirection)}drawTitle(){const e=this.options,t=e.title,n=jb(t.font),r=Sb(t.padding);if(!t.display)return;const o=cv(e.rtl,this.left,this.width),a=this.ctx,i=t.position,s=n.size/2,l=r.top+s;let c,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),c=this.top+l,d=Tx(e.align,d,this.right-u);else{const t=this.columnSizes.reduce(((e,t)=>Math.max(e,t.height)),0);c=l+Tx(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}const h=Tx(i,d,d+u);a.textAlign=o.textAlign(Ox(i)),a.textBaseline="middle",a.strokeStyle=t.color,a.fillStyle=t.color,a.font=n.string,mb(a,t.text,h,c,n)}_computeTitleHeight(){const e=this.options.title,t=jb(e.font),n=Sb(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,o;if(jx(e,this.left,this.right)&&jx(t,this.top,this.bottom))for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(r=o[n],jx(e,r.left,r.left+r.width)&&jx(t,r.top,r.top+r.height))return this.legendItems[n];return null}handleEvent(e){const t=this.options;if(!function(e,t){if(("mousemove"===e||"mouseout"===e)&&(t.onHover||t.onLeave))return!0;if(t.onClick&&("click"===e||"mouseup"===e))return!0;return!1}(e.type,t))return;const n=this._getLegendItemAt(e.x,e.y);if("mousemove"===e.type||"mouseout"===e.type){const a=this._hoveredItem,i=(o=n,null!==(r=a)&&null!==o&&r.datasetIndex===o.datasetIndex&&r.index===o.index);a&&!i&&Bg(t.onLeave,[e,a,this],this),this._hoveredItem=n,n&&!i&&Bg(t.onHover,[e,n,this],this)}else n&&Bg(t.onClick,[e,n,this],this);var r,o}}function xk(e,t){return t*(e.text?e.text.length:0)}var bk={id:"legend",_element:gk,start(e,t,n){const r=e.legend=new gk({ctx:e.ctx,options:n,chart:e});Sy.configure(e,r,n),Sy.addBox(e,r)},stop(e){Sy.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Sy.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,o=n.chart;o.isDatasetVisible(r)?(o.hide(r),t.hidden=!0):(o.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:o,color:a,useBorderRadius:i,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map((e=>{const l=e.controller.getStyle(n?0:void 0),c=Sb(l.borderWidth);return{text:t[e.index].label,fillStyle:l.backgroundColor,fontColor:a,hidden:!e.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:r||l.pointStyle,rotation:l.rotation,textAlign:o||l.textAlign,borderRadius:i&&(s||l.borderRadius),datasetIndex:e.index}}),this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class vk extends Wy{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){const n=this.options;if(this.left=0,this.top=0,!n.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=e,this.height=this.bottom=t;const r=Tg(n.text)?n.text.length:1;this._padding=Sb(n.padding);const o=r*jb(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const e=this.options.position;return"top"===e||"bottom"===e}_drawArgs(e){const{top:t,left:n,bottom:r,right:o,options:a}=this,i=a.align;let s,l,c,d=0;return this.isHorizontal()?(l=Tx(i,n,o),c=t+e,s=o-n):("left"===a.position?(l=n+e,c=Tx(i,r,t),d=-.5*tx):(l=o-e,c=Tx(i,t,r),d=.5*tx),s=r-t),{titleX:l,titleY:c,maxWidth:s,rotation:d}}draw(){const e=this.ctx,t=this.options;if(!t.display)return;const n=jb(t.font),r=n.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:i,rotation:s}=this._drawArgs(r);mb(e,t.text,0,0,n,{color:t.color,maxWidth:i,rotation:s,textAlign:Ox(t.align),textBaseline:"middle",translation:[o,a]})}}var yk={id:"title",_element:vk,start(e,t,n){!function(e,t){const n=new vk({ctx:e.ctx,options:t,chart:e});Sy.configure(e,n,t),Sy.addBox(e,n),e.titleBlock=n}(e,n)},stop(e){const t=e.titleBlock;Sy.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Sy.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};new WeakMap;const wk={average(e){if(!e.length)return!1;let t,n,r=new Set,o=0,a=0;for(t=0,n=e.length;t<n;++t){const n=e[t].element;if(n&&n.hasValue()){const e=n.tooltipPosition();r.add(e.x),o+=e.y,++a}}if(0===a||0===r.size)return!1;return{x:[...r].reduce(((e,t)=>e+t))/r.size,y:o/a}},nearest(e,t){if(!e.length)return!1;let n,r,o,a=t.x,i=t.y,s=Number.POSITIVE_INFINITY;for(n=0,r=e.length;n<r;++n){const r=e[n].element;if(r&&r.hasValue()){const e=vx(t,r.getCenterPoint());e<s&&(s=e,o=r)}}if(o){const e=o.tooltipPosition();a=e.x,i=e.y}return{x:a,y:i}}};function kk(e,t){return t&&(Tg(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Sk(e){return("string"===typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function jk(e,t){const{element:n,datasetIndex:r,index:o}=t,a=e.getDatasetMeta(r).controller,{label:i,value:s}=a.getLabelAndValue(o);return{chart:e,label:i,parsed:a.getParsed(o),raw:e.data.datasets[r].data[o],formattedValue:s,dataset:a.getDataset(),dataIndex:o,datasetIndex:r,element:n}}function Ak(e,t){const n=e.chart.ctx,{body:r,footer:o,title:a}=e,{boxWidth:i,boxHeight:s}=t,l=jb(t.bodyFont),c=jb(t.titleFont),d=jb(t.footerFont),u=a.length,h=o.length,p=r.length,f=Sb(t.padding);let m=f.height,g=0,x=r.reduce(((e,t)=>e+t.before.length+t.lines.length+t.after.length),0);if(x+=e.beforeBody.length+e.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),x){m+=p*(t.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(x-p)*l.lineHeight+(x-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*d.lineHeight+(h-1)*t.footerSpacing);let b=0;const v=function(e){g=Math.max(g,n.measureText(e).width+b)};return n.save(),n.font=c.string,Wg(e.title,v),n.font=l.string,Wg(e.beforeBody.concat(e.afterBody),v),b=t.displayColors?i+2+t.boxPadding:0,Wg(r,(e=>{Wg(e.before,v),Wg(e.lines,v),Wg(e.after,v)})),b=0,n.font=d.string,Wg(e.footer,v),n.restore(),g+=f.width,{width:g,height:m}}function Ck(e,t,n,r){const{x:o,width:a}=n,{width:i,chartArea:{left:s,right:l}}=e;let c="center";return"center"===r?c=o<=(s+l)/2?"left":"right":o<=a/2?c="left":o>=i-a/2&&(c="right"),function(e,t,n,r){const{x:o,width:a}=r,i=n.caretSize+n.caretPadding;return"left"===e&&o+a+i>t.width||"right"===e&&o-a-i<0||void 0}(c,e,t,n)&&(c="center"),c}function _k(e,t,n){const r=n.yAlign||t.yAlign||function(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}(e,n);return{xAlign:n.xAlign||t.xAlign||Ck(e,t,n,r),yAlign:r}}function Ek(e,t,n,r){const{caretSize:o,caretPadding:a,cornerRadius:i}=e,{xAlign:s,yAlign:l}=n,c=o+a,{topLeft:d,topRight:u,bottomLeft:h,bottomRight:p}=kb(i);let f=function(e,t){let{x:n,width:r}=e;return"right"===t?n-=r:"center"===t&&(n-=r/2),n}(t,s);const m=function(e,t,n){let{y:r,height:o}=e;return"top"===t?r+=n:r-="bottom"===t?o+n:o/2,r}(t,l,c);return"center"===l?"left"===s?f+=c:"right"===s&&(f-=c):"left"===s?f-=Math.max(d,h)+o:"right"===s&&(f+=Math.max(u,p)+o),{x:Sx(f,0,r.width-t.width),y:Sx(m,0,r.height-t.height)}}function Mk(e,t,n){const r=Sb(n.padding);return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-r.right:e.x+r.left}function Nk(e){return kk([],Sk(e))}function Rk(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Pk={beforeTitle:Rg,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Rg,beforeBody:Rg,beforeLabel:Rg,label(e){if(this&&this.options&&"dataset"===this.options.mode)return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return Og(n)||(t+=n),t},labelColor(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:Rg,afterBody:Rg,beforeFooter:Rg,footer:Rg,afterFooter:Rg};function Ok(e,t,n,r){const o=e[t].call(n,r);return"undefined"===typeof o?Pk[t].call(n,r):o}class Tk extends Wy{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&t.options.animation&&n.animations,o=new Cv(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=(e=this.chart.getContext(),t=this,n=this._tooltipItems,Cb(e,{tooltip:t,tooltipItems:n,type:"tooltip"})));var e,t,n}getTitle(e,t){const{callbacks:n}=t,r=Ok(n,"beforeTitle",this,e),o=Ok(n,"title",this,e),a=Ok(n,"afterTitle",this,e);let i=[];return i=kk(i,Sk(r)),i=kk(i,Sk(o)),i=kk(i,Sk(a)),i}getBeforeBody(e,t){return Nk(Ok(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:n}=t,r=[];return Wg(e,(e=>{const t={before:[],lines:[],after:[]},o=Rk(n,e);kk(t.before,Sk(Ok(o,"beforeLabel",this,e))),kk(t.lines,Ok(o,"label",this,e)),kk(t.after,Sk(Ok(o,"afterLabel",this,e))),r.push(t)})),r}getAfterBody(e,t){return Nk(Ok(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:n}=t,r=Ok(n,"beforeFooter",this,e),o=Ok(n,"footer",this,e),a=Ok(n,"afterFooter",this,e);let i=[];return i=kk(i,Sk(r)),i=kk(i,Sk(o)),i=kk(i,Sk(a)),i}_createItems(e){const t=this._active,n=this.chart.data,r=[],o=[],a=[];let i,s,l=[];for(i=0,s=t.length;i<s;++i)l.push(jk(this.chart,t[i]));return e.filter&&(l=l.filter(((t,r,o)=>e.filter(t,r,o,n)))),e.itemSort&&(l=l.sort(((t,r)=>e.itemSort(t,r,n)))),Wg(l,(t=>{const n=Rk(e.callbacks,t);r.push(Ok(n,"labelColor",this,t)),o.push(Ok(n,"labelPointStyle",this,t)),a.push(Ok(n,"labelTextColor",this,t))})),this.labelColors=r,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=l,l}update(e,t){const n=this.options.setContext(this.getContext()),r=this._active;let o,a=[];if(r.length){const e=wk[n.position].call(this,r,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);const t=this._size=Ak(this,n),i=Object.assign({},e,t),s=_k(this.chart,n,i),l=Ek(n,i,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,o={opacity:1,x:l.x,y:l.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}else 0!==this.opacity&&(o={opacity:0});this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){const o=this.getCaretPosition(e,n,r);t.lineTo(o.x1,o.y1),t.lineTo(o.x2,o.y2),t.lineTo(o.x3,o.y3)}getCaretPosition(e,t,n){const{xAlign:r,yAlign:o}=this,{caretSize:a,cornerRadius:i}=n,{topLeft:s,topRight:l,bottomLeft:c,bottomRight:d}=kb(i),{x:u,y:h}=e,{width:p,height:f}=t;let m,g,x,b,v,y;return"center"===o?(v=h+f/2,"left"===r?(m=u,g=m-a,b=v+a,y=v-a):(m=u+p,g=m+a,b=v-a,y=v+a),x=m):(g="left"===r?u+Math.max(s,c)+a:"right"===r?u+p-Math.max(l,d)-a:this.caretX,"top"===o?(b=h,v=b-a,m=g-a,x=g+a):(b=h+f,v=b+a,m=g+a,x=g-a),y=b),{x1:m,x2:g,x3:x,y1:b,y2:v,y3:y}}drawTitle(e,t,n){const r=this.title,o=r.length;let a,i,s;if(o){const l=cv(n.rtl,this.x,this.width);for(e.x=Mk(this,n.titleAlign,n),t.textAlign=l.textAlign(n.titleAlign),t.textBaseline="middle",a=jb(n.titleFont),i=n.titleSpacing,t.fillStyle=n.titleColor,t.font=a.string,s=0;s<o;++s)t.fillText(r[s],l.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+i,s+1===o&&(e.y+=n.titleMarginBottom-i)}}_drawColorBox(e,t,n,r,o){const a=this.labelColors[n],i=this.labelPointStyles[n],{boxHeight:s,boxWidth:l}=o,c=jb(o.bodyFont),d=Mk(this,"left",o),u=r.x(d),h=s<c.lineHeight?(c.lineHeight-s)/2:0,p=t.y+h;if(o.usePointStyle){const t={radius:Math.min(l,s)/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:1},n=r.leftForLtr(u,l)+l/2,c=p+s/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,ib(e,t,n,c),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,ib(e,t,n,c)}else{e.lineWidth=Lg(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;const t=r.leftForLtr(u,l),n=r.leftForLtr(r.xPlus(u,1),l-2),i=kb(a.borderRadius);Object.values(i).some((e=>0!==e))?(e.beginPath(),e.fillStyle=o.multiKeyBackground,gb(e,{x:t,y:p,w:l,h:s,radius:i}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),gb(e,{x:n,y:p+1,w:l-2,h:s-2,radius:i}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(t,p,l,s),e.strokeRect(t,p,l,s),e.fillStyle=a.backgroundColor,e.fillRect(n,p+1,l-2,s-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){const{body:r}=this,{bodySpacing:o,bodyAlign:a,displayColors:i,boxHeight:s,boxWidth:l,boxPadding:c}=n,d=jb(n.bodyFont);let u=d.lineHeight,h=0;const p=cv(n.rtl,this.x,this.width),f=function(n){t.fillText(n,p.x(e.x+h),e.y+u/2),e.y+=u+o},m=p.textAlign(a);let g,x,b,v,y,w,k;for(t.textAlign=a,t.textBaseline="middle",t.font=d.string,e.x=Mk(this,m,n),t.fillStyle=n.bodyColor,Wg(this.beforeBody,f),h=i&&"right"!==m?"center"===a?l/2+c:l+2+c:0,v=0,w=r.length;v<w;++v){for(g=r[v],x=this.labelTextColors[v],t.fillStyle=x,Wg(g.before,f),b=g.lines,i&&b.length&&(this._drawColorBox(t,e,v,p,n),u=Math.max(d.lineHeight,s)),y=0,k=b.length;y<k;++y)f(b[y]),u=d.lineHeight;Wg(g.after,f)}h=0,u=d.lineHeight,Wg(this.afterBody,f),e.y-=o}drawFooter(e,t,n){const r=this.footer,o=r.length;let a,i;if(o){const s=cv(n.rtl,this.x,this.width);for(e.x=Mk(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=s.textAlign(n.footerAlign),t.textBaseline="middle",a=jb(n.footerFont),t.fillStyle=n.footerColor,t.font=a.string,i=0;i<o;++i)t.fillText(r[i],s.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+n.footerSpacing}}drawBackground(e,t,n,r){const{xAlign:o,yAlign:a}=this,{x:i,y:s}=e,{width:l,height:c}=n,{topLeft:d,topRight:u,bottomLeft:h,bottomRight:p}=kb(r.cornerRadius);t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(i+d,s),"top"===a&&this.drawCaret(e,t,n,r),t.lineTo(i+l-u,s),t.quadraticCurveTo(i+l,s,i+l,s+u),"center"===a&&"right"===o&&this.drawCaret(e,t,n,r),t.lineTo(i+l,s+c-p),t.quadraticCurveTo(i+l,s+c,i+l-p,s+c),"bottom"===a&&this.drawCaret(e,t,n,r),t.lineTo(i+h,s+c),t.quadraticCurveTo(i,s+c,i,s+c-h),"center"===a&&"left"===o&&this.drawCaret(e,t,n,r),t.lineTo(i,s+d),t.quadraticCurveTo(i,s,i+d,s),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,n=this.$animations,r=n&&n.x,o=n&&n.y;if(r||o){const n=wk[e.position].call(this,this._active,this._eventPosition);if(!n)return;const a=this._size=Ak(this,e),i=Object.assign({},n,this._size),s=_k(t,e,i),l=Ek(e,i,s,t);r._to===l.x&&o._to===l.y||(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=a.width,this.height=a.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(t);const r={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const a=Sb(t.padding),i=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&i&&(e.save(),e.globalAlpha=n,this.drawBackground(o,e,r,t),dv(e,t.textDirection),o.y+=a.top,this.drawTitle(o,e,t),this.drawBody(o,e,t),this.drawFooter(o,e,t),uv(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const n=this._active,r=e.map((e=>{let{datasetIndex:t,index:n}=e;const r=this.chart.getDatasetMeta(t);if(!r)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:r.data[n],index:n}})),o=!Hg(n,r),a=this._positionChanged(r,t);(o||a)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,o=this._active||[],a=this._getActiveElements(e,o,t,n),i=this._positionChanged(a,e),s=t||!Hg(a,o)||i;return s&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){const o=this.options;if("mouseout"===e.type)return[];if(!r)return t.filter((e=>this.chart.data.datasets[e.datasetIndex]&&void 0!==this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index)));const a=this.chart.getElementsAtEventForMode(e,o.mode,o,n);return o.reverse&&a.reverse(),a}_positionChanged(e,t){const{caretX:n,caretY:r,options:o}=this,a=wk[o.position].call(this,e,t);return!1!==a&&(n!==a.x||r!==a.y)}}s(Tk,"positioners",wk);var Lk={id:"tooltip",_element:Tk,positioners:wk,afterInit(e,t,n){n&&(e.tooltip=new Tk({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(!1===e.notifyPlugins("beforeTooltipDraw",c(c({},n),{},{cancelable:!0})))return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Pk},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>"filter"!==e&&"itemSort"!==e&&"external"!==e,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function Ik(e,t,n,r){const o=e.indexOf(t);if(-1===o)return((e,t,n,r)=>("string"===typeof t?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n))(e,t,n,r);return o!==e.lastIndexOf(t)?n:o}function zk(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Dk extends Zy{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const e=this.getLabels();for(const{index:n,label:r}of t)e[n]===r&&e.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(Og(e))return null;const n=this.getLabels();return((e,t)=>null===e?null:Sx(Math.round(e),0,t))(t=isFinite(t)&&n[t]===e?t:Ik(n,e,Dg(t,e),this._addedLabels),n.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:n,max:r}=this.getMinMax(!0);"ticks"===this.options.bounds&&(e||(n=0),t||(r=this.getLabels().length-1)),this.min=n,this.max=r}buildTicks(){const e=this.min,t=this.max,n=this.options.offset,r=[];let o=this.getLabels();o=0===e&&t===o.length-1?o:o.slice(e,t+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let a=e;a<=t;a++)r.push({value:a});return r}getLabelForValue(e){return zk.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return"number"!==typeof e&&(e=this.parse(e)),null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function Fk(e,t){const n=[],{bounds:r,step:o,min:a,max:i,precision:s,count:l,maxTicks:c,maxDigits:d,includeBounds:u}=e,h=o||1,p=c-1,{min:f,max:m}=t,g=!Og(a),x=!Og(i),b=!Og(l),v=(m-f)/(d+1);let y,w,k,S,j=hx((m-f)/p/h)*h;if(j<1e-14&&!g&&!x)return[{value:f},{value:m}];S=Math.ceil(m/j)-Math.floor(f/j),S>p&&(j=hx(S*j/p/h)*h),Og(s)||(y=Math.pow(10,s),j=Math.ceil(j*y)/y),"ticks"===r?(w=Math.floor(f/j)*j,k=Math.ceil(m/j)*j):(w=f,k=m),g&&x&&o&&function(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}((i-a)/o,j/1e3)?(S=Math.round(Math.min((i-a)/j,c)),j=(i-a)/S,w=a,k=i):b?(w=g?a:w,k=x?i:k,S=l-1,j=(k-w)/S):(S=(k-w)/j,S=ux(S,Math.round(S),j/1e3)?Math.round(S):Math.ceil(S));const A=Math.max(xx(j),xx(w));y=Math.pow(10,Og(s)?A:s),w=Math.round(w*y)/y,k=Math.round(k*y)/y;let C=0;for(g&&(u&&w!==a?(n.push({value:a}),w<a&&C++,ux(Math.round((w+C*j)*y)/y,a,Bk(a,v,e))&&C++):w<a&&C++);C<S;++C){const e=Math.round((w+C*j)*y)/y;if(x&&e>i)break;n.push({value:e})}return x&&u&&k!==i?n.length&&ux(n[n.length-1].value,i,Bk(i,v,e))?n[n.length-1].value=i:n.push({value:i}):x&&k!==i||n.push({value:k}),n}function Bk(e,t,n){let{horizontal:r,minRotation:o}=n;const a=mx(o),i=(r?Math.sin(a):Math.cos(a))||.001,s=.75*t*(""+e).length;return Math.min(t/i,s)}s(Dk,"id","category"),s(Dk,"defaults",{ticks:{callback:zk}});class Wk extends Zy{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return Og(e)||("number"===typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:o}=this;const a=e=>r=t?r:e,i=e=>o=n?o:e;if(e){const e=dx(r),t=dx(o);e<0&&t<0?i(0):e>0&&t>0&&a(0)}if(r===o){let t=0===o?1:Math.abs(.05*o);i(o+t),e||a(r-t)}this.min=r,this.max=o}getTickLimit(){const e=this.options.ticks;let t,{maxTicksLimit:n,stepSize:r}=e;return r?(t=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,t>1e3&&(console.warn("scales.".concat(this.id,".ticks.stepSize: ").concat(r," would result generating up to ").concat(t," ticks. Limiting to 1000.")),t=1e3)):(t=this.computeTickLimit(),n=n||11),n&&(t=Math.min(n,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let n=this.getTickLimit();n=Math.max(2,n);const r=Fk({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:!1!==t.includeBounds},this._range||this);return"ticks"===e.bounds&&fx(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const e=this.ticks;let t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){const r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return Kx(e,this.chart.options.locale,this.options.ticks.format)}}class Hk extends Wk{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Ig(e)?e:0,this.max=Ig(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,n=mx(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/r))}getPixelForValue(e){return null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}s(Hk,"id","linear"),s(Hk,"defaults",{ticks:{callback:Yx.formatters.numeric}});const Vk=e=>Math.floor(cx(e)),Uk=(e,t)=>Math.pow(10,Vk(e)+t);function qk(e){return 1===e/Math.pow(10,Vk(e))}function $k(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function Kk(e,t){let{min:n,max:r}=t;n=zg(e.min,n);const o=[],a=Vk(n);let i=function(e,t){let n=Vk(t-e);for(;$k(e,t,n)>10;)n++;for(;$k(e,t,n)<10;)n--;return Math.min(n,Vk(e))}(n,r),s=i<0?Math.pow(10,Math.abs(i)):1;const l=Math.pow(10,i),c=a>i?Math.pow(10,a):0,d=Math.round((n-c)*s)/s,u=Math.floor((n-c)/l/10)*l*10;let h=Math.floor((d-u)/Math.pow(10,i)),p=zg(e.min,Math.round((c+u+h*Math.pow(10,i))*s)/s);for(;p<r;)o.push({value:p,major:qk(p),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(i++,h=2,s=i>=0?1:s),p=Math.round((c+u+h*Math.pow(10,i))*s)/s;const f=zg(e.max,p);return o.push({value:f,major:qk(f),significand:h}),o}class Xk extends Zy{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const n=Wk.prototype.parse.apply(this,[e,t]);if(0!==n)return Ig(n)&&n>0?n:null;this._zero=!0}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Ig(e)?Math.max(0,e):null,this.max=Ig(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Ig(this._userMin)&&(this.min=e===Uk(this.min,0)?Uk(this.min,-1):Uk(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let n=this.min,r=this.max;const o=t=>n=e?n:t,a=e=>r=t?r:e;n===r&&(n<=0?(o(1),a(10)):(o(Uk(n,-1)),a(Uk(r,1)))),n<=0&&o(Uk(r,-1)),r<=0&&a(Uk(n,1)),this.min=n,this.max=r}buildTicks(){const e=this.options,t=Kk({min:this._userMin,max:this._userMax},this);return"ticks"===e.bounds&&fx(t,this,"value"),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return void 0===e?"0":Kx(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=cx(e),this._valueRange=cx(this.max)-cx(e)}getPixelForValue(e){return void 0!==e&&0!==e||(e=this.min),null===e||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(cx(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}function Yk(e){const t=e.ticks;if(t.display&&e.display){const e=Sb(t.backdropPadding);return Dg(t.font&&t.font.size,tb.font.size)+e.height}return 0}function Gk(e,t,n,r,o){return e===r||e===o?{start:t-n/2,end:t+n/2}:e<r||e>o?{start:t-n,end:t}:{start:t,end:t+n}}function Zk(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],o=[],a=e._pointLabels.length,i=e.options.pointLabels,s=i.centerPointLabels?tx/a:0;for(let u=0;u<a;u++){const a=i.setContext(e.getPointLabelContext(u));o[u]=a.padding;const h=e.getPointPosition(u,e.drawingArea+o[u],s),p=jb(a.font),f=(l=e.ctx,c=p,d=Tg(d=e._pointLabels[u])?d:[d],{w:rb(l,c.string,d),h:d.length*c.lineHeight});r[u]=f;const m=wx(e.getIndexAngle(u)+s),g=Math.round(gx(m));Jk(n,t,m,Gk(g,h.x,f.w,0,180),Gk(g,h.y,f.h,90,270))}var l,c,d;e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=function(e,t,n){const r=[],o=e._pointLabels.length,a=e.options,{centerPointLabels:i,display:s}=a.pointLabels,l={extra:Yk(a)/2,additionalAngle:i?tx/o:0};let c;for(let d=0;d<o;d++){l.padding=n[d],l.size=t[d];const o=Qk(e,d,l);r.push(o),"auto"===s&&(o.visible=eS(o,c),o.visible&&(c=o))}return r}(e,r,o)}function Jk(e,t,n,r,o){const a=Math.abs(Math.sin(n)),i=Math.abs(Math.cos(n));let s=0,l=0;r.start<t.l?(s=(t.l-r.start)/a,e.l=Math.min(e.l,t.l-s)):r.end>t.r&&(s=(r.end-t.r)/a,e.r=Math.max(e.r,t.r+s)),o.start<t.t?(l=(t.t-o.start)/i,e.t=Math.min(e.t,t.t-l)):o.end>t.b&&(l=(o.end-t.b)/i,e.b=Math.max(e.b,t.b+l))}function Qk(e,t,n){const r=e.drawingArea,{extra:o,additionalAngle:a,padding:i,size:s}=n,l=e.getPointPosition(t,r+o+i,a),c=Math.round(gx(wx(l.angle+ix))),d=function(e,t,n){90===n||270===n?e-=t/2:(n>270||n<90)&&(e-=t);return e}(l.y,s.h,c),u=function(e){if(0===e||180===e)return"center";if(e<180)return"left";return"right"}(c),h=function(e,t,n){"right"===n?e-=t:"center"===n&&(e-=t/2);return e}(l.x,s.w,u);return{visible:!0,x:l.x,y:d,textAlign:u,left:h,top:d,right:h+s.w,bottom:d+s.h}}function eS(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:a}=e;return!(lb({x:n,y:r},t)||lb({x:n,y:a},t)||lb({x:o,y:r},t)||lb({x:o,y:a},t))}function tS(e,t,n){const{left:r,top:o,right:a,bottom:i}=n,{backdropColor:s}=t;if(!Og(s)){const n=kb(t.borderRadius),l=Sb(t.backdropPadding);e.fillStyle=s;const c=r-l.left,d=o-l.top,u=a-r+l.width,h=i-o+l.height;Object.values(n).some((e=>0!==e))?(e.beginPath(),gb(e,{x:c,y:d,w:u,h:h,radius:n}),e.fill()):e.fillRect(c,d,u,h)}}function nS(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,nx);else{let n=e.getPointPosition(0,t);o.moveTo(n.x,n.y);for(let a=1;a<r;a++)n=e.getPointPosition(a,t),o.lineTo(n.x,n.y)}}s(Xk,"id","logarithmic"),s(Xk,"defaults",{ticks:{callback:Yx.formatters.logarithmic,major:{enabled:!0}}});class rS extends Wk{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=Sb(Yk(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=Ig(e)&&!isNaN(e)?e:0,this.max=Ig(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Yk(this.options))}generateTickLabels(e){Wk.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map(((e,t)=>{const n=Bg(this.options.pointLabels.callback,[e,t],this);return n||0===n?n:""})).filter(((e,t)=>this.chart.getDataVisibility(t)))}fit(){const e=this.options;e.display&&e.pointLabels.display?Zk(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}getIndexAngle(e){return wx(e*(nx/(this._pointLabels.length||1))+mx(this.options.startAngle||0))}getDistanceFromCenterForValue(e){if(Og(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(Og(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const n=t[e];return function(e,t,n){return Cb(e,{label:n,index:t,type:"pointLabel"})}(this.getContext(),e,n)}}getPointPosition(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=this.getIndexAngle(e)-ix+n;return{x:Math.cos(r)*t+this.xCenter,y:Math.sin(r)*t+this.yCenter,angle:r}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:n,right:r,bottom:o}=this._pointLabelItems[e];return{left:t,top:n,right:r,bottom:o}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const n=this.ctx;n.save(),n.beginPath(),nS(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:n,grid:r,border:o}=t,a=this._pointLabels.length;let i,s,l;if(t.pointLabels.display&&function(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let o=t-1;o>=0;o--){const t=e._pointLabelItems[o];if(!t.visible)continue;const a=r.setContext(e.getPointLabelContext(o));tS(n,a,t);const i=jb(a.font),{x:s,y:l,textAlign:c}=t;mb(n,e._pointLabels[o],s,l+i.lineHeight/2,i,{color:a.color,textAlign:c,textBaseline:"middle"})}}(this,a),r.display&&this.ticks.forEach(((e,t)=>{if(0!==t||0===t&&this.min<0){s=this.getDistanceFromCenterForValue(e.value);const n=this.getContext(t),i=r.setContext(n),l=o.setContext(n);!function(e,t,n,r,o){const a=e.ctx,i=t.circular,{color:s,lineWidth:l}=t;!i&&!r||!s||!l||n<0||(a.save(),a.strokeStyle=s,a.lineWidth=l,a.setLineDash(o.dash||[]),a.lineDashOffset=o.dashOffset,a.beginPath(),nS(e,n,i,r),a.closePath(),a.stroke(),a.restore())}(this,i,s,a,l)}})),n.display){for(e.save(),i=a-1;i>=0;i--){const r=n.setContext(this.getPointLabelContext(i)),{color:o,lineWidth:a}=r;a&&o&&(e.lineWidth=a,e.strokeStyle=o,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,s=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),l=this.getPointPosition(i,s),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;const r=this.getIndexAngle(0);let o,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach(((r,i)=>{if(0===i&&this.min>=0&&!t.reverse)return;const s=n.setContext(this.getContext(i)),l=jb(s.font);if(o=this.getDistanceFromCenterForValue(this.ticks[i].value),s.showLabelBackdrop){e.font=l.string,a=e.measureText(r.label).width,e.fillStyle=s.backdropColor;const t=Sb(s.backdropPadding);e.fillRect(-a/2-t.left,-o-l.size/2-t.top,a+t.width,l.size+t.height)}mb(e,r.label,0,-o,l,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})})),e.restore()}drawTitle(){}}s(rS,"id","radialLinear"),s(rS,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Yx.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:e=>e,padding:5,centerPointLabels:!1}}),s(rS,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),s(rS,"descriptors",{angleLines:{_fallback:"grid"}});const oS={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},aS=Object.keys(oS);function iS(e,t){return e-t}function sS(e,t){if(Og(t))return null;const n=e._adapter,{parser:r,round:o,isoWeekday:a}=e._parseOpts;let i=t;return"function"===typeof r&&(i=r(i)),Ig(i)||(i="string"===typeof r?n.parse(i,r):n.parse(i)),null===i?null:(o&&(i="week"!==o||!px(a)&&!0!==a?n.startOf(i,o):n.startOf(i,"isoWeek",a)),+i)}function lS(e,t,n,r){const o=aS.length;for(let a=aS.indexOf(e);a<o-1;++a){const e=oS[aS[a]],o=e.steps?e.steps:Number.MAX_SAFE_INTEGER;if(e.common&&Math.ceil((n-t)/(o*e.size))<=r)return aS[a]}return aS[o-1]}function cS(e,t,n){if(n){if(n.length){const{lo:r,hi:o}=Ax(n,t);e[n[r]>=t?n[r]:n[o]]=!0}}else e[t]=!0}function dS(e,t,n){const r=[],o={},a=t.length;let i,s;for(i=0;i<a;++i)s=t[i],o[s]=i,r.push({value:s,major:!1});return 0!==a&&n?function(e,t,n,r){const o=e._adapter,a=+o.startOf(t[0].value,r),i=t[t.length-1].value;let s,l;for(s=a;s<=i;s=+o.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}(e,r,o,n):r}class uS extends Zy{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.time||(e.time={}),r=this._adapter=new ry(e.adapters.date);r.init(t),Kg(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return void 0===e?null:sS(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,n=e.time.unit||"day";let{min:r,max:o,minDefined:a,maxDefined:i}=this.getUserBounds();function s(e){a||isNaN(e.min)||(r=Math.min(r,e.min)),i||isNaN(e.max)||(o=Math.max(o,e.max))}a&&i||(s(this._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||s(this.getMinMax(!1))),r=Ig(r)&&!isNaN(r)?r:+t.startOf(Date.now(),n),o=Ig(o)&&!isNaN(o)?o:+t.endOf(Date.now(),n)+1,this.min=Math.min(r,o-1),this.max=Math.max(r+1,o)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){const e=this.options,t=e.time,n=e.ticks,r="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===e.bounds&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const o=this.min,a=function(e,t,n){let r=0,o=e.length;for(;r<o&&e[r]<t;)r++;for(;o>r&&e[o-1]>n;)o--;return r>0||o<e.length?e.slice(r,o):e}(r,o,this.max);return this._unit=t.unit||(n.autoSkip?lS(t.minUnit,this.min,this.max,this._getLabelCapacity(o)):function(e,t,n,r,o){for(let a=aS.length-1;a>=aS.indexOf(n);a--){const n=aS[a];if(oS[n].common&&e._adapter.diff(o,r,n)>=t-1)return n}return aS[n?aS.indexOf(n):0]}(this,a.length,t.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?function(e){for(let t=aS.indexOf(e)+1,n=aS.length;t<n;++t)if(oS[aS[t]].common)return aS[t]}(this._unit):void 0,this.initOffsets(r),e.reverse&&a.reverse(),dS(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((e=>+e.value)))}initOffsets(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=0,o=0;this.options.offset&&n.length&&(e=this.getDecimalForValue(n[0]),r=1===n.length?1-e:(this.getDecimalForValue(n[1])-e)/2,t=this.getDecimalForValue(n[n.length-1]),o=1===n.length?t:(t-this.getDecimalForValue(n[n.length-2]))/2);const a=n.length<3?.5:.25;r=Sx(r,0,a),o=Sx(o,0,a),this._offsets={start:r,end:o,factor:1/(r+1+o)}}_generate(){const e=this._adapter,t=this.min,n=this.max,r=this.options,o=r.time,a=o.unit||lS(o.minUnit,t,n,this._getLabelCapacity(t)),i=Dg(r.ticks.stepSize,1),s="week"===a&&o.isoWeekday,l=px(s)||!0===s,c={};let d,u,h=t;if(l&&(h=+e.startOf(h,"isoWeek",s)),h=+e.startOf(h,l?"day":a),e.diff(n,t,a)>1e5*i)throw new Error(t+" and "+n+" are too far apart with stepSize of "+i+" "+a);const p="data"===r.ticks.source&&this.getDataTimestamps();for(d=h,u=0;d<n;d=+e.add(d,i,a),u++)cS(c,d,p);return d!==n&&"ticks"!==r.bounds&&1!==u||cS(c,d,p),Object.keys(c).sort(iS).map((e=>+e))}getLabelForValue(e){const t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){const n=this.options.time.displayFormats,r=this._unit,o=t||n[r];return this._adapter.format(e,o)}_tickFormatFunction(e,t,n,r){const o=this.options,a=o.ticks.callback;if(a)return Bg(a,[e,t,n],this);const i=o.time.displayFormats,s=this._unit,l=this._majorUnit,c=s&&i[s],d=l&&i[l],u=n[t],h=l&&d&&u&&u.major;return this._adapter.format(e,r||(h?d:c))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t<n;++t)r=e[t],r.label=this._tickFormatFunction(r.value,t,e)}getDecimalForValue(e){return null===e?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,n=this.ctx.measureText(e).width,r=mx(this.isHorizontal()?t.maxRotation:t.minRotation),o=Math.cos(r),a=Math.sin(r),i=this._resolveTickFontOptions(0).size;return{w:n*o+i*a,h:n*a+i*o}}_getLabelCapacity(e){const t=this.options.time,n=t.displayFormats,r=n[t.unit]||n.millisecond,o=this._tickFormatFunction(e,0,dS(this,[e],this._majorUnit),r),a=this._getLabelSize(o),i=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return i>0?i:1}getDataTimestamps(){let e,t,n=this._cache.data||[];if(n.length)return n;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,t=r.length;e<t;++e)n=n.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const e=this._cache.labels||[];let t,n;if(e.length)return e;const r=this.getLabels();for(t=0,n=r.length;t<n;++t)e.push(sS(this,r[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Nx(e.sort(iS))}}function hS(e,t,n){let r,o,a,i,s=0,l=e.length-1;n?(t>=e[s].pos&&t<=e[l].pos&&({lo:s,hi:l}=Cx(e,"pos",t)),({pos:r,time:a}=e[s]),({pos:o,time:i}=e[l])):(t>=e[s].time&&t<=e[l].time&&({lo:s,hi:l}=Cx(e,"time",t)),({time:r,pos:a}=e[s]),({time:o,pos:i}=e[l]));const c=o-r;return c?a+(i-a)*(t-r)/c:a}s(uS,"id","time"),s(uS,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});class pS extends uS{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=hS(t,this.min),this._tableRange=hS(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:n}=this,r=[],o=[];let a,i,s,l,c;for(a=0,i=e.length;a<i;++a)l=e[a],l>=t&&l<=n&&r.push(l);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,i=r.length;a<i;++a)c=r[a+1],s=r[a-1],l=r[a],Math.round((c+s)/2)!==l&&o.push({time:l,pos:a/(i-1)});return o}_generate(){const e=this.min,t=this.max;let n=super.getDataTimestamps();return n.includes(e)&&n.length||n.splice(0,0,e),n.includes(t)&&1!==n.length||n.push(t),n.sort(((e,t)=>e-t))}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(hS(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return hS(this._table,n*this._tableRange+this._minPos,!0)}}s(pS,"id","timeseries"),s(pS,"defaults",uS.defaults);const fS=["height","width","redraw","datasetIdKey","type","data","options","plugins","fallbackContent","updateMode"],mS="label";function gS(e,t){"function"===typeof e?e(t):e&&(e.current=t)}function xS(e,t){e.labels=t}function bS(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:mS;const r=[];e.datasets=t.map((t=>{const o=e.datasets.find((e=>e[n]===t[n]));return o&&t.data&&!r.includes(o)?(r.push(o),Object.assign(o,t),o):c({},t)}))}function vS(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mS;const n={labels:[],datasets:[]};return xS(n,e.labels),bS(n,e.datasets,t),n}function yS(e,t){const{height:n=150,width:o=300,redraw:a=!1,datasetIdKey:i,type:s,data:l,options:d,plugins:u=[],fallbackContent:h,updateMode:p}=e,f=rr(e,fS),m=(0,r.useRef)(null),g=(0,r.useRef)(null),x=()=>{m.current&&(g.current=new _w(m.current,{type:s,data:vS(l,i),options:d&&c({},d),plugins:u}),gS(t,g.current))},b=()=>{gS(t,null),g.current&&(g.current.destroy(),g.current=null)};return(0,r.useEffect)((()=>{!a&&g.current&&d&&function(e,t){const n=e.options;n&&t&&Object.assign(n,t)}(g.current,d)}),[a,d]),(0,r.useEffect)((()=>{!a&&g.current&&xS(g.current.config.data,l.labels)}),[a,l.labels]),(0,r.useEffect)((()=>{!a&&g.current&&l.datasets&&bS(g.current.config.data,l.datasets,i)}),[a,l.datasets]),(0,r.useEffect)((()=>{g.current&&(a?(b(),setTimeout(x)):g.current.update(p))}),[a,d,l.labels,l.datasets,p]),(0,r.useEffect)((()=>{g.current&&(b(),setTimeout(x))}),[s]),(0,r.useEffect)((()=>(x(),()=>b())),[]),r.createElement("canvas",c({ref:m,role:"img",height:n,width:o},f),h)}const wS=(0,r.forwardRef)(yS);function kS(e,t){return _w.register(t),(0,r.forwardRef)(((t,n)=>r.createElement(wS,c(c({},t),{},{ref:n,type:e}))))}const SS=kS("line",Gv);const jS=r.createContext();function AS(e){return(0,ni.Ay)("MuiGrid",e)}const CS=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],_S=(0,$a.A)("MuiGrid",["root","container","item","zeroMinWidth",...[0,1,2,3,4,5,6,7,8,9,10].map((e=>"spacing-xs-".concat(e))),...["column-reverse","column","row-reverse","row"].map((e=>"direction-xs-".concat(e))),...["nowrap","wrap-reverse","wrap"].map((e=>"wrap-xs-".concat(e))),...CS.map((e=>"grid-xs-".concat(e))),...CS.map((e=>"grid-sm-".concat(e))),...CS.map((e=>"grid-md-".concat(e))),...CS.map((e=>"grid-lg-".concat(e))),...CS.map((e=>"grid-xl-".concat(e)))]),ES=_S,MS=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function NS(e){const t=parseFloat(e);return"".concat(t).concat(String(e).replace(String(t),"")||"px")}function RS(e){let{breakpoints:t,values:n}=e,r="";Object.keys(n).forEach((e=>{""===r&&0!==n[e]&&(r=e)}));const o=Object.keys(t).sort(((e,n)=>t[e]-t[n]));return o.slice(0,o.indexOf(r))}const PS=(0,Qa.Ay)("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{container:r,direction:o,item:a,spacing:i,wrap:s,zeroMinWidth:l,breakpoints:c}=n;let d=[];r&&(d=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e||e<=0)return[];if("string"===typeof e&&!Number.isNaN(Number(e))||"number"===typeof e)return[n["spacing-xs-".concat(String(e))]];const r=[];return t.forEach((t=>{const o=e[t];Number(o)>0&&r.push(n["spacing-".concat(t,"-").concat(String(o))])})),r}(i,c,t));const u=[];return c.forEach((e=>{const r=n[e];r&&u.push(t["grid-".concat(e,"-").concat(String(r))])})),[t.root,r&&t.container,a&&t.item,l&&t.zeroMinWidth,...d,"row"!==o&&t["direction-xs-".concat(String(o))],"wrap"!==s&&t["wrap-xs-".concat(String(s))],...u]}})((e=>{let{ownerState:t}=e;return(0,ba.A)({boxSizing:"border-box"},t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},t.item&&{margin:0},t.zeroMinWidth&&{minWidth:0},"wrap"!==t.wrap&&{flexWrap:t.wrap})}),(function(e){let{theme:t,ownerState:n}=e;const r=(0,bp.kW)({values:n.direction,breakpoints:t.breakpoints.values});return(0,bp.NI)({theme:t},r,(e=>{const t={flexDirection:e};return 0===e.indexOf("column")&&(t["& > .".concat(ES.item)]={maxWidth:"none"}),t}))}),(function(e){let{theme:t,ownerState:n}=e;const{container:r,rowSpacing:o}=n;let a={};if(r&&0!==o){const e=(0,bp.kW)({values:o,breakpoints:t.breakpoints.values});let n;"object"===typeof e&&(n=RS({breakpoints:t.breakpoints.values,values:e})),a=(0,bp.NI)({theme:t},e,((e,r)=>{var o;const a=t.spacing(e);return"0px"!==a?{marginTop:"-".concat(NS(a)),["& > .".concat(ES.item)]:{paddingTop:NS(a)}}:null!=(o=n)&&o.includes(r)?{}:{marginTop:0,["& > .".concat(ES.item)]:{paddingTop:0}}}))}return a}),(function(e){let{theme:t,ownerState:n}=e;const{container:r,columnSpacing:o}=n;let a={};if(r&&0!==o){const e=(0,bp.kW)({values:o,breakpoints:t.breakpoints.values});let n;"object"===typeof e&&(n=RS({breakpoints:t.breakpoints.values,values:e})),a=(0,bp.NI)({theme:t},e,((e,r)=>{var o;const a=t.spacing(e);return"0px"!==a?{width:"calc(100% + ".concat(NS(a),")"),marginLeft:"-".concat(NS(a)),["& > .".concat(ES.item)]:{paddingLeft:NS(a)}}:null!=(o=n)&&o.includes(r)?{}:{width:"100%",marginLeft:0,["& > .".concat(ES.item)]:{paddingLeft:0}}}))}return a}),(function(e){let t,{theme:n,ownerState:r}=e;return n.breakpoints.keys.reduce(((e,o)=>{let a={};if(r[o]&&(t=r[o]),!t)return e;if(!0===t)a={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if("auto"===t)a={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const i=(0,bp.kW)({values:r.columns,breakpoints:n.breakpoints.values}),s="object"===typeof i?i[o]:i;if(void 0===s||null===s)return e;const l="".concat(Math.round(t/s*1e8)/1e6,"%");let c={};if(r.container&&r.item&&0!==r.columnSpacing){const e=n.spacing(r.columnSpacing);if("0px"!==e){const t="calc(".concat(l," + ").concat(NS(e),")");c={flexBasis:t,maxWidth:t}}}a=(0,ba.A)({flexBasis:l,flexGrow:0,maxWidth:l},c)}return 0===n.breakpoints.values[o]?Object.assign(e,a):e[n.breakpoints.up(o)]=a,e}),{})}));const OS=e=>{const{classes:t,container:n,direction:r,item:o,spacing:a,wrap:i,zeroMinWidth:s,breakpoints:l}=e;let c=[];n&&(c=function(e,t){if(!e||e<=0)return[];if("string"===typeof e&&!Number.isNaN(Number(e))||"number"===typeof e)return["spacing-xs-".concat(String(e))];const n=[];return t.forEach((t=>{const r=e[t];if(Number(r)>0){const e="spacing-".concat(t,"-").concat(String(r));n.push(e)}})),n}(a,l));const d=[];l.forEach((t=>{const n=e[t];n&&d.push("grid-".concat(t,"-").concat(String(n)))}));const u={root:["root",n&&"container",o&&"item",s&&"zeroMinWidth",...c,"row"!==r&&"direction-xs-".concat(String(r)),"wrap"!==i&&"wrap-xs-".concat(String(i)),...d]};return(0,Za.A)(u,AS,t)},TS=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiGrid"}),{breakpoints:o}=wl(),a=(0,Ba.A)(n),{className:i,columns:s,columnSpacing:l,component:c="div",container:d=!1,direction:u="row",item:h=!1,rowSpacing:p,spacing:f=0,wrap:m="wrap",zeroMinWidth:g=!1}=a,x=(0,nr.A)(a,MS),b=p||f,v=l||f,y=r.useContext(jS),w=d?s||12:y,k={},S=(0,ba.A)({},x);o.keys.forEach((e=>{null!=x[e]&&(k[e]=x[e],delete S[e])}));const j=(0,ba.A)({},a,{columns:w,container:d,direction:u,item:h,rowSpacing:b,columnSpacing:v,wrap:m,zeroMinWidth:g,spacing:f},k,{breakpoints:o.keys}),A=OS(j);return(0,ka.jsx)(jS.Provider,{value:w,children:(0,ka.jsx)(PS,(0,ba.A)({ownerState:j,className:(0,za.A)(A.root,i),as:c,ref:t},S))})}));const LS=TS;function IS(e){return(0,ni.Ay)("MuiCard",e)}(0,$a.A)("MuiCard",["root"]);const zS=["className","raised"],DS=(0,Qa.Ay)(ii,{name:"MuiCard",slot:"Root",overridesResolver:(e,t)=>t.root})((()=>({overflow:"hidden"}))),FS=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiCard"}),{className:r,raised:o=!1}=n,a=(0,nr.A)(n,zS),i=(0,ba.A)({},n,{raised:o}),s=(e=>{const{classes:t}=e;return(0,Za.A)({root:["root"]},IS,t)})(i);return(0,ka.jsx)(DS,(0,ba.A)({className:(0,za.A)(s.root,r),elevation:o?8:void 0,ref:t,ownerState:i},a))}));function BS(e){return(0,ni.Ay)("MuiCardContent",e)}(0,$a.A)("MuiCardContent",["root"]);const WS=["className","component"],HS=(0,Qa.Ay)("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,t)=>t.root})((()=>({padding:16,"&:last-child":{paddingBottom:24}}))),VS=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiCardContent"}),{className:r,component:o="div"}=n,a=(0,nr.A)(n,WS),i=(0,ba.A)({},n,{component:o}),s=(e=>{const{classes:t}=e;return(0,Za.A)({root:["root"]},BS,t)})(i);return(0,ka.jsx)(HS,(0,ba.A)({as:o,className:(0,za.A)(s.root,r),ownerState:i,ref:t},a))}));_w.register(Dk,Hk,Uw,Hw,yk,Lk,bk,uS);const US=e=>{let{processId:t,initialData:n}=e;const[o,a]=(0,r.useState)([]);(0,r.useEffect)((()=>{n&&n.monit&&a([{timestamp:Date.now(),cpu:n.monit.cpu,memory:n.monit.memory}]);const e=setInterval((async()=>{try{const e=await tr.get("/api/process/".concat(t,"/stats"));e.data&&e.data.monit&&a((t=>{const n=[...t,{timestamp:Date.now(),cpu:e.data.monit.cpu,memory:e.data.monit.memory}];return n.length>20?n.slice(n.length-20):n}))}catch(NR){console.error("Error fetching metrics:",NR)}}),2e3);return()=>{clearInterval(e)}}),[t,n]);const i=o.length>0?o[o.length-1].cpu:n.monit?n.monit.cpu:0,s=o.length>0?o[o.length-1].memory:n.monit?n.monit.memory:0,l={labels:o.map((e=>new Date(e.timestamp).toLocaleTimeString())),datasets:[{label:"CPU Usage (%)",data:o.map((e=>e.cpu)),fill:!1,borderColor:"rgb(75, 192, 192)",tension:.1}]},c={labels:o.map((e=>new Date(e.timestamp).toLocaleTimeString())),datasets:[{label:"Memory Usage (MB)",data:o.map((e=>e.memory/1048576)),fill:!1,borderColor:"rgb(255, 99, 132)",tension:.1}]};return(0,ka.jsxs)(Ga,{children:[(0,ka.jsxs)(LS,{container:!0,spacing:2,sx:{mb:3},children:[(0,ka.jsx)(LS,{item:!0,xs:12,sm:6,children:(0,ka.jsx)(FS,{variant:"outlined",children:(0,ka.jsxs)(VS,{children:[(0,ka.jsx)(Tp,{variant:"subtitle2",color:"text.secondary",children:"Current CPU Usage"}),(0,ka.jsxs)(Tp,{variant:"h4",color:"primary",children:[i.toFixed(1),"%"]})]})})}),(0,ka.jsx)(LS,{item:!0,xs:12,sm:6,children:(0,ka.jsx)(FS,{variant:"outlined",children:(0,ka.jsxs)(VS,{children:[(0,ka.jsx)(Tp,{variant:"subtitle2",color:"text.secondary",children:"Current Memory Usage"}),(0,ka.jsx)(Tp,{variant:"h4",color:"primary",children:(e=>{if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return"".concat((e/Math.pow(1024,t)).toFixed(2)," ").concat(["B","KB","MB","GB"][t])})(s)})]})})})]}),(0,ka.jsxs)(LS,{container:!0,spacing:3,children:[(0,ka.jsx)(LS,{item:!0,xs:12,md:6,children:(0,ka.jsxs)(ii,{variant:"outlined",sx:{p:2},children:[(0,ka.jsx)(Tp,{variant:"subtitle2",gutterBottom:!0,color:"text.secondary",children:"CPU Usage Over Time"}),(0,ka.jsx)(Ga,{sx:{height:250},children:(0,ka.jsx)(SS,{data:l,options:{responsive:!0,maintainAspectRatio:!1,scales:{y:{beginAtZero:!0,suggestedMax:100}}}})})]})}),(0,ka.jsx)(LS,{item:!0,xs:12,md:6,children:(0,ka.jsxs)(ii,{variant:"outlined",sx:{p:2},children:[(0,ka.jsx)(Tp,{variant:"subtitle2",gutterBottom:!0,color:"text.secondary",children:"Memory Usage Over Time"}),(0,ka.jsx)(Ga,{sx:{height:250},children:(0,ka.jsx)(SS,{data:c,options:{responsive:!0,maintainAspectRatio:!1}})})]})})]})]})};let qS;function $S(){if(qS)return qS;const e=document.createElement("div"),t=document.createElement("div");return t.style.width="10px",t.style.height="1px",e.appendChild(t),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),qS="reverse",e.scrollLeft>0?qS="default":(e.scrollLeft=1,0===e.scrollLeft&&(qS="negative")),document.body.removeChild(e),qS}function KS(e,t){const n=e.scrollLeft;if("rtl"!==t)return n;switch($S()){case"negative":return e.scrollWidth-e.clientWidth+n;case"reverse":return e.scrollWidth-e.clientWidth-n;default:return n}}function XS(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}const YS=["onChange"],GS={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};const ZS=(0,Zc.A)((0,ka.jsx)("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),JS=(0,Zc.A)((0,ka.jsx)("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function QS(e){return(0,ni.Ay)("MuiTabScrollButton",e)}const ej=(0,$a.A)("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),tj=["className","slots","slotProps","direction","orientation","disabled"],nj=(0,Qa.Ay)(ts,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})((e=>{let{ownerState:t}=e;return(0,ba.A)({width:40,flexShrink:0,opacity:.8,["&.".concat(ej.disabled)]:{opacity:0}},"vertical"===t.orientation&&{width:"100%",height:40,"& svg":{transform:"rotate(".concat(t.isRtl?-90:90,"deg)")}})})),rj=r.forwardRef((function(e,t){var n,r;const o=(0,ti.b)({props:e,name:"MuiTabScrollButton"}),{className:a,slots:i={},slotProps:s={},direction:l}=o,c=(0,nr.A)(o,tj),d=Ea(),u=(0,ba.A)({isRtl:d},o),h=(e=>{const{classes:t,orientation:n,disabled:r}=e,o={root:["root",n,r&&"disabled"]};return(0,Za.A)(o,QS,t)})(u),p=null!=(n=i.StartScrollButtonIcon)?n:ZS,f=null!=(r=i.EndScrollButtonIcon)?r:JS,m=$s({elementType:p,externalSlotProps:s.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:u}),g=$s({elementType:f,externalSlotProps:s.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:u});return(0,ka.jsx)(nj,(0,ba.A)({component:"div",className:(0,za.A)(h.root,a),ref:t,role:null,ownerState:u,tabIndex:null},c,{children:"left"===l?(0,ka.jsx)(p,(0,ba.A)({},m)):(0,ka.jsx)(f,(0,ba.A)({},g))}))}));function oj(e){return(0,ni.Ay)("MuiTabs",e)}const aj=(0,$a.A)("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),ij=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],sj=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,lj=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,cj=(e,t,n)=>{let r=!1,o=n(e,t);for(;o;){if(o===e.firstChild){if(r)return;r=!0}const t=o.disabled||"true"===o.getAttribute("aria-disabled");if(o.hasAttribute("tabindex")&&!t)return void o.focus();o=n(e,o)}},dj=(0,Qa.Ay)("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{["& .".concat(aj.scrollButtons)]:t.scrollButtons},{["& .".concat(aj.scrollButtons)]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})((e=>{let{ownerState:t,theme:n}=e;return(0,ba.A)({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{["& .".concat(aj.scrollButtons)]:{[n.breakpoints.down("sm")]:{display:"none"}}})})),uj=(0,Qa.Ay)("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})((e=>{let{ownerState:t}=e;return(0,ba.A)({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})})),hj=(0,Qa.Ay)("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})((e=>{let{ownerState:t}=e;return(0,ba.A)({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})})),pj=(0,Qa.Ay)("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})((e=>{let{ownerState:t,theme:n}=e;return(0,ba.A)({position:"absolute",height:2,bottom:0,width:"100%",transition:n.transitions.create()},"primary"===t.indicatorColor&&{backgroundColor:(n.vars||n).palette.primary.main},"secondary"===t.indicatorColor&&{backgroundColor:(n.vars||n).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})})),fj=(0,Qa.Ay)((function(e){const{onChange:t}=e,n=(0,nr.A)(e,YS),o=r.useRef(),a=r.useRef(null),i=()=>{o.current=a.current.offsetHeight-a.current.clientHeight};return(0,el.A)((()=>{const e=(0,ll.A)((()=>{const e=o.current;i(),e!==o.current&&t(o.current)})),n=(0,cl.A)(a.current);return n.addEventListener("resize",e),()=>{e.clear(),n.removeEventListener("resize",e)}}),[t]),r.useEffect((()=>{i(),t(o.current)}),[t]),(0,ka.jsx)("div",(0,ba.A)({style:GS},n,{ref:a}))}))({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),mj={};const gj=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiTabs"}),o=wl(),a=Ea(),{"aria-label":i,"aria-labelledby":s,action:l,centered:c=!1,children:d,className:u,component:h="div",allowScrollButtonsMobile:p=!1,indicatorColor:f="primary",onChange:m,orientation:g="horizontal",ScrollButtonComponent:x=rj,scrollButtons:b="auto",selectionFollowsFocus:v,slots:y={},slotProps:w={},TabIndicatorProps:k={},TabScrollButtonProps:S={},textColor:j="primary",value:A,variant:C="standard",visibleScrollbar:_=!1}=n,E=(0,nr.A)(n,ij),M="scrollable"===C,N="vertical"===g,R=N?"scrollTop":"scrollLeft",P=N?"top":"left",O=N?"bottom":"right",T=N?"clientHeight":"clientWidth",L=N?"height":"width",I=(0,ba.A)({},n,{component:h,allowScrollButtonsMobile:p,indicatorColor:f,orientation:g,vertical:N,scrollButtons:b,textColor:j,variant:C,visibleScrollbar:_,fixed:!M,hideScrollbar:M&&!_,scrollableX:M&&!N,scrollableY:M&&N,centered:c&&!M,scrollButtonsHideMobile:!p}),z=(e=>{const{vertical:t,fixed:n,hideScrollbar:r,scrollableX:o,scrollableY:a,centered:i,scrollButtonsHideMobile:s,classes:l}=e,c={root:["root",t&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",o&&"scrollableX",a&&"scrollableY"],flexContainer:["flexContainer",t&&"flexContainerVertical",i&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",s&&"scrollButtonsHideMobile"],scrollableX:[o&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]};return(0,Za.A)(c,oj,l)})(I),D=$s({elementType:y.StartScrollButtonIcon,externalSlotProps:w.startScrollButtonIcon,ownerState:I}),F=$s({elementType:y.EndScrollButtonIcon,externalSlotProps:w.endScrollButtonIcon,ownerState:I});const[B,W]=r.useState(!1),[H,V]=r.useState(mj),[U,q]=r.useState(!1),[$,K]=r.useState(!1),[X,Y]=r.useState(!1),[G,Z]=r.useState({overflow:"hidden",scrollbarWidth:0}),J=new Map,Q=r.useRef(null),ee=r.useRef(null),te=()=>{const e=Q.current;let t,n;if(e){const n=e.getBoundingClientRect();t={clientWidth:e.clientWidth,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollLeftNormalized:KS(e,a?"rtl":"ltr"),scrollWidth:e.scrollWidth,top:n.top,bottom:n.bottom,left:n.left,right:n.right}}if(e&&!1!==A){const e=ee.current.children;if(e.length>0){const t=e[J.get(A)];0,n=t?t.getBoundingClientRect():null}}return{tabsMeta:t,tabMeta:n}},ne=(0,vi.A)((()=>{const{tabsMeta:e,tabMeta:t}=te();let n,r=0;if(N)n="top",t&&e&&(r=t.top-e.top+e.scrollTop);else if(n=a?"right":"left",t&&e){const o=a?e.scrollLeftNormalized+e.clientWidth-e.scrollWidth:e.scrollLeft;r=(a?-1:1)*(t[n]-e[n]+o)}const o={[n]:r,[L]:t?t[L]:0};if(isNaN(H[n])||isNaN(H[L]))V(o);else{const e=Math.abs(H[n]-o[n]),t=Math.abs(H[L]-o[L]);(e>=1||t>=1)&&V(o)}})),re=function(e){let{animation:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t?function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:()=>{};const{ease:a=XS,duration:i=300}=r;let s=null;const l=t[e];let c=!1;const d=()=>{c=!0},u=r=>{if(c)return void o(new Error("Animation cancelled"));null===s&&(s=r);const d=Math.min(1,(r-s)/i);t[e]=a(d)*(n-l)+l,d>=1?requestAnimationFrame((()=>{o(null)})):requestAnimationFrame(u)};l===n?o(new Error("Element already at target position")):requestAnimationFrame(u)}(R,Q.current,e,{duration:o.transitions.duration.standard}):Q.current[R]=e},oe=e=>{let t=Q.current[R];N?t+=e:(t+=e*(a?-1:1),t*=a&&"reverse"===$S()?-1:1),re(t)},ae=()=>{const e=Q.current[T];let t=0;const n=Array.from(ee.current.children);for(let r=0;r<n.length;r+=1){const o=n[r];if(t+o[T]>e){0===r&&(t=e);break}t+=o[T]}return t},ie=()=>{oe(-1*ae())},se=()=>{oe(ae())},le=r.useCallback((e=>{Z({overflow:null,scrollbarWidth:e})}),[]),ce=(0,vi.A)((e=>{const{tabsMeta:t,tabMeta:n}=te();if(n&&t)if(n[P]<t[P]){const r=t[R]+(n[P]-t[P]);re(r,{animation:e})}else if(n[O]>t[O]){const r=t[R]+(n[O]-t[O]);re(r,{animation:e})}})),de=(0,vi.A)((()=>{M&&!1!==b&&Y(!X)}));r.useEffect((()=>{const e=(0,ll.A)((()=>{Q.current&&ne()}));let t;const n=n=>{n.forEach((e=>{e.removedNodes.forEach((e=>{var n;null==(n=t)||n.unobserve(e)})),e.addedNodes.forEach((e=>{var n;null==(n=t)||n.observe(e)}))})),e(),de()},r=(0,cl.A)(Q.current);let o;return r.addEventListener("resize",e),"undefined"!==typeof ResizeObserver&&(t=new ResizeObserver(e),Array.from(ee.current.children).forEach((e=>{t.observe(e)}))),"undefined"!==typeof MutationObserver&&(o=new MutationObserver(n),o.observe(ee.current,{childList:!0})),()=>{var n,a;e.clear(),r.removeEventListener("resize",e),null==(n=o)||n.disconnect(),null==(a=t)||a.disconnect()}}),[ne,de]),r.useEffect((()=>{const e=Array.from(ee.current.children),t=e.length;if("undefined"!==typeof IntersectionObserver&&t>0&&M&&!1!==b){const n=e[0],r=e[t-1],o={root:Q.current,threshold:.99},a=new IntersectionObserver((e=>{q(!e[0].isIntersecting)}),o);a.observe(n);const i=new IntersectionObserver((e=>{K(!e[0].isIntersecting)}),o);return i.observe(r),()=>{a.disconnect(),i.disconnect()}}}),[M,b,X,null==d?void 0:d.length]),r.useEffect((()=>{W(!0)}),[]),r.useEffect((()=>{ne()})),r.useEffect((()=>{ce(mj!==H)}),[ce,H]),r.useImperativeHandle(l,(()=>({updateIndicator:ne,updateScrollButtons:de})),[ne,de]);const ue=(0,ka.jsx)(pj,(0,ba.A)({},k,{className:(0,za.A)(z.indicator,k.className),ownerState:I,style:(0,ba.A)({},H,k.style)}));let he=0;const pe=r.Children.map(d,(e=>{if(!r.isValidElement(e))return null;const t=void 0===e.props.value?he:e.props.value;J.set(t,he);const n=t===A;return he+=1,r.cloneElement(e,(0,ba.A)({fullWidth:"fullWidth"===C,indicator:n&&!B&&ue,selected:n,selectionFollowsFocus:v,onChange:m,textColor:j,value:t},1!==he||!1!==A||e.props.tabIndex?{}:{tabIndex:0}))})),fe=(()=>{const e={};e.scrollbarSizeListener=M?(0,ka.jsx)(fj,{onChange:le,className:(0,za.A)(z.scrollableX,z.hideScrollbar)}):null;const t=M&&("auto"===b&&(U||$)||!0===b);return e.scrollButtonStart=t?(0,ka.jsx)(x,(0,ba.A)({slots:{StartScrollButtonIcon:y.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:D},orientation:g,direction:a?"right":"left",onClick:ie,disabled:!U},S,{className:(0,za.A)(z.scrollButtons,S.className)})):null,e.scrollButtonEnd=t?(0,ka.jsx)(x,(0,ba.A)({slots:{EndScrollButtonIcon:y.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:F},orientation:g,direction:a?"left":"right",onClick:se,disabled:!$},S,{className:(0,za.A)(z.scrollButtons,S.className)})):null,e})();return(0,ka.jsxs)(dj,(0,ba.A)({className:(0,za.A)(z.root,u),ownerState:I,ref:t,as:h},E,{children:[fe.scrollButtonStart,fe.scrollbarSizeListener,(0,ka.jsxs)(uj,{className:z.scroller,ownerState:I,style:{overflow:G.overflow,[N?"margin".concat(a?"Left":"Right"):"marginBottom"]:_?void 0:-G.scrollbarWidth},ref:Q,children:[(0,ka.jsx)(hj,{"aria-label":i,"aria-labelledby":s,"aria-orientation":"vertical"===g?"vertical":null,className:z.flexContainer,ownerState:I,onKeyDown:e=>{const t=ee.current,n=(0,zs.A)(t).activeElement;if("tab"!==n.getAttribute("role"))return;let r="horizontal"===g?"ArrowLeft":"ArrowUp",o="horizontal"===g?"ArrowRight":"ArrowDown";switch("horizontal"===g&&a&&(r="ArrowRight",o="ArrowLeft"),e.key){case r:e.preventDefault(),cj(t,n,lj);break;case o:e.preventDefault(),cj(t,n,sj);break;case"Home":e.preventDefault(),cj(t,null,sj);break;case"End":e.preventDefault(),cj(t,null,lj)}},ref:ee,role:"tablist",children:pe}),B&&ue]}),fe.scrollButtonEnd]}))})),xj=gj;function bj(e){return(0,ni.Ay)("MuiTab",e)}const vj=(0,$a.A)("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),yj=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],wj=(0,Qa.Ay)(ts,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t["textColor".concat((0,si.A)(n.textColor))],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{["& .".concat(vj.iconWrapper)]:t.iconWrapper}]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},n.label&&{flexDirection:"top"===n.iconPosition||"bottom"===n.iconPosition?"column":"row"},{lineHeight:1.25},n.icon&&n.label&&{minHeight:72,paddingTop:9,paddingBottom:9,["& > .".concat(vj.iconWrapper)]:(0,ba.A)({},"top"===n.iconPosition&&{marginBottom:6},"bottom"===n.iconPosition&&{marginTop:6},"start"===n.iconPosition&&{marginRight:t.spacing(1)},"end"===n.iconPosition&&{marginLeft:t.spacing(1)})},"inherit"===n.textColor&&{color:"inherit",opacity:.6,["&.".concat(vj.selected)]:{opacity:1},["&.".concat(vj.disabled)]:{opacity:(t.vars||t).palette.action.disabledOpacity}},"primary"===n.textColor&&{color:(t.vars||t).palette.text.secondary,["&.".concat(vj.selected)]:{color:(t.vars||t).palette.primary.main},["&.".concat(vj.disabled)]:{color:(t.vars||t).palette.text.disabled}},"secondary"===n.textColor&&{color:(t.vars||t).palette.text.secondary,["&.".concat(vj.selected)]:{color:(t.vars||t).palette.secondary.main},["&.".concat(vj.disabled)]:{color:(t.vars||t).palette.text.disabled}},n.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},n.wrapped&&{fontSize:t.typography.pxToRem(12)})})),kj=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiTab"}),{className:o,disabled:a=!1,disableFocusRipple:i=!1,fullWidth:s,icon:l,iconPosition:c="top",indicator:d,label:u,onChange:h,onClick:p,onFocus:f,selected:m,selectionFollowsFocus:g,textColor:x="inherit",value:b,wrapped:v=!1}=n,y=(0,nr.A)(n,yj),w=(0,ba.A)({},n,{disabled:a,disableFocusRipple:i,selected:m,icon:!!l,iconPosition:c,label:!!u,fullWidth:s,textColor:x,wrapped:v}),k=(e=>{const{classes:t,textColor:n,fullWidth:r,wrapped:o,icon:a,label:i,selected:s,disabled:l}=e,c={root:["root",a&&i&&"labelIcon","textColor".concat((0,si.A)(n)),r&&"fullWidth",o&&"wrapped",s&&"selected",l&&"disabled"],iconWrapper:["iconWrapper"]};return(0,Za.A)(c,bj,t)})(w),S=l&&u&&r.isValidElement(l)?r.cloneElement(l,{className:(0,za.A)(k.iconWrapper,l.props.className)}):l;return(0,ka.jsxs)(wj,(0,ba.A)({focusRipple:!i,className:(0,za.A)(k.root,o),ref:t,role:"tab","aria-selected":m,disabled:a,onClick:e=>{!m&&h&&h(e,b),p&&p(e)},onFocus:e=>{g&&!m&&h&&h(e,b),f&&f(e)},ownerState:w,tabIndex:m?0:-1},y,{children:["top"===c||"start"===c?(0,ka.jsxs)(r.Fragment,{children:[S,u]}):(0,ka.jsxs)(r.Fragment,{children:[u,S]}),d]}))})),Sj=kj,jj=(0,Zc.A)((0,ka.jsx)("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack"),Aj=(0,Zc.A)((0,ka.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),Cj=(0,Zc.A)((0,ka.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop"),_j=(0,Zc.A)((0,ka.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),Ej=(0,Zc.A)((0,ka.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),Mj=e=>{let{title:t,subtitle:n,actions:r}=e;return(0,ka.jsxs)("div",{className:"flex items-center justify-between mb-4 pb-3 border-b border-neutral-200 dark:border-neutral-800",children:[(0,ka.jsxs)("div",{children:[(0,ka.jsx)("h1",{className:"text-base font-semibold text-neutral-900 dark:text-neutral-100 leading-tight",children:t}),n&&(0,ka.jsx)("p",{className:"text-xs text-neutral-500 dark:text-neutral-400 mt-0.5",children:n})]}),r&&(0,ka.jsx)("div",{className:"flex items-center gap-2 shrink-0",children:r})]})},Nj=["children","value","index"],Rj=e=>{let{children:t,value:n,index:r}=e,o=rr(e,Nj);return(0,ka.jsx)("div",c(c({role:"tabpanel",hidden:n!==r,id:"process-tabpanel-".concat(r),"aria-labelledby":"process-tab-".concat(r)},o),{},{children:n===r&&(0,ka.jsx)(Ga,{sx:{p:2},children:t})}))},Pj=e=>{let{onAction:t,connectionId:n}=e;const{id:o}=lo(),[a,i]=(0,r.useState)(null),[s,l]=(0,r.useState)(!0),[c,d]=(0,r.useState)(""),[u,h]=(0,r.useState)(0),p=so();(0,r.useEffect)((()=>{const e=async()=>{try{const e=n?"/api/remote/".concat(n,"/processes"):"/api/processes",t=(await tr.get(e)).data.find((e=>e.pm_id===Number(o)));t?i(t):d("Process with ID ".concat(o," not found"))}catch(NR){console.error("Error fetching process:",NR),d("Failed to fetch process details")}finally{l(!1)}};o&&e();const t=setInterval((()=>{o&&e()}),3e3);return()=>clearInterval(t)}),[o,n]);const f=e=>e?new Date(e).toLocaleString():"N/A",m=async e=>{if(a)try{if(t){if(t(a.pm_id,e),"delete"===e)return void p("/")}else await tr.post("/api/process/".concat(a.pm_id,"/").concat(e));const n=(await tr.get("/api/processes")).data.find((e=>e.pm_id===Number(o)));n&&i(n)}catch(NR){console.error("Error performing ".concat(e,":"),NR),d("Failed to ".concat(e," process. ").concat(NR instanceof Error?NR.message:"Unknown error"))}};return s?(0,ka.jsxs)(Ga,{sx:{display:"flex",justifyContent:"center",alignItems:"center",py:8,gap:1.5},children:[(0,ka.jsx)(Xf,{size:20}),(0,ka.jsx)(Tp,{variant:"body2",color:"text.secondary",children:"Loading process details\u2026"})]}):c||!a?(0,ka.jsx)(Ga,{children:(0,ka.jsx)(ds,{variant:"outlined",startIcon:(0,ka.jsx)(jj,{}),onClick:()=>p("/"),children:"Back to Process List"})}):(0,ka.jsxs)(Ga,{children:[(0,ka.jsx)(Mj,{title:a.name,subtitle:"PID ".concat(a.pm_id," \xb7 ").concat(a.pm2_env.exec_mode||"fork"," mode \xb7 ns: ").concat(a.pm2_env.namespace||"default"),actions:(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,ka.jsx)(ap,{label:a.pm2_env.status,size:"small",color:(g=a.pm2_env.status,"online"===g?"success":"stopped"===g?"error":"warning")}),(0,ka.jsx)(Gh,{title:"Back to process list",children:(0,ka.jsx)(xf,{size:"small",onClick:()=>p("/"),children:(0,ka.jsx)(jj,{fontSize:"small"})})}),(0,ka.jsx)(ds,{variant:"outlined",size:"small",startIcon:(0,ka.jsx)(Aj,{}),onClick:()=>m("start"),disabled:"online"===a.pm2_env.status,children:"Start"}),(0,ka.jsx)(ds,{variant:"outlined",size:"small",color:"error",startIcon:(0,ka.jsx)(Cj,{}),onClick:()=>m("stop"),disabled:"stopped"===a.pm2_env.status,children:"Stop"}),(0,ka.jsx)(ds,{variant:"outlined",size:"small",startIcon:(0,ka.jsx)(_j,{}),onClick:()=>m("restart"),children:"Restart"}),(0,ka.jsx)(ds,{variant:"outlined",size:"small",color:"error",startIcon:(0,ka.jsx)(Ej,{}),onClick:()=>m("delete"),children:"Delete"})]})}),(0,ka.jsx)(ii,{variant:"outlined",sx:{p:2,mb:2},children:(0,ka.jsx)(LS,{container:!0,spacing:2,children:[{label:"CPU Usage",value:a.monit?"".concat(a.monit.cpu,"%"):"N/A"},{label:"Memory",value:a.monit?(e=>{if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return"".concat((e/Math.pow(1024,t)).toFixed(2)," ").concat(["B","KB","MB","GB"][t])})(a.monit.memory):"N/A"},{label:"Restarts",value:a.pm2_env.restart_time},{label:"Started At",value:f(a.pm2_env.pm_uptime)}].map((e=>{let{label:t,value:n}=e;return(0,ka.jsxs)(LS,{item:!0,xs:6,sm:3,children:[(0,ka.jsx)(Tp,{variant:"caption",color:"text.secondary",display:"block",children:t}),(0,ka.jsx)(Tp,{variant:"body2",fontWeight:500,children:n})]},t)}))})}),(0,ka.jsxs)(ii,{variant:"outlined",children:[(0,ka.jsx)(Ga,{sx:{borderBottom:1,borderColor:"divider"},children:(0,ka.jsxs)(xj,{value:u,onChange:(e,t)=>h(t),"aria-label":"process details tabs",children:[(0,ka.jsx)(Sj,{label:"Details",id:"process-tab-0","aria-controls":"process-tabpanel-0"}),(0,ka.jsx)(Sj,{label:"Logs",id:"process-tab-1","aria-controls":"process-tabpanel-1"}),(0,ka.jsx)(Sj,{label:"Log Files",id:"process-tab-2","aria-controls":"process-tabpanel-2"}),(0,ka.jsx)(Sj,{label:"Metrics",id:"process-tab-3","aria-controls":"process-tabpanel-3"})]})}),(0,ka.jsx)(Rj,{value:u,index:0,children:(0,ka.jsxs)(LS,{container:!0,spacing:2,children:[(0,ka.jsxs)(LS,{item:!0,xs:12,md:6,children:[(0,ka.jsx)(Tp,{variant:"subtitle2",sx:{fontWeight:600,mb:1.5},children:"Process Information"}),(0,ka.jsxs)(LS,{container:!0,spacing:1.5,children:[[{label:"Namespace",value:a.pm2_env.namespace||"default"},{label:"Exec Mode",value:a.pm2_env.exec_mode||"N/A"},{label:"Instances",value:a.pm2_env.instances||1},{label:"Created At",value:f(a.pm2_env.created_at)},{label:"Restarts",value:a.pm2_env.restart_time}].map((e=>{let{label:t,value:n}=e;return(0,ka.jsxs)(LS,{item:!0,xs:6,children:[(0,ka.jsx)(Tp,{variant:"caption",color:"text.secondary",display:"block",children:t}),(0,ka.jsx)(Tp,{variant:"body2",fontWeight:500,children:n})]},t)})),(0,ka.jsxs)(LS,{item:!0,xs:12,children:[(0,ka.jsx)(Tp,{variant:"caption",color:"text.secondary",display:"block",children:"Script Path"}),(0,ka.jsx)(Tp,{variant:"body2",fontWeight:500,sx:{wordBreak:"break-all"},children:a.pm2_env.pm_exec_path})]})]})]}),(0,ka.jsxs)(LS,{item:!0,xs:12,md:6,children:[(0,ka.jsx)(Tp,{variant:"subtitle2",sx:{fontWeight:600,mb:1.5},children:"Environment Variables"}),(0,ka.jsx)(ii,{variant:"outlined",sx:{p:1.5,maxHeight:260,overflow:"auto",bgcolor:"action.hover"},children:a.pm2_env.env&&Object.keys(a.pm2_env.env).length>0?(0,ka.jsx)(Ga,{component:"pre",sx:{m:0,fontSize:"0.75rem",fontFamily:"monospace",lineHeight:1.6},children:JSON.stringify(a.pm2_env.env,null,2)}):(0,ka.jsx)(Tp,{variant:"body2",color:"text.secondary",children:"No environment variables found."})})]})]})}),(0,ka.jsx)(Rj,{value:u,index:1,children:(0,ka.jsx)(Jf,{processId:a.pm_id,processName:a.name,connectionId:n})}),(0,ka.jsx)(Rj,{value:u,index:2,children:(0,ka.jsx)(Zm,{processId:a.pm_id,processName:a.name,connectionId:n})}),(0,ka.jsx)(Rj,{value:u,index:3,children:(0,ka.jsx)(US,{processId:a.pm_id,initialData:a})})]})]});var g},Oj=["title","titleId"];function Tj(e,t){let{title:n,titleId:o}=e,a=rr(e,Oj);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const Lj=r.forwardRef(Tj),Ij=["title","titleId"];function zj(e,t){let{title:n,titleId:o}=e,a=rr(e,Ij);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"}))}const Dj=r.forwardRef(zj),Fj=["title","titleId"];function Bj(e,t){let{title:n,titleId:o}=e,a=rr(e,Fj);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"}))}const Wj=r.forwardRef(Bj),Hj=["title","titleId"];function Vj(e,t){let{title:n,titleId:o}=e,a=rr(e,Hj);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 14.25h13.5m-13.5 0a3 3 0 0 1-3-3m3 3a3 3 0 1 0 0 6h13.5a3 3 0 1 0 0-6m-16.5-3a3 3 0 0 1 3-3h13.5a3 3 0 0 1 3 3m-19.5 0a4.5 4.5 0 0 1 .9-2.7L5.737 5.1a3.375 3.375 0 0 1 2.7-1.35h7.126c1.062 0 2.062.5 2.7 1.35l2.587 3.45a4.5 4.5 0 0 1 .9 2.7m0 0a3 3 0 0 1-3 3m0 3h.008v.008h-.008v-.008Zm0-6h.008v.008h-.008v-.008Zm-3 6h.008v.008h-.008v-.008Zm0-6h.008v.008h-.008v-.008Z"}))}const Uj=r.forwardRef(Vj),qj=e=>{if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return"".concat((e/Math.pow(1024,t)).toFixed(1)," ").concat(["B","KB","MB","GB"][t])},$j=e=>{const t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return t>0?"".concat(t,"d ").concat(n,"h"):n>0?"".concat(n,"h ").concat(r,"m"):"".concat(r,"m")},Kj=e=>{let{icon:t,iconColor:n,iconBg:r,label:o,value:a,sub:i}=e;return(0,ka.jsxs)("div",{className:"flex items-center gap-2.5 bg-white dark:bg-neutral-900 rounded-lg border border-neutral-200 dark:border-neutral-800 px-3 py-2 min-w-0",children:[(0,ka.jsx)("div",{className:"shrink-0 w-7 h-7 rounded-lg ".concat(r," flex items-center justify-center"),children:(0,ka.jsx)(t,{className:"h-3.5 w-3.5 ".concat(n)})}),(0,ka.jsxs)("div",{className:"min-w-0",children:[(0,ka.jsx)("p",{className:"text-[9px] font-medium text-neutral-500 dark:text-neutral-400 uppercase tracking-wide leading-none mb-0.5",children:o}),(0,ka.jsx)("p",{className:"text-[11px] font-bold text-neutral-900 dark:text-neutral-100 leading-tight truncate",children:a}),i&&(0,ka.jsx)("div",{className:"mt-0.5",children:i})]})]})},Xj=e=>{let{metrics:t}=e;const n=Math.round(t.memory.used/t.memory.total*100),r=n>80?"bg-red-500":n>60?"bg-yellow-500":"bg-green-500";return(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsx)(Kj,{icon:Lj,iconColor:"text-blue-500",iconBg:"bg-blue-500/10",label:"System Uptime",value:$j(t.uptime)}),(0,ka.jsx)(Kj,{icon:Dj,iconColor:"text-violet-500",iconBg:"bg-violet-500/10",label:"Load Avg",value:t.loadAvg[0].toFixed(2),sub:(0,ka.jsxs)("p",{className:"text-[10px] text-neutral-400 dark:text-neutral-500 leading-none",children:[t.loadAvg[1].toFixed(2)," \xb7 ",t.loadAvg[2].toFixed(2)]})}),(0,ka.jsx)(Kj,{icon:Wj,iconColor:n>80?"text-red-500":n>60?"text-yellow-500":"text-green-500",iconBg:n>80?"bg-red-500/10":n>60?"bg-yellow-500/10":"bg-green-500/10",label:"Memory",value:"".concat(qj(t.memory.used)," / ").concat(qj(t.memory.total)),sub:(0,ka.jsx)("div",{className:"w-full bg-neutral-200 dark:bg-neutral-700 rounded-full h-1 mt-1",children:(0,ka.jsx)("div",{className:"h-1 rounded-full transition-all duration-300 ".concat(r),style:{width:"".concat(n,"%")}})})}),(0,ka.jsx)(Kj,{icon:Uj,iconColor:"text-neutral-500",iconBg:"bg-neutral-100 dark:bg-neutral-800",label:"CPU Cores",value:String(t.cpus)})]})},Yj=["title","titleId"];function Gj(e,t){let{title:n,titleId:o}=e,a=rr(e,Yj);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}const Zj=r.forwardRef(Gj),Jj=["title","titleId"];function Qj(e,t){let{title:n,titleId:o}=e,a=rr(e,Jj);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const eA=r.forwardRef(Qj),tA=["title","titleId"];function nA(e,t){let{title:n,titleId:o}=e,a=rr(e,tA);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z"}))}const rA=r.forwardRef(nA),oA=["title","titleId"];function aA(e,t){let{title:n,titleId:o}=e,a=rr(e,oA);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"}))}const iA=r.forwardRef(aA),sA=["title","titleId"];function lA(e,t){let{title:n,titleId:o}=e,a=rr(e,sA);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const cA=r.forwardRef(lA),dA=["title","titleId"];function uA(e,t){let{title:n,titleId:o}=e,a=rr(e,dA);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const hA=r.forwardRef(uA),pA=["bg-violet-100 dark:bg-violet-900/30 text-violet-700 dark:text-violet-300","bg-sky-100 dark:bg-sky-900/30 text-sky-700 dark:text-sky-300","bg-emerald-100 dark:bg-emerald-900/30 text-emerald-700 dark:text-emerald-300","bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300","bg-rose-100 dark:bg-rose-900/30 text-rose-700 dark:text-rose-300","bg-cyan-100 dark:bg-cyan-900/30 text-cyan-700 dark:text-cyan-300"],fA=e=>{if(!e||"default"===e)return"bg-neutral-100 dark:bg-neutral-800 text-neutral-500 dark:text-neutral-400";let t=0;for(let n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)>>>0;return pA[t%pA.length]},mA=e=>{if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return"".concat((e/Math.pow(1024,t)).toFixed(1)," ").concat(["B","KB","MB","GB"][t])},gA=e=>{if(!e)return"\u2014";const t=Math.max(0,Math.floor((Date.now()-e)/1e3)),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),o=Math.floor(t%3600/60);return n>0?"".concat(n,"d ").concat(r,"h"):r>0?"".concat(r,"h ").concat(o,"m"):"".concat(o,"m")},xA=e=>e.name.startsWith("pm2-"),bA=e=>{let{processes:t,onAction:n}=e;const o=t.reduce(((e,t)=>{var n;const r=(null===(n=t.pm2_env)||void 0===n?void 0:n.namespace)||"default";return e[r]||(e[r]=[]),e[r].push(t),e}),{}),a=Object.keys(o).sort(((e,t)=>"default"===e?-1:"default"===t?1:e.localeCompare(t))),i=a.length>1;return(0,ka.jsx)("div",{className:"overflow-x-auto",children:(0,ka.jsxs)("table",{className:"min-w-full",children:[(0,ka.jsx)("thead",{className:"bg-neutral-50 dark:bg-neutral-800/50",children:(0,ka.jsxs)("tr",{children:[(0,ka.jsx)("th",{className:"px-4 py-1.5 text-left text-[9px] font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider w-8",children:"#"}),(0,ka.jsx)("th",{className:"px-4 py-1.5 text-left text-[9px] font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider",children:"Name"}),(0,ka.jsx)("th",{className:"px-4 py-1.5 text-left text-[9px] font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider w-24",children:"Status"}),(0,ka.jsx)("th",{className:"px-4 py-1.5 text-left text-[9px] font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider w-16",children:"PID"}),(0,ka.jsx)("th",{className:"px-4 py-1.5 text-left text-[9px] font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider w-32",children:"CPU"}),(0,ka.jsx)("th",{className:"px-4 py-1.5 text-left text-[9px] font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider w-24",children:"Memory"}),(0,ka.jsx)("th",{className:"px-4 py-1.5 text-left text-[9px] font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider w-20",children:"Uptime"}),(0,ka.jsx)("th",{className:"px-4 py-1.5 text-left text-[9px] font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider w-16",children:"Restarts"}),(0,ka.jsx)("th",{className:"px-4 py-1.5 text-left text-[9px] font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider w-16",children:"Mode"}),(0,ka.jsx)("th",{className:"px-4 py-1.5 text-right text-[9px] font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider w-32",children:"Actions"})]})}),(0,ka.jsx)("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:a.map((e=>(0,ka.jsxs)(r.Fragment,{children:[i&&(0,ka.jsx)("tr",{className:"bg-neutral-50/80 dark:bg-neutral-800/40",children:(0,ka.jsx)("td",{colSpan:10,className:"px-4 py-1",children:(0,ka.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-[10px] font-semibold ".concat(fA(e)),children:[(0,ka.jsx)("span",{className:"opacity-50",children:"#"}),e,(0,ka.jsxs)("span",{className:"opacity-40 font-normal ml-1",children:[o[e].length," process",1!==o[e].length?"es":""]})]})})}),o[e].map((t=>{var r,o,a,s,l,c;const d="online"===t.pm2_env.status,u="stopped"===t.pm2_env.status,h=null!==(r=null===(o=t.monit)||void 0===o?void 0:o.cpu)&&void 0!==r?r:0,p=null!==(a=null===(s=t.pm2_env.exec_mode)||void 0===s?void 0:s.replace("_mode",""))&&void 0!==a?a:"fork";return(0,ka.jsxs)("tr",{className:"hover:bg-neutral-50 dark:hover:bg-neutral-800/40 group transition-colors",children:[(0,ka.jsx)("td",{className:"px-4 py-2",children:(0,ka.jsx)("div",{className:"w-5 h-5 bg-primary-50 dark:bg-primary-900/20 rounded flex items-center justify-center",children:(0,ka.jsx)("span",{className:"text-primary-600 dark:text-primary-400 font-semibold text-[9px]",children:t.pm_id})})}),(0,ka.jsxs)("td",{className:"px-4 py-2",children:[(0,ka.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ka.jsx)("span",{className:"text-[11px] font-semibold text-neutral-900 dark:text-neutral-100",children:t.name}),!i&&"default"!==e&&(0,ka.jsx)("span",{className:"inline-flex items-center px-1.5 py-0 rounded text-[9px] font-medium ".concat(fA(e)),children:e})]}),(0,ka.jsx)("p",{className:"text-[9px] text-neutral-400 dark:text-neutral-500 mt-0.5 font-mono truncate max-w-xs",children:null===(l=t.pm2_env.pm_exec_path)||void 0===l?void 0:l.split(/[\\/]/).slice(-2).join("/")})]}),(0,ka.jsx)("td",{className:"px-4 py-2",children:(0,ka.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[9px] font-semibold rounded-full ".concat(d?"bg-green-100 dark:bg-green-900/25 text-green-700 dark:text-green-400":u?"bg-red-100 dark:bg-red-900/25 text-red-700 dark:text-red-400":"bg-yellow-100 dark:bg-yellow-900/25 text-yellow-700 dark:text-yellow-400"),children:[(0,ka.jsx)("span",{className:"w-1 h-1 rounded-full ".concat(d?"bg-green-500 animate-pulse":u?"bg-red-400":"bg-yellow-400")}),t.pm2_env.status]})}),(0,ka.jsx)("td",{className:"px-4 py-2",children:(0,ka.jsx)("span",{className:"text-[10px] font-mono text-neutral-500 dark:text-neutral-400",children:t.pid>0?t.pid:"\u2014"})}),(0,ka.jsx)("td",{className:"px-4 py-2",children:(0,ka.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ka.jsx)("div",{className:"w-14 h-1.5 bg-neutral-200 dark:bg-neutral-700 rounded-full overflow-hidden",children:(0,ka.jsx)("div",{className:"h-full rounded-full transition-all duration-300 ".concat(h>80?"bg-red-500":h>50?"bg-yellow-500":"bg-blue-500"),style:{width:"".concat(Math.min(h,100),"%")}})}),(0,ka.jsx)("span",{className:"text-[10px] font-medium text-neutral-700 dark:text-neutral-300 tabular-nums w-7",children:t.monit?"".concat(h,"%"):"\u2014"})]})}),(0,ka.jsx)("td",{className:"px-4 py-2",children:(0,ka.jsx)("span",{className:"text-[10px] font-medium text-neutral-700 dark:text-neutral-300",children:t.monit?mA(t.monit.memory):"\u2014"})}),(0,ka.jsx)("td",{className:"px-4 py-2",children:(0,ka.jsx)("span",{className:"text-[10px] text-neutral-600 dark:text-neutral-400",children:d?gA(t.pm2_env.pm_uptime):"\u2014"})}),(0,ka.jsx)("td",{className:"px-4 py-2",children:(0,ka.jsx)("span",{className:"text-[10px] font-medium tabular-nums ".concat(t.pm2_env.restart_time>10?"text-red-500 dark:text-red-400":t.pm2_env.restart_time>3?"text-yellow-600 dark:text-yellow-400":"text-neutral-600 dark:text-neutral-400"),children:null!==(c=t.pm2_env.restart_time)&&void 0!==c?c:0})}),(0,ka.jsx)("td",{className:"px-4 py-2",children:(0,ka.jsx)("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-[9px] font-medium ".concat("cluster"===p?"bg-violet-100 dark:bg-violet-900/30 text-violet-700 dark:text-violet-300":"bg-neutral-100 dark:bg-neutral-800 text-neutral-500 dark:text-neutral-400"),children:p})}),(0,ka.jsx)("td",{className:"px-4 py-2",children:(0,ka.jsxs)("div",{className:"flex items-center justify-end gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,ka.jsx)(ca,{to:"/process/".concat(t.pm_id),className:"inline-flex items-center justify-center w-5 h-5 rounded bg-blue-100 dark:bg-blue-900/30 hover:bg-blue-200 dark:hover:bg-blue-800/50 text-blue-600 dark:text-blue-400 transition-colors",title:"Details",children:(0,ka.jsx)(Zj,{className:"h-3 w-3"})}),d?(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsx)("button",{onClick:()=>n(t.pm_id,"restart"),className:"inline-flex items-center justify-center w-5 h-5 rounded bg-yellow-100 dark:bg-yellow-900/30 hover:bg-yellow-200 dark:hover:bg-yellow-800/50 text-yellow-600 dark:text-yellow-400 transition-colors",title:"Restart",children:(0,ka.jsx)(eA,{className:"h-3 w-3"})}),(0,ka.jsx)("button",{onClick:()=>n(t.pm_id,"stop"),className:"inline-flex items-center justify-center w-5 h-5 rounded bg-red-100 dark:bg-red-900/30 hover:bg-red-200 dark:hover:bg-red-800/50 text-red-600 dark:text-red-400 transition-colors",title:"Stop",children:(0,ka.jsx)(rA,{className:"h-3 w-3"})})]}):(0,ka.jsx)("button",{onClick:()=>n(t.pm_id,"start"),className:"inline-flex items-center justify-center w-5 h-5 rounded bg-green-100 dark:bg-green-900/30 hover:bg-green-200 dark:hover:bg-green-800/50 text-green-600 dark:text-green-400 transition-colors",title:"Start",children:(0,ka.jsx)(iA,{className:"h-3 w-3"})}),(0,ka.jsx)("button",{onClick:()=>n(t.pm_id,"delete"),className:"inline-flex items-center justify-center w-5 h-5 rounded bg-red-100 dark:bg-red-900/30 hover:bg-red-200 dark:hover:bg-red-800/50 text-red-600 dark:text-red-400 transition-colors",title:"Delete",children:(0,ka.jsx)(cA,{className:"h-3 w-3"})}),(0,ka.jsx)(ca,{to:"/logs/".concat(t.pm_id),className:"inline-flex items-center justify-center w-5 h-5 rounded bg-neutral-100 dark:bg-neutral-800 hover:bg-neutral-200 dark:hover:bg-neutral-700 text-neutral-500 dark:text-neutral-400 transition-colors",title:"Logs",children:(0,ka.jsx)(hA,{className:"h-3 w-3"})})]})})]},t.pm_id)}))]},e)))})]})})},vA=e=>{let{processes:t,onAction:n}=e;const r=t.filter((e=>!xA(e))),o=t.filter((e=>xA(e)));return 0===t.length?(0,ka.jsxs)("div",{className:"bg-white dark:bg-neutral-900 rounded-lg border border-neutral-200 dark:border-neutral-800 p-16 text-center",children:[(0,ka.jsx)("div",{className:"mx-auto flex items-center justify-center h-16 w-16 rounded-2xl bg-neutral-100 dark:bg-neutral-800 mb-6",children:(0,ka.jsx)(Zj,{className:"h-8 w-8 text-neutral-400 dark:text-neutral-500"})}),(0,ka.jsx)("h3",{className:"text-base font-semibold text-neutral-900 dark:text-white mb-2",children:"No PM2 Processes Found"}),(0,ka.jsx)("p",{className:"text-sm text-neutral-500 dark:text-neutral-400 max-w-sm mx-auto",children:"Make sure PM2 is running and has active processes to display them here."})]}):(0,ka.jsxs)("div",{className:"space-y-3",children:[(0,ka.jsxs)("div",{className:"bg-white dark:bg-neutral-900 rounded-lg border border-neutral-200 dark:border-neutral-800",children:[(0,ka.jsxs)("div",{className:"px-4 py-2 border-b border-neutral-200 dark:border-neutral-800 flex items-center justify-between",children:[(0,ka.jsx)("h2",{className:"text-xs font-semibold text-neutral-900 dark:text-neutral-100",children:"Application Processes"}),(0,ka.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-600 dark:text-neutral-300",children:r.length})]}),0===r.length?(0,ka.jsx)("div",{className:"px-4 py-8 text-center text-xs text-neutral-400 dark:text-neutral-500",children:"No application processes running."}):(0,ka.jsx)(bA,{processes:r,onAction:n})]}),o.length>0&&(0,ka.jsxs)("div",{className:"bg-white dark:bg-neutral-900 rounded-lg border border-neutral-200 dark:border-neutral-800",children:[(0,ka.jsxs)("div",{className:"px-4 py-2 border-b border-neutral-200 dark:border-neutral-800 flex items-center justify-between",children:[(0,ka.jsx)("h2",{className:"text-xs font-semibold text-neutral-900 dark:text-neutral-100",children:"PM2 Modules"}),(0,ka.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-medium bg-violet-100 dark:bg-violet-900/30 text-violet-700 dark:text-violet-300",children:o.length})]}),(0,ka.jsx)(bA,{processes:o,onAction:n})]})]})},yA=["title","titleId"];function wA(e,t){let{title:n,titleId:o}=e,a=rr(e,yA);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const kA=r.forwardRef(wA),SA=["title","titleId"];function jA(e,t){let{title:n,titleId:o}=e,a=rr(e,SA);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const AA=r.forwardRef(jA),CA=["title","titleId"];function _A(e,t){let{title:n,titleId:o}=e,a=rr(e,CA);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"}))}const EA=r.forwardRef(_A),MA=["title","titleId"];function NA(e,t){let{title:n,titleId:o}=e,a=rr(e,MA);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"}))}const RA=r.forwardRef(NA),PA=["title","titleId"];function OA(e,t){let{title:n,titleId:o}=e,a=rr(e,PA);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}const TA=r.forwardRef(OA),LA=["title","titleId"];function IA(e,t){let{title:n,titleId:o}=e,a=rr(e,LA);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6.878V6a2.25 2.25 0 0 1 2.25-2.25h7.5A2.25 2.25 0 0 1 18 6v.878m-12 0c.235-.083.487-.128.75-.128h10.5c.263 0 .515.045.75.128m-12 0A2.25 2.25 0 0 0 4.5 9v.878m13.5-3A2.25 2.25 0 0 1 19.5 9v.878m0 0a2.246 2.246 0 0 0-.75-.128H5.25c-.263 0-.515.045-.75.128m15 0A2.25 2.25 0 0 1 21 12v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6c0-.98.626-1.813 1.5-2.122"}))}const zA=r.forwardRef(IA),DA=["title","titleId"];function FA(e,t){let{title:n,titleId:o}=e,a=rr(e,DA);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"}))}const BA=r.forwardRef(FA),WA=e=>{let{icon:t,iconColor:n,iconBg:r,label:o,value:a,total:i}=e;return(0,ka.jsxs)("div",{className:"flex items-center gap-2.5 bg-white dark:bg-neutral-900 rounded-lg border border-neutral-200 dark:border-neutral-800 px-3 py-2 min-w-0",children:[(0,ka.jsx)("div",{className:"shrink-0 w-7 h-7 rounded-lg ".concat(r," flex items-center justify-center"),children:(0,ka.jsx)(t,{className:"h-3.5 w-3.5 ".concat(n)})}),(0,ka.jsxs)("div",{className:"min-w-0",children:[(0,ka.jsx)("p",{className:"text-[9px] font-medium text-neutral-500 dark:text-neutral-400 uppercase tracking-wide leading-none mb-0.5",children:o}),(0,ka.jsxs)("p",{className:"text-[11px] font-bold text-neutral-900 dark:text-neutral-100 leading-tight",children:[a,void 0!==i&&(0,ka.jsxs)("span",{className:"text-[10px] font-normal text-neutral-400 dark:text-neutral-500 ml-1",children:["/ ",i]})]})]})]})},HA=e=>{let{processes:t,metrics:n,searchTerm:r,statusFilter:o,namespaceFilter:a,onSearchChange:i,onStatusFilterChange:s,onNamespaceFilterChange:l,onProcessAction:c}=e;const d=t.filter((e=>{var t;return"online"===(null===(t=e.pm2_env)||void 0===t?void 0:t.status)})).length,u=t.filter((e=>{var t;return"stopped"===(null===(t=e.pm2_env)||void 0===t?void 0:t.status)})).length,h=t.filter((e=>{var t;return!["online","stopped"].includes(null===(t=e.pm2_env)||void 0===t?void 0:t.status)})).length,p=Array.from(new Set(t.map((e=>{var t;return(null===(t=e.pm2_env)||void 0===t?void 0:t.namespace)||"default"})))).sort(((e,t)=>"default"===e?-1:"default"===t?1:e.localeCompare(t)));return(0,ka.jsxs)("div",{className:"space-y-3",children:[(0,ka.jsx)("div",{className:"flex items-center justify-between",children:(0,ka.jsxs)("div",{children:[(0,ka.jsx)("h1",{className:"text-base font-semibold text-neutral-900 dark:text-neutral-100",children:"Process Dashboard"}),(0,ka.jsx)("p",{className:"text-[11px] text-neutral-500 dark:text-neutral-400 mt-0.5",children:"Monitor and manage your PM2 processes in real-time"})]})}),(0,ka.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 lg:grid-cols-8 gap-2",children:[(0,ka.jsx)(WA,{icon:kA,iconColor:"text-green-500",iconBg:"bg-green-500/10",label:"Online",value:d,total:t.length}),(0,ka.jsx)(WA,{icon:AA,iconColor:"text-red-500",iconBg:"bg-red-500/10",label:"Stopped",value:u}),(0,ka.jsx)(WA,{icon:EA,iconColor:"text-yellow-500",iconBg:"bg-yellow-500/10",label:"Errored",value:h}),(0,ka.jsx)(WA,{icon:RA,iconColor:"text-primary-500",iconBg:"bg-primary-500/10",label:"Total",value:t.length}),(0,ka.jsx)(Xj,{metrics:n})]}),(0,ka.jsx)("div",{className:"bg-white dark:bg-neutral-900 rounded-lg border border-neutral-200 dark:border-neutral-800 p-2.5",children:(0,ka.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,ka.jsxs)("div",{className:"flex-1 relative",children:[(0,ka.jsx)(TA,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-neutral-400 dark:text-neutral-500 pointer-events-none"}),(0,ka.jsx)("input",{type:"text",placeholder:"Search processes by name or ID...",value:r,onChange:i,className:"w-full pl-8 pr-3 py-1.5 border border-neutral-300 dark:border-neutral-700 rounded-md text-xs bg-white dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 placeholder-neutral-400 dark:placeholder-neutral-500 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500 transition-colors"})]}),p.length>1&&(0,ka.jsxs)("div",{className:"sm:w-40 relative",children:[(0,ka.jsx)(zA,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-neutral-400 dark:text-neutral-500 pointer-events-none"}),(0,ka.jsxs)("select",{value:a,onChange:l,className:"w-full pl-8 pr-6 py-1.5 border border-neutral-300 dark:border-neutral-700 rounded-md text-xs bg-white dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500 cursor-pointer transition-colors",children:[(0,ka.jsx)("option",{value:"all",children:"All Namespaces"}),p.map((e=>(0,ka.jsx)("option",{value:e,children:e},e)))]})]}),(0,ka.jsxs)("div",{className:"sm:w-40 relative",children:[(0,ka.jsx)(BA,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-neutral-400 dark:text-neutral-500 pointer-events-none"}),(0,ka.jsxs)("select",{value:o,onChange:s,className:"w-full pl-8 pr-6 py-1.5 border border-neutral-300 dark:border-neutral-700 rounded-md text-xs bg-white dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500 cursor-pointer transition-colors",children:[(0,ka.jsx)("option",{value:"all",children:"All Processes"}),(0,ka.jsx)("option",{value:"online",children:"Online Only"}),(0,ka.jsx)("option",{value:"stopped",children:"Stopped Only"}),(0,ka.jsx)("option",{value:"errored",children:"Errored Only"})]})]})]})}),(0,ka.jsx)(vA,{processes:t,onAction:c})]})};function VA(e){return(0,ni.Ay)("MuiDialog",e)}const UA=(0,$a.A)("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]);const qA=r.createContext({}),$A=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],KA=(0,Qa.Ay)(ql,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),XA=(0,Qa.Ay)(sc,{name:"MuiDialog",slot:"Root",overridesResolver:(e,t)=>t.root})({"@media print":{position:"absolute !important"}}),YA=(0,Qa.Ay)("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t["scroll".concat((0,si.A)(n.scroll))]]}})((e=>{let{ownerState:t}=e;return(0,ba.A)({height:"100%","@media print":{height:"auto"},outline:0},"paper"===t.scroll&&{display:"flex",justifyContent:"center",alignItems:"center"},"body"===t.scroll&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})})),GA=(0,Qa.Ay)(ii,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t["scrollPaper".concat((0,si.A)(n.scroll))],t["paperWidth".concat((0,si.A)(String(n.maxWidth)))],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},"paper"===n.scroll&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},"body"===n.scroll&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!n.maxWidth&&{maxWidth:"calc(100% - 64px)"},"xs"===n.maxWidth&&{maxWidth:"px"===t.breakpoints.unit?Math.max(t.breakpoints.values.xs,444):"max(".concat(t.breakpoints.values.xs).concat(t.breakpoints.unit,", 444px)"),["&.".concat(UA.paperScrollBody)]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}},n.maxWidth&&"xs"!==n.maxWidth&&{maxWidth:"".concat(t.breakpoints.values[n.maxWidth]).concat(t.breakpoints.unit),["&.".concat(UA.paperScrollBody)]:{[t.breakpoints.down(t.breakpoints.values[n.maxWidth]+64)]:{maxWidth:"calc(100% - 64px)"}}},n.fullWidth&&{width:"calc(100% - 64px)"},n.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,["&.".concat(UA.paperScrollBody)]:{margin:0,maxWidth:"100%"}})})),ZA=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiDialog"}),o=wl(),a={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{"aria-describedby":i,"aria-labelledby":s,BackdropComponent:l,BackdropProps:c,children:d,className:u,disableEscapeKeyDown:h=!1,fullScreen:p=!1,fullWidth:f=!1,maxWidth:m="sm",onBackdropClick:g,onClick:x,onClose:b,open:v,PaperComponent:y=ii,PaperProps:w={},scroll:k="paper",TransitionComponent:S=Wl,transitionDuration:j=a,TransitionProps:A}=n,C=(0,nr.A)(n,$A),_=(0,ba.A)({},n,{disableEscapeKeyDown:h,fullScreen:p,fullWidth:f,maxWidth:m,scroll:k}),E=(e=>{const{classes:t,scroll:n,maxWidth:r,fullWidth:o,fullScreen:a}=e,i={root:["root"],container:["container","scroll".concat((0,si.A)(n))],paper:["paper","paperScroll".concat((0,si.A)(n)),"paperWidth".concat((0,si.A)(String(r))),o&&"paperFullWidth",a&&"paperFullScreen"]};return(0,Za.A)(i,VA,t)})(_),M=r.useRef(),N=(0,Is.A)(s),R=r.useMemo((()=>({titleId:N})),[N]);return(0,ka.jsx)(XA,(0,ba.A)({className:(0,za.A)(E.root,u),closeAfterTransition:!0,components:{Backdrop:KA},componentsProps:{backdrop:(0,ba.A)({transitionDuration:j,as:l},c)},disableEscapeKeyDown:h,onClose:b,open:v,ref:t,onClick:e=>{x&&x(e),M.current&&(M.current=null,g&&g(e),b&&b(e,"backdropClick"))},ownerState:_},C,{children:(0,ka.jsx)(S,(0,ba.A)({appear:!0,in:v,timeout:j,role:"presentation"},A,{children:(0,ka.jsx)(YA,{className:(0,za.A)(E.container),onMouseDown:e=>{M.current=e.target===e.currentTarget},ownerState:_,children:(0,ka.jsx)(GA,(0,ba.A)({as:y,elevation:24,role:"dialog","aria-describedby":i,"aria-labelledby":N},w,{className:(0,za.A)(E.paper,w.className),ownerState:_,children:(0,ka.jsx)(qA.Provider,{value:R,children:d})}))})}))}))}));function JA(e){return(0,ni.Ay)("MuiDialogTitle",e)}const QA=(0,$a.A)("MuiDialogTitle",["root"]),eC=["className","id"],tC=(0,Qa.Ay)(Tp,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:"16px 24px",flex:"0 0 auto"}),nC=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiDialogTitle"}),{className:o,id:a}=n,i=(0,nr.A)(n,eC),s=n,l=(e=>{const{classes:t}=e;return(0,Za.A)({root:["root"]},JA,t)})(s),{titleId:c=a}=r.useContext(qA);return(0,ka.jsx)(tC,(0,ba.A)({component:"h2",className:(0,za.A)(l.root,o),ownerState:s,ref:t,variant:"h6",id:null!=a?a:c},i))}));function rC(e){return(0,ni.Ay)("MuiDialogContent",e)}(0,$a.A)("MuiDialogContent",["root","dividers"]);const oC=["className","dividers"],aC=(0,Qa.Ay)("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},n.dividers?{padding:"16px 24px",borderTop:"1px solid ".concat((t.vars||t).palette.divider),borderBottom:"1px solid ".concat((t.vars||t).palette.divider)}:{[".".concat(QA.root," + &")]:{paddingTop:0}})})),iC=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiDialogContent"}),{className:r,dividers:o=!1}=n,a=(0,nr.A)(n,oC),i=(0,ba.A)({},n,{dividers:o}),s=(e=>{const{classes:t,dividers:n}=e,r={root:["root",n&&"dividers"]};return(0,Za.A)(r,rC,t)})(i);return(0,ka.jsx)(aC,(0,ba.A)({className:(0,za.A)(s.root,r),ownerState:i,ref:t},a))}));function sC(e){return(0,ni.Ay)("MuiDialogContentText",e)}(0,$a.A)("MuiDialogContentText",["root"]);const lC=["children","className"],cC=(0,Qa.Ay)(Tp,{shouldForwardProp:e=>(0,xi.A)(e)||"classes"===e,name:"MuiDialogContentText",slot:"Root",overridesResolver:(e,t)=>t.root})({}),dC=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiDialogContentText"}),{className:r}=n,o=(0,nr.A)(n,lC),a=(e=>{const{classes:t}=e,n=(0,Za.A)({root:["root"]},sC,t);return(0,ba.A)({},t,n)})(o);return(0,ka.jsx)(cC,(0,ba.A)({component:"p",variant:"body1",color:"text.secondary",ref:t,ownerState:o,className:(0,za.A)(a.root,r)},n,{classes:a}))}));function uC(e){return(0,ni.Ay)("MuiDialogActions",e)}(0,$a.A)("MuiDialogActions",["root","spacing"]);const hC=["className","disableSpacing"],pC=(0,Qa.Ay)("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})((e=>{let{ownerState:t}=e;return(0,ba.A)({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})})),fC=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiDialogActions"}),{className:r,disableSpacing:o=!1}=n,a=(0,nr.A)(n,hC),i=(0,ba.A)({},n,{disableSpacing:o}),s=(e=>{const{classes:t,disableSpacing:n}=e,r={root:["root",!n&&"spacing"]};return(0,Za.A)(r,uC,t)})(i);return(0,ka.jsx)(pC,(0,ba.A)({className:(0,za.A)(s.root,r),ownerState:i,ref:t},a))})),mC=e=>{let{isOpen:t,title:n,message:r,confirmLabel:o="Confirm",cancelLabel:a="Cancel",onConfirm:i,onCancel:s,type:l="danger"}=e;return(0,ka.jsxs)(ZA,{open:t,onClose:s,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[(0,ka.jsx)(nC,{id:"alert-dialog-title",children:n}),(0,ka.jsx)(iC,{children:(0,ka.jsx)(dC,{id:"alert-dialog-description",children:r})}),(0,ka.jsxs)(fC,{children:[(0,ka.jsx)(ds,{onClick:s,color:"inherit",children:a}),(0,ka.jsx)(ds,{onClick:i,color:(()=>{switch(l){case"danger":return"error";case"warning":return"warning";default:return"primary"}})(),variant:"contained",autoFocus:!0,children:o})]})]})};function gC(e){return(0,ni.Ay)("MuiFormHelperText",e)}const xC=(0,$a.A)("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var bC;const vC=["children","className","component","disabled","error","filled","focused","margin","required","variant"],yC=(0,Qa.Ay)("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t["size".concat((0,si.A)(n.size))],n.contained&&t.contained,n.filled&&t.filled]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({color:(t.vars||t).palette.text.secondary},t.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,["&.".concat(xC.disabled)]:{color:(t.vars||t).palette.text.disabled},["&.".concat(xC.error)]:{color:(t.vars||t).palette.error.main}},"small"===n.size&&{marginTop:4},n.contained&&{marginLeft:14,marginRight:14})})),wC=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiFormHelperText"}),{children:r,className:o,component:a="p"}=n,i=(0,nr.A)(n,vC),s=ys({props:n,muiFormControl:ws(),states:["variant","size","disabled","error","filled","focused","required"]}),l=(0,ba.A)({},n,{component:a,contained:"filled"===s.variant||"outlined"===s.variant,variant:s.variant,size:s.size,disabled:s.disabled,error:s.error,filled:s.filled,focused:s.focused,required:s.required}),c=(e=>{const{classes:t,contained:n,size:r,disabled:o,error:a,filled:i,focused:s,required:l}=e,c={root:["root",o&&"disabled",a&&"error",r&&"size".concat((0,si.A)(r)),n&&"contained",s&&"focused",i&&"filled",l&&"required"]};return(0,Za.A)(c,gC,t)})(l);return(0,ka.jsx)(yC,(0,ba.A)({as:a,ownerState:l,className:(0,za.A)(c.root,o),ref:t},i,{children:" "===r?bC||(bC=(0,ka.jsx)("span",{className:"notranslate",children:"\u200b"})):r}))}));function kC(e){return(0,ni.Ay)("MuiTextField",e)}(0,$a.A)("MuiTextField",["root"]);const SC=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],jC={standard:Ad,filled:Pd,outlined:Ud},AC=(0,Qa.Ay)(vs,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),CC=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiTextField"}),{autoComplete:r,autoFocus:o=!1,children:a,className:i,color:s="primary",defaultValue:l,disabled:c=!1,error:d=!1,FormHelperTextProps:u,fullWidth:h=!1,helperText:p,id:f,InputLabelProps:m,inputProps:g,InputProps:x,inputRef:b,label:v,maxRows:y,minRows:w,multiline:k=!1,name:S,onBlur:j,onChange:A,onFocus:C,placeholder:_,required:E=!1,rows:M,select:N=!1,SelectProps:R,type:P,value:O,variant:T="outlined"}=n,L=(0,nr.A)(n,SC),I=(0,ba.A)({},n,{autoFocus:o,color:s,disabled:c,error:d,fullWidth:h,multiline:k,required:E,select:N,variant:T}),z=(e=>{const{classes:t}=e;return(0,Za.A)({root:["root"]},kC,t)})(I);const D={};"outlined"===T&&(m&&"undefined"!==typeof m.shrink&&(D.notched=m.shrink),D.label=v),N&&(R&&R.native||(D.id=void 0),D["aria-describedby"]=void 0);const F=(0,Is.A)(f),B=p&&F?"".concat(F,"-helper-text"):void 0,W=v&&F?"".concat(F,"-label"):void 0,H=jC[T],V=(0,ka.jsx)(H,(0,ba.A)({"aria-describedby":B,autoComplete:r,autoFocus:o,defaultValue:l,fullWidth:h,multiline:k,name:S,rows:M,maxRows:y,minRows:w,type:P,value:O,id:F,inputRef:b,onBlur:j,onChange:A,onFocus:C,placeholder:_,inputProps:g},D,x));return(0,ka.jsxs)(AC,(0,ba.A)({className:(0,za.A)(z.root,i),disabled:c,error:d,fullWidth:h,ref:t,required:E,color:s,variant:T,ownerState:I},L,{children:[null!=v&&""!==v&&(0,ka.jsx)(Ps,(0,ba.A)({htmlFor:F,id:W},m,{children:v})),N?(0,ka.jsx)(Jd,(0,ba.A)({"aria-describedby":B,id:F,labelId:W,value:O,input:V},R,{children:a})):V,p&&(0,ka.jsx)(wC,(0,ba.A)({id:B},u,{children:p}))]}))})),_C=CC;function EC(e){return(0,ni.Ay)("MuiSwitch",e)}const MC=(0,$a.A)("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),NC=["className","color","edge","size","sx"],RC=(0,Qa.Ay)("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.edge&&t["edge".concat((0,si.A)(n.edge))],t["size".concat((0,si.A)(n.size))]]}})({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,["& .".concat(MC.thumb)]:{width:16,height:16},["& .".concat(MC.switchBase)]:{padding:4,["&.".concat(MC.checked)]:{transform:"translateX(16px)"}}}}]}),PC=(0,Qa.Ay)($p,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.switchBase,{["& .".concat(MC.input)]:t.input},"default"!==n.color&&t["color".concat((0,si.A)(n.color))]]}})((e=>{let{theme:t}=e;return{position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:"".concat("light"===t.palette.mode?t.palette.common.white:t.palette.grey[300]),transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),["&.".concat(MC.checked)]:{transform:"translateX(20px)"},["&.".concat(MC.disabled)]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:"".concat("light"===t.palette.mode?t.palette.grey[100]:t.palette.grey[600])},["&.".concat(MC.checked," + .").concat(MC.track)]:{opacity:.5},["&.".concat(MC.disabled," + .").concat(MC.track)]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:"".concat("light"===t.palette.mode?.12:.2)},["& .".concat(MC.input)]:{left:"-100%",width:"300%"}}}),(e=>{let{theme:t}=e;return{"&:hover":{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.action.activeChannel," / ").concat(t.vars.palette.action.hoverOpacity,")"):(0,Ja.X4)(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter((e=>{let[,t]=e;return t.main&&t.light})).map((e=>{let[n]=e;return{props:{color:n},style:{["&.".concat(MC.checked)]:{color:(t.vars||t).palette[n].main,"&:hover":{backgroundColor:t.vars?"rgba(".concat(t.vars.palette[n].mainChannel," / ").concat(t.vars.palette.action.hoverOpacity,")"):(0,Ja.X4)(t.palette[n].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},["&.".concat(MC.disabled)]:{color:t.vars?t.vars.palette.Switch["".concat(n,"DisabledColor")]:"".concat("light"===t.palette.mode?(0,Ja.a)(t.palette[n].main,.62):(0,Ja.e$)(t.palette[n].main,.55))}},["&.".concat(MC.checked," + .").concat(MC.track)]:{backgroundColor:(t.vars||t).palette[n].main}}}}))]}})),OC=(0,Qa.Ay)("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(e,t)=>t.track})((e=>{let{theme:t}=e;return{height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:"".concat("light"===t.palette.mode?t.palette.common.black:t.palette.common.white),opacity:t.vars?t.vars.opacity.switchTrack:"".concat("light"===t.palette.mode?.38:.3)}})),TC=(0,Qa.Ay)("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})((e=>{let{theme:t}=e;return{boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}})),LC=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiSwitch"}),{className:r,color:o="primary",edge:a=!1,size:i="medium",sx:s}=n,l=(0,nr.A)(n,NC),c=(0,ba.A)({},n,{color:o,edge:a,size:i}),d=(e=>{const{classes:t,edge:n,size:r,color:o,checked:a,disabled:i}=e,s={root:["root",n&&"edge".concat((0,si.A)(n)),"size".concat((0,si.A)(r))],switchBase:["switchBase","color".concat((0,si.A)(o)),a&&"checked",i&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=(0,Za.A)(s,EC,t);return(0,ba.A)({},t,l)})(c),u=(0,ka.jsx)(TC,{className:d.thumb,ownerState:c});return(0,ka.jsxs)(RC,{className:(0,za.A)(d.root,r),sx:s,ownerState:c,children:[(0,ka.jsx)(PC,(0,ba.A)({type:"checkbox",icon:u,checkedIcon:u,ref:t,ownerState:c},l,{classes:(0,ba.A)({},d,{root:d.switchBase})})),(0,ka.jsx)(OC,{className:d.track,ownerState:c})]})})),IC=LC,zC=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],DC=(0,Qa.Ay)("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,"vertical"===n.orientation&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&"vertical"===n.orientation&&t.withChildrenVertical,"right"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignRight,"left"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignLeft]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin"},n.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},n.light&&{borderColor:t.vars?"rgba(".concat(t.vars.palette.dividerChannel," / 0.08)"):(0,Ja.X4)(t.palette.divider,.08)},"inset"===n.variant&&{marginLeft:72},"middle"===n.variant&&"horizontal"===n.orientation&&{marginLeft:t.spacing(2),marginRight:t.spacing(2)},"middle"===n.variant&&"vertical"===n.orientation&&{marginTop:t.spacing(1),marginBottom:t.spacing(1)},"vertical"===n.orientation&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},n.flexItem&&{alignSelf:"stretch",height:"auto"})}),(e=>{let{ownerState:t}=e;return(0,ba.A)({},t.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}})}),(e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({},n.children&&"vertical"!==n.orientation&&{"&::before, &::after":{width:"100%",borderTop:"thin solid ".concat((t.vars||t).palette.divider),borderTopStyle:"inherit"}})}),(e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({},n.children&&"vertical"===n.orientation&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:"thin solid ".concat((t.vars||t).palette.divider),borderLeftStyle:"inherit"}})}),(e=>{let{ownerState:t}=e;return(0,ba.A)({},"right"===t.textAlign&&"vertical"!==t.orientation&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},"left"===t.textAlign&&"vertical"!==t.orientation&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})})),FC=(0,Qa.Ay)("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.wrapper,"vertical"===n.orientation&&t.wrapperVertical]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({display:"inline-block",paddingLeft:"calc(".concat(t.spacing(1)," * 1.2)"),paddingRight:"calc(".concat(t.spacing(1)," * 1.2)")},"vertical"===n.orientation&&{paddingTop:"calc(".concat(t.spacing(1)," * 1.2)"),paddingBottom:"calc(".concat(t.spacing(1)," * 1.2)")})})),BC=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiDivider"}),{absolute:r=!1,children:o,className:a,component:i=(o?"div":"hr"),flexItem:s=!1,light:l=!1,orientation:c="horizontal",role:d=("hr"!==i?"separator":void 0),textAlign:u="center",variant:h="fullWidth"}=n,p=(0,nr.A)(n,zC),f=(0,ba.A)({},n,{absolute:r,component:i,flexItem:s,light:l,orientation:c,role:d,textAlign:u,variant:h}),m=(e=>{const{absolute:t,children:n,classes:r,flexItem:o,light:a,orientation:i,textAlign:s,variant:l}=e,c={root:["root",t&&"absolute",l,a&&"light","vertical"===i&&"vertical",o&&"flexItem",n&&"withChildren",n&&"vertical"===i&&"withChildrenVertical","right"===s&&"vertical"!==i&&"textAlignRight","left"===s&&"vertical"!==i&&"textAlignLeft"],wrapper:["wrapper","vertical"===i&&"wrapperVertical"]};return(0,Za.A)(c,Qd,r)})(f);return(0,ka.jsx)(DC,(0,ba.A)({as:i,className:(0,za.A)(m.root,a),role:d,ref:t,ownerState:f},p,{children:o?(0,ka.jsx)(FC,{className:m.wrapper,ownerState:f,children:o}):null}))}));BC.muiSkipListHighlight=!0;const WC=BC;const HC=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:o,open:a,resumeHideDuration:i}=e,s=(0,Pi.A)();r.useEffect((()=>{if(a)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){e.defaultPrevented||"Escape"!==e.key&&"Esc"!==e.key||null==o||o(e,"escapeKeyDown")}}),[a,o]);const l=(0,$l.A)(((e,t)=>{null==o||o(e,t)})),c=(0,$l.A)((e=>{o&&null!=e&&s.start(e,(()=>{l(null,"timeout")}))}));r.useEffect((()=>(a&&c(t),s.clear)),[a,t,c,s]);const d=s.clear,u=r.useCallback((()=>{null!=t&&c(null!=i?i:.5*t)}),[t,i,c]),h=e=>t=>{const n=e.onFocus;null==n||n(t),d()},p=e=>t=>{const n=e.onMouseEnter;null==n||n(t),d()},f=e=>t=>{const n=e.onMouseLeave;null==n||n(t),u()};return r.useEffect((()=>{if(!n&&a)return window.addEventListener("focus",u),window.addEventListener("blur",d),()=>{window.removeEventListener("focus",u),window.removeEventListener("blur",d)}}),[n,a,u,d]),{getRootProps:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=(0,ba.A)({},Ws(e),Ws(t));return(0,ba.A)({role:"presentation"},t,n,{onBlur:(r=n,e=>{const t=r.onBlur;null==t||t(e),u()}),onFocus:h(n),onMouseEnter:p(n),onMouseLeave:f(n)});var r},onClickAway:e=>{null==o||o(e,"clickaway")}}};function VC(e){return e.substring(2).toLowerCase()}function UC(e){const{children:t,disableReactTree:n=!1,mouseEvent:o="onClick",onClickAway:a,touchEvent:i="onTouchEnd"}=e,s=r.useRef(!1),l=r.useRef(null),c=r.useRef(!1),d=r.useRef(!1);r.useEffect((()=>(setTimeout((()=>{c.current=!0}),0),()=>{c.current=!1})),[]);const u=(0,Ds.A)(Ts(t),l),h=(0,$l.A)((e=>{const t=d.current;d.current=!1;const r=(0,Nl.A)(l.current);if(!c.current||!l.current||"clientX"in e&&function(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}(e,r))return;if(s.current)return void(s.current=!1);let o;o=e.composedPath?e.composedPath().indexOf(l.current)>-1:!r.documentElement.contains(e.target)||l.current.contains(e.target),o||!n&&t||a(e)})),p=e=>n=>{d.current=!0;const r=t.props[e];r&&r(n)},f={ref:u};return!1!==i&&(f[i]=p(i)),r.useEffect((()=>{if(!1!==i){const e=VC(i),t=(0,Nl.A)(l.current),n=()=>{s.current=!0};return t.addEventListener(e,h),t.addEventListener("touchmove",n),()=>{t.removeEventListener(e,h),t.removeEventListener("touchmove",n)}}}),[h,i]),!1!==o&&(f[o]=p(o)),r.useEffect((()=>{if(!1!==o){const e=VC(o),t=(0,Nl.A)(l.current);return t.addEventListener(e,h),()=>{t.removeEventListener(e,h)}}}),[h,o]),(0,ka.jsx)(r.Fragment,{children:r.cloneElement(t,f)})}function qC(e){return(0,ni.Ay)("MuiSnackbarContent",e)}(0,$a.A)("MuiSnackbarContent",["root","message","action"]);const $C=["action","className","message","role"],KC=(0,Qa.Ay)(ii,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(e,t)=>t.root})((e=>{let{theme:t}=e;const n="light"===t.palette.mode?.8:.98,r=(0,Ja.tL)(t.palette.background.default,n);return(0,ba.A)({},t.typography.body2,{color:t.vars?t.vars.palette.SnackbarContent.color:t.palette.getContrastText(r),backgroundColor:t.vars?t.vars.palette.SnackbarContent.bg:r,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,flexGrow:1,[t.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}})})),XC=(0,Qa.Ay)("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0"}),YC=(0,Qa.Ay)("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),GC=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiSnackbarContent"}),{action:r,className:o,message:a,role:i="alert"}=n,s=(0,nr.A)(n,$C),l=n,c=(e=>{const{classes:t}=e;return(0,Za.A)({root:["root"],action:["action"],message:["message"]},qC,t)})(l);return(0,ka.jsxs)(KC,(0,ba.A)({role:i,square:!0,elevation:6,className:(0,za.A)(c.root,o),ownerState:l,ref:t},s,{children:[(0,ka.jsx)(XC,{className:c.message,ownerState:l,children:a}),r?(0,ka.jsx)(YC,{className:c.action,ownerState:l,children:r}):null]}))}));function ZC(e){return(0,ni.Ay)("MuiSnackbar",e)}(0,$a.A)("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const JC=["onEnter","onExited"],QC=["action","anchorOrigin","autoHideDuration","children","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onBlur","onClose","onFocus","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"],e_=(0,Qa.Ay)("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t["anchorOrigin".concat((0,si.A)(n.anchorOrigin.vertical)).concat((0,si.A)(n.anchorOrigin.horizontal))]]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({zIndex:(t.vars||t).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},"top"===n.anchorOrigin.vertical?{top:8}:{bottom:8},"left"===n.anchorOrigin.horizontal&&{justifyContent:"flex-start"},"right"===n.anchorOrigin.horizontal&&{justifyContent:"flex-end"},{[t.breakpoints.up("sm")]:(0,ba.A)({},"top"===n.anchorOrigin.vertical?{top:24}:{bottom:24},"center"===n.anchorOrigin.horizontal&&{left:"50%",right:"auto",transform:"translateX(-50%)"},"left"===n.anchorOrigin.horizontal&&{left:24,right:"auto"},"right"===n.anchorOrigin.horizontal&&{right:24,left:"auto"})})})),t_=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiSnackbar"}),o=wl(),a={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{action:i,anchorOrigin:{vertical:s,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:c=null,children:d,className:u,ClickAwayListenerProps:h,ContentProps:p,disableWindowBlurListener:f=!1,message:m,open:g,TransitionComponent:x=Ml,transitionDuration:b=a,TransitionProps:{onEnter:v,onExited:y}={}}=n,w=(0,nr.A)(n.TransitionProps,JC),k=(0,nr.A)(n,QC),S=(0,ba.A)({},n,{anchorOrigin:{vertical:s,horizontal:l},autoHideDuration:c,disableWindowBlurListener:f,TransitionComponent:x,transitionDuration:b}),j=(e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root","anchorOrigin".concat((0,si.A)(n.vertical)).concat((0,si.A)(n.horizontal))]};return(0,Za.A)(r,ZC,t)})(S),{getRootProps:A,onClickAway:C}=HC((0,ba.A)({},S)),[_,E]=r.useState(!0),M=$s({elementType:e_,getSlotProps:A,externalForwardedProps:k,ownerState:S,additionalProps:{ref:t},className:[j.root,u]});return!g&&_?null:(0,ka.jsx)(UC,(0,ba.A)({onClickAway:C},h,{children:(0,ka.jsx)(e_,(0,ba.A)({},M,{children:(0,ka.jsx)(x,(0,ba.A)({appear:!0,in:g,timeout:b,direction:"top"===s?"down":"up",onEnter:(e,t)=>{E(!1),v&&v(e,t)},onExited:e=>{E(!0),y&&y(e)}},w,{children:d||(0,ka.jsx)(GC,(0,ba.A)({message:m,action:i},p))}))}))}))}));var n_=n(2505),r_=n(3471),o_=n(6360);const a_={node:{label:"Node.js",scriptLabel:"Entry File",scriptHelp:"e.g. dist/index.js",defaultExecMode:"fork",supportsCluster:!0},python:{label:"Python",scriptLabel:"Python File",scriptHelp:"e.g. app.py",interpreterEnvVar:"PYTHON_INTERPRETER",defaultExecMode:"fork",supportsCluster:!1,requiresInterpreter:!0,interpreterHelp:"e.g. /path/to/venv/bin/python"},dotnet:{label:".NET",scriptLabel:"DLL Path",scriptHelp:"e.g. bin/Release/net8.0/app.dll",interpreterEnvVar:"DOTNET_COMMAND",defaultExecMode:"fork",supportsCluster:!1},other:{label:"Other",scriptLabel:"Script / Binary",scriptHelp:"Full path to executable",defaultExecMode:"fork",supportsCluster:!1}},i_=e=>{let{title:t,children:n}=e;return(0,ka.jsxs)(ii,{variant:"outlined",sx:{mb:2},children:[(0,ka.jsx)(Ga,{sx:{px:2,py:1,borderBottom:1,borderColor:"divider",bgcolor:"action.hover"},children:(0,ka.jsx)(Tp,{variant:"subtitle2",color:"text.secondary",sx:{textTransform:"uppercase",letterSpacing:"0.05em",fontSize:"0.6875rem"},children:t})}),(0,ka.jsx)(Ga,{sx:{p:2},children:n})]})},s_=()=>{const e=so(),[t,n]=(0,r.useState)("node"),[o,a]=(0,r.useState)(!0),[i,s]=(0,r.useState)(!1),[l,d]=(0,r.useState)(!1),[u,h]=(0,r.useState)(""),[p,f]=(0,r.useState)(""),[m,g]=(0,r.useState)(""),[x,b]=(0,r.useState)([]),[v,y]=(0,r.useState)({key:"",value:""}),[w,k]=(0,r.useState)([]),S=(0,r.useRef)(null),[j,A]=(0,r.useState)({name:"",script:"",cwd:"",namespace:"default",instances:1,exec_mode:"fork",autorestart:!0,watch:!1,max_memory_restart:"150M",port:"",interpreter:""});(0,r.useEffect)((()=>{var e;null===(e=S.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})}),[w]);const C=e=>{const{name:t,value:n,type:r,checked:o}=e.target;"port"===t&&g(n&&(!/^\d+$/.test(n)||+n<1||+n>65535)?"Must be a number between 1\u201365535":""),A((e=>c(c({},e),{},{[t]:"checkbox"===r?o:n})))},_=e=>{n(e),A((t=>c(c({},t),{},{exec_mode:a_[e].defaultExecMode})))},E=()=>{v.key.trim()&&(b((e=>[...e,c({},v)])),y({key:"",value:""}))},M=(e,t,n)=>b((r=>r.map(((r,o)=>o===e?c(c({},r),{},{[t]:n}):r)))),N=a_[t];return(0,ka.jsxs)(Ga,{component:"form",onSubmit:async n=>{if(n.preventDefault(),m)return;const r={};x.forEach((e=>{let{key:t,value:n}=e;t.trim()&&(r[t]=n)})),j.interpreter&&a_[t].interpreterEnvVar&&(r[a_[t].interpreterEnvVar]=j.interpreter),s(!0),k([]);try{var a;const n=await fetch("/api/deploy",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c(c({},j),{},{env:r,appType:t,autoSetup:o}))});if(!n.ok&&null!==(a=n.headers.get("content-type"))&&void 0!==a&&a.includes("application/json")){const e=await n.json();return f(e.error||"Deployment failed"),void s(!1)}const d=n.body.getReader(),u=new TextDecoder;let p="";for(;;){var i;const{done:t,value:n}=await d.read();if(t)break;p+=u.decode(n,{stream:!0});const r=p.split("\n\n");p=null!==(i=r.pop())&&void 0!==i?i:"";for(const o of r){const t=o.split("\n").find((e=>e.startsWith("data: ")));if(t)try{const n=JSON.parse(t.slice(6));if("log"===n.type)k((e=>[...e,n.message]));else if("done"===n.type)if(n.success)h("Application deployed successfully"),setTimeout((()=>e("/processes")),2e3);else{const e=n.error||"Deployment failed";f(e.includes("port")&&e.includes("use")?"Port ".concat(j.port," is already in use"):e)}}catch(l){}}}}catch(NR){f(NR.message||"Failed to deploy application")}finally{s(!1)}},children:[(0,ka.jsx)(Mj,{title:"Deploy Application",subtitle:"Start a new process managed by PM2",actions:(0,ka.jsxs)(Ga,{sx:{display:"flex",gap:1},children:[(0,ka.jsx)(ds,{variant:"outlined",size:"small",onClick:()=>e("/processes"),children:"Cancel"}),(0,ka.jsxs)(ds,{type:"submit",variant:"contained",size:"small",disabled:i||!!m,children:[i?(0,ka.jsx)(Xf,{size:14,sx:{mr:1}}):null,"Deploy"]})]})}),(0,ka.jsx)(i_,{title:"Basic Info",children:(0,ka.jsxs)(LS,{container:!0,spacing:2,children:[(0,ka.jsx)(LS,{item:!0,xs:12,sm:4,children:(0,ka.jsxs)(vs,{fullWidth:!0,size:"small",children:[(0,ka.jsx)(Ps,{children:"App Type"}),(0,ka.jsx)(Jd,{value:t,label:"App Type",onChange:e=>_(e.target.value),children:Object.keys(a_).map((e=>(0,ka.jsx)(cu,{value:e,children:a_[e].label},e)))})]})}),(0,ka.jsx)(LS,{item:!0,xs:12,sm:5,children:(0,ka.jsx)(_C,{required:!0,fullWidth:!0,size:"small",label:"Application Name",name:"name",value:j.name,onChange:C})}),(0,ka.jsx)(LS,{item:!0,xs:12,sm:3,children:(0,ka.jsx)(_C,{fullWidth:!0,size:"small",label:"Namespace",name:"namespace",value:j.namespace,onChange:C,helperText:'Group name (e.g. "backend")'})}),(0,ka.jsx)(LS,{item:!0,xs:12,sm:6,children:(0,ka.jsx)(_C,{required:!0,fullWidth:!0,size:"small",label:N.scriptLabel,name:"script",value:j.script,onChange:C,helperText:N.scriptHelp})}),(0,ka.jsx)(LS,{item:!0,xs:12,sm:6,children:(0,ka.jsx)(_C,{fullWidth:!0,size:"small",label:"Working Directory",name:"cwd",value:j.cwd,onChange:C,helperText:"Leave empty to use script's directory",InputProps:{endAdornment:(0,ka.jsx)(Gh,{title:"Auto-detect project type",children:(0,ka.jsx)("span",{children:(0,ka.jsx)(xf,{size:"small",onClick:async()=>{const e=j.cwd||(()=>{const e=j.script,t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t>0?e.substring(0,t):"."})();if(e&&"."!==e)try{d(!0);const{data:n}=await tr.post("/api/deploy/detect-project",{projectPath:e});var t;if(n.success&&n.projectType)_(n.projectType),h("Detected: ".concat((null===(t=n.config)||void 0===t?void 0:t.name)||n.projectType));else f("Could not detect project type")}catch(NR){var n,r;f((null===(n=NR.response)||void 0===n||null===(r=n.data)||void 0===r?void 0:r.error)||"Detection failed")}finally{d(!1)}else f("Set Working Directory or Entry File first")},disabled:l,children:l?(0,ka.jsx)(Xf,{size:14}):(0,ka.jsx)(o_.A,{fontSize:"small"})})})})}})}),N.requiresInterpreter&&(0,ka.jsx)(LS,{item:!0,xs:12,children:(0,ka.jsx)(_C,{fullWidth:!0,size:"small",label:"Interpreter Path",name:"interpreter",value:j.interpreter,onChange:C,helperText:N.interpreterHelp})})]})}),(0,ka.jsx)(i_,{title:"Runtime",children:(0,ka.jsxs)(LS,{container:!0,spacing:2,alignItems:"center",children:[(0,ka.jsx)(LS,{item:!0,xs:6,sm:3,children:(0,ka.jsx)(_C,{fullWidth:!0,size:"small",type:"number",label:"Instances",name:"instances",value:j.instances,onChange:C,inputProps:{min:1}})}),(0,ka.jsx)(LS,{item:!0,xs:6,sm:3,children:(0,ka.jsxs)(vs,{fullWidth:!0,size:"small",children:[(0,ka.jsx)(Ps,{children:"Exec Mode"}),(0,ka.jsxs)(Jd,{name:"exec_mode",value:j.exec_mode,label:"Exec Mode",disabled:!N.supportsCluster,onChange:e=>A((t=>c(c({},t),{},{exec_mode:e.target.value}))),children:[(0,ka.jsx)(cu,{value:"fork",children:"Fork"}),N.supportsCluster&&(0,ka.jsx)(cu,{value:"cluster",children:"Cluster"})]})]})}),(0,ka.jsx)(LS,{item:!0,xs:6,sm:3,children:(0,ka.jsx)(_C,{fullWidth:!0,size:"small",label:"Max Memory",name:"max_memory_restart",value:j.max_memory_restart,onChange:C,helperText:"e.g. 150M, 1G"})}),(0,ka.jsx)(LS,{item:!0,xs:6,sm:3,children:(0,ka.jsx)(_C,{fullWidth:!0,size:"small",label:"Port",name:"port",value:j.port,onChange:C,error:!!m,helperText:m||"Optional"})}),(0,ka.jsx)(LS,{item:!0,xs:12,children:(0,ka.jsxs)(Ga,{sx:{display:"flex",gap:3,flexWrap:"wrap"},children:[(0,ka.jsx)(Bp,{control:(0,ka.jsx)(IC,{size:"small",checked:j.autorestart,name:"autorestart",onChange:C}),label:(0,ka.jsx)(Tp,{variant:"body2",children:"Auto Restart"})}),(0,ka.jsx)(Bp,{control:(0,ka.jsx)(IC,{size:"small",checked:j.watch,name:"watch",onChange:C}),label:(0,ka.jsx)(Tp,{variant:"body2",children:"Watch for Changes"})}),(0,ka.jsx)(Bp,{control:(0,ka.jsx)(IC,{size:"small",checked:o,onChange:e=>a(e.target.checked)}),label:(0,ka.jsx)(Tp,{variant:"body2",children:"Auto Setup on Deploy"})})]})}),+j.instances>1&&(0,ka.jsx)(LS,{item:!0,xs:12,children:(0,ka.jsxs)(Nf,{severity:"info",sx:{py:.5},children:[j.instances," instances","cluster"===j.exec_mode?" in cluster mode \u2014 port is shared across instances.":" \u2014 consider switching to Cluster mode for better load balancing."]})})]})}),(0,ka.jsxs)(i_,{title:"Environment Variables",children:[x.length>0&&(0,ka.jsxs)(Ga,{sx:{mb:1.5},children:[x.map(((e,t)=>(0,ka.jsxs)(Ga,{sx:{display:"flex",gap:1,mb:1},children:[(0,ka.jsx)(_C,{size:"small",label:"Key",value:e.key,sx:{flex:1},onChange:e=>M(t,"key",e.target.value),inputProps:{style:{fontFamily:"monospace"}}}),(0,ka.jsx)(_C,{size:"small",label:"Value",value:e.value,sx:{flex:2},onChange:e=>M(t,"value",e.target.value),inputProps:{style:{fontFamily:"monospace"}}}),(0,ka.jsx)(xf,{size:"small",color:"error",onClick:()=>(e=>b((t=>t.filter(((t,n)=>n!==e)))))(t),children:(0,ka.jsx)(r_.A,{fontSize:"small"})})]},t))),(0,ka.jsx)(WC,{sx:{my:1.5}})]}),(0,ka.jsxs)(Ga,{sx:{display:"flex",gap:1},children:[(0,ka.jsx)(_C,{size:"small",label:"Key",value:v.key,sx:{flex:1},onChange:e=>y((t=>c(c({},t),{},{key:e.target.value}))),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),E())},inputProps:{style:{fontFamily:"monospace"}}}),(0,ka.jsx)(_C,{size:"small",label:"Value",value:v.value,sx:{flex:2},onChange:e=>y((t=>c(c({},t),{},{value:e.target.value}))),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),E())},inputProps:{style:{fontFamily:"monospace"}}}),(0,ka.jsx)(ds,{variant:"outlined",size:"small",onClick:E,startIcon:(0,ka.jsx)(n_.A,{}),disabled:!v.key.trim(),children:"Add"})]}),0===x.length&&(0,ka.jsx)(Tp,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:1},children:"No environment variables \u2014 type a key and value above, then press Add or Enter."})]}),w.length>0&&(0,ka.jsxs)(ii,{variant:"outlined",sx:{mb:2},children:[(0,ka.jsxs)(Ga,{sx:{px:2,py:1,borderBottom:1,borderColor:"divider",bgcolor:"action.hover",display:"flex",alignItems:"center",gap:1},children:[(0,ka.jsx)(Tp,{variant:"subtitle2",color:"text.secondary",sx:{textTransform:"uppercase",letterSpacing:"0.05em",fontSize:"0.6875rem",flex:1},children:"Deployment Log"}),i&&(0,ka.jsx)(Xf,{size:12})]}),(0,ka.jsxs)(Ga,{sx:{p:1.5,maxHeight:280,overflowY:"auto",bgcolor:e=>"dark"===e.palette.mode?"#0d1117":"#1e1e1e",fontFamily:"monospace",fontSize:"0.75rem",lineHeight:1.6},children:[w.map(((e,t)=>{const n=e.startsWith("[ERROR]"),r=e.startsWith("[WARN]"),o=e.startsWith("[OK]"),a=e.startsWith("[STEP]"),i=e.startsWith("[SKIP]"),s=n?"#f97171":r?"#fbbf24":o?"#4ade80":a?"#60a5fa":i?"#9ca3af":"#d4d4d4";return(0,ka.jsx)(Ga,{component:"div",sx:{color:s,whiteSpace:"pre-wrap",wordBreak:"break-all"},children:e},t)})),(0,ka.jsx)("div",{ref:S})]})]}),(0,ka.jsx)(t_,{open:!!p,autoHideDuration:5e3,onClose:()=>f(""),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:(0,ka.jsx)(Nf,{severity:"error",onClose:()=>f(""),children:p})}),(0,ka.jsx)(t_,{open:!!u,autoHideDuration:3e3,onClose:()=>h(""),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:(0,ka.jsx)(Nf,{severity:"success",onClose:()=>h(""),children:u})})]})},l_=["title","titleId"];function c_(e,t){let{title:n,titleId:o}=e,a=rr(e,l_);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const d_=r.forwardRef(c_),u_=["title","titleId"];function h_(e,t){let{title:n,titleId:o}=e,a=rr(e,u_);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const p_=r.forwardRef(h_),f_=["title","titleId"];function m_(e,t){let{title:n,titleId:o}=e,a=rr(e,f_);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z"}))}const g_=r.forwardRef(m_),x_=["title","titleId"];function b_(e,t){let{title:n,titleId:o}=e,a=rr(e,x_);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const v_=r.forwardRef(b_),y_=["title","titleId"];function w_(e,t){let{title:n,titleId:o}=e,a=rr(e,y_);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const k_=r.forwardRef(w_),S_=[{name:"pm2-logrotate",description:"Automatically rotate PM2 log files to prevent unbounded disk growth.",category:"Logging"},{name:"pm2-server-monit",description:"Monitor CPU, memory, network and disk usage of your server in PM2.",category:"Monitoring"},{name:"pm2-auto-pull",description:"Auto pull & restart from a git remote whenever a new commit is pushed.",category:"Deployment"},{name:"pm2-slack",description:"Send process event notifications (restart, stop, error) to Slack channels.",category:"Notifications"},{name:"pm2-telegram",description:"Receive PM2 process event alerts directly in a Telegram chat.",category:"Notifications"},{name:"pm2-githook",description:"Listen for GitHub webhook pushes and auto-deploy on new commits.",category:"Deployment"},{name:"pm2-metrics",description:"Expose aggregated PM2 process metrics for Prometheus / Grafana scraping.",category:"Monitoring"},{name:"pm2-notify",description:"Cross-platform desktop/email notifications for PM2 process state changes.",category:"Notifications"},{name:"pm2-keymetrics-agent",description:"Connect to the Keymetrics SaaS dashboard for remote monitoring.",category:"Monitoring"},{name:"pm2-intercom",description:"Expose a simple RPC bridge between PM2 processes via pm2 trigger.",category:"Utilities"}],j_={"pm2-logrotate":[{key:"max_size",label:"Max Log Size",description:"Size before rotation, e.g. 10M or 1G",type:"text",default:"10M"},{key:"retain",label:"Retained Rotations",description:"How many rotated files to keep",type:"number",default:"30"},{key:"compress",label:"Compress Rotated Logs",description:"Gzip rotated log files",type:"boolean",default:"false"},{key:"dateFormat",label:"Date Format",description:"Timestamp appended to rotated file names",type:"text",default:"YYYY-MM-DD_HH-mm-ss"},{key:"rotateModule",label:"Rotate PM2 Module Logs",description:"Include PM2 internal module logs in rotation",type:"boolean",default:"true"},{key:"workerInterval",label:"Worker Interval (s)",description:"How often to check log sizes",type:"number",default:"30"},{key:"rotateInterval",label:"Cron Rotate Schedule",description:"Cron expression for time-based rotation",type:"text",default:"0 0 * * *"},{key:"TZ",label:"Timezone",description:"e.g. America/New_York (blank = system default)",type:"text",default:""},{key:"su",label:"Run as su",description:"Use sudo for log rotation (Unix only)",type:"boolean",default:"false"}],"pm2-server-monit":[{key:"port",label:"HTTP Port",description:"Port the monitoring dashboard listens on",type:"number",default:"4357"},{key:"refresh",label:"Refresh Interval (ms)",description:"Polling interval for system metrics",type:"number",default:"2000"}],"pm2-auto-pull":[{key:"service_name",label:"Service Name",description:"Systemd service name for auto-pull",type:"text",default:"pm2-auto-pull"},{key:"port",label:"Webhook Port",description:"Port that receives GitHub webhook payloads",type:"number",default:"8888"},{key:"secret",label:"Webhook Secret",description:"HMAC secret to verify payload signatures",type:"text",default:""}],"pm2-slack":[{key:"slack_url",label:"Slack Webhook URL",description:"Incoming webhook URL from your Slack app",type:"text",default:""},{key:"servername",label:"Server Name",description:"Label displayed in Slack notifications",type:"text",default:""},{key:"events",label:"Events to Notify",description:"Comma-separated: start,stop,restart,error",type:"text",default:"start,stop,restart,error,kill,exception"}],"pm2-telegram":[{key:"telegram_token",label:"Bot Token",description:"Telegram bot token from @BotFather",type:"text",default:""},{key:"telegram_chat_id",label:"Chat ID",description:"Target chat or group ID for alerts",type:"text",default:""},{key:"servername",label:"Server Name",description:"Label shown in Telegram notifications",type:"text",default:""}]},A_=e=>{const t=e.toLowerCase();return t.includes("online")||t.includes("enabled")?"bg-emerald-100 dark:bg-emerald-900/30 text-emerald-700 dark:text-emerald-300":t.includes("error")||t.includes("disabled")?"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300":"bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300"},C_={Logging:"text-sky-500 bg-sky-500/10",Monitoring:"text-emerald-500 bg-emerald-500/10",Deployment:"text-violet-500 bg-violet-500/10",Notifications:"text-amber-500 bg-amber-500/10",Utilities:"text-neutral-400 bg-neutral-500/10"},__=e=>{var t;let{moduleName:n,onClose:o,onNotify:a}=e;const i=null!==(t=j_[n])&&void 0!==t?t:[],[s,l]=(0,r.useState)({}),[d,u]=(0,r.useState)(!0),[h,p]=(0,r.useState)(!1),[f,m]=(0,r.useState)([]);(0,r.useEffect)((()=>{(async()=>{try{var e;const t=null!==(e=(await tr.get("/api/modules/".concat(encodeURIComponent(n),"/config"))).data.config)&&void 0!==e?e:{};l(t);const r=new Set(i.map((e=>e.key))),o=Object.entries(t).filter((e=>{let[t]=e;return!r.has(t)})).map((e=>{let[t,n]=e;return{key:t,value:String(n)}}));m(o)}catch(t){a("Failed to load module configuration","error")}finally{u(!1)}})()}),[n]);const g=(e,t)=>l((n=>c(c({},n),{},{[e]:t}))),x=(e,t,n)=>m((r=>r.map(((r,o)=>o===e?c(c({},r),{},{[t]:n}):r))));return(0,ka.jsxs)("div",{className:"fixed inset-0 z-50 flex justify-end",children:[(0,ka.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:o}),(0,ka.jsxs)("div",{className:"relative z-10 flex flex-col w-full max-w-md h-full bg-white dark:bg-neutral-900 border-l border-neutral-200 dark:border-neutral-800 shadow-2xl overflow-hidden",children:[(0,ka.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-neutral-200 dark:border-neutral-800 shrink-0",children:[(0,ka.jsxs)("div",{children:[(0,ka.jsx)("h2",{className:"text-sm font-semibold text-neutral-900 dark:text-neutral-100",children:"Configure Module"}),(0,ka.jsx)("p",{className:"text-xs text-neutral-400 font-mono mt-0.5",children:n})]}),(0,ka.jsx)("button",{onClick:o,className:"text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 transition-colors",children:(0,ka.jsx)(d_,{className:"h-4 w-4"})})]}),(0,ka.jsx)("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-4",children:d?(0,ka.jsxs)("div",{className:"flex items-center justify-center h-24 gap-2 text-xs text-neutral-400",children:[(0,ka.jsxs)("svg",{className:"h-4 w-4 animate-spin text-primary-500",viewBox:"0 0 24 24",fill:"none",children:[(0,ka.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,ka.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),"Loading\u2026"]}):(0,ka.jsxs)(ka.Fragment,{children:[i.length>0&&(0,ka.jsxs)("div",{className:"space-y-3",children:[(0,ka.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-neutral-400",children:"Settings"}),i.map((e=>{var t;const n=null!==(t=s[e.key])&&void 0!==t?t:e.default;return(0,ka.jsxs)("div",{children:[(0,ka.jsx)("label",{className:"block text-xs font-medium text-neutral-700 dark:text-neutral-300 mb-1",children:e.label}),"boolean"===e.type?(0,ka.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ka.jsx)("button",{onClick:()=>g(e.key,"true"===n?"false":"true"),className:"relative inline-flex h-5 w-9 shrink-0 rounded-full border-2 border-transparent\n transition-colors duration-200 focus:outline-none cursor-pointer\n ".concat("true"===n?"bg-primary-600":"bg-neutral-300 dark:bg-neutral-600"),children:(0,ka.jsx)("span",{className:"pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow\n transform transition-transform duration-200\n ".concat("true"===n?"translate-x-4":"translate-x-0")})}),(0,ka.jsx)("span",{className:"text-xs text-neutral-500",children:"true"===n?"Enabled":"Disabled"})]}):(0,ka.jsx)("input",{type:"number"===e.type?"number":"text",value:n,onChange:t=>g(e.key,t.target.value),placeholder:e.default,className:"w-full h-8 px-3 text-xs rounded border bg-white dark:bg-neutral-800 border-neutral-200 dark:border-neutral-700 text-neutral-900 dark:text-neutral-100 placeholder-neutral-400 dark:placeholder-neutral-500 focus:outline-none focus:ring-1 focus:ring-primary-500"}),e.description&&(0,ka.jsx)("p",{className:"mt-0.5 text-[11px] text-neutral-400",children:e.description})]},e.key)}))]}),(0,ka.jsxs)("div",{className:"space-y-2",children:[(0,ka.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ka.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-neutral-400",children:i.length>0?"Additional Keys":"Configuration Keys"}),(0,ka.jsx)("button",{onClick:()=>m((e=>[...e,{key:"",value:""}])),className:"text-[10px] font-medium text-primary-600 dark:text-primary-400 hover:underline",children:"+ Add key"})]}),0===f.length&&i.length>0?(0,ka.jsx)("p",{className:"text-[11px] text-neutral-400 italic",children:"No additional keys"}):f.map(((e,t)=>(0,ka.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,ka.jsx)("input",{type:"text",value:e.key,onChange:e=>x(t,"key",e.target.value),placeholder:"key",className:"w-32 h-7 px-2 text-xs rounded border font-mono bg-white dark:bg-neutral-800 border-neutral-200 dark:border-neutral-700 text-neutral-900 dark:text-neutral-100 placeholder-neutral-400 dark:placeholder-neutral-500 focus:outline-none focus:ring-1 focus:ring-primary-500"}),(0,ka.jsx)("input",{type:"text",value:e.value,onChange:e=>x(t,"value",e.target.value),placeholder:"value",className:"flex-1 h-7 px-2 text-xs rounded border bg-white dark:bg-neutral-800 border-neutral-200 dark:border-neutral-700 text-neutral-900 dark:text-neutral-100 placeholder-neutral-400 dark:placeholder-neutral-500 focus:outline-none focus:ring-1 focus:ring-primary-500"}),(0,ka.jsx)("button",{onClick:()=>m((e=>e.filter(((e,n)=>n!==t)))),className:"shrink-0 text-neutral-400 hover:text-red-500 transition-colors",children:(0,ka.jsx)(d_,{className:"h-3.5 w-3.5"})})]},t)))]}),0===i.length&&0===f.length&&(0,ka.jsx)("p",{className:"text-xs text-neutral-400 italic text-center py-4",children:'No configuration found. Use "+ Add key" to add custom settings.'})]})}),(0,ka.jsxs)("div",{className:"flex justify-end gap-2 px-4 py-3 border-t border-neutral-200 dark:border-neutral-800 shrink-0",children:[(0,ka.jsx)("button",{onClick:o,className:"h-7 px-3 text-xs font-medium rounded border border-neutral-200 dark:border-neutral-700 text-neutral-600 dark:text-neutral-400 hover:bg-neutral-100 dark:hover:bg-neutral-800 transition-colors",children:"Cancel"}),(0,ka.jsx)("button",{onClick:async()=>{const e=c({},s);f.forEach((t=>{let{key:n,value:r}=t;n.trim()&&(e[n.trim()]=r)}));try{p(!0),await tr.put("/api/modules/".concat(encodeURIComponent(n),"/config"),{config:e}),a("Configuration saved for ".concat(n),"success"),o()}catch(NR){var t,r;a((null===(t=NR.response)||void 0===t||null===(r=t.data)||void 0===r?void 0:r.error)||"Failed to save configuration","error")}finally{p(!1)}},disabled:h||d,className:"h-7 px-3 text-xs font-medium rounded bg-primary-600 hover:bg-primary-700 text-white disabled:opacity-50 transition-colors flex items-center gap-1.5",children:h?(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsxs)("svg",{className:"h-3.5 w-3.5 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[(0,ka.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,ka.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),"Saving\u2026"]}):"Save"})]})]})]})},E_=e=>{let{onNotify:t}=e;const[n,o]=(0,r.useState)([]),[a,i]=(0,r.useState)(!0),[s,l]=(0,r.useState)(!1),[c,d]=(0,r.useState)(""),[u,h]=(0,r.useState)(!1),[p,f]=(0,r.useState)(null),m=(0,r.useCallback)((async()=>{try{i(!0);const e=await tr.get("/api/modules");o(e.data)}catch(NR){var e,n;t((null===(e=NR.response)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.error)||"Failed to fetch modules","error")}finally{i(!1)}}),[t]);(0,r.useEffect)((()=>{m()}),[m]);const g=async()=>{if(c.trim())try{h(!0),await tr.post("/api/modules/install",{moduleName:c.trim()}),t("Installed: ".concat(c.trim()),"success"),d(""),l(!1),m()}catch(NR){var e,n;t((null===(e=NR.response)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.error)||"Failed to install module","error")}finally{h(!1)}else t("Module name is required","warn")},x=new Set(n.map((e=>e.name)));return(0,ka.jsxs)("div",{children:[(0,ka.jsx)(Mj,{title:"PM2 Modules",subtitle:"Install, configure and manage PM2 plugin modules",actions:(0,ka.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ka.jsxs)("button",{onClick:m,disabled:a,className:"h-7 px-3 text-xs font-medium rounded border border-neutral-200 dark:border-neutral-700 text-neutral-600 dark:text-neutral-400 hover:bg-neutral-100 dark:hover:bg-neutral-800 disabled:opacity-50 transition-colors flex items-center gap-1.5",children:[(0,ka.jsx)(eA,{className:"h-3.5 w-3.5 ".concat(a?"animate-spin":"")}),"Refresh"]}),(0,ka.jsxs)("button",{onClick:()=>l(!0),className:"h-7 px-3 text-xs font-medium rounded bg-primary-600 hover:bg-primary-700 text-white transition-colors flex items-center gap-1.5",children:[(0,ka.jsx)(p_,{className:"h-3.5 w-3.5"}),"Install Module"]})]})}),(0,ka.jsxs)("section",{className:"mb-6",children:[(0,ka.jsx)("h2",{className:"text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-widest mb-2",children:"Installed"}),(0,ka.jsx)("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800 overflow-hidden",children:a?(0,ka.jsxs)("div",{className:"flex items-center justify-center h-24 gap-2 text-xs text-neutral-400",children:[(0,ka.jsxs)("svg",{className:"h-4 w-4 animate-spin text-primary-500",viewBox:"0 0 24 24",fill:"none",children:[(0,ka.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,ka.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),"Loading modules\u2026"]}):0===n.length?(0,ka.jsxs)("div",{className:"flex flex-col items-center justify-center h-24 gap-1 text-xs text-neutral-400 dark:text-neutral-500",children:[(0,ka.jsx)(g_,{className:"h-5 w-5 opacity-40"}),(0,ka.jsx)("span",{children:"No PM2 modules installed"})]}):(0,ka.jsxs)("table",{className:"w-full text-xs",children:[(0,ka.jsx)("thead",{children:(0,ka.jsxs)("tr",{className:"border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-900/60 text-neutral-500 dark:text-neutral-400",children:[(0,ka.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"Name"}),(0,ka.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"Version"}),(0,ka.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"Status"}),(0,ka.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Actions"})]})}),(0,ka.jsx)("tbody",{children:n.map(((e,n)=>(0,ka.jsxs)("tr",{className:"border-b last:border-0 border-neutral-100 dark:border-neutral-800\n ".concat(n%2===0?"":"bg-neutral-50/50 dark:bg-neutral-900/30"),children:[(0,ka.jsx)("td",{className:"px-3 py-2 font-mono font-medium text-neutral-900 dark:text-neutral-100",children:e.name}),(0,ka.jsx)("td",{className:"px-3 py-2 text-neutral-500 dark:text-neutral-400",children:e.version}),(0,ka.jsx)("td",{className:"px-3 py-2",children:(0,ka.jsx)("span",{className:"inline-block text-[10px] font-semibold px-1.5 py-0.5 rounded ".concat(A_(e.status)),children:e.status})}),(0,ka.jsx)("td",{className:"px-3 py-2",children:(0,ka.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,ka.jsx)("button",{onClick:()=>f(e.name),title:"Configure",className:"inline-flex items-center justify-center h-6 w-6 rounded text-neutral-400 hover:text-primary-500 hover:bg-primary-50 dark:hover:bg-primary-900/20 transition-colors",children:(0,ka.jsx)(v_,{className:"h-3.5 w-3.5"})}),(0,ka.jsx)("button",{onClick:()=>(async e=>{try{await tr.delete("/api/modules/".concat(e)),t("Uninstalled: ".concat(e),"success"),m()}catch(NR){var n,r;t((null===(n=NR.response)||void 0===n||null===(r=n.data)||void 0===r?void 0:r.error)||"Failed to uninstall module","error")}})(e.name),title:"Uninstall",className:"inline-flex items-center justify-center h-6 w-6 rounded text-neutral-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:(0,ka.jsx)(cA,{className:"h-3.5 w-3.5"})})]})})]},e.name)))})]})})]}),(0,ka.jsxs)("section",{children:[(0,ka.jsx)("h2",{className:"text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-widest mb-2",children:"Available Modules"}),(0,ka.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:S_.map((e=>{var n;const r=x.has(e.name);return(0,ka.jsxs)("div",{className:"flex items-start gap-3 rounded-lg border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900/40 px-3 py-2.5 hover:border-primary-300 dark:hover:border-primary-700/60 transition-colors",children:[(0,ka.jsx)("div",{className:"shrink-0 mt-0.5 h-7 w-7 rounded flex items-center justify-center bg-neutral-100 dark:bg-neutral-800",children:(0,ka.jsx)(g_,{className:"h-4 w-4 text-neutral-400"})}),(0,ka.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ka.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,ka.jsx)("span",{className:"font-mono text-xs font-semibold text-neutral-900 dark:text-neutral-100",children:e.name}),(0,ka.jsx)("span",{className:"text-[10px] font-semibold px-1.5 py-px rounded ".concat(null!==(n=C_[e.category])&&void 0!==n?n:C_.Utilities),children:e.category}),r&&(0,ka.jsx)("span",{className:"text-[10px] font-semibold px-1.5 py-px rounded bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",children:"Installed"})]}),(0,ka.jsx)("p",{className:"text-[11px] text-neutral-500 dark:text-neutral-400 mt-0.5 leading-relaxed",children:e.description})]}),(0,ka.jsx)("div",{className:"flex flex-col gap-1 shrink-0 mt-0.5",children:r?(0,ka.jsx)("button",{onClick:()=>f(e.name),title:"Configure",className:"h-7 w-7 flex items-center justify-center rounded border border-primary-300 dark:border-primary-700 text-primary-600 dark:text-primary-400 hover:bg-primary-50 dark:hover:bg-primary-900/20 transition-colors",children:(0,ka.jsx)(v_,{className:"h-3.5 w-3.5"})}):(0,ka.jsx)("button",{onClick:()=>(async e=>{try{await tr.post("/api/modules/install",{moduleName:e}),t("Installed: ".concat(e),"success"),m()}catch(NR){var n,r;t((null===(n=NR.response)||void 0===n||null===(r=n.data)||void 0===r?void 0:r.error)||"Failed to install ".concat(e),"error")}})(e.name),title:"Install",className:"h-7 w-7 flex items-center justify-center rounded border border-primary-300 dark:border-primary-700 text-primary-600 dark:text-primary-400 hover:bg-primary-50 dark:hover:bg-primary-900/20 transition-colors",children:(0,ka.jsx)(k_,{className:"h-3.5 w-3.5"})})})]},e.name)}))})]}),s&&(0,ka.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",children:(0,ka.jsxs)("div",{className:"w-full max-w-sm rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-neutral-900 shadow-xl",children:[(0,ka.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-neutral-200 dark:border-neutral-800",children:[(0,ka.jsx)("h3",{className:"text-sm font-semibold text-neutral-900 dark:text-neutral-100",children:"Install PM2 Module"}),(0,ka.jsx)("button",{onClick:()=>l(!1),className:"text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 transition-colors",children:(0,ka.jsx)(d_,{className:"h-4 w-4"})})]}),(0,ka.jsxs)("div",{className:"px-4 py-4",children:[(0,ka.jsx)("label",{className:"block text-xs font-medium text-neutral-700 dark:text-neutral-300 mb-1",children:"Module Name"}),(0,ka.jsx)("input",{autoFocus:!0,type:"text",value:c,onChange:e=>d(e.target.value),onKeyDown:e=>"Enter"===e.key&&g(),placeholder:"e.g. pm2-logrotate",className:"w-full h-8 px-3 text-xs rounded border bg-white dark:bg-neutral-800 border-neutral-200 dark:border-neutral-700 text-neutral-900 dark:text-neutral-100 placeholder-neutral-400 dark:placeholder-neutral-500 focus:outline-none focus:ring-1 focus:ring-primary-500"}),(0,ka.jsx)("p",{className:"mt-1.5 text-[11px] text-neutral-400",children:"Enter any npm-published PM2 module name."})]}),(0,ka.jsxs)("div",{className:"flex justify-end gap-2 px-4 py-3 border-t border-neutral-200 dark:border-neutral-800",children:[(0,ka.jsx)("button",{onClick:()=>l(!1),className:"h-7 px-3 text-xs font-medium rounded border border-neutral-200 dark:border-neutral-700 text-neutral-600 dark:text-neutral-400 hover:bg-neutral-100 dark:hover:bg-neutral-800 transition-colors",children:"Cancel"}),(0,ka.jsx)("button",{onClick:g,disabled:u,className:"h-7 px-3 text-xs font-medium rounded bg-primary-600 hover:bg-primary-700 text-white disabled:opacity-50 transition-colors flex items-center gap-1.5",children:u?(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsxs)("svg",{className:"h-3.5 w-3.5 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[(0,ka.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,ka.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),"Installing\u2026"]}):(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsx)(k_,{className:"h-3.5 w-3.5"}),"Install"]})})]})]})}),p&&(0,ka.jsx)(__,{moduleName:p,onClose:()=>f(null),onNotify:t})]})},M_=(0,Zc.A)((0,ka.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.89-2-2-2m0 16H5V7h14zm-5.5-6c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5 1.5.67 1.5 1.5M12 9c-2.73 0-5.06 1.66-6 4 .94 2.34 3.27 4 6 4s5.06-1.66 6-4c-.94-2.34-3.27-4-6-4m0 6.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"Preview"),N_=(0,Zc.A)((0,ka.jsx)("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"}),"Save"),R_=()=>{const[e,t]=(0,r.useState)(!1),[n,o]=(0,r.useState)(""),[a,i]=(0,r.useState)(""),[s,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,h]=(0,r.useState)(!1),[p,f]=(0,r.useState)(!0),m=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{if(t(!0),e){const e=await tr.get("/api/deploy/generate-ecosystem-preview");d(e.data.content),h(!0)}else{const e=await tr.post("/api/deploy/generate-ecosystem",{path:n.trim()||void 0,includeAllProcesses:p});i("Ecosystem file saved to: ".concat(e.data.path))}}catch(NR){var r,o;l((null===(r=NR.response)||void 0===r||null===(o=r.data)||void 0===o?void 0:o.error)||"Failed to generate ecosystem file")}finally{t(!1)}};return(0,ka.jsxs)(Ga,{children:[(0,ka.jsx)(Mj,{title:"Ecosystem Generator",subtitle:"Generate an ecosystem.config.js from your current PM2 processes",actions:(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsx)(ds,{variant:"outlined",startIcon:(0,ka.jsx)(M_,{}),onClick:()=>m(!0),disabled:e,children:"Preview"}),(0,ka.jsxs)(ds,{variant:"contained",startIcon:(0,ka.jsx)(N_,{}),onClick:()=>m(!1),disabled:e,children:[e?(0,ka.jsx)(Xf,{size:14,sx:{mr:1}}):null,"Generate File"]})]})}),(0,ka.jsxs)(ii,{variant:"outlined",sx:{p:2},children:[(0,ka.jsx)(Tp,{variant:"subtitle2",sx:{fontWeight:600,mb:1.5},children:"Output Options"}),(0,ka.jsxs)(Ga,{component:"form",onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,ka.jsx)(_C,{fullWidth:!0,label:"Save Path (optional)",placeholder:"/path/to/ecosystem.config.js",value:n,onChange:e=>o(e.target.value),helperText:"Leave empty to save in the current working directory",sx:{mb:2}}),(0,ka.jsx)(Bp,{control:(0,ka.jsx)(of,{checked:p,onChange:e=>f(e.target.checked)}),label:(0,ka.jsx)(Tp,{variant:"body2",children:"Include stopped processes"})})]}),(0,ka.jsxs)(Tp,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:1.5},children:["The generated file can be used to redeploy and manage your processes across environments with ",(0,ka.jsx)("code",{children:"pm2 start ecosystem.config.js"}),"."]})]}),(0,ka.jsxs)(ZA,{open:u,onClose:()=>h(!1),maxWidth:"md",fullWidth:!0,children:[(0,ka.jsx)(nC,{children:"ecosystem.config.js \u2014 Preview"}),(0,ka.jsx)(iC,{dividers:!0,children:(0,ka.jsx)(Ga,{component:"pre",sx:{p:2,borderRadius:1,m:0,bgcolor:"action.hover",overflowX:"auto",fontSize:"0.8125rem",fontFamily:"monospace",lineHeight:1.6},children:c})}),(0,ka.jsxs)(fC,{children:[(0,ka.jsx)(ds,{onClick:()=>h(!1),children:"Close"}),(0,ka.jsx)(ds,{variant:"contained",onClick:()=>{h(!1),m(!1)},children:"Save File"})]})]}),(0,ka.jsx)(t_,{open:!!s,autoHideDuration:5e3,onClose:()=>l(""),children:(0,ka.jsx)(Nf,{severity:"error",children:s})}),(0,ka.jsx)(t_,{open:!!a,autoHideDuration:5e3,onClose:()=>i(""),children:(0,ka.jsx)(Nf,{severity:"success",children:a})})]})},P_=e=>{let{procId:t}=e;const n=lo(),o=t||Number(n.id),[a,i]=(0,r.useState)(null),[s,l]=(0,r.useState)(!0),[d,u]=(0,r.useState)(""),[h,p]=(0,r.useState)(""),[f,m]=(0,r.useState)([]),[g,x]=(0,r.useState)(""),[b,v]=(0,r.useState)(""),y=so();(0,r.useEffect)((()=>{(async()=>{try{l(!0);const e=await tr.get("/api/config/".concat(o));i(e.data),m(Object.keys(e.data.env||{})),l(!1)}catch(NR){u("Failed to fetch configuration for process ".concat(o)),l(!1)}})()}),[o]);const w=e=>{const{name:t,value:n,type:r,checked:o}=e.target;i((e=>e?c(c({},e),{},{[t]:"checkbox"===r?o:n}):e))};return s?(0,ka.jsx)(Tp,{children:"Loading configuration..."}):a?(0,ka.jsxs)(Ga,{children:[(0,ka.jsxs)(ii,{sx:{p:3,mb:3},children:[(0,ka.jsx)(Tp,{variant:"h5",gutterBottom:!0,children:"Process Configuration"}),(0,ka.jsx)(WC,{sx:{mb:3}}),(0,ka.jsxs)(LS,{container:!0,spacing:3,children:[(0,ka.jsx)(LS,{item:!0,xs:12,md:6,children:(0,ka.jsx)(_C,{fullWidth:!0,label:"Name",name:"name",value:a.name,onChange:w,margin:"normal"})}),(0,ka.jsx)(LS,{item:!0,xs:12,md:6,children:(0,ka.jsx)(_C,{fullWidth:!0,label:"Script Path",name:"script",value:a.script,onChange:w,margin:"normal"})}),(0,ka.jsx)(LS,{item:!0,xs:12,children:(0,ka.jsx)(_C,{fullWidth:!0,label:"Current Working Directory",name:"cwd",value:a.cwd,onChange:w,margin:"normal"})}),(0,ka.jsx)(LS,{item:!0,xs:12,md:6,children:(0,ka.jsx)(_C,{fullWidth:!0,label:"Instances",name:"instances",type:"number",value:a.instances,onChange:w,margin:"normal"})}),(0,ka.jsx)(LS,{item:!0,xs:12,md:6,children:(0,ka.jsxs)(vs,{fullWidth:!0,margin:"normal",children:[(0,ka.jsx)(Ps,{children:"Execution Mode"}),(0,ka.jsxs)(Jd,{name:"exec_mode",value:a.exec_mode,onChange:e=>{const{name:t,value:n}=e.target;i((e=>e?c(c({},e),{},{[t]:n}):e))},label:"Execution Mode",children:[(0,ka.jsx)(cu,{value:"fork",children:"Fork"}),(0,ka.jsx)(cu,{value:"cluster",children:"Cluster"})]})]})}),(0,ka.jsx)(LS,{item:!0,xs:12,md:6,children:(0,ka.jsx)(Bp,{control:(0,ka.jsx)(IC,{checked:a.autorestart,onChange:w,name:"autorestart"}),label:"Auto Restart"})}),(0,ka.jsx)(LS,{item:!0,xs:12,md:6,children:(0,ka.jsx)(Bp,{control:(0,ka.jsx)(IC,{checked:a.watch,onChange:w,name:"watch"}),label:"Watch for Changes"})}),(0,ka.jsx)(LS,{item:!0,xs:12,children:(0,ka.jsx)(_C,{fullWidth:!0,label:"Max Memory Restart",name:"max_memory_restart",value:a.max_memory_restart,onChange:w,margin:"normal",helperText:"e.g. 150M, 1G"})})]}),(0,ka.jsx)(Tp,{variant:"h6",sx:{mt:4,mb:2},children:"Environment Variables"}),(0,ka.jsx)(WC,{sx:{mb:3}}),f.map((e=>(0,ka.jsxs)(Ga,{sx:{display:"flex",mb:2},children:[(0,ka.jsx)(_C,{sx:{mr:1,flexGrow:1},label:"Key",value:e,disabled:!0}),(0,ka.jsx)(_C,{sx:{mr:1,flexGrow:2},label:"Value",value:a.env[e],onChange:t=>((e,t)=>{i((n=>n?c(c({},n),{},{env:c(c({},n.env),{},{[e]:t})}):n))})(e,t.target.value)}),(0,ka.jsx)(ds,{variant:"outlined",color:"error",onClick:()=>(e=>{i((t=>{if(!t)return t;const n=c({},t.env);return delete n[e],c(c({},t),{},{env:n})})),m(f.filter((t=>t!==e)))})(e),children:"Remove"})]},e))),(0,ka.jsxs)(Ga,{sx:{display:"flex",mt:2},children:[(0,ka.jsx)(_C,{sx:{mr:1,flexGrow:1},label:"New Key",value:g,onChange:e=>x(e.target.value)}),(0,ka.jsx)(_C,{sx:{mr:1,flexGrow:2},label:"New Value",value:b,onChange:e=>v(e.target.value)}),(0,ka.jsx)(ds,{variant:"contained",onClick:()=>{g.trim()&&(i((e=>e?c(c({},e),{},{env:c(c({},e.env),{},{[g]:b})}):e)),m((e=>[...e,g])),x(""),v(""))},children:"Add"})]}),(0,ka.jsxs)(Ga,{sx:{mt:4,display:"flex",justifyContent:"flex-end"},children:[(0,ka.jsx)(ds,{variant:"contained",color:"primary",onClick:async()=>{try{await tr.post("/api/config/".concat(o),a),p("Configuration saved successfully")}catch(NR){u("Failed to save configuration")}},sx:{mr:2},children:"Save Configuration"}),(0,ka.jsx)(ds,{variant:"outlined",onClick:()=>y("/processes"),children:"Cancel"})]})]}),(0,ka.jsx)(t_,{open:!!d,autoHideDuration:6e3,onClose:()=>u(""),children:(0,ka.jsx)(Nf,{severity:"error",children:d})}),(0,ka.jsx)(t_,{open:!!h,autoHideDuration:6e3,onClose:()=>p(""),children:(0,ka.jsx)(Nf,{severity:"success",children:h})})]}):(0,ka.jsx)(Tp,{color:"error",children:"Configuration not found"})},O_=["title","titleId"];function T_(e,t){let{title:n,titleId:o}=e,a=rr(e,O_);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"}))}const L_=r.forwardRef(T_),I_=["title","titleId"];function z_(e,t){let{title:n,titleId:o}=e,a=rr(e,I_);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z"}))}const D_=r.forwardRef(z_),F_=e=>{let{processes:t,onRefresh:n}=e;const[o,a]=(0,r.useState)(""),[i,s]=(0,r.useState)([]),[l,c]=(0,r.useState)(1),[d,u]=(0,r.useState)(!1),[h,p]=(0,r.useState)(""),[f,m]=(0,r.useState)("");(0,r.useEffect)((()=>{o&&g(o)}),[o]);const g=async e=>{try{u(!0);const t=await tr.get("/api/cluster/".concat(e));s([t.data]),c(t.data.instances||1)}catch(t){m("Failed to fetch cluster information")}finally{u(!1)}},x=async e=>{if(o)try{u(!0),await tr.post("/api/cluster/".concat(o,"/exec-mode"),{mode:e}),await g(o),p("Execution mode changed to ".concat(e)),n()}catch(t){m("Failed to change execution mode")}finally{u(!1)}},b=i[0];return(0,ka.jsxs)("div",{children:[(0,ka.jsx)(Mj,{title:"Cluster Management",subtitle:"Scale processes and manage execution modes"}),f&&(0,ka.jsxs)("div",{className:"mb-4 flex items-center gap-2 rounded-lg border border-red-300 dark:border-red-700 bg-red-50 dark:bg-red-900/20 px-3 py-2 text-xs text-red-700 dark:text-red-400",children:[(0,ka.jsx)("span",{className:"flex-1",children:f}),(0,ka.jsx)("button",{onClick:()=>m(""),className:"text-red-400 hover:text-red-600",children:"\u2715"})]}),h&&(0,ka.jsxs)("div",{className:"mb-4 flex items-center gap-2 rounded-lg border border-emerald-300 dark:border-emerald-700 bg-emerald-50 dark:bg-emerald-900/20 px-3 py-2 text-xs text-emerald-700 dark:text-emerald-400",children:[(0,ka.jsx)("span",{className:"flex-1",children:h}),(0,ka.jsx)("button",{onClick:()=>p(""),className:"text-emerald-400 hover:text-emerald-600",children:"\u2715"})]}),(0,ka.jsxs)("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 p-4 mb-4",children:[(0,ka.jsx)("p",{className:"text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider mb-3",children:"Select Process"}),(0,ka.jsxs)("select",{value:o,onChange:e=>a(e.target.value),className:"w-full sm:w-72 h-8 px-3 text-xs rounded border\r bg-white dark:bg-neutral-800\r border-neutral-200 dark:border-neutral-700\r text-neutral-900 dark:text-neutral-100\r focus:outline-none focus:ring-1 focus:ring-primary-500",children:[(0,ka.jsx)("option",{value:"",children:"\u2014 choose a process \u2014"}),t.map((e=>(0,ka.jsxs)("option",{value:e.pm_id,children:[e.name," (ID: ",e.pm_id,")"]},e.pm_id)))]})]}),d?(0,ka.jsx)("div",{className:"flex justify-center py-10",children:(0,ka.jsx)(eA,{className:"h-5 w-5 animate-spin text-neutral-400"})}):o?b?(0,ka.jsxs)("div",{className:"grid grid-cols-1 gap-4",children:[(0,ka.jsxs)("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 overflow-hidden",children:[(0,ka.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2.5 border-b border-neutral-100 dark:border-neutral-800",children:[(0,ka.jsx)(Dj,{className:"h-3.5 w-3.5 text-neutral-400"}),(0,ka.jsx)("p",{className:"text-xs font-semibold text-neutral-700 dark:text-neutral-300",children:"Current Status"})]}),(0,ka.jsxs)("table",{className:"w-full text-xs",children:[(0,ka.jsx)("thead",{children:(0,ka.jsx)("tr",{className:"bg-neutral-50 dark:bg-neutral-800/60 border-b border-neutral-100 dark:border-neutral-800",children:["ID","Name","Instances","Exec Mode","Mode"].map((e=>(0,ka.jsx)("th",{className:"px-4 py-2 text-left text-[11px] font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider",children:e},e)))})}),(0,ka.jsx)("tbody",{children:i.map((e=>(0,ka.jsxs)("tr",{className:"text-neutral-700 dark:text-neutral-300",children:[(0,ka.jsx)("td",{className:"px-4 py-2.5",children:e.pm_id}),(0,ka.jsx)("td",{className:"px-4 py-2.5 font-medium",children:e.name}),(0,ka.jsx)("td",{className:"px-4 py-2.5",children:e.instances}),(0,ka.jsx)("td",{className:"px-4 py-2.5 font-mono",children:e.exec_mode}),(0,ka.jsx)("td",{className:"px-4 py-2.5",children:(0,ka.jsx)("span",{className:"inline-flex px-1.5 py-0.5 rounded border text-[11px] font-medium ".concat(e.isCluster?"bg-primary-500/10 text-primary-600 dark:text-primary-400 border-primary-400/30":"bg-neutral-100 dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border-neutral-300 dark:border-neutral-700"),children:e.isCluster?"Cluster":"Fork"})})]},e.pm_id)))})]})]}),(0,ka.jsxs)("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 p-4",children:[(0,ka.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,ka.jsx)(L_,{className:"h-3.5 w-3.5 text-neutral-400"}),(0,ka.jsx)("p",{className:"text-xs font-semibold text-neutral-700 dark:text-neutral-300",children:"Scale Instances"})]}),(0,ka.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ka.jsx)("input",{type:"number",min:0,value:l,onChange:e=>c(Number(e.target.value)),className:"w-24 h-8 px-3 text-xs rounded border\r bg-white dark:bg-neutral-800\r border-neutral-200 dark:border-neutral-700\r text-neutral-900 dark:text-neutral-100\r focus:outline-none focus:ring-1 focus:ring-primary-500"}),(0,ka.jsxs)("button",{onClick:async()=>{if(o&&!(l<0))try{u(!0),await tr.post("/api/cluster/".concat(o,"/scale"),{instances:l}),await g(o),p("Scaled to ".concat(l," instances")),n()}catch(e){m("Failed to scale process")}finally{u(!1)}},disabled:d,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded\r bg-primary-600 hover:bg-primary-700 text-white transition-colors\r disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,ka.jsx)(L_,{className:"h-3.5 w-3.5"}),"Scale"]})]})]}),(0,ka.jsxs)("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 p-4",children:[(0,ka.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,ka.jsx)(Uj,{className:"h-3.5 w-3.5 text-neutral-400"}),(0,ka.jsx)("p",{className:"text-xs font-semibold text-neutral-700 dark:text-neutral-300",children:"Execution Mode"})]}),(0,ka.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,ka.jsx)("button",{onClick:()=>x("fork"),disabled:!b.isCluster,className:"px-3 py-1.5 text-xs font-medium rounded border transition-colors\r border-neutral-200 dark:border-neutral-700\r text-neutral-700 dark:text-neutral-300\r hover:bg-neutral-50 dark:hover:bg-neutral-800\r disabled:opacity-40 disabled:cursor-not-allowed",children:"Switch to Fork"}),(0,ka.jsx)("button",{onClick:()=>x("cluster"),disabled:b.isCluster,className:"px-3 py-1.5 text-xs font-medium rounded border transition-colors\r border-neutral-200 dark:border-neutral-700\r text-neutral-700 dark:text-neutral-300\r hover:bg-neutral-50 dark:hover:bg-neutral-800\r disabled:opacity-40 disabled:cursor-not-allowed",children:"Switch to Cluster"})]}),(0,ka.jsxs)("p",{className:"text-xs text-neutral-400 dark:text-neutral-500",children:["Use ",(0,ka.jsx)("span",{className:"font-medium text-neutral-600 dark:text-neutral-300",children:"cluster mode"})," with multiple instances to distribute requests across all CPU cores."]})]}),(0,ka.jsxs)("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 p-4",children:[(0,ka.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,ka.jsx)(D_,{className:"h-3.5 w-3.5 text-amber-400"}),(0,ka.jsx)("p",{className:"text-xs font-semibold text-neutral-700 dark:text-neutral-300",children:"Zero-Downtime Reload"})]}),(0,ka.jsx)("p",{className:"text-xs text-neutral-400 dark:text-neutral-500 mb-3",children:"Reload instances one by one \u2014 no service interruption during code updates."}),(0,ka.jsxs)("button",{onClick:async()=>{if(o)try{u(!0),await tr.post("/api/cluster/".concat(o,"/reload")),p("Process reloaded with zero downtime"),n()}catch(e){m("Failed to reload process")}finally{u(!1)}},disabled:d,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded\r bg-amber-500 hover:bg-amber-600 text-white transition-colors\r disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,ka.jsx)(D_,{className:"h-3.5 w-3.5"}),"Graceful Reload"]})]})]}):null:(0,ka.jsxs)("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 p-8 text-center",children:[(0,ka.jsx)(Uj,{className:"mx-auto h-8 w-8 text-neutral-300 dark:text-neutral-600 mb-2"}),(0,ka.jsx)("p",{className:"text-xs text-neutral-400 dark:text-neutral-500",children:"Select a process above to view cluster options"})]})]})},B_=(e,t)=>{if("err"===e)return"text-red-400";const n=t.toLowerCase();return n.includes("error")||n.includes("err ")||n.includes("exception")?"text-red-400":n.includes("warn")?"text-amber-400":"text-neutral-300"},W_=e=>{let{processId:t,logType:n="out"}=e;const o=lo(),a=Boolean(o.serverId),i=a?o.serverId:"local",s=a?o.processId?Number(o.processId):null:o.id?Number(o.id):void 0!==t?Number(t):null,l=(0,r.useRef)(null),c=(0,r.useRef)(null),[d,u]=(0,r.useState)([]),[h,p]=(0,r.useState)(!1),[f,m]=(0,r.useState)(""),[g,x]=(0,r.useState)(!0),[b,v]=(0,r.useState)(""),[y,w]=(0,r.useState)(!1),[k,S]=(0,r.useState)(n),[j,A]=(0,r.useState)("");(0,r.useEffect)((()=>{if(null===s)return;(async()=>{try{if("local"===i){const e=(await tr.get("/api/processes")).data.find((e=>e.pm_id===s));e&&A(e.name)}else{const e=(await tr.get("/api/remote/".concat(i,"/processes"))).data.find((e=>e.pm_id===s));e&&A(e.name)}}catch(e){}})()}),[s,i]),(0,r.useEffect)((()=>{if(null===s)return;c.current&&(c.current.disconnect(),c.current=null),w(!1),u([]);if((async()=>{try{p(!0),m("");let e=[];if("local"===i){e=(await tr.get("/api/logs/".concat(s,"/").concat(k))).data.logs||[]}else{const t=await tr.get("/api/remote/".concat(i,"/logs/").concat(s));e="out"===k?t.data.stdout||[]:t.data.stderr||[]}u(e),p(!1)}catch(NR){var e,t;m((null===(e=NR.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||"Failed to fetch logs"),p(!1)}})(),"local"===i){const e=Re("http://localhost:3101",{transports:["websocket","polling"],reconnection:!0});return c.current=e,e.on("connect",(()=>{e.emit("subscribe-logs",{processId:s,logType:k}),w(!0)})),e.on("log-line",(e=>{e.processId===s&&e.logType===k&&u((t=>[...t,e.line]))})),()=>{e.emit("unsubscribe-logs",{processId:s,logType:k}),e.disconnect()}}}),[s,i,k]),(0,r.useEffect)((()=>{g&&l.current&&(l.current.scrollTop=l.current.scrollHeight)}),[d,g]);const C=b?d.filter((e=>e.toLowerCase().includes(b.toLowerCase()))):d;return(0,ka.jsxs)("div",{children:[(0,ka.jsx)(Mj,{title:"Log Streaming",subtitle:j?"".concat(a?"Remote \xb7 ".concat(i):"Local"," \u2014 ").concat(j):"Select a process from the sidebar",actions:(0,ka.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,ka.jsxs)("select",{value:k,onChange:e=>S(e.target.value),className:"h-7 px-2 pr-7 text-xs rounded border\r bg-white dark:bg-neutral-800\r border-neutral-200 dark:border-neutral-700\r text-neutral-900 dark:text-neutral-100\r focus:outline-none focus:ring-1 focus:ring-primary-500",children:[(0,ka.jsx)("option",{value:"out",children:"Standard out"}),(0,ka.jsx)("option",{value:"err",children:"Standard err"})]}),"local"===i&&(0,ka.jsx)("button",{onClick:()=>{var e;if(null===s||"local"!==i)return;const t=y?"unsubscribe-logs":"subscribe-logs";null===(e=c.current)||void 0===e||e.emit(t,{processId:s,logType:k}),w((e=>!e))},disabled:null===s,className:"h-7 px-3 text-xs font-medium rounded border transition-colors\n disabled:opacity-50\n ".concat(y?"border-red-500 text-red-500 hover:bg-red-500/10":"border-primary-500 text-primary-500 hover:bg-primary-500/10"),children:y?"Stop Stream":"Live Stream"})]})}),(0,ka.jsxs)("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2 mb-3",children:[(0,ka.jsxs)("div",{className:"relative flex-1",children:[(0,ka.jsx)(TA,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-neutral-400 pointer-events-none"}),(0,ka.jsx)("input",{type:"text",placeholder:"Filter logs...",value:b,onChange:e=>v(e.target.value),className:"w-full h-8 pl-8 pr-3 text-xs rounded border\r bg-white dark:bg-neutral-800\r border-neutral-200 dark:border-neutral-700\r text-neutral-900 dark:text-neutral-100\r placeholder-neutral-400 dark:placeholder-neutral-500\r focus:outline-none focus:ring-1 focus:ring-primary-500"})]}),(0,ka.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,ka.jsx)("button",{onClick:()=>x((e=>!e)),className:"h-8 px-2.5 text-xs font-medium rounded border transition-colors\n ".concat(g?"bg-primary-600 border-primary-600 text-white":"border-neutral-200 dark:border-neutral-700 text-neutral-600 dark:text-neutral-400 hover:bg-neutral-100 dark:hover:bg-neutral-800"),children:"Auto-scroll"}),y&&(0,ka.jsxs)("span",{className:"flex items-center gap-1 px-2 text-xs text-emerald-500",children:[(0,ka.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"live"]}),(0,ka.jsx)("button",{onClick:async()=>{if(null!==s)try{p(!0),m("");let e=[];if("local"===i){e=(await tr.get("/api/logs/".concat(s,"/").concat(k))).data.logs||[]}else{const t=await tr.get("/api/remote/".concat(i,"/logs/").concat(s));e="out"===k?t.data.stdout||[]:t.data.stderr||[]}u(e),p(!1)}catch(NR){var e,t;m((null===(e=NR.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||"Failed to fetch logs"),p(!1)}},title:"Refresh",className:"h-8 w-8 flex items-center justify-center rounded border\r border-neutral-200 dark:border-neutral-700 text-neutral-500 dark:text-neutral-400\r hover:bg-neutral-100 dark:hover:bg-neutral-800 transition-colors",children:(0,ka.jsx)(eA,{className:"h-3.5 w-3.5"})}),(0,ka.jsx)("button",{onClick:()=>u([]),title:"Clear",className:"h-8 w-8 flex items-center justify-center rounded border\r border-neutral-200 dark:border-neutral-700 text-neutral-500 dark:text-neutral-400\r hover:bg-neutral-100 dark:hover:bg-neutral-800 transition-colors",children:(0,ka.jsx)(d_,{className:"h-3.5 w-3.5"})}),(0,ka.jsx)("button",{onClick:()=>{if(null===s)return;const e=new Blob([d.join("\n")],{type:"text/plain;charset=utf-8"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download="".concat(j||s,"-").concat(k,".log"),document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)},disabled:null===s||0===d.length,title:"Download",className:"h-8 w-8 flex items-center justify-center rounded border\r border-neutral-200 dark:border-neutral-700 text-neutral-500 dark:text-neutral-400\r hover:bg-neutral-100 dark:hover:bg-neutral-800 transition-colors\r disabled:opacity-40 disabled:cursor-not-allowed",children:(0,ka.jsx)(k_,{className:"h-3.5 w-3.5"})})]})]}),(0,ka.jsx)("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800 overflow-hidden",children:h?(0,ka.jsx)("div",{className:"flex items-center justify-center h-64",children:(0,ka.jsxs)("div",{className:"flex items-center gap-2 text-xs text-neutral-500 dark:text-neutral-400",children:[(0,ka.jsxs)("svg",{className:"h-4 w-4 animate-spin text-primary-500",viewBox:"0 0 24 24",fill:"none",children:[(0,ka.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,ka.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),"Loading logs..."]})}):f?(0,ka.jsxs)("div",{className:"flex items-center gap-2 p-4 text-xs text-red-500 dark:text-red-400 bg-red-50 dark:bg-red-900/10",children:[(0,ka.jsx)("span",{className:"font-medium",children:"Error:"})," ",f]}):null===s?(0,ka.jsx)("div",{className:"flex items-center justify-center h-64 text-xs text-neutral-400 dark:text-neutral-500",children:"Select a process from the sidebar to view logs"}):(0,ka.jsx)("div",{ref:l,className:"h-[calc(100vh-16rem)] overflow-y-auto bg-neutral-950 p-3 font-mono text-xs leading-relaxed",children:0===C.length?(0,ka.jsx)("span",{className:"text-neutral-600 italic",children:"No logs available"}):C.map(((e,t)=>(0,ka.jsx)("div",{className:"whitespace-pre-wrap break-all ".concat(B_(k,e)),children:e},t)))})})]})},H_=["title","titleId"];function V_(e,t){let{title:n,titleId:o}=e,a=rr(e,H_);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z"}))}const U_=r.forwardRef(V_),q_=["title","titleId"];function $_(e,t){let{title:n,titleId:o}=e,a=rr(e,q_);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 6a7.5 7.5 0 1 0 7.5 7.5h-7.5V6Z"}),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5H21A7.5 7.5 0 0 0 13.5 3v7.5Z"}))}const K_=r.forwardRef($_),X_=["title","titleId"];function Y_(e,t){let{title:n,titleId:o}=e,a=rr(e,X_);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 15a4.5 4.5 0 0 0 4.5 4.5H18a3.75 3.75 0 0 0 1.332-7.257 3 3 0 0 0-3.758-3.848 5.25 5.25 0 0 0-10.233 2.33A4.502 4.502 0 0 0 2.25 15Z"}))}const G_=r.forwardRef(Y_),Z_=["title","titleId"];function J_(e,t){let{title:n,titleId:o}=e,a=rr(e,Z_);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v17.25m0 0c-1.472 0-2.882.265-4.185.75M12 20.25c1.472 0 2.882.265 4.185.75M18.75 4.97A48.416 48.416 0 0 0 12 4.5c-2.291 0-4.545.16-6.75.47m13.5 0c1.01.143 2.01.317 3 .52m-3-.52 2.62 10.726c.122.499-.106 1.028-.589 1.202a5.988 5.988 0 0 1-2.031.352 5.988 5.988 0 0 1-2.031-.352c-.483-.174-.711-.703-.59-1.202L18.75 4.971Zm-16.5.52c.99-.203 1.99-.377 3-.52m0 0 2.62 10.726c.122.499-.106 1.028-.589 1.202a5.989 5.989 0 0 1-2.031.352 5.989 5.989 0 0 1-2.031-.352c-.483-.174-.711-.703-.59-1.202L5.25 4.971Z"}))}const Q_=r.forwardRef(J_),eE=["title","titleId"];function tE(e,t){let{title:n,titleId:o}=e,a=rr(e,eE);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const nE=r.forwardRef(tE),rE=["title","titleId"];function oE(e,t){let{title:n,titleId:o}=e,a=rr(e,rE);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const aE=r.forwardRef(oE),iE=["title","titleId"];function sE(e,t){let{title:n,titleId:o}=e,a=rr(e,iE);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 17.25v-.228a4.5 4.5 0 0 0-.12-1.03l-2.268-9.64a3.375 3.375 0 0 0-3.285-2.602H7.923a3.375 3.375 0 0 0-3.285 2.602l-2.268 9.64a4.5 4.5 0 0 0-.12 1.03v.228m19.5 0a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3m19.5 0a3 3 0 0 0-3-3H5.25a3 3 0 0 0-3 3m16.5 0h.008v.008h-.008v-.008Zm-3 0h.008v.008h-.008v-.008Z"}))}const lE=r.forwardRef(sE),cE=e=>{let{onItemClick:t,collapsed:n=!1}=e;const o=oo(),a=so(),i=o.pathname,s=()=>null===t||void 0===t?void 0:t(),[l,d]=(0,r.useState)([]),[u,h]=(0,r.useState)(new Set(["local"])),[p,f]=(0,r.useState)(!1);(0,r.useEffect)((()=>{let e=!1;return(async()=>{f(!0);try{const[t,n]=await Promise.all([tr.get("/api/processes"),tr.get("/api/remote/connections").catch((()=>({data:[]})))]),r=[{serverId:"local",serverName:"Local Server",isRemote:!1,connected:!0,processes:t.data.map((e=>{var t,n,r;return{id:e.pm_id,name:e.name,status:null!==(t=null!==(n=null===(r=e.pm2_env)||void 0===r?void 0:r.status)&&void 0!==n?n:e.status)&&void 0!==t?t:"unknown"}})),loading:!1}],o=n.data;for(const e of o)r.push({serverId:e.id,serverName:e.name,isRemote:!0,connected:e.connected,processes:[],loading:e.connected});e||d(r);const a=o.filter((e=>e.connected));if(a.length>0){const t=await Promise.allSettled(a.map((e=>tr.get("/api/remote/".concat(e.id,"/processes")).then((t=>({id:e.id,data:t.data}))))));e||d((e=>e.map((e=>{const n=t.find((t=>"fulfilled"===t.status&&t.value.id===e.serverId));if(!n||"fulfilled"!==n.status)return c(c({},e),{},{loading:!1});const r=n.value.data.map((e=>{var t,n,r;return{id:e.pm_id,name:e.name,status:null!==(t=null!==(n=null===(r=e.pm2_env)||void 0===r?void 0:r.status)&&void 0!==n?n:e.status)&&void 0!==t?t:"unknown"}}));return c(c({},e),{},{processes:r,loading:!1})}))))}}catch(t){}finally{e||f(!1)}})(),()=>{e=!0}}),[]);const m=[{label:"Processes",path:"/processes",icon:U_},{label:"Logs",path:"/logs",icon:K_},{label:"Remote Servers",path:"/remote",icon:G_},{label:"Metrics",path:"/metrics",icon:Dj},{label:"Deploy App",path:"/deploy",icon:p_},{label:"PM2 Modules",path:"/modules",icon:g_},{label:"Ecosystem Config",path:"/ecosystem",icon:hA},{label:"Cluster",path:"/cluster",icon:Uj},{label:"Cron Jobs",path:"/cron-jobs",icon:Lj},{label:"Load Balancing",path:"/load-balancing-guide",icon:Q_}];return(0,ka.jsxs)("div",{className:"h-full flex flex-col bg-white dark:bg-neutral-900 overflow-hidden",children:[(0,ka.jsxs)("nav",{className:"px-1.5 py-2 overflow-x-hidden shrink-0",children:[!n&&(0,ka.jsx)("p",{className:"px-1.5 mb-1 text-xs font-semibold text-neutral-400 dark:text-neutral-600 uppercase tracking-widest whitespace-nowrap",children:"Management"}),(0,ka.jsx)("div",{className:"space-y-0.5",children:m.map((e=>{const t=e.icon,r="/"===(o=e.path)&&("/"===i||"/processes"===i)||i===o||i.startsWith(o+"/");var o;return(0,ka.jsxs)(ca,{to:e.path,onClick:s,title:n?e.label:void 0,className:"\n flex items-center gap-2 rounded-md text-xs font-medium\n transition-colors duration-100\n ".concat(n?"px-0 py-1.5 justify-center w-full":"px-2 py-1.5","\n ").concat(r?"bg-primary-600 text-white":"text-neutral-600 dark:text-neutral-400 hover:bg-neutral-100 dark:hover:bg-neutral-800 hover:text-neutral-900 dark:hover:text-neutral-100","\n "),children:[(0,ka.jsx)(t,{className:"h-3.5 w-3.5 shrink-0 ".concat(r?"text-white":"text-neutral-500 dark:text-neutral-500")}),!n&&(0,ka.jsx)("span",{className:"truncate",children:e.label})]},e.path)}))})]}),!n&&(0,ka.jsxs)("div",{className:"flex-1 min-h-0 flex flex-col border-t border-neutral-100 dark:border-neutral-800",children:[(0,ka.jsx)("p",{className:"px-3 pt-2 pb-1 text-xs font-semibold text-neutral-400 dark:text-neutral-600 uppercase tracking-widest shrink-0",children:"Processes"}),(0,ka.jsx)("div",{className:"flex-1 overflow-y-auto",children:p&&0===l.length?(0,ka.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,ka.jsxs)("svg",{className:"h-3.5 w-3.5 animate-spin text-primary-500",viewBox:"0 0 24 24",fill:"none",children:[(0,ka.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,ka.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}):l.map((e=>{const t=u.has(e.serverId);return(0,ka.jsxs)("div",{children:[(0,ka.jsxs)("button",{onClick:()=>{return t=e.serverId,void h((e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}));var t},className:"w-full flex items-center gap-1.5 px-2 py-1.5 text-left hover:bg-neutral-50 dark:hover:bg-neutral-800/60 transition-colors",children:[t?(0,ka.jsx)(nE,{className:"h-3 w-3 text-neutral-400 shrink-0"}):(0,ka.jsx)(aE,{className:"h-3 w-3 text-neutral-400 shrink-0"}),e.isRemote?(0,ka.jsx)(G_,{className:"h-3.5 w-3.5 text-blue-500 shrink-0"}):(0,ka.jsx)(lE,{className:"h-3.5 w-3.5 text-emerald-500 shrink-0"}),(0,ka.jsx)("span",{className:"flex-1 text-xs font-medium text-neutral-700 dark:text-neutral-300 truncate",children:e.serverName}),e.isRemote&&(0,ka.jsx)("span",{className:"h-1.5 w-1.5 rounded-full shrink-0 ".concat(e.connected?"bg-emerald-500":"bg-neutral-400")})]}),t&&(0,ka.jsx)("div",{className:"pb-0.5",children:e.connected?e.loading?(0,ka.jsx)("p",{className:"pl-8 pr-2 py-1 text-xs text-neutral-400 animate-pulse",children:"Loading..."}):0===e.processes.length?(0,ka.jsx)("p",{className:"pl-8 pr-2 py-1 text-xs text-neutral-400 italic",children:"No processes"}):e.processes.map((t=>{const n=i.startsWith("/logs/remote/"),r=!n&&i.startsWith("/logs/"),o="local"===e.serverId&&r&&i==="/logs/".concat(t.id)||"local"!==e.serverId&&n&&i==="/logs/remote/".concat(e.serverId,"/").concat(t.id);return(0,ka.jsxs)("button",{onClick:()=>((e,t)=>{s(),a("local"===e?"/logs/".concat(t.id):"/logs/remote/".concat(e,"/").concat(t.id))})(e.serverId,t),className:"w-full flex items-center gap-1.5 pl-7 pr-2 py-1.5 text-left transition-colors\n ".concat(o?"bg-primary-50 dark:bg-primary-900/20 text-primary-700 dark:text-primary-300":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60 text-neutral-600 dark:text-neutral-400"),children:[(0,ka.jsx)("span",{className:"h-1.5 w-1.5 rounded-full shrink-0 ".concat((l=t.status,"online"===l?"bg-emerald-500":"stopping"===l||"launching"===l?"bg-amber-400":"bg-neutral-500"))}),(0,ka.jsx)(Dj,{className:"h-3 w-3 shrink-0 opacity-40"}),(0,ka.jsx)("span",{className:"text-xs truncate",children:t.name})]},t.id);var l})):(0,ka.jsx)("p",{className:"pl-8 pr-2 py-1 text-xs text-neutral-400 italic",children:"Not connected"})})]},e.serverId)}))})]})]})};function dE(e){return(0,ni.Ay)("MuiLinearProgress",e)}(0,$a.A)("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);var uE,hE,pE,fE,mE,gE;const xE=["className","color","value","valueBuffer","variant"];let bE,vE,yE,wE,kE,SE;const jE=(0,Ri.i7)(bE||(bE=uE||(uE=wi(["\n 0% {\n left: -35%;\n right: 100%;\n }\n\n 60% {\n left: 100%;\n right: -90%;\n }\n\n 100% {\n left: 100%;\n right: -90%;\n }\n"])))),AE=(0,Ri.i7)(vE||(vE=hE||(hE=wi(["\n 0% {\n left: -200%;\n right: 100%;\n }\n\n 60% {\n left: 107%;\n right: -8%;\n }\n\n 100% {\n left: 107%;\n right: -8%;\n }\n"])))),CE=(0,Ri.i7)(yE||(yE=pE||(pE=wi(["\n 0% {\n opacity: 1;\n background-position: 0 -23px;\n }\n\n 60% {\n opacity: 0;\n background-position: 0 -23px;\n }\n\n 100% {\n opacity: 1;\n background-position: -200px -23px;\n }\n"])))),_E=(e,t)=>"inherit"===t?"currentColor":e.vars?e.vars.palette.LinearProgress["".concat(t,"Bg")]:"light"===e.palette.mode?(0,Ja.a)(e.palette[t].main,.62):(0,Ja.e$)(e.palette[t].main,.5),EE=(0,Qa.Ay)("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t["color".concat((0,si.A)(n.color))],t[n.variant]]}})((e=>{let{ownerState:t,theme:n}=e;return(0,ba.A)({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},backgroundColor:_E(n,t.color)},"inherit"===t.color&&"buffer"!==t.variant&&{backgroundColor:"none","&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}},"buffer"===t.variant&&{backgroundColor:"transparent"},"query"===t.variant&&{transform:"rotate(180deg)"})})),ME=(0,Qa.Ay)("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.dashed,t["dashedColor".concat((0,si.A)(n.color))]]}})((e=>{let{ownerState:t,theme:n}=e;const r=_E(n,t.color);return(0,ba.A)({position:"absolute",marginTop:0,height:"100%",width:"100%"},"inherit"===t.color&&{opacity:.3},{backgroundImage:"radial-gradient(".concat(r," 0%, ").concat(r," 16%, transparent 42%)"),backgroundSize:"10px 10px",backgroundPosition:"0 -23px"})}),(0,Ri.AH)(wE||(wE=fE||(fE=wi(["\n animation: "," 3s infinite linear;\n "]))),CE)),NE=(0,Qa.Ay)("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.bar,t["barColor".concat((0,si.A)(n.color))],("indeterminate"===n.variant||"query"===n.variant)&&t.bar1Indeterminate,"determinate"===n.variant&&t.bar1Determinate,"buffer"===n.variant&&t.bar1Buffer]}})((e=>{let{ownerState:t,theme:n}=e;return(0,ba.A)({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",backgroundColor:"inherit"===t.color?"currentColor":(n.vars||n).palette[t.color].main},"determinate"===t.variant&&{transition:"transform .".concat(4,"s linear")},"buffer"===t.variant&&{zIndex:1,transition:"transform .".concat(4,"s linear")})}),(e=>{let{ownerState:t}=e;return("indeterminate"===t.variant||"query"===t.variant)&&(0,Ri.AH)(kE||(kE=mE||(mE=wi(["\n width: auto;\n animation: "," 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n "]))),jE)})),RE=(0,Qa.Ay)("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.bar,t["barColor".concat((0,si.A)(n.color))],("indeterminate"===n.variant||"query"===n.variant)&&t.bar2Indeterminate,"buffer"===n.variant&&t.bar2Buffer]}})((e=>{let{ownerState:t,theme:n}=e;return(0,ba.A)({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},"buffer"!==t.variant&&{backgroundColor:"inherit"===t.color?"currentColor":(n.vars||n).palette[t.color].main},"inherit"===t.color&&{opacity:.3},"buffer"===t.variant&&{backgroundColor:_E(n,t.color),transition:"transform .".concat(4,"s linear")})}),(e=>{let{ownerState:t}=e;return("indeterminate"===t.variant||"query"===t.variant)&&(0,Ri.AH)(SE||(SE=gE||(gE=wi(["\n width: auto;\n animation: "," 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;\n "]))),AE)})),PE=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiLinearProgress"}),{className:r,color:o="primary",value:a,valueBuffer:i,variant:s="indeterminate"}=n,l=(0,nr.A)(n,xE),c=(0,ba.A)({},n,{color:o,variant:s}),d=(e=>{const{classes:t,variant:n,color:r}=e,o={root:["root","color".concat((0,si.A)(r)),n],dashed:["dashed","dashedColor".concat((0,si.A)(r))],bar1:["bar","barColor".concat((0,si.A)(r)),("indeterminate"===n||"query"===n)&&"bar1Indeterminate","determinate"===n&&"bar1Determinate","buffer"===n&&"bar1Buffer"],bar2:["bar","buffer"!==n&&"barColor".concat((0,si.A)(r)),"buffer"===n&&"color".concat((0,si.A)(r)),("indeterminate"===n||"query"===n)&&"bar2Indeterminate","buffer"===n&&"bar2Buffer"]};return(0,Za.A)(o,dE,t)})(c),u=Ea(),h={},p={bar1:{},bar2:{}};if("determinate"===s||"buffer"===s)if(void 0!==a){h["aria-valuenow"]=Math.round(a),h["aria-valuemin"]=0,h["aria-valuemax"]=100;let e=a-100;u&&(e=-e),p.bar1.transform="translateX(".concat(e,"%)")}else 0;if("buffer"===s)if(void 0!==i){let e=(i||0)-100;u&&(e=-e),p.bar2.transform="translateX(".concat(e,"%)")}else 0;return(0,ka.jsxs)(EE,(0,ba.A)({className:(0,za.A)(d.root,r),ownerState:c,role:"progressbar"},h,{ref:t},l,{children:["buffer"===s?(0,ka.jsx)(ME,{className:d.dashed,ownerState:c}):null,(0,ka.jsx)(NE,{className:d.bar1,ownerState:c,style:p.bar1}),"determinate"===s?null:(0,ka.jsx)(RE,{className:d.bar2,ownerState:c,style:p.bar2})]}))})),OE=PE;var TE=n(6974),LE=n(7021),IE=n(7940),zE=n(9719),DE=n(9778),FE=n(6170),BE=n(7193),WE=n(7555),HE=n(3531);const VE=[{id:"general",label:"General",icon:(0,ka.jsx)(TE.A,{sx:{fontSize:16}})},{id:"appearance",label:"Appearance",icon:(0,ka.jsx)(LE.A,{sx:{fontSize:16}})},{id:"pm2",label:"PM2",icon:(0,ka.jsx)(IE.A,{sx:{fontSize:16}})},{id:"advanced",label:"Advanced",icon:(0,ka.jsx)(zE.A,{sx:{fontSize:16}})},{id:"updates",label:"Updates",icon:(0,ka.jsx)(BE.A,{sx:{fontSize:16}})},{id:"security",label:"Security",icon:(0,ka.jsx)(WE.A,{sx:{fontSize:16}})}],UE=(e,t)=>{var n;return null!==(n=localStorage.getItem(e))&&void 0!==n?n:t},qE=e=>{let{label:t,description:n,control:r,last:o}=e;return(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:1.5,gap:3},children:[(0,ka.jsxs)(Ga,{sx:{minWidth:0},children:[(0,ka.jsx)(Tp,{variant:"body2",sx:{fontWeight:500},children:t}),n&&(0,ka.jsx)(Tp,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:.25},children:n})]}),(0,ka.jsx)(Ga,{sx:{flexShrink:0},children:r})]}),!o&&(0,ka.jsx)(WC,{})]})},$E=e=>{let{title:t,children:n}=e;return(0,ka.jsxs)(ii,{variant:"outlined",sx:{mb:2},children:[(0,ka.jsx)(Ga,{sx:{px:2,py:1.25,borderBottom:1,borderColor:"divider",bgcolor:"action.hover"},children:(0,ka.jsx)(Tp,{variant:"subtitle2",color:"text.secondary",sx:{textTransform:"uppercase",letterSpacing:"0.05em",fontSize:"0.6875rem"},children:t})}),(0,ka.jsx)(Ga,{sx:{px:2},children:n})]})},KE=()=>{var e;const[t,n]=(0,r.useState)((()=>{const e=new URLSearchParams(window.location.search).get("section");return["general","appearance","pm2","advanced","updates","security"].includes(e)?e:"general"})),[o,a]=(0,r.useState)(null),[i,s]=(0,r.useState)(""),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)(""),[h,p]=(0,r.useState)(""),[f,m]=(0,r.useState)(!1),[g,x]=(0,r.useState)(!1),[b,v]=(0,r.useState)(null),[y,w]=(0,r.useState)(null),[k,S]=(0,r.useState)(0),[j,A]=(0,r.useState)(!1),[C,_]=(0,r.useState)(null),[E,M]=(0,r.useState)(""),[N,R]=(0,r.useState)(""),[P,O]=(0,r.useState)(""),[T,L]=(0,r.useState)(!1),[I,z]=(0,r.useState)(!1);r.useEffect((()=>{"security"===t&&null===o&&fetch("/api/auth/status").then((e=>e.json())).then((e=>{var t,n,r;a(null!==(t=e.passwordSet)&&void 0!==t&&t),_(null!==(n=e.pinSet)&&void 0!==n&&n),S(null!==(r=e.autoLockMinutes)&&void 0!==r?r:0)})).catch((()=>a(!1)))}),[t,o]);const D=async()=>{if(v(null),w(null),/^\d{4}$/.test(E))if(E===N){L(!0);try{const e=await fetch("/api/auth/pin/set",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pin:E})}),t=await e.json();t.success?(_(!0),M(""),R(""),w(C?"PIN changed successfully":"PIN protection enabled")):v(t.error||"Failed to save PIN")}catch(e){v("Network error \u2014 could not reach the server")}finally{L(!1)}}else v("PINs do not match");else v("PIN must be exactly 4 digits")},F=async()=>{if(v(null),w(null),P){z(!0);try{const e=await fetch("/api/auth/pin/remove",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:P})}),t=await e.json();t.success?(_(!1),O(""),w("PIN protection removed")):v(t.error||"Failed to remove PIN")}catch(e){v("Network error \u2014 could not reach the server")}finally{z(!1)}}else v("Enter your current password to remove the PIN")},B=async()=>{if(v(null),w(null),i.length<4)v("Password must be at least 4 characters");else if(i===l){m(!0);try{const e={password:i};o&&(e.currentPassword=d);const t=await fetch("/api/auth/set",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json();n.success?(a(!0),s(""),c(""),u(""),w(o?"Password changed successfully":"Password protection enabled")):v(n.error||"Failed to save password")}catch(e){v("Network error \u2014 could not reach the server")}finally{m(!1)}}else v("Passwords do not match")},W=async()=>{if(v(null),w(null),h){x(!0);try{const e=await fetch("/api/auth/remove",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:h})}),t=await e.json();t.success?(a(!1),p(""),w("Password protection removed")):v(t.error||"Failed to remove password")}catch(e){v("Network error \u2014 could not reach the server")}finally{x(!1)}}else v("Enter your current password to remove protection")},[H,V]=(0,r.useState)(null),[U,q]=(0,r.useState)(!1),[$,K]=(0,r.useState)(null),[X,Y]=(0,r.useState)([]),[G,Z]=(0,r.useState)(!1),[J,Q]=(0,r.useState)(!1),ee=(0,r.useRef)(null);(0,r.useEffect)((()=>{var e;null===(e=ee.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})}),[X]);const[te,ne]=(0,r.useState)("true"===UE("autoRefresh","true")),[re,oe]=(0,r.useState)(UE("refreshInterval","3000")),[ae,ie]=(0,r.useState)(UE("logLines","100")),[se,le]=(0,r.useState)(UE("pm2Path","pm2")),[ce,de]=(0,r.useState)(UE("theme","blue")),[ue,he]=(0,r.useState)("true"===UE("compactMode","false")),[pe,fe]=(0,r.useState)("true"===UE("showTimestamps","true")),[me,ge]=(0,r.useState)(!1),[xe,be]=(0,r.useState)("Settings saved"),ve=(0,r.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Saved";localStorage.setItem(e,t),be(n),ge(!0)}),[]),ye=e=>{de(e.target.value),ve("theme",e.target.value)},we=()=>{Object.entries({autoRefresh:"true",refreshInterval:"3000",logLines:"100",pm2Path:"pm2",theme:"blue",compactMode:"false",showTimestamps:"true"}).forEach((e=>{let[t,n]=e;return localStorage.setItem(t,n)})),ne(!0),oe("3000"),ie("100"),le("pm2"),de("blue"),he(!1),fe(!0),be("Reset to defaults"),ge(!0)},ke=()=>{localStorage.clear(),be("All local data cleared"),ge(!0)},Se=async()=>{q(!0),K(null),V(null);try{const e=await fetch("/api/update/check"),t=await e.json();t.success?V(t.data):K(t.error||"Failed to check for updates")}catch(e){K("Network error \u2014 could not reach npm registry")}finally{q(!1)}},je=async()=>{Z(!0),Y([]);try{const n=await fetch("/api/update/install",{method:"POST"});if(!n.body)throw new Error("No response body");const r=n.body.getReader(),o=new TextDecoder;let a="";for(;;){var e;const{done:n,value:i}=await r.read();if(n)break;a+=o.decode(i,{stream:!0});const s=a.split("\n");a=null!==(e=s.pop())&&void 0!==e?e:"";for(const e of s){const n=e.trim();if(n)try{const e=JSON.parse(n);Y((t=>[...t,e]))}catch(t){}}}}catch(NR){Y((t=>[...t,{type:"fail",message:"Stream error: ".concat(NR.message)}]))}finally{Z(!1),Se()}},Ae=async()=>{Q(!0);try{await fetch("/api/update/restart",{method:"POST"})}catch(t){}const e=setInterval((async()=>{try{await fetch("/api/update/check"),clearInterval(e),Q(!1),window.location.reload()}catch(t){}}),1500)};return(0,ka.jsxs)(Ga,{children:[(0,ka.jsx)(Mj,{title:"Settings",subtitle:"Application preferences and configuration"}),(0,ka.jsxs)(Ga,{sx:{display:"flex",gap:2,alignItems:"flex-start"},children:[(0,ka.jsx)(ii,{variant:"outlined",sx:{width:168,flexShrink:0,overflow:"hidden"},children:VE.map(((e,o)=>(0,ka.jsxs)(r.Fragment,{children:[(0,ka.jsxs)(Ga,{onClick:()=>n(e.id),sx:{display:"flex",alignItems:"center",gap:1.25,px:1.75,py:1.25,cursor:"pointer",bgcolor:t===e.id?"primary.main":"transparent",color:t===e.id?"primary.contrastText":"text.secondary",transition:"background 0.15s","&:hover":t!==e.id?{bgcolor:"action.hover",color:"text.primary"}:{}},children:[e.icon,(0,ka.jsx)(Tp,{variant:"body2",sx:{fontWeight:t===e.id?600:400,fontSize:"0.8125rem"},children:e.label}),t===e.id&&(0,ka.jsx)(DE.A,{sx:{fontSize:13,ml:"auto",opacity:.8}})]}),o<VE.length-1&&(0,ka.jsx)(WC,{})]},e.id)))}),(0,ka.jsxs)(Ga,{sx:{flex:1,minWidth:0},children:[(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,ka.jsx)(Tp,{variant:"subtitle1",sx:{fontWeight:600},children:null===(e=VE.find((e=>e.id===t)))||void 0===e?void 0:e.label}),(0,ka.jsx)(ap,{label:"Auto-saved",size:"small",variant:"outlined",sx:{fontSize:"0.6875rem",height:18,opacity:.5}})]}),(()=>{switch(t){case"general":return(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsxs)($E,{title:"Dashboard",children:[(0,ka.jsx)(qE,{label:"Auto Refresh",description:"Automatically refresh process data at a set interval",control:(0,ka.jsx)(IC,{size:"small",checked:te,onChange:e=>{ne(e.target.checked),ve("autoRefresh",String(e.target.checked))}})}),(0,ka.jsx)(qE,{label:"Refresh Interval",description:"How often to poll for updated process data",last:!0,control:(0,ka.jsx)(vs,{size:"small",sx:{minWidth:130},children:(0,ka.jsxs)(Jd,{value:re,disabled:!te,onChange:e=>{oe(e.target.value),ve("refreshInterval",e.target.value)},children:[(0,ka.jsx)(cu,{value:"1000",children:"Every 1s"}),(0,ka.jsx)(cu,{value:"2000",children:"Every 2s"}),(0,ka.jsx)(cu,{value:"3000",children:"Every 3s"}),(0,ka.jsx)(cu,{value:"5000",children:"Every 5s"}),(0,ka.jsx)(cu,{value:"10000",children:"Every 10s"}),(0,ka.jsx)(cu,{value:"30000",children:"Every 30s"})]})})})]}),(0,ka.jsxs)($E,{title:"Logs",children:[(0,ka.jsx)(qE,{label:"Log Lines to Display",description:"Maximum number of log lines shown in the log viewer",control:(0,ka.jsx)(vs,{size:"small",sx:{minWidth:100},children:(0,ka.jsxs)(Jd,{value:ae,onChange:e=>{ie(e.target.value),ve("logLines",e.target.value)},children:[(0,ka.jsx)(cu,{value:"50",children:"50"}),(0,ka.jsx)(cu,{value:"100",children:"100"}),(0,ka.jsx)(cu,{value:"200",children:"200"}),(0,ka.jsx)(cu,{value:"500",children:"500"}),(0,ka.jsx)(cu,{value:"1000",children:"1000"})]})})}),(0,ka.jsx)(qE,{label:"Show Timestamps",description:"Display timestamps alongside each log line",last:!0,control:(0,ka.jsx)(IC,{size:"small",checked:pe,onChange:e=>{fe(e.target.checked),ve("showTimestamps",String(e.target.checked))}})})]})]});case"appearance":return(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsxs)($E,{title:"Theme",children:[(0,ka.jsx)(qE,{label:"Compact Mode",description:"Reduce padding and spacing for a denser layout",control:(0,ka.jsx)(IC,{size:"small",checked:ue,onChange:e=>{he(e.target.checked),ve("compactMode",String(e.target.checked))}})}),(0,ka.jsx)(qE,{label:"Accent Color",description:"Primary color used for highlights and active states",last:!0,control:(0,ka.jsx)(vs,{size:"small",sx:{minWidth:130},children:(0,ka.jsxs)(Jd,{value:ce,onChange:ye,children:[(0,ka.jsx)(cu,{value:"blue",children:(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,ka.jsx)(Ga,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:"#3b82f6"}}),"Blue"]})}),(0,ka.jsx)(cu,{value:"purple",children:(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,ka.jsx)(Ga,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:"#8b5cf6"}}),"Purple"]})}),(0,ka.jsx)(cu,{value:"green",children:(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,ka.jsx)(Ga,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:"#22c55e"}}),"Green"]})}),(0,ka.jsx)(cu,{value:"orange",children:(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,ka.jsx)(Ga,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:"#f97316"}}),"Orange"]})})]})})})]}),(0,ka.jsx)(ii,{variant:"outlined",sx:{p:2},children:(0,ka.jsx)(Tp,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:1.5},children:"Dark / light mode is toggled from the top-right sun/moon icon in the navigation bar."})})]});case"pm2":return(0,ka.jsx)($E,{title:"PM2 Executable",children:(0,ka.jsx)(qE,{label:"PM2 Path",description:"Absolute path or command name for the PM2 binary",last:!0,control:(0,ka.jsx)(_C,{size:"small",value:se,onChange:e=>le(e.target.value),onBlur:e=>ve("pm2Path",e.target.value),placeholder:"pm2",sx:{width:200},inputProps:{style:{fontFamily:"monospace",fontSize:"0.8125rem"}}})})});case"advanced":return(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsx)($E,{title:"Reset",children:(0,ka.jsx)(qE,{label:"Reset to Defaults",description:"Restore all settings to their original default values",last:!0,control:(0,ka.jsx)(ds,{variant:"outlined",size:"small",startIcon:(0,ka.jsx)(FE.A,{fontSize:"small"}),onClick:we,children:"Reset"})})}),(0,ka.jsx)($E,{title:"Data",children:(0,ka.jsx)(qE,{label:"Clear Local Storage",description:"Wipe all locally stored data including preferences and cached values",last:!0,control:(0,ka.jsx)(ds,{variant:"outlined",size:"small",color:"error",startIcon:(0,ka.jsx)(zE.A,{fontSize:"small"}),onClick:ke,children:"Clear All"})})}),(0,ka.jsx)(ii,{variant:"outlined",sx:{p:2},children:(0,ka.jsxs)(Tp,{variant:"caption",color:"text.secondary",children:[(0,ka.jsx)("strong",{children:"Note:"})," Clearing local storage will remove all saved preferences. The page will revert to defaults on next load."]})})]});case"updates":{const e=X[X.length-1],t="done"===(null===e||void 0===e?void 0:e.type),n="fail"===(null===e||void 0===e?void 0:e.type);return(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsxs)($E,{title:"Version",children:[(0,ka.jsx)(qE,{label:"Current Version",description:"The version of ezpm2gui currently running",control:(0,ka.jsx)(ap,{label:H?"v".concat(H.currentVersion):"unknown",size:"small",variant:"outlined",sx:{fontFamily:"monospace",fontSize:"0.75rem"}})}),(0,ka.jsx)(qE,{label:"Latest on npm",description:"The most recent published version from the npm registry",control:H?(0,ka.jsx)(ap,{label:"v".concat(H.latestVersion),size:"small",color:H.updateAvailable?"warning":"success",sx:{fontFamily:"monospace",fontSize:"0.75rem"}}):(0,ka.jsx)(ap,{label:"\u2014",size:"small",variant:"outlined",sx:{fontFamily:"monospace",fontSize:"0.75rem"}})}),(0,ka.jsx)(qE,{label:"Status",description:null!==H&&void 0!==H&&H.publishedAt?"Latest published: ".concat(new Date(H.publishedAt).toLocaleDateString()):"Click Check for Updates to fetch latest version info",last:!0,control:(0,ka.jsx)(ds,{variant:"outlined",size:"small",startIcon:U?(0,ka.jsx)(Xf,{size:12}):(0,ka.jsx)(BE.A,{fontSize:"small"}),onClick:Se,disabled:U||G,children:U?"Checking...":"Check for Updates"})})]}),$&&(0,ka.jsx)(Nf,{severity:"error",sx:{mb:2,fontSize:"0.8125rem"},children:$}),H&&(0,ka.jsx)(Nf,{severity:H.updateAvailable?"info":"success",sx:{mb:2,fontSize:"0.8125rem"},children:H.updateAvailable?"v".concat(H.latestVersion," is available. Install it below."):"You are on the latest version (v".concat(H.currentVersion,").")}),(null===H||void 0===H?void 0:H.updateAvailable)&&!t&&(0,ka.jsx)($E,{title:"Install Update",children:(0,ka.jsx)(qE,{label:"Install v".concat(H.latestVersion),description:"Runs npm install -g ezpm2gui@latest. Frontend assets update immediately; restart the server to apply backend changes.",last:!0,control:(0,ka.jsx)(ds,{variant:"contained",size:"small",color:"primary",startIcon:G?(0,ka.jsx)(Xf,{size:12,color:"inherit"}):(0,ka.jsx)(BE.A,{fontSize:"small"}),onClick:je,disabled:G,children:G?"Installing...":"Install Update"})})}),X.length>0&&(0,ka.jsxs)(ii,{variant:"outlined",sx:{mb:2},children:[(0,ka.jsxs)(Ga,{sx:{px:2,py:1.25,borderBottom:1,borderColor:"divider",bgcolor:"action.hover",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,ka.jsx)(Tp,{variant:"subtitle2",color:"text.secondary",sx:{textTransform:"uppercase",letterSpacing:"0.05em",fontSize:"0.6875rem"},children:"Install Output"}),G&&(0,ka.jsx)(OE,{sx:{width:80,ml:1}})]}),(0,ka.jsxs)(Ga,{sx:{p:1.5,maxHeight:260,overflowY:"auto",bgcolor:"background.default"},children:[X.map(((e,t)=>(0,ka.jsx)(Tp,{variant:"caption",component:"div",sx:{fontFamily:"monospace",fontSize:"0.75rem",lineHeight:1.6,color:"error"===e.type||"fail"===e.type?"error.main":"done"===e.type?"success.main":"text.secondary",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:e.message},t))),(0,ka.jsx)("div",{ref:ee})]})]}),t&&(0,ka.jsxs)($E,{title:"Apply Update",children:[(0,ka.jsx)(qE,{label:"Reload Page",description:"Refresh to load the updated frontend assets immediately",control:(0,ka.jsx)(ds,{variant:"outlined",size:"small",onClick:()=>window.location.reload(),children:"Reload"})}),(0,ka.jsx)(qE,{label:"Restart Server",description:"Restarts the Node.js server process to apply backend changes. Requires a process manager (PM2, systemd, nodemon) to respawn the process.",last:!0,control:(0,ka.jsx)(ds,{variant:"contained",size:"small",color:"warning",startIcon:J?(0,ka.jsx)(Xf,{size:12,color:"inherit"}):(0,ka.jsx)(FE.A,{fontSize:"small"}),onClick:Ae,disabled:J,children:J?"Restarting...":"Restart Server"})})]}),n&&(0,ka.jsxs)(Nf,{severity:"error",sx:{fontSize:"0.8125rem"},children:["Update failed. Check the output above. You can also run ",(0,ka.jsx)("code",{children:"npm install -g ezpm2gui@latest"})," manually."]})]})}case"security":{const e=null===o;return(0,ka.jsxs)(ka.Fragment,{children:[b&&(0,ka.jsx)(Nf,{severity:"error",sx:{mb:2,fontSize:"0.8125rem"},onClose:()=>v(null),children:b}),y&&(0,ka.jsx)(Nf,{severity:"success",sx:{mb:2,fontSize:"0.8125rem"},onClose:()=>w(null),children:y}),e?(0,ka.jsx)(Ga,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,ka.jsx)(Xf,{size:20})}):(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsx)($E,{title:"Status",children:(0,ka.jsx)(qE,{label:"Password Protection",description:"When enabled, a password is required to access EZ PM2 GUI",last:!0,control:(0,ka.jsx)(ap,{label:o?"Enabled":"Disabled",size:"small",color:o?"success":"default",variant:o?"filled":"outlined",icon:o?(0,ka.jsx)(WE.A,{sx:{fontSize:"12px !important"}}):(0,ka.jsx)(HE.A,{sx:{fontSize:"12px !important"}})})})}),(0,ka.jsxs)($E,{title:o?"Change Password":"Set Password",children:[o&&(0,ka.jsx)(qE,{label:"Current Password",description:"Required to change the existing password",control:(0,ka.jsx)(_C,{type:"password",size:"small",value:d,onChange:e=>u(e.target.value),placeholder:"Current password",sx:{width:200}})}),(0,ka.jsx)(qE,{label:"New Password",description:"Minimum 4 characters",control:(0,ka.jsx)(_C,{type:"password",size:"small",value:i,onChange:e=>s(e.target.value),placeholder:"New password",sx:{width:200}})}),(0,ka.jsx)(qE,{label:"Confirm Password",description:"Re-enter new password to confirm",last:!0,control:(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,ka.jsx)(_C,{type:"password",size:"small",value:l,onChange:e=>c(e.target.value),placeholder:"Confirm password",sx:{width:200}}),(0,ka.jsx)(ds,{variant:"contained",size:"small",onClick:B,disabled:f||!i||!l,startIcon:f?(0,ka.jsx)(Xf,{size:12,color:"inherit"}):(0,ka.jsx)(WE.A,{fontSize:"small"}),children:f?"Saving...":o?"Change":"Enable"})]})})]}),o&&(0,ka.jsx)($E,{title:"Remove Password",children:(0,ka.jsx)(qE,{label:"Disable Protection",description:"Enter your current password to remove password protection",last:!0,control:(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,ka.jsx)(_C,{type:"password",size:"small",value:h,onChange:e=>p(e.target.value),placeholder:"Current password",sx:{width:160}}),(0,ka.jsx)(ds,{variant:"outlined",size:"small",color:"error",onClick:W,disabled:g||!h,startIcon:g?(0,ka.jsx)(Xf,{size:12,color:"inherit"}):(0,ka.jsx)(HE.A,{fontSize:"small"}),children:g?"Removing...":"Remove"})]})})}),o&&(0,ka.jsxs)($E,{title:"PIN Protection",children:[(0,ka.jsx)(qE,{label:"PIN Status",description:"A 4-digit PIN can be used on the lock screen as an alternative to your password",control:(0,ka.jsx)(ap,{size:"small",label:C?"Enabled":"Disabled",color:C?"success":"default",variant:C?"filled":"outlined"})}),(0,ka.jsx)(qE,{label:C?"Change PIN":"Set PIN",description:"Enter a 4-digit numeric PIN",control:(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,ka.jsx)(_C,{size:"small",value:E,onChange:e=>M(e.target.value.replace(/\D/g,"").slice(0,4)),placeholder:"New PIN",inputProps:{inputMode:"numeric",pattern:"[0-9]*",maxLength:4},sx:{width:100}}),(0,ka.jsx)(_C,{size:"small",value:N,onChange:e=>R(e.target.value.replace(/\D/g,"").slice(0,4)),placeholder:"Confirm",inputProps:{inputMode:"numeric",pattern:"[0-9]*",maxLength:4},sx:{width:100}}),(0,ka.jsx)(ds,{variant:"contained",size:"small",onClick:D,disabled:T||4!==E.length||4!==N.length,startIcon:T?(0,ka.jsx)(Xf,{size:12,color:"inherit"}):void 0,children:T?"Saving...":C?"Change":"Enable"})]})}),C&&(0,ka.jsx)(qE,{label:"Remove PIN",description:"Enter your current password to remove PIN protection",last:!0,control:(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,ka.jsx)(_C,{type:"password",size:"small",value:P,onChange:e=>O(e.target.value),placeholder:"Current password",sx:{width:160}}),(0,ka.jsx)(ds,{variant:"outlined",size:"small",color:"error",onClick:F,disabled:I||!P,startIcon:I?(0,ka.jsx)(Xf,{size:12,color:"inherit"}):(0,ka.jsx)(HE.A,{fontSize:"small"}),children:I?"Removing...":"Remove"})]})}),!C&&(0,ka.jsx)(Ga,{})]}),o&&(0,ka.jsx)($E,{title:"Auto-Lock",children:(0,ka.jsx)(qE,{label:"Lock after inactivity",description:"Automatically lock the app after a period of inactivity. Set to 0 to disable.",last:!0,control:(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,ka.jsx)(_C,{type:"number",size:"small",value:k,onChange:e=>S(Math.max(0,parseInt(e.target.value,10)||0)),inputProps:{min:0,max:480,step:1},sx:{width:80}}),(0,ka.jsx)(Tp,{variant:"caption",color:"text.secondary",children:"min"}),(0,ka.jsx)(ds,{variant:"outlined",size:"small",onClick:()=>(async e=>{A(!0),v(null),w(null);try{const t=await fetch("/api/auth/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({autoLockMinutes:e})}),n=await t.json();n.success?(S(n.autoLockMinutes),w(0===n.autoLockMinutes?"Auto-lock disabled":"Auto-lock set to ".concat(n.autoLockMinutes," minute").concat(1!==n.autoLockMinutes?"s":"")),window.dispatchEvent(new CustomEvent("ezpm2_autolock_changed",{detail:{autoLockMinutes:n.autoLockMinutes}}))):v(n.error||"Failed to save auto-lock setting")}catch(t){v("Network error \u2014 could not reach the server")}finally{A(!1)}})(k),disabled:j,startIcon:j?(0,ka.jsx)(Xf,{size:12,color:"inherit"}):void 0,children:j?"Saving...":"Save"})]})})}),(0,ka.jsx)(ii,{variant:"outlined",sx:{p:2},children:(0,ka.jsx)(Tp,{variant:"caption",color:"text.secondary",children:"The password is hashed with PBKDF2 (SHA-512, 100,000 iterations) and stored server-side. It is never stored in plain text."})})]})]})}}})()]})]}),(0,ka.jsx)(t_,{open:me,autoHideDuration:2e3,onClose:()=>ge(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:(0,ka.jsx)(Nf,{onClose:()=>ge(!1),severity:"success",icon:(0,ka.jsx)(DE.A,{fontSize:"small"}),sx:{fontSize:"0.8125rem"},children:xe})})]})};const XE=r.createContext({});function YE(e){return(0,ni.Ay)("MuiAccordion",e)}const GE=(0,$a.A)("MuiAccordion",["root","rounded","expanded","disabled","gutters","region"]),ZE=["children","className","defaultExpanded","disabled","disableGutters","expanded","onChange","square","slots","slotProps","TransitionComponent","TransitionProps"],JE=(0,Qa.Ay)(ii,{name:"MuiAccordion",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{["& .".concat(GE.region)]:t.region},t.root,!n.square&&t.rounded,!n.disableGutters&&t.gutters]}})((e=>{let{theme:t}=e;const n={duration:t.transitions.duration.shortest};return{position:"relative",transition:t.transitions.create(["margin"],n),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(t.vars||t).palette.divider,transition:t.transitions.create(["opacity","background-color"],n)},"&:first-of-type":{"&::before":{display:"none"}},["&.".concat(GE.expanded)]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},["&.".concat(GE.disabled)]:{backgroundColor:(t.vars||t).palette.action.disabledBackground}}}),(e=>{let{theme:t}=e;return{variants:[{props:e=>!e.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(t.vars||t).shape.borderRadius,borderBottomRightRadius:(t.vars||t).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:e=>!e.disableGutters,style:{["&.".concat(GE.expanded)]:{margin:"16px 0"}}}]}})),QE=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiAccordion"}),{children:o,className:a,defaultExpanded:i=!1,disabled:s=!1,disableGutters:l=!1,expanded:c,onChange:d,square:u=!1,slots:h={},slotProps:p={},TransitionComponent:f,TransitionProps:m}=n,g=(0,nr.A)(n,ZE),[x,b]=(0,Fc.A)({controlled:c,default:i,name:"Accordion",state:"expanded"}),v=r.useCallback((e=>{b(!x),d&&d(e,!x)}),[x,d,b]),[y,...w]=r.Children.toArray(o),k=r.useMemo((()=>({expanded:x,disabled:s,disableGutters:l,toggle:v})),[x,s,l,v]),S=(0,ba.A)({},n,{square:u,disabled:s,disableGutters:l,expanded:x}),j=(e=>{const{classes:t,square:n,expanded:r,disabled:o,disableGutters:a}=e,i={root:["root",!n&&"rounded",r&&"expanded",o&&"disabled",!a&&"gutters"],region:["region"]};return(0,Za.A)(i,YE,t)})(S),A=(0,ba.A)({transition:f},h),C=(0,ba.A)({transition:m},p),[_,E]=cf("transition",{elementType:Hm,externalForwardedProps:{slots:A,slotProps:C},ownerState:S});return(0,ka.jsxs)(JE,(0,ba.A)({className:(0,za.A)(j.root,a),ref:t,ownerState:S,square:u},g,{children:[(0,ka.jsx)(XE.Provider,{value:k,children:y}),(0,ka.jsx)(_,(0,ba.A)({in:x,timeout:"auto"},E,{children:(0,ka.jsx)("div",{"aria-labelledby":y.props.id,id:y.props["aria-controls"],role:"region",className:j.region,children:w})}))]}))}));function eM(e){return(0,ni.Ay)("MuiAccordionSummary",e)}const tM=(0,$a.A)("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),nM=["children","className","expandIcon","focusVisibleClassName","onClick"],rM=(0,Qa.Ay)(ts,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(e,t)=>t.root})((e=>{let{theme:t}=e;const n={duration:t.transitions.duration.shortest};return{display:"flex",minHeight:48,padding:t.spacing(0,2),transition:t.transitions.create(["min-height","background-color"],n),["&.".concat(tM.focusVisible)]:{backgroundColor:(t.vars||t).palette.action.focus},["&.".concat(tM.disabled)]:{opacity:(t.vars||t).palette.action.disabledOpacity},["&:hover:not(.".concat(tM.disabled,")")]:{cursor:"pointer"},variants:[{props:e=>!e.disableGutters,style:{["&.".concat(tM.expanded)]:{minHeight:64}}}]}})),oM=(0,Qa.Ay)("div",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(e,t)=>t.content})((e=>{let{theme:t}=e;return{display:"flex",flexGrow:1,margin:"12px 0",variants:[{props:e=>!e.disableGutters,style:{transition:t.transitions.create(["margin"],{duration:t.transitions.duration.shortest}),["&.".concat(tM.expanded)]:{margin:"20px 0"}}}]}})),aM=(0,Qa.Ay)("div",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(e,t)=>t.expandIconWrapper})((e=>{let{theme:t}=e;return{display:"flex",color:(t.vars||t).palette.action.active,transform:"rotate(0deg)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shortest}),["&.".concat(tM.expanded)]:{transform:"rotate(180deg)"}}})),iM=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiAccordionSummary"}),{children:o,className:a,expandIcon:i,focusVisibleClassName:s,onClick:l}=n,c=(0,nr.A)(n,nM),{disabled:d=!1,disableGutters:u,expanded:h,toggle:p}=r.useContext(XE),f=(0,ba.A)({},n,{expanded:h,disabled:d,disableGutters:u}),m=(e=>{const{classes:t,expanded:n,disabled:r,disableGutters:o}=e,a={root:["root",n&&"expanded",r&&"disabled",!o&&"gutters"],focusVisible:["focusVisible"],content:["content",n&&"expanded",!o&&"contentGutters"],expandIconWrapper:["expandIconWrapper",n&&"expanded"]};return(0,Za.A)(a,eM,t)})(f);return(0,ka.jsxs)(rM,(0,ba.A)({focusRipple:!1,disableRipple:!0,disabled:d,component:"div","aria-expanded":h,className:(0,za.A)(m.root,a),focusVisibleClassName:(0,za.A)(m.focusVisible,s),onClick:e=>{p&&p(e),l&&l(e)},ref:t,ownerState:f},c,{children:[(0,ka.jsx)(oM,{className:m.content,ownerState:f,children:o}),i&&(0,ka.jsx)(aM,{className:m.expandIconWrapper,ownerState:f,children:i})]}))}));function sM(e){return(0,ni.Ay)("MuiAccordionDetails",e)}(0,$a.A)("MuiAccordionDetails",["root"]);const lM=["className"],cM=(0,Qa.Ay)("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(e,t)=>t.root})((e=>{let{theme:t}=e;return{padding:t.spacing(1,2,2)}})),dM=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiAccordionDetails"}),{className:r}=n,o=(0,nr.A)(n,lM),a=n,i=(e=>{const{classes:t}=e;return(0,Za.A)({root:["root"]},sM,t)})(a);return(0,ka.jsx)(cM,(0,ba.A)({className:(0,za.A)(i.root,r),ref:t,ownerState:a},o))}));function uM(e){return(0,ni.Ay)("MuiListItem",e)}const hM=(0,$a.A)("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]);const pM=(0,$a.A)("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]);function fM(e){return(0,ni.Ay)("MuiListItemSecondaryAction",e)}(0,$a.A)("MuiListItemSecondaryAction",["root","disableGutters"]);const mM=["className"],gM=(0,Qa.Ay)("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})((e=>{let{ownerState:t}=e;return(0,ba.A)({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},t.disableGutters&&{right:0})})),xM=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiListItemSecondaryAction"}),{className:o}=n,a=(0,nr.A)(n,mM),i=r.useContext(Ks),s=(0,ba.A)({},n,{disableGutters:i.disableGutters}),l=(e=>{const{disableGutters:t,classes:n}=e,r={root:["root",t&&"disableGutters"]};return(0,Za.A)(r,fM,n)})(s);return(0,ka.jsx)(gM,(0,ba.A)({className:(0,za.A)(l.root,o),ownerState:s,ref:t},a))}));xM.muiName="ListItemSecondaryAction";const bM=xM,vM=["className"],yM=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],wM=(0,Qa.Ay)("div",{name:"MuiListItem",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,"flex-start"===n.alignItems&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.button&&t.button,n.hasSecondaryAction&&t.secondaryAction]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!n.disablePadding&&(0,ba.A)({paddingTop:8,paddingBottom:8},n.dense&&{paddingTop:4,paddingBottom:4},!n.disableGutters&&{paddingLeft:16,paddingRight:16},!!n.secondaryAction&&{paddingRight:48}),!!n.secondaryAction&&{["& > .".concat(pM.root)]:{paddingRight:48}},{["&.".concat(hM.focusVisible)]:{backgroundColor:(t.vars||t).palette.action.focus},["&.".concat(hM.selected)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / ").concat(t.vars.palette.action.selectedOpacity,")"):(0,Ja.X4)(t.palette.primary.main,t.palette.action.selectedOpacity),["&.".concat(hM.focusVisible)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.focusOpacity,"))"):(0,Ja.X4)(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},["&.".concat(hM.disabled)]:{opacity:(t.vars||t).palette.action.disabledOpacity}},"flex-start"===n.alignItems&&{alignItems:"flex-start"},n.divider&&{borderBottom:"1px solid ".concat((t.vars||t).palette.divider),backgroundClip:"padding-box"},n.button&&{transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},["&.".concat(hM.selected,":hover")]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.hoverOpacity,"))"):(0,Ja.X4)(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / ").concat(t.vars.palette.action.selectedOpacity,")"):(0,Ja.X4)(t.palette.primary.main,t.palette.action.selectedOpacity)}}},n.hasSecondaryAction&&{paddingRight:48})})),kM=(0,Qa.Ay)("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"}),SM=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiListItem"}),{alignItems:o="center",autoFocus:a=!1,button:i=!1,children:s,className:l,component:c,components:d={},componentsProps:u={},ContainerComponent:h="li",ContainerProps:{className:p}={},dense:f=!1,disabled:m=!1,disableGutters:g=!1,disablePadding:x=!1,divider:b=!1,focusVisibleClassName:v,secondaryAction:y,selected:w=!1,slotProps:k={},slots:S={}}=n,j=(0,nr.A)(n.ContainerProps,vM),A=(0,nr.A)(n,yM),C=r.useContext(Ks),_=r.useMemo((()=>({dense:f||C.dense||!1,alignItems:o,disableGutters:g})),[o,C.dense,f,g]),E=r.useRef(null);(0,el.A)((()=>{a&&E.current&&E.current.focus()}),[a]);const M=r.Children.toArray(s),N=M.length&&(0,ps.A)(M[M.length-1],["ListItemSecondaryAction"]),R=(0,ba.A)({},n,{alignItems:o,autoFocus:a,button:i,dense:_.dense,disabled:m,disableGutters:g,disablePadding:x,divider:b,hasSecondaryAction:N,selected:w}),P=(e=>{const{alignItems:t,button:n,classes:r,dense:o,disabled:a,disableGutters:i,disablePadding:s,divider:l,hasSecondaryAction:c,selected:d}=e,u={root:["root",o&&"dense",!i&&"gutters",!s&&"padding",l&&"divider",a&&"disabled",n&&"button","flex-start"===t&&"alignItemsFlexStart",c&&"secondaryAction",d&&"selected"],container:["container"]};return(0,Za.A)(u,uM,r)})(R),O=(0,bi.A)(E,t),T=S.root||d.Root||wM,L=k.root||u.root||{},I=(0,ba.A)({className:(0,za.A)(P.root,L.className,l),disabled:m},A);let z=c||"li";return i&&(I.component=c||"div",I.focusVisibleClassName=(0,za.A)(hM.focusVisible,v),z=ts),N?(z=I.component||c?z:"div","li"===h&&("li"===z?z="div":"li"===I.component&&(I.component="div")),(0,ka.jsx)(Ks.Provider,{value:_,children:(0,ka.jsxs)(kM,(0,ba.A)({as:h,className:(0,za.A)(P.container,p),ref:O,ownerState:R},j,{children:[(0,ka.jsx)(T,(0,ba.A)({},L,!Fs(T)&&{as:z,ownerState:(0,ba.A)({},R,L.ownerState)},I,{children:M})),M.pop()]}))})):(0,ka.jsx)(Ks.Provider,{value:_,children:(0,ka.jsxs)(T,(0,ba.A)({},L,{as:z,ref:O},!Fs(T)&&{ownerState:(0,ba.A)({},R,L.ownerState)},I,{children:[M,y&&(0,ka.jsx)(bM,{children:y})]}))})})),jM=["className"],AM=(0,Qa.Ay)("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"flex-start"===n.alignItems&&t.alignItemsFlexStart]}})((e=>{let{theme:t,ownerState:n}=e;return(0,ba.A)({minWidth:56,color:(t.vars||t).palette.action.active,flexShrink:0,display:"inline-flex"},"flex-start"===n.alignItems&&{marginTop:8})})),CM=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiListItemIcon"}),{className:o}=n,a=(0,nr.A)(n,jM),i=r.useContext(Ks),s=(0,ba.A)({},n,{alignItems:i.alignItems}),l=(e=>{const{alignItems:t,classes:n}=e,r={root:["root","flex-start"===t&&"alignItemsFlexStart"]};return(0,Za.A)(r,tu,n)})(s);return(0,ka.jsx)(AM,(0,ba.A)({className:(0,za.A)(l.root,o),ownerState:s,ref:t},a))})),_M=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],EM=(0,Qa.Ay)("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{["& .".concat(ou.primary)]:t.primary},{["& .".concat(ou.secondary)]:t.secondary},t.root,n.inset&&t.inset,n.primary&&n.secondary&&t.multiline,n.dense&&t.dense]}})((e=>{let{ownerState:t}=e;return(0,ba.A)({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},t.primary&&t.secondary&&{marginTop:6,marginBottom:6},t.inset&&{paddingLeft:56})})),MM=r.forwardRef((function(e,t){const n=(0,ti.b)({props:e,name:"MuiListItemText"}),{children:o,className:a,disableTypography:i=!1,inset:s=!1,primary:l,primaryTypographyProps:c,secondary:d,secondaryTypographyProps:u}=n,h=(0,nr.A)(n,_M),{dense:p}=r.useContext(Ks);let f=null!=l?l:o,m=d;const g=(0,ba.A)({},n,{disableTypography:i,inset:s,primary:!!f,secondary:!!m,dense:p}),x=(e=>{const{classes:t,inset:n,primary:r,secondary:o,dense:a}=e,i={root:["root",n&&"inset",a&&"dense",r&&o&&"multiline"],primary:["primary"],secondary:["secondary"]};return(0,Za.A)(i,ru,t)})(g);return null==f||f.type===Tp||i||(f=(0,ka.jsx)(Tp,(0,ba.A)({variant:p?"body2":"body1",className:x.primary,component:null!=c&&c.variant?void 0:"span",display:"block"},c,{children:f}))),null==m||m.type===Tp||i||(m=(0,ka.jsx)(Tp,(0,ba.A)({variant:"body2",className:x.secondary,color:"text.secondary",display:"block"},u,{children:m}))),(0,ka.jsxs)(EM,(0,ba.A)({className:(0,za.A)(x.root,a),ownerState:g,ref:t},h,{children:[f,m]}))})),NM=(0,Zc.A)((0,ka.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),RM=(0,Zc.A)((0,ka.jsx)("path",{d:"m20.38 8.57-1.23 1.85a8 8 0 0 1-.22 7.58H5.07A8 8 0 0 1 15.58 6.85l1.85-1.23A10 10 0 0 0 3.35 19a2 2 0 0 0 1.72 1h13.85a2 2 0 0 0 1.74-1 10 10 0 0 0-.27-10.44zm-9.79 6.84a2 2 0 0 0 2.83 0l5.66-8.49-8.49 5.66a2 2 0 0 0 0 2.83"}),"Speed"),PM=(0,Zc.A)((0,ka.jsx)("path",{d:"m17 16-4-4V8.82C14.16 8.4 15 7.3 15 6c0-1.66-1.34-3-3-3S9 4.34 9 6c0 1.3.84 2.4 2 2.82V12l-4 4H3v5h5v-3.05l4-4.2 4 4.2V21h5v-5z"}),"DeviceHub"),OM=(0,Zc.A)((0,ka.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"}),"Update"),TM=(0,Zc.A)((0,ka.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings"),LM=(0,Zc.A)((0,ka.jsx)("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}),"Code"),IM=(0,Zc.A)([(0,ka.jsx)("circle",{cx:"7.2",cy:"14.4",r:"3.2"},"0"),(0,ka.jsx)("circle",{cx:"14.8",cy:"18",r:"2"},"1"),(0,ka.jsx)("circle",{cx:"15.2",cy:"8.8",r:"4.8"},"2")],"BubbleChart"),zM=()=>{const e=so(),[t,n]=(0,r.useState)("panel1"),o=e=>(t,r)=>n(!!r&&e);return(0,ka.jsxs)(Ga,{children:[(0,ka.jsx)(Mj,{title:"Load Balancing Guide",subtitle:"How to set up PM2 cluster mode and distribute traffic across CPU cores",actions:(0,ka.jsx)(ds,{variant:"outlined",onClick:()=>e("/cluster"),children:"Go to Cluster Management"})}),(0,ka.jsxs)(ii,{variant:"outlined",sx:{p:2},children:[(0,ka.jsxs)(QE,{expanded:"panel1"===t,onChange:o("panel1"),disableGutters:!0,elevation:0,children:[(0,ka.jsx)(iM,{expandIcon:(0,ka.jsx)(NM,{}),children:(0,ka.jsx)(Tp,{variant:"subtitle2",sx:{fontWeight:600},children:"What is PM2 Load Balancing?"})}),(0,ka.jsxs)(dM,{sx:{pt:0},children:[(0,ka.jsx)(Tp,{variant:"body2",color:"text.secondary",paragraph:!0,children:"PM2 load balancing creates multiple instances of your app that share the same port, distributing requests across all instances automatically. Useful for:"}),(0,ka.jsx)(Zs,{dense:!0,disablePadding:!0,children:[[RM,"Utilise all CPU cores for maximum throughput"],[PM,"Distribute incoming requests across worker processes"],[OM,"Enable zero-downtime reloads during deployments"]].map(((e,t)=>{let[n,r]=e;return(0,ka.jsxs)(SM,{sx:{py:.25,px:0},children:[(0,ka.jsx)(CM,{sx:{minWidth:32},children:(0,ka.jsx)(n,{fontSize:"small"})}),(0,ka.jsx)(MM,{primary:(0,ka.jsx)(Tp,{variant:"body2",children:r})})]},t)}))})]})]}),(0,ka.jsxs)(QE,{expanded:"panel2"===t,onChange:o("panel2"),disableGutters:!0,elevation:0,children:[(0,ka.jsx)(iM,{expandIcon:(0,ka.jsx)(NM,{}),children:(0,ka.jsx)(Tp,{variant:"subtitle2",sx:{fontWeight:600},children:"Setting Up Load Balancing"})}),(0,ka.jsxs)(dM,{sx:{pt:0},children:[(0,ka.jsx)(Tp,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Two settings are required in your ecosystem.config.js:"}),(0,ka.jsx)(LS,{container:!0,spacing:2,children:[{title:"Multiple Instances",desc:"Set instances > 1 to create workers. Use -1 to match CPU core count.",code:'"instances": 4 // or -1 for max'},{title:"Cluster Mode",desc:"Allow all instances to share the same server port.",code:'"exec_mode": "cluster"'}].map((e=>{let{title:t,desc:n,code:r}=e;return(0,ka.jsx)(LS,{item:!0,xs:12,md:6,children:(0,ka.jsx)(FS,{variant:"outlined",children:(0,ka.jsxs)(VS,{sx:{pb:"12px !important"},children:[(0,ka.jsx)(Tp,{variant:"subtitle2",sx:{fontWeight:600,mb:.5},children:t}),(0,ka.jsx)(Tp,{variant:"body2",color:"text.secondary",sx:{mb:1},children:n}),(0,ka.jsx)(Ga,{sx:{p:1,borderRadius:1,bgcolor:"action.hover",fontFamily:"monospace",fontSize:"0.8125rem"},children:r})]})})},t)}))})]})]}),(0,ka.jsxs)(QE,{expanded:"panel3"===t,onChange:o("panel3"),disableGutters:!0,elevation:0,children:[(0,ka.jsx)(iM,{expandIcon:(0,ka.jsx)(NM,{}),children:(0,ka.jsx)(Tp,{variant:"subtitle2",sx:{fontWeight:600},children:"Best Practices"})}),(0,ka.jsx)(dM,{sx:{pt:0},children:(0,ka.jsx)(Zs,{dense:!0,disablePadding:!0,children:[[TM,"Instances","Match CPU cores for CPU-bound apps. I/O-bound apps can use more."],[LM,"Stateless Design","Keep app stateless or use Redis for shared session storage."],[IM,"Memory Limits","Set max_memory_restart to automatically cycle processes with leaks."],[OM,"Zero-downtime","Use pm2 reload (not restart) to update without dropping connections."]].map((e=>{let[t,n,r]=e;return(0,ka.jsxs)(SM,{sx:{py:.5,px:0},children:[(0,ka.jsx)(CM,{sx:{minWidth:32},children:(0,ka.jsx)(t,{fontSize:"small"})}),(0,ka.jsx)(MM,{primary:(0,ka.jsx)(Tp,{variant:"body2",sx:{fontWeight:500},children:n}),secondary:(0,ka.jsx)(Tp,{variant:"caption",color:"text.secondary",children:r})})]},n)}))})})]})]})]})},DM=(0,Zc.A)((0,ka.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),FM=(0,Zc.A)((0,ka.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess"),BM=(0,Zc.A)((0,ka.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),WM=(0,Zc.A)((0,ka.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility"),HM=(0,Zc.A)((0,ka.jsx)("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"}),"Pause"),VM=(0,Zc.A)((0,ka.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),UM=(0,Zc.A)((0,ka.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),qM=(0,Zc.A)((0,ka.jsx)("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),$M=(0,Zc.A)((0,ka.jsx)("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp"),KM=(0,Zc.A)((0,ka.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),XM=e=>{const t=[];return e.forEach(((e,n)=>{const r=e.startsWith("[STDERR]"),o=e.replace(/^\[(STDOUT|STDERR)\]\s*/,"").trim();o&&t.push({id:String(n),type:r?"stderr":"stdout",message:o,timestamp:new Date})})),t},YM=e=>{var t;let{logWindows:n,onClose:o,onClear:a}=e;const[i,s]=(0,r.useState)(null),[l,c]=(0,r.useState)(!1),[d,u]=(0,r.useState)({}),h=(0,r.useRef)(null),p=(0,r.useRef)([]),f=(0,r.useRef)(null),[m,g]=(0,r.useState)(!1),[x,b]=(0,r.useState)(!1);(0,r.useEffect)((()=>{const e=Object.keys(n),t=p.current,r=e.filter((e=>!t.includes(e)));r.length>0?s(r[r.length-1]):0===e.length?s(null):s((e=>e&&n[e]?e:null)),p.current=e}),[n]);const v=(0,r.useMemo)((()=>{if(l)return d;const e={};return Object.entries(n).forEach((t=>{let[n,r]=t;e[n]=XM(r.logs)})),e}),[n,l,d]);(0,r.useEffect)((()=>{var e;i&&!l&&(null===(e=h.current)||void 0===e||e.scrollIntoView({behavior:"smooth"}))}),[v,i,l]);const y=()=>{const e=f.current;e&&(g(e.scrollLeft>0),b(e.scrollLeft+e.clientWidth<e.scrollWidth-1))};(0,r.useEffect)((()=>{y()}),[n]);const w=e=>{const t=f.current;t&&(t.scrollBy({left:"left"===e?-160:160,behavior:"smooth"}),setTimeout(y,200))};if(0===Object.keys(n).length)return null;const k=i&&null!==(t=v[i])&&void 0!==t?t:[],S=i?n[i]:null,j=(e,t)=>{var n;return(null!==(n=v[e])&&void 0!==n?n:[]).filter((e=>e.type===t)).length};return(0,ka.jsxs)(Ga,{sx:{position:"fixed",bottom:0,left:{xs:0,sm:"200px"},right:0,zIndex:1200,display:"flex",flexDirection:"column"},children:[i&&(0,ka.jsxs)(Ga,{sx:{height:320,display:"flex",flexDirection:"column",bgcolor:"#0c0c0c",borderTop:"1px solid rgba(255,255,255,0.09)",borderLeft:"1px solid rgba(255,255,255,0.06)",borderRight:"1px solid rgba(255,255,255,0.06)"},children:[(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1.5,flexShrink:0,height:30,bgcolor:"#181818",borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[(0,ka.jsx)(Ga,{sx:{width:6,height:6,borderRadius:"50%",bgcolor:l?"#555":"#22c55e",boxShadow:l?"none":"0 0 5px #22c55e88"}}),(0,ka.jsxs)(Tp,{sx:{fontFamily:"monospace",fontSize:"0.7rem",color:"#aaa"},children:[null===S||void 0===S?void 0:S.processName,(0,ka.jsx)(Ga,{component:"span",sx:{color:"#555",mx:.5},children:"\xb7"}),null===S||void 0===S?void 0:S.connectionName]}),(0,ka.jsxs)(Ga,{sx:{display:"flex",gap:.75},children:[j(i,"stdout")>0&&(0,ka.jsx)(Ga,{sx:{px:.6,py:0,borderRadius:"3px",bgcolor:"rgba(34,197,94,0.12)",border:"1px solid rgba(34,197,94,0.25)"},children:(0,ka.jsxs)(Tp,{sx:{fontSize:"0.6rem",color:"#22c55e",fontFamily:"monospace",lineHeight:"16px"},children:["OUT ",j(i,"stdout")]})}),j(i,"stderr")>0&&(0,ka.jsx)(Ga,{sx:{px:.6,py:0,borderRadius:"3px",bgcolor:"rgba(239,68,68,0.12)",border:"1px solid rgba(239,68,68,0.25)"},children:(0,ka.jsxs)(Tp,{sx:{fontSize:"0.6rem",color:"#ef4444",fontFamily:"monospace",lineHeight:"16px"},children:["ERR ",j(i,"stderr")]})})]})]}),(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center"},children:[(0,ka.jsx)(Gh,{title:l?"Resume":"Pause",children:(0,ka.jsx)(xf,{size:"small",onClick:()=>{if(!l){const e={};Object.entries(n).forEach((t=>{let[n,r]=t;e[n]=XM(r.logs)})),u(e)}c((e=>!e))},sx:{color:"#666","&:hover":{color:"#ccc"}},children:l?(0,ka.jsx)(Aj,{sx:{fontSize:13}}):(0,ka.jsx)(HM,{sx:{fontSize:13}})})}),(0,ka.jsx)(Gh,{title:"Clear",children:(0,ka.jsx)(xf,{size:"small",onClick:()=>a(i),sx:{color:"#666","&:hover":{color:"#ccc"}},children:(0,ka.jsx)(Ej,{sx:{fontSize:13}})})}),(0,ka.jsx)(Gh,{title:"Collapse",children:(0,ka.jsx)(xf,{size:"small",onClick:()=>s(null),sx:{color:"#666","&:hover":{color:"#ccc"}},children:(0,ka.jsx)(VM,{sx:{fontSize:14}})})}),(0,ka.jsx)(Gh,{title:"Close session",children:(0,ka.jsx)(xf,{size:"small",onClick:()=>o(i),sx:{color:"#666","&:hover":{color:"#ef4444"}},children:(0,ka.jsx)(UM,{sx:{fontSize:13}})})})]})]}),(0,ka.jsxs)(Ga,{sx:{flex:1,overflowY:"auto",py:.5,"&::-webkit-scrollbar":{width:4},"&::-webkit-scrollbar-track":{bgcolor:"transparent"},"&::-webkit-scrollbar-thumb":{bgcolor:"#2a2a2a",borderRadius:2}},children:[0===k.length?(0,ka.jsx)(Ga,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:(0,ka.jsx)(Tp,{sx:{color:"#3a3a3a",fontSize:"0.75rem",fontFamily:"monospace"},children:l?"\u23f8 paused":"\u25cf waiting for logs\u2026"})}):k.map((e=>{return(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"flex-start",gap:1,px:1.5,py:"1px","&:hover":{bgcolor:"rgba(255,255,255,0.025)"}},children:[(0,ka.jsx)(Tp,{component:"span",sx:{color:"#3d3d3d",fontSize:"0.68rem",flexShrink:0,fontFamily:"monospace",pt:"1px"},children:(t=e.timestamp,t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}))}),(0,ka.jsx)(Tp,{component:"span",sx:{color:"stderr"===e.type?"#7f1d1d":"#14532d",fontSize:"0.65rem",flexShrink:0,fontFamily:"monospace",pt:"1px",minWidth:22},children:"stderr"===e.type?"ERR":"OUT"}),(0,ka.jsx)(Tp,{component:"span",sx:{color:"stderr"===e.type?"#fca5a5":"#d4d4d4",fontSize:"0.75rem",fontFamily:"monospace",wordBreak:"break-word",flex:1,lineHeight:1.5},children:e.message})]},e.id);var t})),(0,ka.jsx)("div",{ref:h})]})]}),(0,ka.jsxs)(Ga,{sx:{height:28,bgcolor:"#161616",borderTop:"1px solid rgba(255,255,255,0.1)",display:"flex",alignItems:"center",flexShrink:0,position:"relative"},children:[(0,ka.jsx)(Tp,{sx:{fontSize:"0.6rem",color:"#444",fontFamily:"monospace",textTransform:"uppercase",letterSpacing:"0.08em",px:1,whiteSpace:"nowrap",flexShrink:0,borderRight:"1px solid rgba(255,255,255,0.06)",alignSelf:"stretch",display:"flex",alignItems:"center"},children:"LOGS"}),(0,ka.jsx)(Ga,{onClick:()=>w("left"),sx:{display:m?"flex":"none",alignItems:"center",px:.25,height:"100%",cursor:"pointer",color:"#555",flexShrink:0,"&:hover":{color:"#aaa",bgcolor:"rgba(255,255,255,0.04)"}},children:(0,ka.jsx)(qM,{sx:{fontSize:16}})}),(0,ka.jsx)(Ga,{ref:f,onScroll:y,sx:{display:"flex",alignItems:"center",gap:.5,flex:1,overflowX:"auto",overflowY:"hidden",px:.5,height:"100%","&::-webkit-scrollbar":{height:3},"&::-webkit-scrollbar-track":{bgcolor:"transparent"},"&::-webkit-scrollbar-thumb":{bgcolor:"#2a2a2a",borderRadius:2}},children:Object.entries(n).map((e=>{let[t,n]=e;const r=t===i,a=j(t,"stdout"),l=j(t,"stderr");return(0,ka.jsxs)(Ga,{onClick:()=>s(r?null:t),sx:{display:"flex",alignItems:"center",gap:.6,px:1,height:20,borderRadius:"3px",cursor:"pointer",flexShrink:0,bgcolor:r?"rgba(255,255,255,0.08)":"transparent",border:r?"1px solid rgba(255,255,255,0.1)":"1px solid transparent",transition:"background 0.1s","&:hover":{bgcolor:r?"rgba(255,255,255,0.1)":"rgba(255,255,255,0.05)"}},children:[(0,ka.jsx)(Ga,{sx:{width:5,height:5,borderRadius:"50%",flexShrink:0,bgcolor:"#22c55e",boxShadow:"0 0 4px #22c55e88"}}),(0,ka.jsx)(Tp,{sx:{fontSize:"0.68rem",fontFamily:"monospace",color:r?"#e5e5e5":"#888",fontWeight:r?600:400,whiteSpace:"nowrap"},children:n.processName}),(0,ka.jsx)(Tp,{sx:{fontSize:"0.62rem",color:"#3d3d3d",fontFamily:"monospace",whiteSpace:"nowrap"},children:n.connectionName}),a>0&&(0,ka.jsx)(Tp,{sx:{fontSize:"0.62rem",color:"#22c55e",fontFamily:"monospace",whiteSpace:"nowrap"},children:a}),l>0&&(0,ka.jsx)(Tp,{sx:{fontSize:"0.62rem",color:"#ef4444",fontFamily:"monospace",whiteSpace:"nowrap"},children:l}),r?(0,ka.jsx)(VM,{sx:{fontSize:11,color:"#555",ml:.25}}):(0,ka.jsx)($M,{sx:{fontSize:11,color:"#3a3a3a",ml:.25}}),(0,ka.jsx)(Ga,{component:"span",onClick:e=>{e.stopPropagation(),o(t)},sx:{fontSize:"13px",lineHeight:1,color:"#444",cursor:"pointer",ml:.25,display:"flex",alignItems:"center","&:hover":{color:"#ef4444"}},children:"\xd7"})]},t)}))}),(0,ka.jsx)(Ga,{onClick:()=>w("right"),sx:{display:x?"flex":"none",alignItems:"center",px:.25,height:"100%",cursor:"pointer",color:"#555",flexShrink:0,"&:hover":{color:"#aaa",bgcolor:"rgba(255,255,255,0.04)"}},children:(0,ka.jsx)(KM,{sx:{fontSize:16}})})]})]})},GM=["children","value","index"];function ZM(e){const{children:t,value:n,index:r}=e,o=rr(e,GM);return(0,ka.jsx)("div",c(c({role:"tabpanel",hidden:n!==r,id:"simple-tabpanel-".concat(r),"aria-labelledby":"simple-tab-".concat(r)},o),{},{children:n===r&&(0,ka.jsx)(Ga,{sx:{p:1.5},children:t})}))}const JM=()=>{const[e,t]=(0,r.useState)([]),[n,o]=(0,r.useState)(!1),[a,i]=(0,r.useState)(null),[s,l]=(0,r.useState)({}),[d,u]=(0,r.useState)({}),[h,p]=(0,r.useState)(new Set),[f,m]=(0,r.useState)({}),[g,x]=(0,r.useState)(null),[b,v]=(0,r.useState)(0),[y,w]=(0,r.useState)({}),[k,S]=(0,r.useState)(null),[j,A]=(0,r.useState)({name:"",host:"",port:22,username:"",password:"",privateKey:"",useSudo:!1});(0,r.useEffect)((()=>{C();const e=Re();return S(e),e.on("remote-log-line",(e=>{console.log("Received remote-log-line:",e);const t="".concat(e.connectionId,"-").concat(e.processId);console.log("Looking for window key:",t),w((n=>(console.log("Current log windows:",Object.keys(n)),n[t]?(console.log("Updating logs for window:",t),c(c({},n),{},{[t]:c(c({},n[t]),{},{logs:[...n[t].logs,"[".concat(e.logType.toUpperCase(),"] ").concat(e.line)]})})):(console.log("Window not found for key:",t),n))))})),e.on("remote-log-error",(e=>{console.error("Remote log error:",e),x("Log streaming error: ".concat(e.error))})),()=>{e&&e.disconnect()}}),[]);const C=async()=>{try{const e=await fetch("/api/remote/connections");if(e.ok){const n=await e.json();t(n)}}catch(g){console.error("Failed to load connections:",g),x("Failed to load connections")}},_=async e=>{m((t=>c(c({},t),{},{[e]:!0})));try{const r=await fetch("/api/remote/".concat(e,"/connect"),{method:"POST"});if(r.ok)await M(e),await N(e),t((t=>t.map((t=>t.id===e?c(c({},t),{},{connected:!0}):t)))),p((t=>new Set([...t,e])));else try{const e=await r.json();x(e.error||"Failed to connect")}catch(n){const e=await r.text();x(e||"Failed to connect (Invalid server response)")}}catch(g){console.error("Connection failed:",g),x("Connection failed: ".concat(g instanceof Error?g.message:"Unknown error"))}finally{m((t=>c(c({},t),{},{[e]:!1})))}},E=async e=>{try{(await fetch("/api/remote/".concat(e,"/disconnect"),{method:"POST"})).ok&&(t((t=>t.map((t=>t.id===e?c(c({},t),{},{connected:!1}):t)))),l((t=>{const n=c({},t);return delete n[e],n})))}catch(g){console.error("Disconnect failed:",g),x("Disconnect failed")}},M=async e=>{m((t=>c(c({},t),{},{["".concat(e,"-processes")]:!0})));try{const t=await fetch("/api/remote/".concat(e,"/processes"));if(t.ok){const n=await t.json();l((t=>c(c({},t),{},{[e]:n})))}else{const n=await t.json().catch((()=>({error:"Unknown error"})));x("Failed to load processes: ".concat(n.error||t.statusText)),l((t=>c(c({},t),{},{[e]:[]})))}}catch(g){console.error("Failed to load processes:",g),x("Failed to load processes: network error"),l((t=>c(c({},t),{},{[e]:[]})))}finally{m((t=>c(c({},t),{},{["".concat(e,"-processes")]:!1})))}},N=async e=>{try{const t=await fetch("/api/remote/".concat(e,"/system-info"));if(t.ok){const n=await t.json();u((t=>c(c({},t),{},{[e]:n})))}}catch(g){console.error("Failed to load system info:",g)}},R=async(e,t,n)=>{try{const r=await fetch("/api/remote/".concat(e,"/processes/").concat(t,"/").concat(n),{method:"POST"});if(r.ok)await M(e);else{const e=await r.json();x(e.error||"Failed to ".concat(n," process"))}}catch(g){console.error("Process ".concat(n," failed:"),g),x("Process ".concat(n," failed"))}},P=()=>{o(!1),i(null),A({name:"",host:"",port:22,username:"",password:"",privateKey:"",useSudo:!1})},O=e=>{switch(e){case"online":return"success";case"stopped":return"error";case"stopping":return"warning";case"waiting restart":case"launching":return"info";default:return"default"}};return(0,ka.jsxs)(Ga,{children:[(0,ka.jsxs)("div",{className:"flex items-center justify-between mb-4 pb-3 border-b border-neutral-200 dark:border-neutral-800",children:[(0,ka.jsxs)("div",{children:[(0,ka.jsx)("h1",{className:"text-base font-semibold text-neutral-900 dark:text-neutral-100 leading-tight",children:"Remote Connections"}),(0,ka.jsx)("p",{className:"text-xs text-neutral-500 dark:text-neutral-400 mt-0.5",children:"Manage SSH connections and remote PM2 processes"})]}),(0,ka.jsxs)(Ga,{sx:{display:"flex",gap:1},children:[e.some((e=>!e.connected))&&(0,ka.jsx)(ds,{variant:"outlined",size:"small",startIcon:(0,ka.jsx)(Aj,{}),onClick:async()=>{const t=e.filter((e=>!e.connected));for(const e of t)await _(e.id)},disabled:Object.values(f).some((e=>e)),children:"Connect All"}),e.some((e=>e.connected))&&(0,ka.jsx)(ds,{variant:"outlined",size:"small",startIcon:(0,ka.jsx)(Cj,{}),onClick:async()=>{const t=e.filter((e=>e.connected));for(const e of t)await E(e.id)},disabled:Object.values(f).some((e=>e)),children:"Disconnect All"}),(0,ka.jsx)(ds,{variant:"contained",size:"small",startIcon:(0,ka.jsx)(DM,{}),onClick:()=>o(!0),children:"Add Connection"})]})]}),g&&(0,ka.jsx)(Nf,{severity:"error",sx:{mb:2},onClose:()=>x(null),children:g}),(0,ka.jsx)(LS,{container:!0,spacing:1.5,children:0===e.length?(0,ka.jsx)(LS,{item:!0,xs:12,children:(0,ka.jsx)(ii,{variant:"outlined",sx:{p:3,textAlign:"center"},children:(0,ka.jsx)(Tp,{variant:"body2",color:"text.secondary",children:'No remote connections configured. Click "Add Connection" to get started.'})})}):e.map((t=>{var n;return(0,ka.jsx)(LS,{item:!0,xs:12,children:(0,ka.jsxs)(ii,{variant:"outlined",sx:{p:0,overflow:"hidden"},children:[(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1,borderBottom:h.has(t.id)?"1px solid":"none",borderColor:"divider"},children:[(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[(0,ka.jsx)(Tp,{variant:"body2",fontWeight:600,sx:{whiteSpace:"nowrap"},children:t.name}),(0,ka.jsx)(ap,{label:t.connected?"Connected":"Disconnected",color:t.connected?"success":"default",size:"small"}),(0,ka.jsxs)(Tp,{variant:"caption",color:"text.secondary",sx:{whiteSpace:"nowrap"},children:[t.username,"@",t.host,":",t.port]})]}),(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:.5,flexShrink:0},children:[t.connected?(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsx)(xf,{size:"small",onClick:()=>{M(t.id),N(t.id)},disabled:f[t.id],children:(0,ka.jsx)(_j,{fontSize:"small"})}),(0,ka.jsx)(xf,{size:"small",onClick:()=>{return e=t.id,void p((t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}));var e},children:h.has(t.id)?(0,ka.jsx)(FM,{fontSize:"small"}):(0,ka.jsx)(NM,{fontSize:"small"})}),(0,ka.jsx)(ds,{variant:"outlined",size:"small",onClick:()=>E(t.id),disabled:f[t.id],children:"Disconnect"})]}):(0,ka.jsx)(ds,{variant:"contained",size:"small",onClick:()=>_(t.id),disabled:f[t.id],startIcon:f[t.id]?(0,ka.jsx)(Xf,{size:12}):void 0,children:"Connect"}),(0,ka.jsx)(xf,{size:"small",onClick:()=>(e=>{i(e),A({name:e.name,host:e.host,port:e.port,username:e.username,password:"",privateKey:e.privateKey||"",useSudo:e.useSudo||!1}),o(!0)})(t),children:(0,ka.jsx)(BM,{fontSize:"small"})}),(0,ka.jsx)(xf,{size:"small",color:"error",onClick:()=>(async e=>{try{(await fetch("/api/remote/connections/".concat(e),{method:"DELETE"})).ok&&await C()}catch(g){console.error("Failed to delete connection:",g),x("Failed to delete connection")}})(t.id),children:(0,ka.jsx)(Ej,{fontSize:"small"})})]})]}),(0,ka.jsx)(Hm,{in:h.has(t.id)&&t.connected,children:(0,ka.jsxs)(Ga,{children:[(0,ka.jsxs)(xj,{value:b,onChange:(e,t)=>v(t),sx:{px:2,borderBottom:"1px solid",borderColor:"divider"},children:[(0,ka.jsx)(Sj,{label:"Processes"}),(0,ka.jsx)(Sj,{label:"System Info"})]}),(0,ka.jsx)(ZM,{value:b,index:0,children:f["".concat(t.id,"-processes")]?(0,ka.jsx)(Ga,{sx:{display:"flex",justifyContent:"center",py:3},children:(0,ka.jsx)(Xf,{size:20})}):void 0===s[t.id]?(0,ka.jsx)(Tp,{variant:"body2",color:"text.secondary",children:"Click refresh to load processes."}):0===s[t.id].length?(0,ka.jsx)(Tp,{variant:"body2",color:"text.secondary",children:"No PM2 processes running on this server."}):(0,ka.jsxs)(lm,{size:"small",children:[(0,ka.jsx)(mm,{children:(0,ka.jsxs)(km,{children:[(0,ka.jsx)(Em,{children:"Name"}),(0,ka.jsx)(Em,{children:"Status"}),(0,ka.jsx)(Em,{children:"CPU"}),(0,ka.jsx)(Em,{children:"Memory"}),(0,ka.jsx)(Em,{children:"Uptime"}),(0,ka.jsx)(Em,{children:"Actions"})]})}),(0,ka.jsx)(Tm,{children:s[t.id].map((n=>(0,ka.jsxs)(km,{children:[(0,ka.jsx)(Em,{children:(0,ka.jsx)(Tp,{variant:"body2",fontWeight:500,children:n.name})}),(0,ka.jsx)(Em,{children:(0,ka.jsx)(ap,{label:n.status,color:O(n.status),size:"small"})}),(0,ka.jsx)(Em,{children:(0,ka.jsxs)(Tp,{variant:"body2",children:[n.cpu,"%"]})}),(0,ka.jsx)(Em,{children:(0,ka.jsx)(Tp,{variant:"body2",children:n.memory})}),(0,ka.jsx)(Em,{children:(0,ka.jsx)(Tp,{variant:"body2",children:n.uptime})}),(0,ka.jsxs)(Em,{children:[(0,ka.jsx)(xf,{size:"small",onClick:()=>R(t.id,n.name,"start"),disabled:"online"===n.status,children:(0,ka.jsx)(Aj,{fontSize:"small"})}),(0,ka.jsx)(xf,{size:"small",onClick:()=>R(t.id,n.name,"stop"),disabled:"stopped"===n.status,children:(0,ka.jsx)(Cj,{fontSize:"small"})}),(0,ka.jsx)(xf,{size:"small",onClick:()=>R(t.id,n.name,"restart"),children:(0,ka.jsx)(_j,{fontSize:"small"})}),(0,ka.jsx)(xf,{size:"small",color:"error",onClick:()=>R(t.id,n.name,"delete"),children:(0,ka.jsx)(Ej,{fontSize:"small"})}),(0,ka.jsx)(xf,{size:"small",color:"primary",onClick:()=>(async(t,n,r)=>{try{const o=void 0!==r?r.toString():n,a="".concat(t,"-").concat(o);if(y[a])return void console.log("Log window already open for:",a);const i=e.find((e=>e.id===t)),s=(null===i||void 0===i?void 0:i.name)||"Unknown";w((e=>c(c({},e),{},{[a]:{connectionId:t,processName:n,processId:o,connectionName:s,logs:[]}})));const l=await fetch("/api/remote/".concat(t,"/logs/").concat(o));if(l.ok){const e=await l.json(),t=[];e.stdout&&e.stdout.length>0&&t.push(...e.stdout.map((e=>"[STDOUT] ".concat(e)))),e.stderr&&e.stderr.length>0&&t.push(...e.stderr.map((e=>"[STDERR] ".concat(e)))),w((e=>c(c({},e),{},{[a]:c(c({},e[a]),{},{logs:t})})))}k?(console.log("Emitting subscribe-remote-logs with:",{connectionId:t,processId:o}),k.emit("subscribe-remote-logs",{connectionId:t,processId:o}),console.log("Socket subscription sent, current log windows:",Object.keys(y))):console.error("Socket not available for subscription")}catch(g){console.error("Failed to open live logs:",g),x("Failed to open live logs")}})(t.id,n.name,n.pm_id),children:(0,ka.jsx)(WM,{fontSize:"small"})})]})]},n.name)))})]})}),(0,ka.jsx)(ZM,{value:b,index:1,children:d[t.id]?(0,ka.jsxs)(LS,{container:!0,spacing:2,children:[(0,ka.jsxs)(LS,{item:!0,xs:12,md:6,children:[(0,ka.jsx)(Tp,{variant:"subtitle2",sx:{fontWeight:600,mb:1},children:"System Information"}),[["Hostname",d[t.id].hostname],["Platform",d[t.id].platform],["Architecture",d[t.id].arch],["Node.js",d[t.id].nodeVersion]].map((e=>{let[t,n]=e;return(0,ka.jsxs)(Ga,{sx:{display:"flex",gap:1,mb:.5},children:[(0,ka.jsxs)(Tp,{variant:"caption",color:"text.secondary",sx:{minWidth:90},children:[t,":"]}),(0,ka.jsx)(Tp,{variant:"caption",children:n})]},t)}))]}),(0,ka.jsxs)(LS,{item:!0,xs:12,md:6,children:[(0,ka.jsx)(Tp,{variant:"subtitle2",sx:{fontWeight:600,mb:1},children:"Resources"}),[["Total Memory",d[t.id].totalMemory],["Free Memory",d[t.id].freeMemory],["CPU Count",d[t.id].cpuCount],["Load Average",null===(n=d[t.id].loadAverage)||void 0===n?void 0:n.join(", ")]].map((e=>{let[t,n]=e;return(0,ka.jsxs)(Ga,{sx:{display:"flex",gap:1,mb:.5},children:[(0,ka.jsxs)(Tp,{variant:"caption",color:"text.secondary",sx:{minWidth:90},children:[t,":"]}),(0,ka.jsx)(Tp,{variant:"caption",children:n})]},t)}))]})]}):(0,ka.jsx)(Tp,{variant:"body2",color:"text.secondary",children:"No system info available."})})]})})]})},t.id)}))}),(0,ka.jsxs)(ZA,{open:n,onClose:P,maxWidth:"md",fullWidth:!0,children:[(0,ka.jsx)(nC,{children:a?"Edit Remote Connection":"Add Remote Connection"}),(0,ka.jsx)(iC,{children:(0,ka.jsxs)(LS,{container:!0,spacing:2,sx:{mt:1},children:[(0,ka.jsx)(LS,{item:!0,xs:12,children:(0,ka.jsx)(_C,{fullWidth:!0,label:"Connection Name",value:j.name,onChange:e=>A((t=>c(c({},t),{},{name:e.target.value})))})}),(0,ka.jsx)(LS,{item:!0,xs:12,md:8,children:(0,ka.jsx)(_C,{fullWidth:!0,label:"Host",value:j.host,onChange:e=>A((t=>c(c({},t),{},{host:e.target.value})))})}),(0,ka.jsx)(LS,{item:!0,xs:12,md:4,children:(0,ka.jsx)(_C,{fullWidth:!0,label:"Port",type:"number",value:j.port,onChange:e=>A((t=>c(c({},t),{},{port:parseInt(e.target.value)})))})}),(0,ka.jsx)(LS,{item:!0,xs:12,children:(0,ka.jsx)(_C,{fullWidth:!0,label:"Username",value:j.username,onChange:e=>A((t=>c(c({},t),{},{username:e.target.value})))})}),(0,ka.jsx)(LS,{item:!0,xs:12,children:(0,ka.jsx)(_C,{fullWidth:!0,label:"Password",type:"password",value:j.password,onChange:e=>A((t=>c(c({},t),{},{password:e.target.value}))),placeholder:a?"Leave blank to keep existing password":"",helperText:a?"Leave blank to keep current password":""})}),(0,ka.jsxs)(LS,{item:!0,xs:12,children:[" ",(0,ka.jsx)(_C,{fullWidth:!0,label:"Private Key (optional)",multiline:!0,rows:4,value:j.privateKey,onChange:e=>A((t=>c(c({},t),{},{privateKey:e.target.value}))),placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"})]})," ",(0,ka.jsx)(LS,{item:!0,xs:12,children:(0,ka.jsx)(Bp,{control:(0,ka.jsx)(of,{checked:j.useSudo,onChange:e=>A((t=>c(c({},t),{},{useSudo:e.target.checked})))}),label:"Use sudo for privileged commands (requires password)"})})]})}),(0,ka.jsxs)(fC,{children:[(0,ka.jsx)(ds,{onClick:P,children:"Cancel"}),(0,ka.jsx)(ds,{onClick:()=>{a?(async()=>{if(a)try{const e=await fetch("/api/remote/connections/".concat(a.id),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)});if(e.ok)await C(),o(!1),i(null),A({name:"",host:"",port:22,username:"",password:"",privateKey:"",useSudo:!1});else{const t=await e.json();x(t.error||"Failed to update connection")}}catch(g){console.error("Failed to update connection:",g),x("Failed to update connection")}})():(async()=>{try{const e=await fetch("/api/remote/connections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)});if(e.ok)await C(),o(!1),A({name:"",host:"",port:22,username:"",password:"",privateKey:"",useSudo:!1});else{const t=await e.json();x(t.error||"Failed to add connection")}}catch(g){console.error("Failed to add connection:",g),x("Failed to add connection")}})()},variant:"contained",children:a?"Update Connection":"Add Connection"})]})]})," ",(0,ka.jsx)(YM,{logWindows:y,onClose:e=>{const t=y[e];k&&t&&k.emit("unsubscribe-remote-logs",{connectionId:t.connectionId,processId:t.processId}),w((t=>{const n=c({},t);return delete n[e],n}))},onClear:e=>{w((t=>c(c({},t),{},{[e]:c(c({},t[e]),{},{logs:[]})})))}})]})},QM=["title","titleId"];function eN(e,t){let{title:n,titleId:o}=e,a=rr(e,QM);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"}))}const tN=r.forwardRef(eN),nN=["title","titleId"];function rN(e,t){let{title:n,titleId:o}=e,a=rr(e,nN);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"}))}const oN=r.forwardRef(rN),aN=e=>{let{value:t,onChange:n,onValidationChange:o}=e;const a=wl(),i=e=>{const t=e.split(" ");return 5===t.length?{minute:t[0],hour:t[1],dayOfMonth:t[2],month:t[3],dayOfWeek:t[4]}:{minute:"*",hour:"*",dayOfMonth:"*",month:"*",dayOfWeek:"*"}},[s,l]=(0,r.useState)(i(t)),[d,u]=(0,r.useState)({valid:!0,description:""}),[h,p]=(0,r.useState)(!1);(0,r.useEffect)((()=>{t&&(async()=>{try{const e=await tr.post("/api/cron-jobs/validate",{expression:t});if(e.data.success){const t=e.data.data;u(t),o&&o(t)}}catch(e){u({valid:!1,error:"Invalid cron expression"}),o&&o({valid:!1,error:"Invalid cron expression"})}})()}),[t,o]),(0,r.useEffect)((()=>{const e="".concat(s.minute," ").concat(s.hour," ").concat(s.dayOfMonth," ").concat(s.month," ").concat(s.dayOfWeek);e!==t&&n(e)}),[s]);const f=(e,t)=>{l((n=>c(c({},n),{},{[e]:t}))),p(!1)};return(0,ka.jsxs)(Ga,{children:[(0,ka.jsx)(Tp,{variant:"subtitle2",sx:{mb:2,fontWeight:600},children:"Cron Schedule"}),(0,ka.jsxs)(vs,{fullWidth:!0,sx:{mb:3},children:[(0,ka.jsx)(Ps,{children:"Use Preset"}),(0,ka.jsxs)(Jd,{value:h?t:"",onChange:e=>{const t=e.target.value;n(t),l(i(t)),p(!0)},label:"Use Preset",children:[(0,ka.jsx)(cu,{value:"",children:(0,ka.jsx)("em",{children:"Custom"})}),Object.entries({"Every minute":"* * * * *","Every 5 minutes":"*/5 * * * *","Every 15 minutes":"*/15 * * * *","Every 30 minutes":"*/30 * * * *","Every hour":"0 * * * *","Every 6 hours":"0 */6 * * *","Every day at midnight":"0 0 * * *","Every day at noon":"0 12 * * *","Every Monday at 9 AM":"0 9 * * 1","Every weekday at 9 AM":"0 9 * * 1-5","Every month on the 1st":"0 0 1 * *"}).map((e=>{let[t,n]=e;return(0,ka.jsxs)(cu,{value:n,children:[t," (",n,")"]},n)}))]})]}),(0,ka.jsx)(_C,{fullWidth:!0,label:"Cron Expression",value:t,onChange:e=>{n(e.target.value),l(i(e.target.value)),p(!1)},placeholder:"* * * * *",sx:{mb:2},error:!d.valid,helperText:d.valid?d.description:d.error}),(0,ka.jsxs)(ii,{sx:{p:2,mb:2,backgroundColor:"dark"===a.palette.mode?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.02)"},children:[(0,ka.jsx)(Tp,{variant:"caption",sx:{mb:2,display:"block",color:"text.secondary"},children:"Build cron expression visually"}),(0,ka.jsxs)(LS,{container:!0,spacing:2,children:[(0,ka.jsx)(LS,{item:!0,xs:12,sm:6,md:2.4,children:(0,ka.jsx)(_C,{fullWidth:!0,label:"Minute",value:s.minute,onChange:e=>f("minute",e.target.value),placeholder:"*",size:"small",helperText:"0-59 or *"})}),(0,ka.jsx)(LS,{item:!0,xs:12,sm:6,md:2.4,children:(0,ka.jsx)(_C,{fullWidth:!0,label:"Hour",value:s.hour,onChange:e=>f("hour",e.target.value),placeholder:"*",size:"small",helperText:"0-23 or *"})}),(0,ka.jsx)(LS,{item:!0,xs:12,sm:6,md:2.4,children:(0,ka.jsx)(_C,{fullWidth:!0,label:"Day of Month",value:s.dayOfMonth,onChange:e=>f("dayOfMonth",e.target.value),placeholder:"*",size:"small",helperText:"1-31 or *"})}),(0,ka.jsx)(LS,{item:!0,xs:12,sm:6,md:2.4,children:(0,ka.jsx)(_C,{fullWidth:!0,label:"Month",value:s.month,onChange:e=>f("month",e.target.value),placeholder:"*",size:"small",helperText:"1-12 or *"})}),(0,ka.jsx)(LS,{item:!0,xs:12,sm:6,md:2.4,children:(0,ka.jsx)(_C,{fullWidth:!0,label:"Day of Week",value:s.dayOfWeek,onChange:e=>f("dayOfWeek",e.target.value),placeholder:"*",size:"small",helperText:"0-6 or *"})})]})]}),d.valid&&d.nextRun&&(0,ka.jsxs)(Ga,{sx:{display:"flex",gap:1,alignItems:"center",flexWrap:"wrap"},children:[(0,ka.jsx)(Tp,{variant:"caption",color:"text.secondary",children:"Next run:"}),(0,ka.jsx)(ap,{label:new Date(d.nextRun).toLocaleString(),size:"small",color:"success"})]}),(0,ka.jsxs)(Ga,{sx:{mt:2,p:2,backgroundColor:"dark"===a.palette.mode?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.01)",borderRadius:1},children:[(0,ka.jsxs)(Tp,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:1},children:[(0,ka.jsx)("strong",{children:"Cron Expression Format:"})," minute hour day-of-month month day-of-week"]}),(0,ka.jsxs)(Tp,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:[(0,ka.jsx)("strong",{children:"Examples:"})," * = any value, */5 = every 5 units, 1-5 = range, 1,3,5 = specific values"]})]})]})},iN=e=>{let{value:t,onChange:n,scriptType:r,placeholder:o}=e;const a=wl();return(0,ka.jsxs)(Ga,{children:[(0,ka.jsx)(Tp,{variant:"subtitle2",sx:{mb:1,fontWeight:600},children:"Inline Script"}),(0,ka.jsx)(ii,{sx:{p:0,backgroundColor:"dark"===a.palette.mode?"#1e1e1e":"#f5f5f5",border:"1px solid ".concat(a.palette.divider),borderRadius:1},children:(0,ka.jsx)("textarea",{value:t,onChange:e=>n(e.target.value),placeholder:(()=>{if(o)return o;switch(r){case"node":return"// Node.js script\nconsole.log('Hello from cron job!');\nconsole.log('Current time:', new Date().toISOString());\n\n// Access environment variables\nconsole.log('Environment:', process.env.NODE_ENV);\n\n// Exit with success code\nprocess.exit(0);";case"python":return"# Python script\nimport sys\nfrom datetime import datetime\n\nprint('Hello from cron job!')\nprint(f'Current time: {datetime.now().isoformat()}')\n\n# Access command line arguments\nprint(f'Arguments: {sys.argv[1:]}')\n\n# Exit with success code\nsys.exit(0)";case"shell":return'#!/bin/bash\n# Shell script\n\necho "Hello from cron job!"\necho "Current time: $(date -Iseconds)"\necho "Current user: $(whoami)"\necho "Working directory: $(pwd)"\n\n# Exit with success code\nexit 0';case"dotnet":return'// C# script\nusing System;\n\nclass Program\n{\n static void Main(string[] args)\n {\n Console.WriteLine("Hello from cron job!");\n Console.WriteLine($"Current time: {DateTime.Now}");\n \n // Access command line arguments\n Console.WriteLine($"Arguments: {string.Join(", ", args)}");\n \n Environment.Exit(0);\n }\n}';default:return"Write your script here..."}})(),style:{width:"100%",minHeight:"300px",padding:"12px",fontFamily:"'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace",fontSize:"13px",lineHeight:"1.6",backgroundColor:"transparent",color:a.palette.text.primary,border:"none",outline:"none",resize:"vertical",whiteSpace:"pre",overflowWrap:"normal",overflowX:"auto"},spellCheck:!1})}),(0,ka.jsx)(Tp,{variant:"caption",color:"text.secondary",sx:{mt:1,display:"block"},children:"Tip: Use console.log/print/echo for output. Scripts should exit when complete."})]})},sN=e=>{let{open:t,onClose:n,onSave:o,editJob:a}=e;const i=wl(),[s,l]=(0,r.useState)(!1),[d,u]=(0,r.useState)({valid:!0}),[h,p]=(0,r.useState)({name:"",description:"",scriptType:"node",scriptMode:"inline",scriptPath:"",inlineScript:"",cronExpression:"0 * * * *",args:[],env:{},cwd:"",enabled:!0}),[f,m]=(0,r.useState)(""),[g,x]=(0,r.useState)(""),[b,v]=(0,r.useState)("");(0,r.useEffect)((()=>{p(a?{name:a.name,description:a.description||"",scriptType:a.scriptType,scriptMode:a.scriptMode||"file",scriptPath:a.scriptPath,inlineScript:a.inlineScript||"",cronExpression:a.cronExpression,args:a.args||[],env:a.env||{},cwd:a.cwd||"",enabled:a.enabled}:{name:"",description:"",scriptType:"node",scriptMode:"inline",scriptPath:"",inlineScript:"",cronExpression:"0 * * * *",args:[],env:{},cwd:"",enabled:!0})}),[a,t]);const y=e=>t=>{p((n=>c(c({},n),{},{[e]:t.target.value})))},w=()=>{f.trim()&&(p((e=>c(c({},e),{},{args:[...e.args,f.trim()]}))),m(""))},k=()=>{g.trim()&&(p((e=>c(c({},e),{},{env:c(c({},e.env),{},{[g.trim()]:b.trim()})}))),x(""),v(""))};return(0,ka.jsxs)(ZA,{open:t,onClose:n,maxWidth:"md",fullWidth:!0,children:[(0,ka.jsx)(nC,{children:a?"Edit Cron Job":"Create New Cron Job"}),(0,ka.jsx)(iC,{dividers:!0,sx:{minHeight:"500px"},children:(0,ka.jsxs)(Ga,{sx:{display:"flex",flexDirection:"column",gap:3},children:[(0,ka.jsxs)(Ga,{children:[(0,ka.jsx)(Tp,{variant:"subtitle2",sx:{mb:2,fontWeight:600},children:"Basic Information"}),(0,ka.jsxs)(LS,{container:!0,spacing:2,children:[(0,ka.jsx)(LS,{item:!0,xs:12,sm:8,children:(0,ka.jsx)(_C,{fullWidth:!0,required:!0,label:"Job Name",value:h.name,onChange:y("name"),placeholder:"My Scheduled Task"})}),(0,ka.jsx)(LS,{item:!0,xs:12,sm:4,children:(0,ka.jsx)(Bp,{control:(0,ka.jsx)(IC,{checked:h.enabled,onChange:(S="enabled",e=>{p((t=>c(c({},t),{},{[S]:e.target.checked})))}),color:"success"}),label:"Enabled"})}),(0,ka.jsx)(LS,{item:!0,xs:12,children:(0,ka.jsx)(_C,{fullWidth:!0,multiline:!0,rows:2,label:"Description",value:h.description,onChange:y("description"),placeholder:"Optional description of this job"})})]})]}),(0,ka.jsxs)(Ga,{children:[(0,ka.jsx)(Tp,{variant:"subtitle2",sx:{mb:2,fontWeight:600},children:"Script Configuration"}),(0,ka.jsxs)(LS,{container:!0,spacing:2,children:[(0,ka.jsx)(LS,{item:!0,xs:12,sm:4,children:(0,ka.jsxs)(vs,{fullWidth:!0,required:!0,children:[(0,ka.jsx)(Ps,{children:"Script Type"}),(0,ka.jsxs)(Jd,{value:h.scriptType,onChange:y("scriptType"),label:"Script Type",children:[(0,ka.jsx)(cu,{value:"node",children:"Node.js"}),(0,ka.jsx)(cu,{value:"python",children:"Python"}),(0,ka.jsx)(cu,{value:"shell",children:"Shell Script"}),(0,ka.jsx)(cu,{value:"dotnet",children:".NET"})]})]})}),(0,ka.jsx)(LS,{item:!0,xs:12,sm:8,children:(0,ka.jsxs)(vs,{fullWidth:!0,required:!0,children:[(0,ka.jsx)(Ps,{children:"Script Mode"}),(0,ka.jsxs)(Jd,{value:h.scriptMode,onChange:y("scriptMode"),label:"Script Mode",children:[(0,ka.jsx)(cu,{value:"inline",children:"Write Script Inline"}),(0,ka.jsx)(cu,{value:"file",children:"Use Script File"})]})]})}),"file"===h.scriptMode?(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsx)(LS,{item:!0,xs:12,children:(0,ka.jsx)(_C,{fullWidth:!0,required:!0,label:"Script Path",value:h.scriptPath,onChange:y("scriptPath"),placeholder:"/path/to/script.js",helperText:"Absolute or relative path to your script"})}),(0,ka.jsx)(LS,{item:!0,xs:12,children:(0,ka.jsx)(_C,{fullWidth:!0,label:"Working Directory",value:h.cwd,onChange:y("cwd"),placeholder:"/path/to/working/directory",helperText:"Optional: Directory to run the script from"})})]}):(0,ka.jsx)(LS,{item:!0,xs:12,children:(0,ka.jsx)(iN,{value:h.inlineScript,onChange:e=>p((t=>c(c({},t),{},{inlineScript:e}))),scriptType:h.scriptType})})]})]}),(0,ka.jsx)(Ga,{children:(0,ka.jsx)(aN,{value:h.cronExpression,onChange:e=>p((t=>c(c({},t),{},{cronExpression:e}))),onValidationChange:u})}),(0,ka.jsxs)(Ga,{children:[(0,ka.jsx)(Tp,{variant:"subtitle2",sx:{mb:2,fontWeight:600},children:"Script Arguments (Optional)"}),(0,ka.jsxs)(Ga,{sx:{display:"flex",gap:1,mb:1},children:[(0,ka.jsx)(_C,{size:"small",fullWidth:!0,placeholder:"Add argument",value:f,onChange:e=>m(e.target.value),onKeyPress:e=>"Enter"===e.key&&w()}),(0,ka.jsx)(xf,{onClick:w,color:"primary",children:(0,ka.jsx)(DM,{})})]}),(0,ka.jsx)(Ga,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:h.args.map(((e,t)=>(0,ka.jsx)(ap,{label:e,onDelete:()=>(e=>{p((t=>c(c({},t),{},{args:t.args.filter(((t,n)=>n!==e))})))})(t),size:"small"},t)))})]}),(0,ka.jsxs)(Ga,{children:[(0,ka.jsx)(Tp,{variant:"subtitle2",sx:{mb:2,fontWeight:600},children:"Environment Variables (Optional)"}),(0,ka.jsxs)(Ga,{sx:{display:"flex",gap:1,mb:1},children:[(0,ka.jsx)(_C,{size:"small",placeholder:"Key",value:g,onChange:e=>x(e.target.value),sx:{flex:1}}),(0,ka.jsx)(_C,{size:"small",placeholder:"Value",value:b,onChange:e=>v(e.target.value),onKeyPress:e=>"Enter"===e.key&&k(),sx:{flex:2}}),(0,ka.jsx)(xf,{onClick:k,color:"primary",children:(0,ka.jsx)(DM,{})})]}),(0,ka.jsx)(Ga,{sx:{display:"flex",flexDirection:"column",gap:.5},children:Object.entries(h.env).map((e=>{let[t,n]=e;return(0,ka.jsxs)(Ga,{sx:{display:"flex",alignItems:"center",gap:1,p:1,backgroundColor:"dark"===i.palette.mode?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.02)",borderRadius:1},children:[(0,ka.jsx)(Tp,{variant:"body2",sx:{fontWeight:600,minWidth:"100px"},children:t}),(0,ka.jsx)(Tp,{variant:"body2",sx:{flex:1,color:"text.secondary"},children:n}),(0,ka.jsx)(xf,{size:"small",onClick:()=>(e=>{p((t=>{const n=c({},t.env);return delete n[e],c(c({},t),{},{env:n})}))})(t),children:(0,ka.jsx)(Ej,{fontSize:"small"})})]},t)}))})]})]})}),(0,ka.jsxs)(fC,{children:[(0,ka.jsx)(ds,{onClick:n,disabled:s,children:"Cancel"}),(0,ka.jsx)(ds,{onClick:async()=>{if(d.valid)if(h.name&&h.cronExpression)if("file"!==h.scriptMode||h.scriptPath)if("inline"!==h.scriptMode||h.inlineScript){l(!0);try{await o(h),n()}catch(e){console.error("Error saving cron job:",e),alert("Failed to save cron job")}finally{l(!1)}}else alert("Please write your script");else alert("Please provide a script path");else alert("Please fill in all required fields")},variant:"contained",disabled:s||!d.valid,children:s?"Saving...":a?"Update":"Create"})]})]});var S},lN=()=>{const[e,t]=(0,r.useState)([]),[n,o]=(0,r.useState)(!0),[a,i]=(0,r.useState)(!1),[s,l]=(0,r.useState)(),[c,d]=(0,r.useState)(!1),[u,h]=(0,r.useState)(null),p=async()=>{try{o(!0);const e=await tr.get("/api/cron-jobs/status");e.data.success&&t(e.data.data)}catch(e){console.error("Error fetching cron jobs:",e)}finally{o(!1)}};(0,r.useEffect)((()=>{p()}),[]);const f=()=>{l(void 0),i(!0)},m=e=>{var t;return null!==(t={node:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-400/30",python:"bg-sky-500/10 text-sky-600 dark:text-sky-400 border-sky-400/30",shell:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-400/30",dotnet:"bg-violet-500/10 text-violet-600 dark:text-violet-400 border-violet-400/30"}[e])&&void 0!==t?t:"bg-neutral-100 dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border-neutral-300 dark:border-neutral-700"};return(0,ka.jsxs)("div",{children:[(0,ka.jsx)(Mj,{title:"Cron Jobs",subtitle:"Schedule and manage automated tasks using PM2's cron feature",actions:(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsxs)("button",{onClick:p,disabled:n,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded border\r border-neutral-200 dark:border-neutral-700\r text-neutral-700 dark:text-neutral-300\r hover:bg-neutral-50 dark:hover:bg-neutral-800\r disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[(0,ka.jsx)(eA,{className:"h-3.5 w-3.5 ".concat(n?"animate-spin":"")}),"Refresh"]}),(0,ka.jsxs)("button",{onClick:f,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded\r bg-primary-600 hover:bg-primary-700 text-white transition-colors",children:[(0,ka.jsx)(p_,{className:"h-3.5 w-3.5"}),"Create Job"]})]})}),(0,ka.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-4",children:[{label:"Total",value:e.length,color:"text-primary-600 dark:text-primary-400"},{label:"Enabled",value:e.filter((e=>e.config.enabled)).length,color:"text-emerald-600 dark:text-emerald-400"},{label:"Running",value:e.filter((e=>e.isRunning)).length,color:"text-sky-600 dark:text-sky-400"},{label:"Scheduled",value:e.filter((e=>e.config.enabled&&!e.isRunning)).length,color:"text-amber-600 dark:text-amber-400"}].map((e=>{let{label:t,value:n,color:r}=e;return(0,ka.jsxs)("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 px-4 py-3",children:[(0,ka.jsx)("p",{className:"text-xl font-bold leading-none ".concat(r),children:n}),(0,ka.jsx)("p",{className:"text-xs text-neutral-500 dark:text-neutral-400 mt-1",children:t})]},t)}))}),0===e.length?(0,ka.jsxs)("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 p-10 text-center",children:[(0,ka.jsx)(Lj,{className:"mx-auto h-8 w-8 text-neutral-300 dark:text-neutral-600 mb-3"}),(0,ka.jsx)("p",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-400",children:"No cron jobs yet"}),(0,ka.jsx)("p",{className:"text-xs text-neutral-400 dark:text-neutral-500 mt-1 mb-4",children:"Create your first scheduled task to automate your workflows"}),(0,ka.jsxs)("button",{onClick:f,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded\r bg-primary-600 hover:bg-primary-700 text-white transition-colors",children:[(0,ka.jsx)(p_,{className:"h-3.5 w-3.5"}),"Create First Job"]})]}):(0,ka.jsx)("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800 overflow-hidden",children:(0,ka.jsxs)("table",{className:"w-full text-xs",children:[(0,ka.jsx)("thead",{children:(0,ka.jsx)("tr",{className:"border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/60",children:["Name","Type","Schedule","Next Run","Status","Enabled",""].map((e=>(0,ka.jsx)("th",{className:"px-3 py-2.5 text-left text-[11px] font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider whitespace-nowrap",children:e},e)))})}),(0,ka.jsx)("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:e.map((e=>(0,ka.jsxs)("tr",{className:"bg-white dark:bg-neutral-900 hover:bg-neutral-50 dark:hover:bg-neutral-800/40 transition-colors",children:[(0,ka.jsxs)("td",{className:"px-3 py-2.5",children:[(0,ka.jsx)("p",{className:"font-semibold text-neutral-900 dark:text-neutral-100",children:e.config.name}),e.config.description&&(0,ka.jsx)("p",{className:"text-neutral-400 dark:text-neutral-500 mt-0.5",children:e.config.description})]}),(0,ka.jsx)("td",{className:"px-3 py-2.5",children:(0,ka.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded border text-[11px] font-medium ".concat(m(e.config.scriptType)),children:[(0,ka.jsx)(tN,{className:"h-3 w-3 shrink-0"}),e.config.scriptType.toUpperCase()]})}),(0,ka.jsx)("td",{className:"px-3 py-2.5",children:(0,ka.jsx)("code",{className:"font-mono text-neutral-600 dark:text-neutral-400",children:e.config.cronExpression})}),(0,ka.jsx)("td",{className:"px-3 py-2.5 text-neutral-500 dark:text-neutral-400 whitespace-nowrap",children:e.nextExecution?new Date(e.nextExecution).toLocaleString():"\u2014"}),(0,ka.jsx)("td",{className:"px-3 py-2.5",children:e.isRunning?(0,ka.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded border text-[11px] font-medium bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-400/30",children:[(0,ka.jsx)(kA,{className:"h-3 w-3"})," Running"]}):e.config.enabled?(0,ka.jsx)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded border text-[11px] font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border-neutral-300 dark:border-neutral-700",children:"Scheduled"}):(0,ka.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded border text-[11px] font-medium bg-red-500/10 text-red-600 dark:text-red-400 border-red-400/30",children:[(0,ka.jsx)(AA,{className:"h-3 w-3"})," Disabled"]})}),(0,ka.jsx)("td",{className:"px-3 py-2.5",children:(0,ka.jsx)("button",{onClick:()=>(async e=>{try{await tr.post("/api/cron-jobs/".concat(e,"/toggle")),p()}catch(t){console.error("Error toggling cron job:",t)}})(e.config.id),className:"relative inline-flex h-5 w-9 shrink-0 rounded-full border-2 border-transparent\n transition-colors duration-200 cursor-pointer\n ".concat(e.config.enabled?"bg-emerald-500":"bg-neutral-300 dark:bg-neutral-600"),children:(0,ka.jsx)("span",{className:"pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow\n transform transition-transform duration-200\n ".concat(e.config.enabled?"translate-x-4":"translate-x-0")})})}),(0,ka.jsx)("td",{className:"px-3 py-2.5",children:(0,ka.jsxs)("div",{className:"flex items-center gap-0.5 justify-end",children:[e.isRunning?(0,ka.jsx)("button",{onClick:()=>(async e=>{try{await tr.post("/api/cron-jobs/".concat(e,"/stop")),p()}catch(t){console.error("Error stopping cron job:",t)}})(e.config.id),title:"Stop",className:"p-1 rounded text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:(0,ka.jsx)(rA,{className:"h-4 w-4"})}):(0,ka.jsx)("button",{onClick:()=>(async e=>{try{await tr.post("/api/cron-jobs/".concat(e,"/start")),p()}catch(t){console.error("Error starting cron job:",t)}})(e.config.id),title:"Start",className:"p-1 rounded text-emerald-600 hover:bg-emerald-50 dark:hover:bg-emerald-900/20 transition-colors",children:(0,ka.jsx)(iA,{className:"h-4 w-4"})}),(0,ka.jsx)("button",{onClick:()=>(e=>{l(e),i(!0)})(e.config),title:"Edit",className:"p-1 rounded text-neutral-500 hover:bg-neutral-100 dark:hover:bg-neutral-800 hover:text-primary-600 transition-colors",children:(0,ka.jsx)(oN,{className:"h-4 w-4"})}),(0,ka.jsx)("button",{onClick:()=>{h(e.config.id),d(!0)},title:"Delete",className:"p-1 rounded text-neutral-500 hover:bg-red-50 dark:hover:bg-red-900/20 hover:text-red-500 transition-colors",children:(0,ka.jsx)(cA,{className:"h-4 w-4"})})]})})]},e.config.id)))})]})}),(0,ka.jsx)(sN,{open:a,onClose:()=>{i(!1),l(void 0)},onSave:async e=>{try{s?await tr.put("/api/cron-jobs/".concat(s.id),e):await tr.post("/api/cron-jobs",e),p(),i(!1)}catch(t){throw console.error("Error saving cron job:",t),t}},editJob:s}),(0,ka.jsx)(mC,{isOpen:c,title:"Delete Cron Job",message:"Are you sure you want to delete this cron job? This action cannot be undone.",onConfirm:async()=>{if(u)try{await tr.delete("/api/cron-jobs/".concat(u)),p(),d(!1),h(null)}catch(e){console.error("Error deleting cron job:",e)}},onCancel:()=>{d(!1),h(null)},type:"danger"})]})},cN=["title","titleId"];function dN(e,t){let{title:n,titleId:o}=e,a=rr(e,cN);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.348 14.652a3.75 3.75 0 0 1 0-5.304m5.304 0a3.75 3.75 0 0 1 0 5.304m-7.425 2.121a6.75 6.75 0 0 1 0-9.546m9.546 0a6.75 6.75 0 0 1 0 9.546M5.106 18.894c-3.808-3.807-3.808-9.98 0-13.788m13.788 0c3.808 3.807 3.808 9.98 0 13.788M12 12h.008v.008H12V12Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"}))}const uN=r.forwardRef(dN);_w.register(Hw,Uw,Hk,Dk,Lk,bk,fk);const hN=[{label:"30 min",ms:18e5},{label:"1 hr",ms:36e5},{label:"6 hr",ms:216e5},{label:"12 hr",ms:432e5},{label:"24 hr",ms:864e5},{label:"7 days",ms:6048e5}];function pN(e){if(0===e.length)return{min:0,max:0,avg:0};let t=e[0],n=e[0],r=0;for(const o of e)o<t&&(t=o),o>n&&(n=o),r+=o;return{min:t,max:n,avg:r/e.length}}const fN=e=>{let{values:t,color:n,width:r=120,height:o=30,max:a}=e;if(t.length<2)return(0,ka.jsx)("span",{style:{display:"inline-block",width:r,height:o,lineHeight:"".concat(o,"px")},className:"text-center text-neutral-300 dark:text-neutral-700 text-xs",children:"\u2014"});const i=r-4,s=o-4,l=null!==a&&void 0!==a?a:Math.max(...t,.01),c=e=>2+s-e/l*s,d=t.map(((e,n)=>"".concat(2+n/(t.length-1)*i,",").concat(c(e)))).join(" "),u=["".concat(2,",").concat(c(t[0])),...t.slice(1).map(((e,n)=>"".concat(2+(n+1)/(t.length-1)*i,",").concat(c(e)))),"".concat(2+i,",").concat(2+s),"".concat(2,",").concat(2+s)].join(" ");return(0,ka.jsxs)("svg",{width:r,height:o,style:{display:"inline-block",verticalAlign:"middle"},children:[(0,ka.jsx)("polygon",{points:u,fill:n,fillOpacity:.12,stroke:"none"}),(0,ka.jsx)("polyline",{points:d,fill:"none",stroke:n,strokeWidth:1.3,strokeLinejoin:"round",strokeLinecap:"round"})]})};function mN(e){if(0===e)return"0 B";const t=e/1048576;return t>=1?"".concat(t.toFixed(1)," MB"):"".concat((e/1024).toFixed(1)," KB")}const gN=e=>{var t;let{processes:n}=e;const[o,a]=(0,r.useState)("live"),[i,s]=(0,r.useState)(""),l=(0,r.useRef)(new Map),[d,u]=(0,r.useState)(0),[h,p]=(0,r.useState)([]),[f,m]=(0,r.useState)(""),[g,x]=(0,r.useState)([]),[b,v]=(0,r.useState)(""),[y,w]=(0,r.useState)(1),[k,S]=(0,r.useState)([]),[j,A]=(0,r.useState)(!1),[C,_]=(0,r.useState)(!1),E=(0,r.useRef)(null);(0,r.useEffect)((()=>{const e=Date.now(),t=l.current;for(const o of n){var r;const n=o.name,a=null!==(r=t.get(n))&&void 0!==r?r:[];a.push({ts:e,cpu:o.monit.cpu,memMb:o.monit.memory/1048576}),a.length>1200&&a.shift(),t.set(n,a)}for(const o of t.keys())n.find((e=>e.name===o))||t.delete(o);u((e=>e+1))}),[n]),(0,r.useEffect)((()=>{!i&&n.length>0&&s(n[0].name)}),[n,i]);const M=(0,r.useCallback)((async()=>{try{const e=await tr.get("/api/remote-metrics/connections");e.data.success&&p(e.data.connections)}catch(e){}}),[]);(0,r.useEffect)((()=>{"history"===o&&M()}),[o,M]),(0,r.useEffect)((()=>{f&&(x([]),v(""),S([]),tr.get("/api/remote-metrics/".concat(encodeURIComponent(f),"/processes")).then((e=>{e.data.success&&(x(e.data.processes),e.data.processes.length>0&&v(e.data.processes[0]))})).catch((()=>{})))}),[f]);const N=(0,r.useCallback)((async()=>{if(f&&b){A(!0);try{const e=hN[y].ms,t=Date.now(),n=await tr.get("/api/remote-metrics/".concat(encodeURIComponent(f),"/").concat(encodeURIComponent(b)),{params:{from:t-e,to:t}});n.data.success&&S(n.data.metrics)}catch(e){}finally{A(!1)}}}),[f,b,y]);(0,r.useEffect)((()=>{N()}),[N]),(0,r.useEffect)((()=>(C?E.current=setInterval(N,3e4):E.current&&clearInterval(E.current),()=>{E.current&&clearInterval(E.current)})),[C,N]);const R=(e,t)=>({responsive:!0,maintainAspectRatio:!1,animation:{duration:0},plugins:{legend:{display:!1},tooltip:{mode:"index",intersect:!1,callbacks:{label:t=>" ".concat(t.parsed.y.toFixed(2)," ").concat(e)}}},scales:{x:{ticks:{font:{size:10},maxTicksLimit:8,maxRotation:0,color:"#9ca3af"},grid:{color:"rgba(156,163,175,0.1)"}},y:c(c({min:0},void 0!==t?{max:t}:{}),{},{ticks:{font:{size:10},color:"#9ca3af"},grid:{color:"rgba(156,163,175,0.1)"},title:{display:!0,text:e,font:{size:10},color:"#9ca3af"}})}}),P=null!==(t=l.current.get(i))&&void 0!==t?t:[],O=P.map((e=>new Date(e.ts).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}))),T=P.map((e=>e.cpu)),L=P.map((e=>e.memMb)),I=pN(T),z=pN(L),D={labels:O,datasets:[{data:T,borderColor:"#6366f1",backgroundColor:"rgba(99,102,241,0.08)",borderWidth:1.5,pointRadius:P.length>60?0:2,tension:.3,fill:!0}]},F={labels:O,datasets:[{data:L,borderColor:"#22d3ee",backgroundColor:"rgba(34,211,238,0.08)",borderWidth:1.5,pointRadius:P.length>60?0:2,tension:.3,fill:!0}]},B=hN[y].ms,W=k.map((e=>function(e,t){const n=new Date(e);return t<=36e5?n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}):t<=864e5?n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):n.toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}(e.timestamp,B))),H=k.map((e=>e.cpu)),V=k.map((e=>e.memory_mb)),U=pN(H),q=pN(V),$={labels:W,datasets:[{data:H,borderColor:"#6366f1",backgroundColor:"rgba(99,102,241,0.08)",borderWidth:1.5,pointRadius:k.length>60?0:2,tension:.3,fill:!0}]},K={labels:W,datasets:[{data:V,borderColor:"#22d3ee",backgroundColor:"rgba(34,211,238,0.08)",borderWidth:1.5,pointRadius:k.length>60?0:2,tension:.3,fill:!0}]},X=e=>{let{label:t,value:n,unit:r,color:o}=e;return(0,ka.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,ka.jsx)("span",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:t}),(0,ka.jsxs)("span",{className:"text-sm font-semibold ".concat(o),children:[n.toFixed(2),(0,ka.jsx)("span",{className:"text-xs font-normal text-neutral-400 ml-0.5",children:r})]})]})},Y=e=>{let{id:t,label:n,icon:r}=e;return(0,ka.jsxs)("button",{onClick:()=>a(t),className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ".concat(o===t?"border-primary-500 text-primary-600 dark:text-primary-400":"border-transparent text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200"),children:[(0,ka.jsx)(r,{className:"h-3.5 w-3.5"}),n]})},G="text-xs px-2 py-1.5 rounded border border-neutral-200 dark:border-neutral-700\n bg-white dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100\n focus:outline-none focus:ring-1 focus:ring-primary-500 disabled:opacity-50",Z=n.find((e=>e.name===i));return(0,ka.jsxs)("div",{children:[(0,ka.jsx)(Mj,{title:"Metrics",subtitle:"Real-time and historical process metrics",actions:"history"===o?(0,ka.jsxs)("button",{onClick:N,disabled:j,className:"flex items-center gap-1.5 px-3 py-1.5 rounded text-xs font-medium\r bg-primary-600 hover:bg-primary-700 text-white disabled:opacity-50 transition-colors",children:[(0,ka.jsx)(eA,{className:"h-3.5 w-3.5 ".concat(j?"animate-spin":"")}),"Refresh"]}):void 0}),(0,ka.jsxs)("div",{className:"flex gap-0 border-b border-neutral-200 dark:border-neutral-800 mb-4",children:[(0,ka.jsx)(Y,{id:"live",label:"Live",icon:uN}),(0,ka.jsx)(Y,{id:"history",label:"History",icon:Lj})]}),"live"===o&&(0,ka.jsxs)("div",{className:"space-y-4",children:[(0,ka.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,ka.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,ka.jsx)("label",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Process"}),(0,ka.jsx)("select",{value:i,onChange:e=>s(e.target.value),className:G,children:0===n.length?(0,ka.jsx)("option",{value:"",children:"No processes running"}):n.map((e=>(0,ka.jsx)("option",{value:e.name,children:e.name},e.pm_id)))})]}),Z&&(0,ka.jsxs)("div",{className:"flex items-center gap-3 text-xs",children:[(0,ka.jsx)("span",{className:"px-2 py-0.5 rounded-full font-medium ".concat("online"===Z.pm2_env.status?"bg-emerald-100 dark:bg-emerald-900/30 text-emerald-700 dark:text-emerald-400":"bg-neutral-100 dark:bg-neutral-800 text-neutral-500"),children:Z.pm2_env.status}),(0,ka.jsxs)("span",{className:"text-neutral-500 dark:text-neutral-400",children:["CPU: ",(0,ka.jsxs)("span",{className:"font-semibold text-indigo-500",children:[Z.monit.cpu.toFixed(1),"%"]})]}),(0,ka.jsxs)("span",{className:"text-neutral-500 dark:text-neutral-400",children:["Mem: ",(0,ka.jsx)("span",{className:"font-semibold text-cyan-500",children:mN(Z.monit.memory)})]}),(0,ka.jsxs)("span",{className:"text-neutral-400 dark:text-neutral-600",children:[P.length," pts \xb7 updates every 3s"]})]})]}),0===n.length?(0,ka.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,ka.jsx)(U_,{className:"h-10 w-10 text-neutral-300 dark:text-neutral-700 mb-3"}),(0,ka.jsx)("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"No processes found"}),(0,ka.jsx)("p",{className:"text-xs text-neutral-400 dark:text-neutral-600 mt-1",children:"Make sure PM2 is running and connected"})]}):(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsxs)("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 p-4",children:[(0,ka.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,ka.jsxs)("div",{children:[(0,ka.jsx)("p",{className:"text-xs font-semibold text-neutral-700 dark:text-neutral-300",children:"CPU Usage"}),(0,ka.jsxs)("p",{className:"text-xs text-neutral-400",children:["rolling ",P.length," pts"]})]}),(0,ka.jsxs)("div",{className:"flex items-center gap-4",children:[(0,ka.jsx)(X,{label:"Min",value:I.min,unit:"%",color:"text-emerald-500"}),(0,ka.jsx)(X,{label:"Avg",value:I.avg,unit:"%",color:"text-primary-400"}),(0,ka.jsx)(X,{label:"Max",value:I.max,unit:"%",color:"text-rose-400"})]})]}),(0,ka.jsx)("div",{className:"h-40",children:P.length>0?(0,ka.jsx)(SS,{data:D,options:R("%",100)}):(0,ka.jsx)("div",{className:"h-full flex items-center justify-center text-xs text-neutral-400",children:"Waiting for data..."})})]}),(0,ka.jsxs)("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 p-4",children:[(0,ka.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,ka.jsxs)("div",{children:[(0,ka.jsx)("p",{className:"text-xs font-semibold text-neutral-700 dark:text-neutral-300",children:"Memory Usage"}),(0,ka.jsxs)("p",{className:"text-xs text-neutral-400",children:["rolling ",P.length," pts"]})]}),(0,ka.jsxs)("div",{className:"flex items-center gap-4",children:[(0,ka.jsx)(X,{label:"Min",value:z.min,unit:"MB",color:"text-emerald-500"}),(0,ka.jsx)(X,{label:"Avg",value:z.avg,unit:"MB",color:"text-cyan-400"}),(0,ka.jsx)(X,{label:"Max",value:z.max,unit:"MB",color:"text-rose-400"})]})]}),(0,ka.jsx)("div",{className:"h-40",children:P.length>0?(0,ka.jsx)(SS,{data:F,options:R("MB")}):(0,ka.jsx)("div",{className:"h-full flex items-center justify-center text-xs text-neutral-400",children:"Waiting for data..."})})]}),(0,ka.jsxs)("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 overflow-hidden",children:[(0,ka.jsx)("div",{className:"px-4 py-2.5 border-b border-neutral-100 dark:border-neutral-800",children:(0,ka.jsx)("p",{className:"text-xs font-semibold text-neutral-700 dark:text-neutral-300",children:"All Processes \u2014 Live Snapshot"})}),(0,ka.jsx)("div",{className:"overflow-x-auto",children:(0,ka.jsxs)("table",{className:"w-full text-xs",children:[(0,ka.jsx)("thead",{children:(0,ka.jsxs)("tr",{className:"text-left text-neutral-500 dark:text-neutral-400 border-b border-neutral-100 dark:border-neutral-800",children:[(0,ka.jsx)("th",{className:"px-4 py-2 font-medium",children:"Name"}),(0,ka.jsx)("th",{className:"px-4 py-2 font-medium",children:"Status"}),(0,ka.jsx)("th",{className:"px-4 py-2 font-medium",children:"CPU"}),(0,ka.jsx)("th",{className:"px-4 py-2 font-medium",children:"CPU (1h)"}),(0,ka.jsx)("th",{className:"px-4 py-2 font-medium",children:"Memory"}),(0,ka.jsx)("th",{className:"px-4 py-2 font-medium",children:"Mem (1h)"}),(0,ka.jsx)("th",{className:"px-4 py-2 font-medium",children:"Restarts"})]})}),(0,ka.jsx)("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:n.map((e=>{var t,n;return(0,ka.jsxs)("tr",{onClick:()=>s(e.name),className:"cursor-pointer transition-colors ".concat(e.name===i?"bg-primary-50 dark:bg-primary-900/20":"hover:bg-neutral-50 dark:hover:bg-neutral-800/50"),children:[(0,ka.jsx)("td",{className:"px-4 py-1.5 font-medium text-neutral-800 dark:text-neutral-200",children:e.name}),(0,ka.jsx)("td",{className:"px-4 py-1.5",children:(0,ka.jsx)("span",{className:"px-1.5 py-0.5 rounded-full text-xs font-medium ".concat("online"===e.pm2_env.status?"bg-emerald-100 dark:bg-emerald-900/30 text-emerald-700 dark:text-emerald-400":"errored"===e.pm2_env.status?"bg-rose-100 dark:bg-rose-900/30 text-rose-700 dark:text-rose-400":"bg-neutral-100 dark:bg-neutral-800 text-neutral-500"),children:e.pm2_env.status})}),(0,ka.jsx)("td",{className:"px-4 py-1.5 tabular-nums",children:(0,ka.jsxs)("span",{className:e.monit.cpu>80?"text-rose-500":e.monit.cpu>50?"text-amber-500":"text-emerald-500",children:[e.monit.cpu.toFixed(1),"%"]})}),(0,ka.jsx)("td",{className:"px-2 py-1",children:(0,ka.jsx)(fN,{values:(null!==(t=l.current.get(e.name))&&void 0!==t?t:[]).map((e=>e.cpu)),color:"#6366f1",max:100})}),(0,ka.jsx)("td",{className:"px-4 py-1.5 text-cyan-600 dark:text-cyan-400 tabular-nums",children:mN(e.monit.memory)}),(0,ka.jsx)("td",{className:"px-2 py-1",children:(0,ka.jsx)(fN,{values:(null!==(n=l.current.get(e.name))&&void 0!==n?n:[]).map((e=>e.memMb)),color:"#22d3ee"})}),(0,ka.jsx)("td",{className:"px-4 py-1.5 text-neutral-500 dark:text-neutral-400 tabular-nums",children:e.pm2_env.restart_time})]},e.pm_id)}))})]})})]})]})]}),"history"===o&&(0,ka.jsxs)("div",{className:"space-y-4",children:[(0,ka.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,ka.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,ka.jsx)("label",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Connection"}),(0,ka.jsxs)("select",{value:f,onChange:e=>m(e.target.value),className:G,children:[(0,ka.jsx)("option",{value:"",children:"-- select connection --"}),h.map((e=>(0,ka.jsx)("option",{value:e.id,children:e.name},e.id)))]})]}),(0,ka.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,ka.jsx)("label",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Process"}),(0,ka.jsx)("select",{value:b,onChange:e=>v(e.target.value),disabled:0===g.length,className:G,children:0===g.length?(0,ka.jsx)("option",{value:"",children:"-- select connection first --"}):g.map((e=>(0,ka.jsx)("option",{value:e,children:e},e)))})]}),(0,ka.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,ka.jsx)("label",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Range"}),(0,ka.jsx)("div",{className:"flex gap-1",children:hN.map(((e,t)=>(0,ka.jsx)("button",{onClick:()=>w(t),className:"text-xs px-2 py-1 rounded transition-colors ".concat(y===t?"bg-primary-600 text-white":"bg-neutral-100 dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 hover:bg-neutral-200 dark:hover:bg-neutral-700"),children:e.label},e.label)))})]}),(0,ka.jsxs)("div",{className:"flex flex-col gap-0.5 ml-auto",children:[(0,ka.jsx)("label",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Auto-refresh (30s)"}),(0,ka.jsx)("button",{onClick:()=>_((e=>!e)),className:"self-start text-xs px-3 py-1.5 rounded border transition-colors ".concat(C?"bg-emerald-600 border-emerald-600 text-white":"border-neutral-300 dark:border-neutral-700 text-neutral-600 dark:text-neutral-400 hover:border-neutral-400"),children:C?"On":"Off"})]})]}),!f&&(0,ka.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,ka.jsx)(U_,{className:"h-10 w-10 text-neutral-300 dark:text-neutral-700 mb-3"}),(0,ka.jsx)("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"Select a connection to view recorded history"}),(0,ka.jsx)("p",{className:"text-xs text-neutral-400 dark:text-neutral-600 mt-1",children:"Metrics are recorded every 30 seconds while a remote server is connected"}),0===h.length&&(0,ka.jsx)("p",{className:"text-xs text-amber-500 mt-3",children:"No data yet \u2014 connect a remote server and wait for the first poll cycle"})]}),f&&!b&&(0,ka.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,ka.jsx)("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"No processes recorded for this connection yet"})}),f&&b&&(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsxs)("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 p-4",children:[(0,ka.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,ka.jsxs)("div",{children:[(0,ka.jsx)("p",{className:"text-xs font-semibold text-neutral-700 dark:text-neutral-300",children:"CPU Usage"}),(0,ka.jsxs)("p",{className:"text-xs text-neutral-400",children:[k.length," data points"]})]}),(0,ka.jsxs)("div",{className:"flex items-center gap-4",children:[(0,ka.jsx)(X,{label:"Min",value:U.min,unit:"%",color:"text-emerald-500"}),(0,ka.jsx)(X,{label:"Avg",value:U.avg,unit:"%",color:"text-primary-400"}),(0,ka.jsx)(X,{label:"Max",value:U.max,unit:"%",color:"text-rose-400"})]})]}),(0,ka.jsx)("div",{className:"h-40",children:k.length>0?(0,ka.jsx)(SS,{data:$,options:R("%",100)}):(0,ka.jsx)("div",{className:"h-full flex items-center justify-center text-xs text-neutral-400",children:"No data for selected range"})})]}),(0,ka.jsxs)("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 p-4",children:[(0,ka.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,ka.jsxs)("div",{children:[(0,ka.jsx)("p",{className:"text-xs font-semibold text-neutral-700 dark:text-neutral-300",children:"Memory Usage"}),(0,ka.jsxs)("p",{className:"text-xs text-neutral-400",children:[k.length," data points"]})]}),(0,ka.jsxs)("div",{className:"flex items-center gap-4",children:[(0,ka.jsx)(X,{label:"Min",value:q.min,unit:"MB",color:"text-emerald-500"}),(0,ka.jsx)(X,{label:"Avg",value:q.avg,unit:"MB",color:"text-cyan-400"}),(0,ka.jsx)(X,{label:"Max",value:q.max,unit:"MB",color:"text-rose-400"})]})]}),(0,ka.jsx)("div",{className:"h-40",children:k.length>0?(0,ka.jsx)(SS,{data:K,options:R("MB")}):(0,ka.jsx)("div",{className:"h-full flex items-center justify-center text-xs text-neutral-400",children:"No data for selected range"})})]}),(0,ka.jsxs)("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 overflow-hidden",children:[(0,ka.jsx)("div",{className:"px-4 py-2.5 border-b border-neutral-100 dark:border-neutral-800",children:(0,ka.jsx)("p",{className:"text-xs font-semibold text-neutral-700 dark:text-neutral-300",children:"Recent Samples (last 20)"})}),(0,ka.jsx)("div",{className:"overflow-x-auto",children:(0,ka.jsxs)("table",{className:"w-full text-xs",children:[(0,ka.jsx)("thead",{children:(0,ka.jsxs)("tr",{className:"text-left text-neutral-500 dark:text-neutral-400 border-b border-neutral-100 dark:border-neutral-800",children:[(0,ka.jsx)("th",{className:"px-4 py-2 font-medium",children:"Time"}),(0,ka.jsx)("th",{className:"px-4 py-2 font-medium",children:"CPU"}),(0,ka.jsx)("th",{className:"px-4 py-2 font-medium",children:"Memory"}),(0,ka.jsx)("th",{className:"px-4 py-2 font-medium",children:"Memory (bytes)"})]})}),(0,ka.jsx)("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[...k].reverse().slice(0,20).map((e=>(0,ka.jsxs)("tr",{className:"hover:bg-neutral-50 dark:hover:bg-neutral-800/50 transition-colors",children:[(0,ka.jsx)("td",{className:"px-4 py-1.5 text-neutral-600 dark:text-neutral-400 tabular-nums",children:new Date(e.timestamp).toLocaleString()}),(0,ka.jsx)("td",{className:"px-4 py-1.5 tabular-nums",children:(0,ka.jsxs)("span",{className:e.cpu>80?"text-rose-500":e.cpu>50?"text-amber-500":"text-emerald-500",children:[e.cpu.toFixed(2),"%"]})}),(0,ka.jsxs)("td",{className:"px-4 py-1.5 text-cyan-600 dark:text-cyan-400 tabular-nums",children:[e.memory_mb.toFixed(2)," MB"]}),(0,ka.jsx)("td",{className:"px-4 py-1.5 text-neutral-500 dark:text-neutral-500 tabular-nums",children:e.memory_bytes.toLocaleString()})]},e.id)))})]})})]})]})]})]})},xN=["title","titleId"];function bN(e,t){let{title:n,titleId:o}=e,a=rr(e,xN);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const vN=r.forwardRef(bN),yN=["title","titleId"];function wN(e,t){let{title:n,titleId:o}=e,a=rr(e,yN);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m3 3 8.735 8.735m0 0a.374.374 0 1 1 .53.53m-.53-.53.53.53m0 0L21 21M14.652 9.348a3.75 3.75 0 0 1 0 5.304m2.121-7.425a6.75 6.75 0 0 1 0 9.546m2.121-11.667c3.808 3.807 3.808 9.98 0 13.788m-9.546-4.242a3.733 3.733 0 0 1-1.06-2.122m-1.061 4.243a6.75 6.75 0 0 1-1.625-6.929m-.496 9.05c-3.068-3.067-3.664-7.67-1.79-11.334M12 12h.008v.008H12V12Z"}))}const kN=r.forwardRef(wN),SN=e=>{var t;let{activeServerId:n,connections:o,darkMode:a,onSwitch:i}=e;const[s,l]=(0,r.useState)(!1),c=(0,r.useRef)(null);(0,r.useEffect)((()=>{const e=e=>{c.current&&!c.current.contains(e.target)&&l(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[]);const d=o.find((e=>e.id===n)),u="local"===n?"Local":(null===d||void 0===d?void 0:d.name)||"Remote",h="local"===n||null!==(t=null===d||void 0===d?void 0:d.connected)&&void 0!==t&&t;return(0,ka.jsxs)("div",{ref:c,className:"relative",children:[(0,ka.jsxs)("button",{onClick:()=>l((e=>!e)),className:"flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium\n border transition-colors duration-100\n ".concat(a?"border-neutral-700 bg-neutral-800 text-neutral-300 hover:bg-neutral-700":"border-neutral-200 bg-white text-neutral-700 hover:bg-neutral-50"),title:"Switch active server",children:[(0,ka.jsx)("div",{className:"w-1.5 h-1.5 rounded-full shrink-0 ".concat(h?"bg-green-500":"bg-neutral-400")}),(0,ka.jsx)(Uj,{className:"h-3 w-3 shrink-0"}),(0,ka.jsx)("span",{className:"max-w-[100px] truncate",children:u}),(0,ka.jsx)(nE,{className:"h-3 w-3 shrink-0 transition-transform ".concat(s?"rotate-180":"")})]}),s&&(0,ka.jsxs)("div",{className:"absolute top-full mt-1.5 right-0 w-60 rounded-lg shadow-xl border z-50 py-1\n ".concat(a?"bg-neutral-800 border-neutral-700":"bg-white border-neutral-200"),children:[(0,ka.jsxs)("button",{onClick:()=>{i("local"),l(!1)},className:"w-full flex items-center gap-2.5 px-3 py-2 text-xs text-left transition-colors\n ".concat(a?"hover:bg-neutral-700":"hover:bg-neutral-50","\n ").concat("local"===n?a?"text-primary-400":"text-primary-600":a?"text-neutral-200":"text-neutral-700"),children:[(0,ka.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-green-500 shrink-0"}),(0,ka.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ka.jsx)("div",{className:"font-medium",children:"Local"}),(0,ka.jsx)("div",{className:"text-xs ".concat(a?"text-neutral-500":"text-neutral-400"),children:"localhost"})]}),"local"===n&&(0,ka.jsx)(vN,{className:"h-3.5 w-3.5 shrink-0 text-primary-500"})]}),o.length>0&&(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsx)("div",{className:"my-1 border-t ".concat(a?"border-neutral-700":"border-neutral-100")}),(0,ka.jsx)("p",{className:"px-3 py-1 text-xs uppercase tracking-wider font-semibold\n ".concat(a?"text-neutral-500":"text-neutral-400"),children:"Remote Servers"}),o.map((e=>(0,ka.jsxs)("button",{onClick:()=>{i(e.id),l(!1)},className:"w-full flex items-center gap-2.5 px-3 py-2 text-xs text-left transition-colors\n ".concat(a?"hover:bg-neutral-700":"hover:bg-neutral-50","\n ").concat(n===e.id?a?"text-primary-400":"text-primary-600":a?"text-neutral-200":"text-neutral-700"),children:[e.connected?(0,ka.jsx)(uN,{className:"h-3.5 w-3.5 shrink-0 text-green-500"}):(0,ka.jsx)(kN,{className:"h-3.5 w-3.5 shrink-0 ".concat(a?"text-neutral-500":"text-neutral-400")}),(0,ka.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ka.jsx)("div",{className:"font-medium truncate",children:e.name}),(0,ka.jsxs)("div",{className:"truncate ".concat(a?"text-neutral-500":"text-neutral-400"),children:[e.username,"@",e.host]})]}),n===e.id&&(0,ka.jsx)(vN,{className:"h-3.5 w-3.5 shrink-0 text-primary-500"})]},e.id)))]})]})]})},jN=["title","titleId"];function AN(e,t){let{title:n,titleId:o}=e,a=rr(e,jN);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z"}))}const CN=r.forwardRef(AN),_N=["title","titleId"];function EN(e,t){let{title:n,titleId:o}=e,a=rr(e,_N);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9.75 14.25 12m0 0 2.25 2.25M14.25 12l2.25-2.25M14.25 12 12 14.25m-2.58 4.92-6.374-6.375a1.125 1.125 0 0 1 0-1.59L9.42 4.83c.21-.211.497-.33.795-.33H19.5a2.25 2.25 0 0 1 2.25 2.25v10.5a2.25 2.25 0 0 1-2.25 2.25h-9.284c-.298 0-.585-.119-.795-.33Z"}))}const MN=r.forwardRef(EN),NN=e=>{let{darkMode:t,onUnlock:n,pinSet:o,passwordSet:a}=e;const[i,s]=(0,r.useState)(o?"pin":"password"),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)(""),[h,p]=(0,r.useState)(""),[f,m]=(0,r.useState)(!1),g=e=>{s(e),p(""),c(""),u("")},x=e=>{if(f||l.length>=4)return;const t=l+e;c(t),p(""),4===t.length&&(async e=>{m(!0),p("");try{const t=await fetch("/api/auth/pin/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pin:e})}),r=await t.json();r.success?n():(p(r.error||"Incorrect PIN"),c(""))}catch(t){p("Could not reach the server."),c("")}finally{m(!1)}})(t)};(0,r.useEffect)((()=>{if("pin"!==i)return;const e=e=>{e.key>="0"&&e.key<="9"?x(e.key):"Backspace"===e.key?c((e=>e.slice(0,-1))):"Escape"===e.key&&(c(""),p(""))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}),[i,l,f]);const b=t?"bg-neutral-950":"bg-neutral-100",v=t?"bg-neutral-900 border-neutral-800":"bg-white border-neutral-200",y=t?"text-neutral-100":"text-neutral-900",w="text-neutral-500",k=t?"bg-neutral-800 hover:bg-neutral-700 active:bg-neutral-600 text-neutral-100":"bg-neutral-100 hover:bg-neutral-200 active:bg-neutral-300 text-neutral-900";return(0,ka.jsx)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center ".concat(b),children:(0,ka.jsxs)("div",{className:"w-full max-w-xs mx-4 rounded-xl border shadow-2xl overflow-hidden ".concat(v),children:[(0,ka.jsxs)("div",{className:"px-6 pt-7 pb-3 text-center",children:[(0,ka.jsx)("div",{className:"inline-flex items-center justify-center w-11 h-11 rounded-full bg-primary-600/10 mb-3",children:(0,ka.jsx)(CN,{className:"h-5 w-5 text-primary-500"})}),(0,ka.jsx)("h1",{className:"text-sm font-semibold mb-0.5 ".concat(y),children:"EZ PM2 GUI"}),(0,ka.jsx)("p",{className:"text-xs ".concat(w),children:"pin"===i?"Enter your PIN to continue":"Enter your password to continue"})]}),o&&a&&(0,ka.jsxs)("div",{className:"flex mx-5 mb-3 rounded-lg overflow-hidden border text-xs font-medium ".concat(t?"border-neutral-700":"border-neutral-200"),children:[(0,ka.jsx)("button",{onClick:()=>g("pin"),className:"flex-1 py-1.5 transition-colors ".concat("pin"===i?"bg-primary-600 text-white":t?"text-neutral-400 hover:text-neutral-200":"text-neutral-500 hover:text-neutral-700"),children:"PIN"}),(0,ka.jsx)("button",{onClick:()=>g("password"),className:"flex-1 py-1.5 transition-colors ".concat("password"===i?"bg-primary-600 text-white":t?"text-neutral-400 hover:text-neutral-200":"text-neutral-500 hover:text-neutral-700"),children:"Password"})]}),"pin"===i&&(0,ka.jsxs)("div",{className:"px-6 pb-7",children:[(0,ka.jsx)("div",{className:"flex justify-center gap-4 mb-5 mt-1",children:Array.from({length:4}).map(((e,n)=>(0,ka.jsx)("div",{className:"w-3 h-3 rounded-full border-2 transition-all duration-100 ".concat(n<l.length?"bg-primary-500 border-primary-500 scale-110":t?"border-neutral-600":"border-neutral-300")},n)))}),h&&(0,ka.jsx)("p",{className:"text-xs text-red-500 text-center mb-3 -mt-1",children:h}),(0,ka.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[["1","2","3","4","5","6","7","8","9"].map((e=>(0,ka.jsx)("button",{onClick:()=>x(e),disabled:f,className:"py-3.5 rounded-lg text-base font-semibold transition-colors select-none disabled:opacity-40 ".concat(k),children:e},e))),(0,ka.jsx)("button",{onClick:()=>{c(""),p("")},disabled:f,className:"py-3.5 rounded-lg text-xs font-medium transition-colors select-none disabled:opacity-40 ".concat(w," ").concat(t?"hover:text-neutral-300":"hover:text-neutral-600"),children:"Clear"}),(0,ka.jsx)("button",{onClick:()=>x("0"),disabled:f,className:"py-3.5 rounded-lg text-base font-semibold transition-colors select-none disabled:opacity-40 ".concat(k),children:"0"}),(0,ka.jsx)("button",{onClick:()=>{c((e=>e.slice(0,-1))),p("")},disabled:f||0===l.length,className:"py-3.5 rounded-lg flex items-center justify-center transition-colors select-none disabled:opacity-30 ".concat(w," ").concat(t?"hover:text-neutral-200":"hover:text-neutral-700"),children:(0,ka.jsx)(MN,{className:"h-5 w-5"})})]}),f&&(0,ka.jsx)("p",{className:"text-xs text-center mt-3 ".concat(w),children:"Verifying\u2026"})]}),"password"===i&&(0,ka.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),d){m(!0),p("");try{const e=await fetch("/api/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:d})}),t=await e.json();t.success?n():(p(t.error||"Incorrect password"),u(""))}catch(t){p("Could not reach the server.")}finally{m(!1)}}},className:"px-6 pb-7 space-y-3",children:[(0,ka.jsx)("input",{type:"password",value:d,onChange:e=>u(e.target.value),placeholder:"Password",autoFocus:!0,className:"w-full px-3 py-2 rounded-lg border text-sm outline-none transition-colors ".concat(t?"bg-neutral-800 border-neutral-700 text-neutral-100 placeholder-neutral-500 focus:border-primary-500":"bg-neutral-50 border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-primary-500"," ").concat(h?"border-red-500":"")}),h&&(0,ka.jsx)("p",{className:"text-xs text-red-500",children:h}),(0,ka.jsx)("button",{type:"submit",disabled:f||!d,className:"w-full py-2 rounded-lg bg-primary-600 hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed text-white text-sm font-medium transition-colors",children:f?"Verifying\u2026":"Unlock"})]})]})})},RN=["title","titleId"];function PN(e,t){let{title:n,titleId:o}=e,a=rr(e,RN);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"}))}const ON=r.forwardRef(PN),TN=["title","titleId"];function LN(e,t){let{title:n,titleId:o}=e,a=rr(e,TN);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"}))}const IN=r.forwardRef(LN),zN=["title","titleId"];function DN(e,t){let{title:n,titleId:o}=e,a=rr(e,zN);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5V6.75a4.5 4.5 0 1 1 9 0v3.75M3.75 21.75h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H3.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z"}))}const FN=r.forwardRef(DN),BN=["title","titleId"];function WN(e,t){let{title:n,titleId:o}=e,a=rr(e,BN);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"}))}const HN=r.forwardRef(WN),VN=["title","titleId"];function UN(e,t){let{title:n,titleId:o}=e,a=rr(e,VN);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"}))}const qN=r.forwardRef(UN),$N=[{version:"1.6.0",date:"April 2026",headline:"App Security & Lock Screen",changes:[{title:"PIN Lock Screen",description:"Protect the app with a 4-digit PIN. The lock screen shows a numeric keypad that auto-submits on the 4th digit. Keyboard entry is also supported.",icon:ON,color:"text-violet-500",tag:"New"},{title:"Password Protection",description:"Optionally require a password before the app is accessible. Set, change, or remove password protection from the Security section in Settings.",icon:IN,color:"text-blue-500",tag:"New"},{title:"Lock / Unlock Toggle",description:"A lock button in the top navbar lets you manually lock the app at any time. Reopening the tab restores your unlocked session automatically.",icon:CN,color:"text-primary-500",tag:"New"},{title:"Session Persistence",description:"Once unlocked, the session stays unlocked through page refreshes within the same browser tab \u2014 no need to re-enter credentials on every reload.",icon:FN,color:"text-green-500",tag:"New"},{title:"Auto-Lock on Inactivity",description:"Configure an inactivity timeout (in minutes) from Settings > Security. The app automatically locks after the specified idle period. Set to 0 to disable.",icon:Lj,color:"text-orange-500",tag:"New"},{title:"PIN + Password Dual Mode",description:"When both PIN and password are configured, the lock screen shows a toggle so you can choose which method to use. Defaults to PIN for convenience.",icon:HN,color:"text-pink-500",tag:"Improved"}]}],KN={New:"bg-green-500/10 text-green-500 border border-green-500/20",Improved:"bg-blue-500/10 text-blue-500 border border-blue-500/20",Fix:"bg-orange-500/10 text-orange-500 border border-orange-500/20"},XN=()=>(0,ka.jsxs)("div",{className:"max-w-3xl mx-auto px-4 py-6",children:[(0,ka.jsxs)("div",{className:"mb-8",children:[(0,ka.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,ka.jsx)(HN,{className:"h-5 w-5 text-primary-500"}),(0,ka.jsx)("h1",{className:"text-lg font-bold text-neutral-900 dark:text-neutral-100",children:"What's New"})]}),(0,ka.jsx)("p",{className:"text-xs text-neutral-500 dark:text-neutral-500",children:"Latest updates and improvements to EZ PM2 GUI"})]}),$N.map((e=>(0,ka.jsxs)("div",{className:"mb-10",children:[(0,ka.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,ka.jsxs)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-bold bg-primary-600 text-white tracking-wide",children:["v",e.version]}),(0,ka.jsx)("span",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-200",children:e.headline}),(0,ka.jsx)("span",{className:"ml-auto text-xs text-neutral-400 dark:text-neutral-600",children:e.date})]}),(0,ka.jsx)("div",{className:"h-px bg-neutral-200 dark:bg-neutral-800 mb-4"}),(0,ka.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:e.changes.map((e=>{const t=e.icon;return(0,ka.jsx)("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800\r bg-white dark:bg-neutral-900 p-4\r hover:border-neutral-300 dark:hover:border-neutral-700\r transition-colors duration-150",children:(0,ka.jsxs)("div",{className:"flex items-start gap-3",children:[(0,ka.jsx)("div",{className:"mt-0.5 shrink-0 w-8 h-8 rounded-md bg-neutral-100 dark:bg-neutral-800\r flex items-center justify-center",children:(0,ka.jsx)(t,{className:"h-4 w-4 ".concat(e.color)})}),(0,ka.jsxs)("div",{className:"min-w-0",children:[(0,ka.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,ka.jsx)("span",{className:"text-xs font-semibold text-neutral-900 dark:text-neutral-100",children:e.title}),(0,ka.jsx)("span",{className:"shrink-0 text-[10px] font-semibold px-1.5 py-0.5 rounded-full ".concat(KN[e.tag]),children:e.tag})]}),(0,ka.jsx)("p",{className:"text-xs text-neutral-500 dark:text-neutral-400 leading-relaxed",children:e.description})]})]})},e.title)}))})]},e.version))),(0,ka.jsxs)("div",{className:"mt-6 rounded-lg border border-neutral-200 dark:border-neutral-800\r bg-neutral-50 dark:bg-neutral-900/50 p-4 flex items-center justify-between",children:[(0,ka.jsxs)("div",{children:[(0,ka.jsx)("p",{className:"text-xs font-semibold text-neutral-800 dark:text-neutral-200 mb-0.5",children:"Configure Security"}),(0,ka.jsx)("p",{className:"text-xs text-neutral-500 dark:text-neutral-500",children:"Set up PIN and password protection from Settings."})]}),(0,ka.jsxs)(ca,{to:"/settings",className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md\r bg-primary-600 hover:bg-primary-700 text-white text-xs font-medium\r transition-colors duration-150",children:["Open Settings",(0,ka.jsx)(qN,{className:"h-3.5 w-3.5"})]})]})]}),YN=["title","titleId"];function GN(e,t){let{title:n,titleId:o}=e,a=rr(e,YN);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"}))}const ZN=r.forwardRef(GN),JN="1.7.0",QN="ezpm2_whats_new_seen_v".concat(JN),eR=[{icon:uN,color:"text-indigo-500",bg:"bg-indigo-500/10",title:"Live Metrics Page",description:"Per-process rolling 1-hour CPU and memory sparklines, updated every 3s. Find it under Metrics in the sidebar."},{icon:U_,color:"text-cyan-500",bg:"bg-cyan-500/10",title:"Metrics History (SQLite)",description:"Remote process metrics recorded every 30s to a local SQLite DB. View CPU and memory charts across 30 min to 7 days."},{icon:Dj,color:"text-emerald-500",bg:"bg-emerald-500/10",title:"Inline Sparklines",description:"Every row in the Metrics table now shows a 1-hour CPU and memory micro-graph \u2014 no extra click required."},{icon:Wj,color:"text-violet-500",bg:"bg-violet-500/10",title:"Background Metrics Poller",description:"Server-side poller samples connected remote servers every 30s regardless of which page you are on."},{icon:Lj,color:"text-orange-500",bg:"bg-orange-500/10",title:"30-Day Retention",description:"Historical metrics auto-purge after 30 days to keep the database lean. Downsampling kicks in beyond 500 points."}];const tR=e=>{let{open:t,onClose:n,darkMode:o}=e;const a=(0,r.useRef)(null);if((0,r.useEffect)((()=>{if(!t)return;const e=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}),[t,n]),(0,r.useEffect)((()=>(document.body.style.overflow=t?"hidden":"",()=>{document.body.style.overflow=""})),[t]),!t)return null;const i="relative w-full max-w-md rounded-2xl border shadow-2xl overflow-hidden ".concat(o?"bg-neutral-900 border-neutral-800":"bg-white border-neutral-200"),s=o?"text-neutral-100":"text-neutral-900",l=o?"text-neutral-400":"text-neutral-500",c=o?"border-neutral-800":"border-neutral-100";return(0,ka.jsx)("div",{ref:a,className:"fixed inset-0 z-[9998] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:e=>{e.target===a.current&&n()},children:(0,ka.jsxs)("div",{className:i,children:[(0,ka.jsx)("div",{className:"px-5 pt-5 pb-4 border-b ".concat(c),children:(0,ka.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,ka.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ka.jsx)("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-violet-500 to-primary-600 flex items-center justify-center shrink-0",children:(0,ka.jsx)(HN,{className:"h-4.5 w-4.5 text-white h-5 w-5"})}),(0,ka.jsxs)("div",{children:[(0,ka.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ka.jsx)("h2",{className:"text-sm font-bold ".concat(s),children:"What's New"}),(0,ka.jsxs)("span",{className:"text-[10px] font-bold px-1.5 py-0.5 rounded-full bg-violet-500/15 text-violet-500 border border-violet-500/25 leading-none",children:["v",JN]})]}),(0,ka.jsx)("p",{className:"text-[11px] mt-0.5 ".concat(l),children:"EZ PM2 GUI \xb7 April 2026"})]})]}),(0,ka.jsx)("button",{onClick:n,className:"p-1 rounded-md transition-colors ".concat(o?"text-neutral-500 hover:text-neutral-300 hover:bg-neutral-800":"text-neutral-400 hover:text-neutral-600 hover:bg-neutral-100"),children:(0,ka.jsx)(d_,{className:"h-4 w-4"})})]})}),(0,ka.jsx)("div",{className:"px-5 py-3 space-y-2.5 max-h-72 overflow-y-auto",children:eR.map((e=>{const t=e.icon;return(0,ka.jsxs)("div",{className:"flex items-start gap-3",children:[(0,ka.jsx)("div",{className:"mt-0.5 shrink-0 w-7 h-7 rounded-lg ".concat(e.bg," flex items-center justify-center"),children:(0,ka.jsx)(t,{className:"h-3.5 w-3.5 ".concat(e.color)})}),(0,ka.jsxs)("div",{children:[(0,ka.jsx)("p",{className:"text-xs font-semibold leading-tight ".concat(s),children:e.title}),(0,ka.jsx)("p",{className:"text-[11px] leading-relaxed mt-0.5 ".concat(l),children:e.description})]})]},e.title)}))}),(0,ka.jsxs)("div",{className:"px-5 py-3 border-t ".concat(c," flex items-center justify-between gap-3"),children:[(0,ka.jsxs)(ca,{to:"/whats-new",onClick:n,className:"flex items-center gap-1 text-xs font-medium transition-colors ".concat(o?"text-neutral-400 hover:text-neutral-200":"text-neutral-500 hover:text-neutral-700"),children:["Full changelog",(0,ka.jsx)(ZN,{className:"h-3 w-3"})]}),(0,ka.jsx)("button",{onClick:n,className:"px-4 py-1.5 rounded-lg bg-primary-600 hover:bg-primary-700 text-white text-xs font-semibold transition-colors",children:"Got it"})]})]})})},nR=["title","titleId"];function rR(e,t){let{title:n,titleId:o}=e,a=rr(e,nR);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))}const oR=["Use pm2 save to persist your process list across reboots.","Cluster mode spreads your app across all CPU cores for maximum throughput.","PM2 automatically restarts crashed processes \u2014 no babysitting required.","Use an Ecosystem Config file to manage all your apps in one place.","Watch mode restarts your app automatically whenever a source file changes.","Log rotation prevents log files from growing unbounded on long-running servers.","You can assign a namespace to group related processes together in the dashboard.","Remote Servers lets you monitor and control PM2 on other machines from here.","The Deploy App wizard generates a pm2 start command from a visual form."],aR={error:{label:"ERR",labelClass:"bg-red-600 text-white",icon:EA,textClass:"text-red-300"},warn:{label:"WARN",labelClass:"bg-amber-500 text-white",icon:r.forwardRef(rR),textClass:"text-amber-200"},success:{label:"OK",labelClass:"bg-emerald-600 text-white",icon:kA,textClass:"text-emerald-300"},info:{label:"INFO",labelClass:"bg-sky-600 text-white",icon:Zj,textClass:"text-sky-200"}},iR=e=>{let{notifications:t,onDismiss:n,status:o}=e;const a=t[0],[i,s]=(0,r.useState)((()=>Math.floor(Math.random()*oR.length))),[l,c]=(0,r.useState)(!0),d=(0,r.useRef)(null);(0,r.useEffect)((()=>(d.current=setInterval((()=>{c(!1),setTimeout((()=>{s((e=>(e+1)%oR.length)),c(!0)}),400)}),8e3),()=>{d.current&&clearInterval(d.current)})),[]);const[u,h]=(0,r.useState)(!1);(0,r.useEffect)((()=>{if(!a)return void h(!1);const e=setTimeout((()=>h(!0)),10),t=setTimeout((()=>h(!1)),9e3),r=setTimeout((()=>n(a.id)),1e4);return()=>{clearTimeout(e),clearTimeout(t),clearTimeout(r)}}),[null===a||void 0===a?void 0:a.id]);const p=t.length-1;return(0,ka.jsxs)("div",{className:"fixed bottom-0 left-0 right-0 z-[60] flex items-center h-[22px] bg-neutral-900 dark:bg-[#0d1117] border-t border-neutral-800 dark:border-neutral-900 text-[11px] select-none",children:[(0,ka.jsxs)("div",{className:"flex items-center shrink-0 h-full",children:[(0,ka.jsxs)("div",{className:"flex items-center gap-1 px-2.5 h-full border-r border-neutral-800 dark:border-neutral-900 ".concat(o.connected?"text-emerald-400 hover:bg-emerald-900/20":"text-red-400 hover:bg-red-900/20"," transition-colors cursor-default"),children:[o.connected?(0,ka.jsx)(uN,{className:"h-3 w-3 shrink-0"}):(0,ka.jsx)(kN,{className:"h-3 w-3 shrink-0 animate-pulse"}),(0,ka.jsx)("span",{className:"font-medium",children:o.connected?"Connected":"Disconnected"})]}),(0,ka.jsx)("div",{className:"flex items-center px-2.5 h-full border-r border-neutral-800 dark:border-neutral-900 text-neutral-400 hover:bg-neutral-800/60 transition-colors cursor-default",children:"local"===o.activeServer?"Local":o.activeServer}),(0,ka.jsxs)("div",{className:"flex items-center gap-1 px-2.5 h-full border-r border-neutral-800 dark:border-neutral-900 text-neutral-400 hover:bg-neutral-800/60 transition-colors cursor-default",children:[(0,ka.jsx)("span",{className:"font-semibold text-neutral-200",children:o.onlineCount}),(0,ka.jsx)("span",{className:"text-neutral-600",children:"/"}),(0,ka.jsx)("span",{children:o.processCount}),(0,ka.jsx)("span",{className:"text-neutral-500 ml-0.5",children:"online"})]})]}),(0,ka.jsx)("div",{className:"flex-1 flex items-center gap-2 px-3 min-w-0 overflow-hidden",children:a?(0,ka.jsx)("div",{className:"flex items-center gap-2 min-w-0 transition-opacity duration-300 ".concat(u?"opacity-100":"opacity-0"),children:(e=>{const t=null!==(e=aR[a.type])&&void 0!==e?e:aR.info;return(0,ka.jsxs)(ka.Fragment,{children:[(0,ka.jsx)("span",{className:"shrink-0 text-[9px] font-bold px-1.5 py-px rounded ".concat(t.labelClass),children:t.label}),(0,ka.jsx)("span",{className:"truncate font-medium ".concat(t.textClass),children:a.message}),p>0&&(0,ka.jsxs)("span",{className:"shrink-0 text-[9px] font-semibold bg-neutral-700 text-neutral-300 rounded-full px-1.5 py-px",children:["+",p]}),(0,ka.jsx)("button",{onClick:()=>n(a.id),className:"shrink-0 text-neutral-500 hover:text-neutral-300 transition-colors ml-0.5","aria-label":"Dismiss",children:(0,ka.jsx)(d_,{className:"h-3 w-3"})})]})})()}):(0,ka.jsxs)("div",{className:"flex items-center gap-2 min-w-0 transition-opacity duration-400 ".concat(l?"opacity-100":"opacity-0"),children:[(0,ka.jsx)("span",{className:"shrink-0 text-[9px] font-bold px-1.5 py-px rounded bg-violet-700/80 text-violet-200",children:"TIP"}),(0,ka.jsx)("span",{className:"truncate text-neutral-500",children:oR[i]})]})}),(0,ka.jsx)("div",{className:"shrink-0 px-3 text-neutral-600 hover:text-neutral-400 transition-colors cursor-default",children:"v1.6.0"})]})};var sR=n(4802),lR=n(6191);const cR=["title","titleId"];function dR(e,t){let{title:n,titleId:o}=e,a=rr(e,cR);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"}))}const uR=r.forwardRef(dR),hR=["title","titleId"];function pR(e,t){let{title:n,titleId:o}=e,a=rr(e,hR);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m0-10.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.75c0 5.592 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.57-.598-3.75h-.152c-3.196 0-6.1-1.25-8.25-3.286Zm0 13.036h.008v.008H12v-.008Z"}))}const fR=r.forwardRef(pR),mR=["title","titleId"];function gR(e,t){let{title:n,titleId:o}=e,a=rr(e,mR);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 11.25-3-3m0 0-3 3m3-3v7.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const xR=r.forwardRef(gR),bR=["title","titleId"];function vR(e,t){let{title:n,titleId:o}=e,a=rr(e,bR);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z"}))}const yR=r.forwardRef(vR),wR=["title","titleId"];function kR(e,t){let{title:n,titleId:o}=e,a=rr(e,wR);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"}))}const SR=r.forwardRef(kR),jR=["title","titleId"];function AR(e,t){let{title:n,titleId:o}=e,a=rr(e,jR);return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),n?r.createElement("title",{id:o},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"}))}const CR=r.forwardRef(AR),_R=Re("http://localhost:3101",{reconnection:!0,reconnectionDelay:1e3,reconnectionDelayMax:5e3,reconnectionAttempts:1/0,timeout:1e4,transports:["websocket","polling"],upgrade:!0,forceNew:!1}),ER=()=>{const[e,t]=(0,r.useState)([]),[n,o]=(0,r.useState)([]),[a,i]=(0,r.useState)({loadAvg:[0,0,0],memory:{total:0,free:0,used:0},uptime:0,cpus:0}),[s,l]=(0,r.useState)([]),d=(0,r.useRef)(0),[u,h]=(0,r.useState)(_R.connected),p=(0,r.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error";const n="notif-".concat(++d.current);l((r=>[...r,{id:n,message:e,type:t}]))}),[]),f=(0,r.useCallback)((e=>{l((t=>t.filter((t=>t.id!==e))))}),[]),[m,g]=(0,r.useState)(!0),[x,b]=(0,r.useState)(""),[v,y]=(0,r.useState)("all"),[w,k]=(0,r.useState)("all"),[S,j]=(0,r.useState)(!1),[A,C]=(0,r.useState)(!1),[_,E]=(0,r.useState)((()=>"1"===localStorage.getItem("ezpm2_sidebar_collapsed"))),[M,N]=(0,r.useState)(!1),[R,P]=(0,r.useState)(null),[O,T]=(0,r.useState)(null),[L,I]=(0,r.useState)((()=>"1"===localStorage.getItem("ezpm2_unlocked"))),z=(0,r.useRef)(null),[D,F]=(0,r.useState)(!1),[B,W]=(0,r.useState)("undefined"===typeof window||window.matchMedia("(prefers-color-scheme: dark)").matches);(0,r.useEffect)((()=>{B?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}),[B]);const[H,V]=(0,r.useState)("local"),U=(0,r.useRef)("local"),[q,$]=(0,r.useState)([]),[K,X]=(0,r.useState)({isOpen:!1,title:"",message:"",action:"",processId:null});(0,r.useEffect)((()=>{let e=Date.now(),n=null,r=_R.connected;return(async()=>{try{const[n,r,o]=await Promise.all([tr.get("/api/processes"),tr.get("/api/metrics"),tr.get("/api/remote/connections").catch((()=>({data:[]})))]);t(n.data),i(r.data),$(o.data),g(!1),e=Date.now()}catch(NR){var n,r;console.error("Error fetching initial data:",NR),null!==(n=NR.response)&&void 0!==n&&null!==(r=n.data)&&void 0!==r&&r.pmNotInstalled?p(NR.response.data.error||"PM2 is not installed. Please install PM2 globally: npm install -g pm2"):p("Failed to connect to the server. Is PM2 running?"),g(!1)}})(),_R.on("processes",(n=>{"local"===U.current&&(t(n),e=Date.now())})),_R.on("metrics",(t=>{i(t),e=Date.now()})),_R.on("connect_error",(()=>{console.warn("Socket connect_error event detected");Date.now()-e>5e3&&(n&&clearTimeout(n),n=setTimeout((()=>{Date.now()-e>5e3&&!r&&p("Connection to server lost. Trying to reconnect...","warn")}),3e3))})),_R.on("connect",(()=>{console.log("Socket connected successfully"),r=!0,h(!0),e=Date.now(),n&&(clearTimeout(n),n=null)})),_R.on("disconnect",(t=>{console.log("Socket disconnected:",t),r=!1,h(!1),"io server disconnect"!==t&&"transport close"!==t||(n&&clearTimeout(n),n=setTimeout((()=>{!r&&Date.now()-e>5e3&&p("Connection to server lost. Trying to reconnect...","warn")}),5e3))})),()=>{n&&clearTimeout(n),_R.off("processes"),_R.off("metrics"),_R.off("connect_error"),_R.off("connect"),_R.off("disconnect")}}),[p]),(0,r.useEffect)((()=>{let t=[...e];if("all"!==w&&(t=t.filter((e=>{var t;return((null===(t=e.pm2_env)||void 0===t?void 0:t.namespace)||"default")===w}))),"all"!==v&&(t=t.filter((e=>e.pm2_env.status===v))),x.trim()){const e=x.toLowerCase();t=t.filter((t=>t.name.toLowerCase().includes(e)||String(t.pm_id).includes(e)))}o(t)}),[e,x,v,w]),(0,r.useEffect)((()=>{if("local"===H)return;const e=async()=>{try{const e=await tr.get("/api/remote/".concat(H,"/processes"));t(e.data)}catch(NR){var e,n;console.error("Error fetching remote processes:",NR),p("Failed to fetch processes from remote server: ".concat((null===(e=NR.response)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.error)||NR.message))}};e();const n=setInterval(e,3e3);return()=>clearInterval(n)}),[H,p]),(0,r.useEffect)((()=>{const e=setInterval((async()=>{try{const e=await tr.get("/api/remote/connections");$(e.data)}catch(e){}}),5e3);return()=>clearInterval(e)}),[]),(0,r.useEffect)((()=>{B?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}),[B]),(0,r.useEffect)((()=>{const e=setTimeout((async()=>{try{var e;const t=await fetch("/api/update/check"),n=await t.json();n.success&&null!==(e=n.data)&&void 0!==e&&e.updateAvailable&&N(!0)}catch(t){}}),4e3);return()=>clearTimeout(e)}),[]);const[Y,G]=(0,r.useState)(0);(0,r.useEffect)((()=>{fetch("/api/auth/status").then((e=>e.json())).then((e=>{var t,n,r;P(null!==(t=e.passwordSet)&&void 0!==t&&t),T(null!==(n=e.pinSet)&&void 0!==n&&n),G(null!==(r=e.autoLockMinutes)&&void 0!==r?r:0)})).catch((()=>{P(!1),T(!1)}))}),[]),(0,r.useEffect)((()=>{L?localStorage.setItem("ezpm2_unlocked","1"):localStorage.removeItem("ezpm2_unlocked")}),[L]),(0,r.useEffect)((()=>{if(!L||Y<=0)return;const e=60*Y*1e3,t=()=>{z.current&&clearTimeout(z.current),z.current=setTimeout((()=>{I(!1)}),e)},n=["mousemove","mousedown","keydown","touchstart","scroll"];return n.forEach((e=>window.addEventListener(e,t,{passive:!0}))),t(),()=>{n.forEach((e=>window.removeEventListener(e,t))),z.current&&clearTimeout(z.current)}}),[L,Y]),(0,r.useEffect)((()=>{const e=e=>{const t=e.detail;G(t.autoLockMinutes)};return window.addEventListener("ezpm2_autolock_changed",e),()=>window.removeEventListener("ezpm2_autolock_changed",e)}),[]);const Z=(t,n)=>{if(["stop","delete","restart"].includes(n)){var r;const o=(null===(r=e.find((e=>e.pm_id===t)))||void 0===r?void 0:r.name)||"Process ".concat(t);let a,i;switch(n){case"stop":a="Stop Process?",i="Are you sure you want to stop ".concat(o,"?");break;case"delete":a="Delete Process?",i="Are you sure you want to delete ".concat(o," from PM2?");break;case"restart":a="Restart Process?",i="Are you sure you want to restart ".concat(o,"?");break;default:a="Confirm Action",i="Are you sure you want to ".concat(n," ").concat(o,"?")}X({isOpen:!0,title:a,message:i,action:n,processId:t})}else J(t,n)},J=async(t,n)=>{try{if("local"!==U.current){const r=e.find((e=>e.pm_id===t)),o=(null===r||void 0===r?void 0:r.name)||String(t);await tr.post("/api/remote/".concat(U.current,"/processes/").concat(o,"/").concat(n))}else await tr.post("/api/process/".concat(t,"/").concat(n))}catch(NR){console.error("Error performing ".concat(n,":"),NR),p("Failed to ".concat(n," process. ").concat(NR instanceof Error?NR.message:"Unknown error"))}},Q=()=>{j(!S)};(0,r.useEffect)((()=>{if("1"!==localStorage.getItem(QN)){const e=setTimeout((()=>{F(!0),localStorage.setItem(QN,"1")}),800);return()=>clearTimeout(e)}}),[]);const ee=()=>{C(!A)},te=async e=>{if(e!==H)if(t([]),U.current=e,V(e),"local"!==e){const t=q.find((t=>t.id===e));if(t&&!t.connected)try{await tr.post("/api/remote/".concat(e,"/connect"));const t=await tr.get("/api/remote/connections");$(t.data)}catch(NR){var n,r;p("Failed to connect to ".concat(t.name||t.host,": ").concat((null===(n=NR.response)||void 0===n||null===(r=n.data)||void 0===r?void 0:r.error)||NR.message))}}else try{const[e,n]=await Promise.all([tr.get("/api/processes"),tr.get("/api/metrics")]);t(e.data),i(n.data)}catch(NR){console.error("Error restoring local processes:",NR)}},ne=e=>{b(e.target.value)},re=e=>{y(e.target.value)},oe=e=>{k(e.target.value)};if(m)return(0,ka.jsx)("div",{className:"min-h-screen flex items-center justify-center ".concat(B?"bg-neutral-950":"bg-neutral-100"),children:(0,ka.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,ka.jsx)("div",{className:"animate-spin rounded-full h-5 w-5 border-2 border-primary-500 border-t-transparent"}),(0,ka.jsx)("span",{className:"text-sm font-medium ".concat(B?"text-neutral-300":"text-neutral-600"),children:"Loading PM2 data\u2026"})]})});const ae=(0,xa.A)({palette:c({mode:B?"dark":"light"},B?{background:{default:"#020617",paper:"#0f172a"}}:{background:{default:"#f1f5f9",paper:"#ffffff"}}),typography:{fontFamily:"inherit",h4:{fontSize:"1.0625rem",fontWeight:600,lineHeight:1.3},h5:{fontSize:"0.9375rem",fontWeight:600,lineHeight:1.3},h6:{fontSize:"0.875rem",fontWeight:600,lineHeight:1.3},subtitle1:{fontSize:"0.8125rem",lineHeight:1.4},subtitle2:{fontSize:"0.75rem",fontWeight:600,lineHeight:1.4},body1:{fontSize:"0.875rem",lineHeight:1.5},body2:{fontSize:"0.8125rem",lineHeight:1.5},caption:{fontSize:"0.75rem",lineHeight:1.4},overline:{fontSize:"0.6875rem",lineHeight:1.4}},shape:{borderRadius:6},components:{MuiButton:{defaultProps:{size:"small",disableElevation:!0},styleOverrides:{root:{textTransform:"none",fontWeight:500}}},MuiIconButton:{defaultProps:{size:"small"}},MuiTextField:{defaultProps:{size:"small"}},MuiSelect:{defaultProps:{size:"small"}},MuiFormControl:{defaultProps:{size:"small"}},MuiInputLabel:{defaultProps:{size:"small"}},MuiChip:{defaultProps:{size:"small"}},MuiCard:{defaultProps:{variant:"outlined"}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"}}},MuiTableCell:{styleOverrides:{head:{fontWeight:600,fontSize:"0.75rem"},body:{fontSize:"0.8125rem"}}},MuiTab:{styleOverrides:{root:{textTransform:"none",minHeight:36,fontSize:"0.8125rem",fontWeight:500}}},MuiTabs:{styleOverrides:{root:{minHeight:36}}},MuiAccordionSummary:{styleOverrides:{root:{minHeight:40,"&.Mui-expanded":{minHeight:40}}}},MuiAlert:{styleOverrides:{root:{fontSize:"0.8125rem",padding:"6px 12px"}}},MuiDialog:{styleOverrides:{paper:{borderRadius:8}}}}});return(0,ka.jsx)(Ia,{theme:ae,children:(0,ka.jsxs)(sa,{children:[(!0===R||!0===O)&&!L&&(0,ka.jsx)(NN,{darkMode:B,onUnlock:()=>I(!0),pinSet:null!==O&&void 0!==O&&O,passwordSet:null!==R&&void 0!==R&&R}),(0,ka.jsxs)("div",{className:"min-h-screen ".concat(B?"bg-neutral-950":"bg-neutral-100"),children:[(0,ka.jsxs)("div",{className:"flex",children:[(0,ka.jsx)("nav",{className:"fixed w-full z-50 h-9 flex items-center border-b ".concat(B?"bg-neutral-900 border-neutral-800":"bg-white border-neutral-200"),children:(0,ka.jsxs)("div",{className:"flex items-center w-full px-3 gap-2",children:[(0,ka.jsx)("button",{onClick:ee,className:"sm:hidden p-1 rounded ".concat(B?"text-neutral-400 hover:text-white":"text-neutral-500 hover:text-neutral-900"),children:(0,ka.jsx)(uR,{className:"h-4 w-4"})}),(0,ka.jsx)("button",{onClick:()=>{E((e=>{const t=!e;return localStorage.setItem("ezpm2_sidebar_collapsed",t?"1":"0"),t}))},title:_?"Expand sidebar":"Collapse sidebar",className:"hidden sm:flex items-center justify-center p-1 rounded transition-colors ".concat(B?"text-neutral-400 hover:text-white hover:bg-neutral-800":"text-neutral-500 hover:text-neutral-900 hover:bg-neutral-100"),children:(0,ka.jsx)(uR,{className:"h-4 w-4"})}),(0,ka.jsx)(ca,{to:"/",className:"text-sm font-bold tracking-tight no-underline",children:(0,ka.jsx)("span",{className:"text-gradient",children:"EZ PM2 GUI"})}),!1===R&&(0,ka.jsxs)(ca,{to:"/settings?section=security",title:"Enable password protection in Settings",className:"hidden sm:flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium no-underline border transition-colors ".concat(B?"bg-orange-400/10 border-orange-400/30 text-orange-400 hover:bg-orange-400/20":"bg-orange-50 border-orange-300 text-orange-700 hover:bg-orange-100"),children:[(0,ka.jsx)(fR,{className:"h-3.5 w-3.5"}),(0,ka.jsx)("span",{children:"No password set \u2014 go to Settings / Security to enable"})]}),(0,ka.jsx)("div",{className:"flex-1"}),"local"!==H&&(()=>{const e=q.find((e=>e.id===H));return(0,ka.jsxs)("div",{className:"hidden sm:flex items-center gap-1.5 text-xs font-medium",children:[(0,ka.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-primary-500 animate-pulse shrink-0"}),(0,ka.jsxs)("span",{className:B?"text-primary-300":"text-primary-700",children:[(0,ka.jsx)("strong",{children:(null===e||void 0===e?void 0:e.name)||"Remote Server"}),e&&(0,ka.jsxs)("span",{className:"opacity-60 font-normal",children:[" \xb7 ",e.username,"@",e.host]})]}),(0,ka.jsx)("button",{onClick:()=>te("local"),className:"ml-1 text-xs underline opacity-70 hover:opacity-100 transition-opacity ".concat(B?"text-primary-400":"text-primary-600"),children:"Switch to Local"})]})})(),(0,ka.jsxs)("div",{className:"flex items-center gap-1.5",children:[M&&(0,ka.jsxs)(ca,{to:"/settings",title:"A newer version of EZ PM2 GUI is available",className:"relative flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium no-underline border transition-colors ".concat(B?"bg-yellow-400/10 border-yellow-400/30 text-yellow-400 hover:bg-yellow-400/20":"bg-yellow-50 border-yellow-300 text-yellow-700 hover:bg-yellow-100"),children:[(0,ka.jsx)(xR,{className:"h-3.5 w-3.5"}),(0,ka.jsx)("span",{children:"Update"}),(0,ka.jsxs)("span",{className:"flex h-1.5 w-1.5 ml-0.5",children:[(0,ka.jsx)("span",{className:"animate-ping absolute inline-flex h-1.5 w-1.5 rounded-full bg-yellow-400 opacity-75"}),(0,ka.jsx)("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-yellow-400"})]})]}),!0===R&&L&&(0,ka.jsx)("button",{onClick:()=>I(!1),title:"Lock app",className:"p-1 rounded transition-colors ".concat(B?"text-green-400 hover:text-red-400":"text-green-600 hover:text-red-500"),children:(0,ka.jsx)(CN,{className:"h-3.5 w-3.5"})}),(0,ka.jsx)("span",{className:"h-4 w-px mx-0.5 ".concat(B?"bg-neutral-700":"bg-neutral-200")}),(0,ka.jsxs)("a",{href:"https://github.com/thechandanbhagat/ezpm2gui",target:"_blank",rel:"noopener noreferrer",title:"Star EZ PM2 GUI on GitHub",className:"flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium no-underline border transition-colors ".concat(B?"bg-neutral-800 border-neutral-700 text-neutral-300 hover:border-yellow-400/60 hover:text-yellow-400":"bg-neutral-50 border-neutral-200 text-neutral-600 hover:border-yellow-400 hover:text-yellow-600"),children:[(0,ka.jsx)(yR,{className:"h-3.5 w-3.5"}),(0,ka.jsx)("span",{className:"hidden sm:inline",children:"Star"})]}),(0,ka.jsx)("a",{href:"https://github.com/thechandanbhagat/ezpm2gui",target:"_blank",rel:"noopener noreferrer",title:"View on GitHub",className:"p-1 rounded transition-colors ".concat(B?"text-neutral-400 hover:text-white":"text-neutral-500 hover:text-neutral-900"),children:(0,ka.jsx)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"currentColor","aria-hidden":"true",children:(0,ka.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"})})}),(0,ka.jsx)("span",{className:"h-4 w-px mx-0.5 ".concat(B?"bg-neutral-700":"bg-neutral-200")}),(0,ka.jsx)(SN,{activeServerId:H,connections:q,darkMode:B,onSwitch:te}),(0,ka.jsx)("span",{className:"h-4 w-px mx-0.5 ".concat(B?"bg-neutral-700":"bg-neutral-200")}),(0,ka.jsx)("button",{onClick:()=>F(!0),title:"What's New",className:"p-1 rounded transition-colors ".concat(B?"text-violet-400 hover:text-violet-300":"text-violet-500 hover:text-violet-700"),children:(0,ka.jsx)(HN,{className:"h-4 w-4"})}),(0,ka.jsx)("button",{onClick:Q,title:"About",className:"p-1 rounded transition-colors ".concat(B?"text-neutral-400 hover:text-white":"text-neutral-500 hover:text-neutral-900"),children:(0,ka.jsx)(Zj,{className:"h-4 w-4"})}),(0,ka.jsx)(ca,{to:"/settings",title:"Settings",className:"p-1 rounded transition-colors ".concat(B?"text-neutral-400 hover:text-white":"text-neutral-500 hover:text-neutral-900"),children:(0,ka.jsx)(v_,{className:"h-4 w-4"})}),(0,ka.jsx)("button",{onClick:()=>{W(!B)},className:"p-1 rounded transition-colors ".concat(B?"text-neutral-400 hover:text-yellow-400":"text-neutral-500 hover:text-neutral-900"),title:B?"Switch to light mode":"Switch to dark mode",children:B?(0,ka.jsx)(SR,{className:"h-4 w-4"}):(0,ka.jsx)(CR,{className:"h-4 w-4"})})]})]})}),A&&(0,ka.jsxs)("div",{className:"fixed inset-0 z-40 sm:hidden",children:[(0,ka.jsx)("div",{className:"fixed inset-0 bg-black/50",onClick:ee}),(0,ka.jsx)("div",{className:"fixed left-0 top-0 h-full w-[200px] border-r shadow-xl ".concat(B?"bg-neutral-900 border-neutral-800":"bg-white border-neutral-200"),children:(0,ka.jsx)("div",{className:"pt-9 h-full overflow-y-auto",children:(0,ka.jsx)(cE,{onItemClick:ee})})})]}),(0,ka.jsx)("div",{className:"hidden sm:flex flex-col fixed left-0 top-9 z-[40] h-[calc(100vh-2.25rem-22px)] border-r overflow-y-auto transition-[width] duration-200 ".concat(_?"w-[44px]":"w-[200px]"," ").concat(B?"bg-neutral-900 border-neutral-800":"bg-white border-neutral-200"),children:(0,ka.jsx)(cE,{collapsed:_})}),(0,ka.jsx)("main",{className:"flex-1 pt-9 min-h-screen transition-[margin] duration-200 ".concat(_?"sm:ml-[44px]":"sm:ml-[200px]"," ").concat(B?"bg-neutral-950":"bg-neutral-100"),children:(0,ka.jsx)("div",{className:"px-3 py-3 pb-8",children:(0,ka.jsxs)(Co,{children:[(0,ka.jsx)(jo,{path:"/",element:(0,ka.jsx)(HA,{processes:n,metrics:a,searchTerm:x,statusFilter:v,onSearchChange:ne,onStatusFilterChange:re,onNamespaceFilterChange:oe,namespaceFilter:w,onProcessAction:Z})}),(0,ka.jsx)(jo,{path:"/processes",element:(0,ka.jsx)(HA,{processes:n,metrics:a,searchTerm:x,statusFilter:v,onSearchChange:ne,onStatusFilterChange:re,onNamespaceFilterChange:oe,namespaceFilter:w,onProcessAction:Z})}),(0,ka.jsx)(jo,{path:"/process/:id",element:(0,ka.jsx)(Pj,{onAction:Z,connectionId:"local"!==H?H:void 0})}),(0,ka.jsx)(jo,{path:"/remote",element:(0,ka.jsx)(JM,{})}),(0,ka.jsx)(jo,{path:"/deploy",element:(0,ka.jsx)(s_,{})}),(0,ka.jsx)(jo,{path:"/modules",element:(0,ka.jsx)(E_,{onNotify:p})}),(0,ka.jsx)(jo,{path:"/ecosystem",element:(0,ka.jsx)(R_,{})}),(0,ka.jsx)(jo,{path:"/configure/:id",element:(0,ka.jsx)(P_,{procId:0})}),(0,ka.jsx)(jo,{path:"/cluster",element:(0,ka.jsx)(F_,{processes:e,onRefresh:()=>{(async()=>{try{const e=await tr.get("/api/processes");t(e.data)}catch(NR){console.error("Error refreshing processes:",NR),p("Failed to refresh process data")}})()}})})," ",(0,ka.jsx)(jo,{path:"/logs",element:(0,ka.jsx)(W_,{})}),(0,ka.jsx)(jo,{path:"/logs/remote/:serverId/:processId",element:(0,ka.jsx)(W_,{})}),(0,ka.jsx)(jo,{path:"/logs/:id",element:(0,ka.jsx)(W_,{})}),(0,ka.jsx)(jo,{path:"/cron-jobs",element:(0,ka.jsx)(lN,{})}),(0,ka.jsx)(jo,{path:"/metrics",element:(0,ka.jsx)(gN,{processes:e,metrics:a})}),(0,ka.jsx)(jo,{path:"/settings",element:(0,ka.jsx)(KE,{})}),(0,ka.jsx)(jo,{path:"/load-balancing-guide",element:(0,ka.jsx)(zM,{})}),(0,ka.jsx)(jo,{path:"/whats-new",element:(0,ka.jsx)(XN,{})})]})})})]}),(0,ka.jsx)(iR,{notifications:s,onDismiss:f,status:{connected:u,processCount:e.length,onlineCount:e.filter((e=>"online"===e.pm2_env.status)).length,activeServer:H}}),(0,ka.jsx)(mC,{isOpen:K.isOpen,title:K.title,message:K.message,onConfirm:()=>{null!==K.processId&&J(K.processId,K.action),X((e=>c(c({},e),{},{isOpen:!1})))},onCancel:()=>{X((e=>c(c({},e),{},{isOpen:!1})))},type:"delete"===K.action?"danger":"warning"}),(0,ka.jsx)(tR,{open:D,onClose:()=>F(!1),darkMode:B}),(0,ka.jsxs)(ZA,{open:S,onClose:Q,maxWidth:"xs",fullWidth:!0,children:[(0,ka.jsxs)(nC,{sx:{display:"flex",alignItems:"center",gap:1.5,pb:1},children:[(0,ka.jsx)("div",{style:{width:32,height:32,borderRadius:8,flexShrink:0,background:"linear-gradient(135deg, #6366f1, #8b5cf6)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,ka.jsx)("span",{style:{color:"#fff",fontWeight:700,fontSize:11},children:"EZ"})}),(0,ka.jsxs)("div",{style:{flex:1},children:[(0,ka.jsx)("div",{style:{fontWeight:600,fontSize:"0.9375rem",lineHeight:1.3},children:"EZ PM2 GUI"}),(0,ka.jsx)("div",{style:{fontSize:"0.75rem",opacity:.5,fontWeight:400},children:"v1.7.0 \xb7 Chandan Bhagat"})]}),(0,ka.jsx)(xf,{size:"small",onClick:Q,sx:{ml:"auto"},children:(0,ka.jsx)(sR.A,{fontSize:"small"})})]}),(0,ka.jsx)(WC,{}),(0,ka.jsxs)(iC,{sx:{pt:2,pb:2.5},children:[(0,ka.jsxs)("ul",{style:{margin:0,paddingLeft:18,fontSize:"0.8125rem",lineHeight:1.8},children:[(0,ka.jsx)("li",{children:"Monitor and manage PM2 processes in real-time"}),(0,ka.jsx)("li",{children:"Deploy new apps, configure ecosystems, manage clusters"}),(0,ka.jsx)("li",{children:"Remote server SSH connections with live logs"}),(0,ka.jsx)("li",{children:"Cron job scheduling and dark-mode support"})]}),(0,ka.jsx)(WC,{sx:{my:2}}),(0,ka.jsxs)("a",{href:"https://github.com/thechandanbhagat/ezpm2gui",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:"0.8125rem",color:"#6366f1",textDecoration:"none"},children:[(0,ka.jsx)(lR.A,{sx:{fontSize:15}}),"GitHub Repository \u2197"]})]})]})]})]})})},MR=document.getElementById("root");if(!MR)throw new Error("Failed to find the root element");o.createRoot(MR).render((0,ka.jsx)(r.StrictMode,{children:(0,ka.jsx)(ER,{})}))})()})();
3
- //# sourceMappingURL=main.28a4a583.js.map