@wandelbots/wandelbots-js-react-components 5.1.0 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/VelocitySlider.d.ts +2 -1
- package/dist/components/VelocitySlider.d.ts.map +1 -1
- package/dist/components/jogging/JoggingCartesianTab.d.ts.map +1 -1
- package/dist/components/jogging/JoggingJointTab.d.ts.map +1 -1
- package/dist/components/jogging/JoggingOptions.d.ts +2 -1
- package/dist/components/jogging/JoggingOptions.d.ts.map +1 -1
- package/dist/components/jogging/JoggingStore.d.ts +8 -12
- package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
- package/dist/components/jogging/JoggingVelocitySlider.d.ts +2 -1
- package/dist/components/jogging/JoggingVelocitySlider.d.ts.map +1 -1
- package/dist/core.cjs.js +1 -1
- package/dist/core.es.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{theming-B5Q8EK1c.cjs → theming-BgAu1ds7.cjs} +38 -38
- package/dist/{theming-B5Q8EK1c.cjs.map → theming-BgAu1ds7.cjs.map} +1 -1
- package/dist/{theming-Bt0cspr6.js → theming-DouElHKD.js} +996 -982
- package/dist/{theming-Bt0cspr6.js.map → theming-DouElHKD.js.map} +1 -1
- package/package.json +1 -1
- package/src/components/VelocitySlider.tsx +3 -2
- package/src/components/jogging/JoggingCartesianTab.tsx +10 -2
- package/src/components/jogging/JoggingJointTab.tsx +11 -2
- package/src/components/jogging/JoggingOptions.tsx +4 -4
- package/src/components/jogging/JoggingStore.ts +22 -36
- package/src/components/jogging/JoggingVelocitySlider.tsx +20 -17
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var ef=Object.defineProperty;var tf=(e,t,n)=>t in e?ef(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var W=(e,t,n)=>tf(e,typeof t!="symbol"?t+"":t,n);const g=require("./interpolation-GwZidExa.cjs"),M=require("@mui/material"),
|
|
1
|
+
"use strict";var ef=Object.defineProperty;var tf=(e,t,n)=>t in e?ef(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var W=(e,t,n)=>tf(e,typeof t!="symbol"?t+"":t,n);const g=require("./interpolation-GwZidExa.cjs"),M=require("@mui/material"),se=require("mobx-react-lite"),D=require("react"),de=require("react-i18next"),x=require("prop-types"),et=require("@mui/x-data-grid"),Ns=require("lodash-es"),ue=require("mobx"),Ie=require("@wandelbots/nova-js"),je=require("./safety-state-stop-ClWLVLMl.cjs"),Lr=require("@mui/icons-material"),nf=require("@emotion/styled"),rf=require("@emotion/react"),Ka=require("axios"),of=require("@mui/x-charts"),hs=require("three");function gu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const O=gu(D),Ja=gu(hs);function sf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}const af=e=>g.jsxRuntimeExports.jsx(M.SvgIcon,{...e,viewBox:"0 0 10 8",children:g.jsxRuntimeExports.jsx("path",{d:"M8.825 0.9125L5 4.72917L1.175 0.9125L0 2.0875L5 7.0875L10 2.0875L8.825 0.9125Z",fill:"currentColor",fillOpacity:"0.56"})}),lf=g.externalizeComponent(se.observer(e=>{const{appIcon:t,appName:n,apps:r=[],onAppSelect:i,disabled:o=!1,sx:s}=e,[a,l]=D.useState(null),c=!!a,u=f=>{l(f.currentTarget)},d=()=>{l(null)},h=f=>{d(),f.onClick?f.onClick():f.href&&(window.location.href=f.href),i==null||i(f)};return g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[g.jsxRuntimeExports.jsx(M.AppBar,{position:"static",sx:{boxShadow:"none",backgroundImage:"none","& .MuiAppBar-root":{backgroundImage:"none",backgroundColor:"transparent"},...s},children:g.jsxRuntimeExports.jsxs(M.Toolbar,{sx:{minHeight:"62px !important"},children:[g.jsxRuntimeExports.jsx(M.Box,{sx:{mr:1,display:"flex",alignItems:"center"},children:t}),g.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",alignItems:"center",flexGrow:1},children:[g.jsxRuntimeExports.jsx(M.Typography,{component:"h1",sx:{fontWeight:"bold",fontSize:"1rem"},children:n}),r.length>0&&g.jsxRuntimeExports.jsx(M.IconButton,{color:"inherit","aria-label":"switch app","aria-controls":"app-menu","aria-haspopup":"true",onClick:u,disabled:o,sx:{ml:1,width:28,height:28,borderRadius:"6px",padding:0,backgroundColor:f=>M.alpha(f.palette.common.white,.1),opacity:1,"&:hover":{backgroundColor:f=>M.alpha(f.palette.common.white,.16)},"& .MuiSvgIcon-root":{fontSize:"8px",width:"8px",height:"6px"}},children:g.jsxRuntimeExports.jsx(af,{})})]})]})}),g.jsxRuntimeExports.jsx(M.Backdrop,{open:c,onClick:d,sx:{backdropFilter:"blur(4px)",backgroundColor:"rgba(0, 0, 0, 0.3)",zIndex:f=>f.zIndex.modal-1}}),g.jsxRuntimeExports.jsx(M.Menu,{id:"app-menu",anchorEl:a,open:c,onClose:d,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},sx:{zIndex:f=>f.zIndex.modal,"& .MuiPaper-root":{minWidth:200,mt:1}},children:r.map(f=>g.jsxRuntimeExports.jsxs(M.MenuItem,{onClick:()=>h(f),children:[g.jsxRuntimeExports.jsx(M.Box,{sx:{display:"flex",alignItems:"center"},children:f.icon}),g.jsxRuntimeExports.jsx(M.Typography,{variant:"body1",sx:{ml:2},children:f.name})]},f.id))})]})}));function L(){return L=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},L.apply(null,arguments)}function pt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Er(e,t,n=void 0){const r={};for(const i in e){const o=e[i];let s="",a=!0;for(let l=0;l<o.length;l+=1){const c=o[l];c&&(s+=(a===!0?"":" ")+t(c),a=!1,n&&n[c]&&(s+=" "+n[c]))}r[i]=s}return r}function yu(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=yu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ne(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=yu(e))&&(r&&(r+=" "),r+=t);return r}function Lt(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}const Ls="$$material";function cf(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var uf={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};function df(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var hf=/[A-Z]|^ms/g,ff=/_EMO_([^_]+?)_([^]*?)_EMO_/g,xu=function(t){return t.charCodeAt(1)===45},Xa=function(t){return t!=null&&typeof t!="boolean"},Lo=df(function(e){return xu(e)?e:e.replace(hf,"-$&").toLowerCase()}),Za=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(ff,function(r,i,o){return Nt={name:i,styles:o,next:Nt},i})}return uf[t]!==1&&!xu(t)&&typeof n=="number"&&n!==0?n+"px":n};function fi(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Nt={name:i.name,styles:i.styles,next:Nt},i.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)Nt={name:s.name,styles:s.styles,next:Nt},s=s.next;var a=o.styles+";";return a}return pf(e,t,n)}}var l=n;return l}function pf(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=fi(e,t,n[i])+";";else for(var o in n){var s=n[o];if(typeof s!="object"){var a=s;Xa(a)&&(r+=Lo(o)+":"+Za(o,a)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&t==null)for(var l=0;l<s.length;l++)Xa(s[l])&&(r+=Lo(o)+":"+Za(o,s[l])+";");else{var c=fi(e,t,s);switch(o){case"animation":case"animationName":{r+=Lo(o)+":"+c+";";break}default:r+=o+"{"+c+"}"}}}return r}var Qa=/label:\s*([^\s;{]+)\s*(;|$)/g,Nt;function mf(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i="";Nt=void 0;var o=e[0];if(o==null||o.raw===void 0)r=!1,i+=fi(n,t,o);else{var s=o;i+=s[0]}for(var a=1;a<e.length;a++)if(i+=fi(n,t,e[a]),r){var l=o;i+=l[a]}Qa.lastIndex=0;for(var c="",u;(u=Qa.exec(i))!==null;)c+="-"+u[1];var d=cf(i)+c;return{name:d,styles:i,next:Nt}}/**
|
|
2
2
|
* @mui/styled-engine v7.3.7
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/function gf(e,t){const n=nf(e,t);return process.env.NODE_ENV!=="production"?(...r)=>{const i=typeof e=="string"?`"${e}"`:"component";return r.length===0?console.error([`MUI: Seems like you called \`styled(${i})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join(`
|
|
8
|
-
`)):r.some(o=>o===void 0)&&console.error(`MUI: the styled(${i})(...args) API requires all its args to be defined.`),n(...r)}:n}function yf(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const el=[];function rn(e){return el[0]=e,mf(el)}var
|
|
8
|
+
`)):r.some(o=>o===void 0)&&console.error(`MUI: the styled(${i})(...args) API requires all its args to be defined.`),n(...r)}:n}function yf(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const el=[];function rn(e){return el[0]=e,mf(el)}var zr={exports:{}},ae={};/**
|
|
9
9
|
* @license React
|
|
10
10
|
* react-is.production.js
|
|
11
11
|
*
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the MIT license found in the
|
|
15
15
|
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/var tl;function xf(){if(tl)return ae;tl=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),
|
|
16
|
+
*/var tl;function xf(){if(tl)return ae;tl=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),f=Symbol.for("react.client.reference");function m(p){if(typeof p=="object"&&p!==null){var y=p.$$typeof;switch(y){case e:switch(p=p.type,p){case n:case i:case r:case l:case c:case h:return p;default:switch(p=p&&p.$$typeof,p){case s:case a:case d:case u:return p;case o:return p;default:return y}}case t:return y}}}return ae.ContextConsumer=o,ae.ContextProvider=s,ae.Element=e,ae.ForwardRef=a,ae.Fragment=n,ae.Lazy=d,ae.Memo=u,ae.Portal=t,ae.Profiler=i,ae.StrictMode=r,ae.Suspense=l,ae.SuspenseList=c,ae.isContextConsumer=function(p){return m(p)===o},ae.isContextProvider=function(p){return m(p)===s},ae.isElement=function(p){return typeof p=="object"&&p!==null&&p.$$typeof===e},ae.isForwardRef=function(p){return m(p)===a},ae.isFragment=function(p){return m(p)===n},ae.isLazy=function(p){return m(p)===d},ae.isMemo=function(p){return m(p)===u},ae.isPortal=function(p){return m(p)===t},ae.isProfiler=function(p){return m(p)===i},ae.isStrictMode=function(p){return m(p)===r},ae.isSuspense=function(p){return m(p)===l},ae.isSuspenseList=function(p){return m(p)===c},ae.isValidElementType=function(p){return typeof p=="string"||typeof p=="function"||p===n||p===i||p===r||p===l||p===c||typeof p=="object"&&p!==null&&(p.$$typeof===d||p.$$typeof===u||p.$$typeof===s||p.$$typeof===o||p.$$typeof===a||p.$$typeof===f||p.getModuleId!==void 0)},ae.typeOf=m,ae}var le={};/**
|
|
17
17
|
* @license React
|
|
18
18
|
* react-is.development.js
|
|
19
19
|
*
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
*
|
|
22
22
|
* This source code is licensed under the MIT license found in the
|
|
23
23
|
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/var nl;function bf(){return nl||(nl=1,process.env.NODE_ENV!=="production"&&(function(){function e(p){if(typeof p=="object"&&p!==null){var y=p.$$typeof;switch(y){case t:switch(p=p.type,p){case r:case o:case i:case
|
|
25
|
-
For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:Lt(18,`(${t})`));return null}const[,r,i]=n,o=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(o)}function Cf(e){const t=(o,s)=>o.replace("@media",s?`@container ${s}`:"@container");function n(o,s){o.up=(...a)=>t(e.breakpoints.up(...a),s),o.down=(...a)=>t(e.breakpoints.down(...a),s),o.between=(...a)=>t(e.breakpoints.between(...a),s),o.only=(...a)=>t(e.breakpoints.only(...a),s),o.not=(...a)=>{const l=t(e.breakpoints.not(...a),s);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},i=o=>(n(r,o),r);return n(i),{...e,containerQueries:i}}const Mf={borderRadius:4},Bt=process.env.NODE_ENV!=="production"?x.oneOfType([x.number,x.string,x.object,x.array]):{};function
|
|
24
|
+
*/var nl;function bf(){return nl||(nl=1,process.env.NODE_ENV!=="production"&&(function(){function e(p){if(typeof p=="object"&&p!==null){var y=p.$$typeof;switch(y){case t:switch(p=p.type,p){case r:case o:case i:case c:case u:case f:return p;default:switch(p=p&&p.$$typeof,p){case a:case l:case h:case d:return p;case s:return p;default:return y}}case n:return y}}}var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.view_transition"),m=Symbol.for("react.client.reference");le.ContextConsumer=s,le.ContextProvider=a,le.Element=t,le.ForwardRef=l,le.Fragment=r,le.Lazy=h,le.Memo=d,le.Portal=n,le.Profiler=o,le.StrictMode=i,le.Suspense=c,le.SuspenseList=u,le.isContextConsumer=function(p){return e(p)===s},le.isContextProvider=function(p){return e(p)===a},le.isElement=function(p){return typeof p=="object"&&p!==null&&p.$$typeof===t},le.isForwardRef=function(p){return e(p)===l},le.isFragment=function(p){return e(p)===r},le.isLazy=function(p){return e(p)===h},le.isMemo=function(p){return e(p)===d},le.isPortal=function(p){return e(p)===n},le.isProfiler=function(p){return e(p)===o},le.isStrictMode=function(p){return e(p)===i},le.isSuspense=function(p){return e(p)===c},le.isSuspenseList=function(p){return e(p)===u},le.isValidElementType=function(p){return typeof p=="string"||typeof p=="function"||p===r||p===o||p===i||p===c||p===u||typeof p=="object"&&p!==null&&(p.$$typeof===h||p.$$typeof===d||p.$$typeof===a||p.$$typeof===s||p.$$typeof===l||p.$$typeof===m||p.getModuleId!==void 0)},le.typeOf=e})()),le}var rl;function vf(){return rl||(rl=1,process.env.NODE_ENV==="production"?zr.exports=xf():zr.exports=bf()),zr.exports}var pi=vf();function ut(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function bu(e){if(O.isValidElement(e)||pi.isValidElementType(e)||!ut(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=bu(e[n])}),t}function Le(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return ut(e)&&ut(t)&&Object.keys(t).forEach(i=>{O.isValidElement(t[i])||pi.isValidElementType(t[i])?r[i]=t[i]:ut(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&ut(e[i])?r[i]=Le(e[i],t[i],n):n.clone?r[i]=ut(t[i])?bu(t[i]):t[i]:r[i]=t[i]}),r}const Sf=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function Ef(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...i}=e,o=Sf(t),s=Object.keys(o);function a(h){return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n})`}function l(h){return`@media (max-width:${(typeof t[h]=="number"?t[h]:h)-r/100}${n})`}function c(h,f){const m=s.indexOf(f);return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n}) and (max-width:${(m!==-1&&typeof t[s[m]]=="number"?t[s[m]]:f)-r/100}${n})`}function u(h){return s.indexOf(h)+1<s.length?c(h,s[s.indexOf(h)+1]):a(h)}function d(h){const f=s.indexOf(h);return f===0?a(s[1]):f===s.length-1?l(s[f]):c(h,s[s.indexOf(h)+1]).replace("@media","@media not all and")}return{keys:s,values:o,up:a,down:l,between:c,only:u,not:d,unit:n,...i}}function il(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,i)=>{var s,a;const o=/min-width:\s*([0-9.]+)/;return+(((s=r.match(o))==null?void 0:s[1])||0)-+(((a=i.match(o))==null?void 0:a[1])||0)});return n.length?n.reduce((r,i)=>{const o=t[i];return delete r[i],r[i]=o,r},{...t}):t}function Tf(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function wf(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n){if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The provided shorthand ${`(${t})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
|
|
25
|
+
For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:Lt(18,`(${t})`));return null}const[,r,i]=n,o=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(o)}function Cf(e){const t=(o,s)=>o.replace("@media",s?`@container ${s}`:"@container");function n(o,s){o.up=(...a)=>t(e.breakpoints.up(...a),s),o.down=(...a)=>t(e.breakpoints.down(...a),s),o.between=(...a)=>t(e.breakpoints.between(...a),s),o.only=(...a)=>t(e.breakpoints.only(...a),s),o.not=(...a)=>{const l=t(e.breakpoints.not(...a),s);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},i=o=>(n(r,o),r);return n(i),{...e,containerQueries:i}}const Mf={borderRadius:4},Bt=process.env.NODE_ENV!=="production"?x.oneOfType([x.number,x.string,x.object,x.array]):{};function sr(e,t){return t?Le(e,t,{clone:!1}):e}const zi={xs:0,sm:600,md:900,lg:1200,xl:1536},ol={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${zi[e]}px)`},Rf={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:zi[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function it(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||ol;return t.reduce((s,a,l)=>(s[o.up(o.keys[l])]=n(t[l]),s),{})}if(typeof t=="object"){const o=r.breakpoints||ol;return Object.keys(t).reduce((s,a)=>{if(Tf(o.keys,a)){const l=wf(r.containerQueries?r:Rf,a);l&&(s[l]=n(t[a],a))}else if(Object.keys(o.values||zi).includes(a)){const l=o.up(a);s[l]=n(t[a],a)}else{const l=a;s[l]=t[l]}return s},{})}return n(t)}function vu(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((r,i)=>{const o=e.up(i);return r[o]={},r},{}))||{}}function fs(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function Af(e,...t){const n=vu(e),r=[n,...t].reduce((i,o)=>Le(i,o),{});return fs(Object.keys(n),r)}function _f(e,t){if(typeof e!="object")return{};const n={},r=Object.keys(t);return Array.isArray(e)?r.forEach((i,o)=>{o<e.length&&(n[i]=!0)}):r.forEach(i=>{e[i]!=null&&(n[i]=!0)}),n}function zo({values:e,breakpoints:t,base:n}){const r=n||_f(e,t),i=Object.keys(r);if(i.length===0)return e;let o;return i.reduce((s,a,l)=>(Array.isArray(e)?(s[a]=e[l]!=null?e[l]:e[o],o=l):typeof e=="object"?(s[a]=e[a]!=null?e[a]:e[o],o=a):s[a]=e,s),{})}function $e(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":Lt(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Fi(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function mi(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=Fi(e,n)||r,t&&(i=t(i,r,e)),i}function ye(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=s=>{if(s[t]==null)return null;const a=s[t],l=s.theme,c=Fi(l,r)||{};return it(s,a,d=>{let h=mi(c,i,d);return d===h&&typeof d=="string"&&(h=mi(c,i,`${t}${d==="default"?"":$e(d)}`,d)),n===!1?h:{[n]:h}})};return o.propTypes=process.env.NODE_ENV!=="production"?{[t]:Bt}:{},o.filterProps=[t],o}function If(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const jf={m:"margin",p:"padding"},kf={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},sl={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Of=If(e=>{if(e.length>2)if(sl[e])e=sl[e];else return[e];const[t,n]=e.split(""),r=jf[t],i=kf[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),Bi=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Gi=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],Pf=[...Bi,...Gi];function Tr(e,t,n,r){const i=Fi(e,t,!0)??n;return typeof i=="number"||typeof i=="string"?o=>typeof o=="string"?o:(process.env.NODE_ENV!=="production"&&typeof o!="number"&&console.error(`MUI: Expected ${r} argument to be a number or a string, got ${o}.`),typeof i=="string"?i.startsWith("var(")&&o===0?0:i.startsWith("var(")&&o===1?i:`calc(${o} * ${i})`:i*o):Array.isArray(i)?o=>{if(typeof o=="string")return o;const s=Math.abs(o);process.env.NODE_ENV!=="production"&&(Number.isInteger(s)?s>i.length-1&&console.error([`MUI: The value provided (${s}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${s} > ${i.length-1}, you need to add the missing values.`].join(`
|
|
26
26
|
`)):console.error([`MUI: The \`theme.${t}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${t}\` as a number.`].join(`
|
|
27
27
|
`)));const a=i[s];return o>=0?a:typeof a=="number"?-a:typeof a=="string"&&a.startsWith("var(")?`calc(-1 * ${a})`:`-${a}`}:typeof i=="function"?i:(process.env.NODE_ENV!=="production"&&console.error([`MUI: The \`theme.${t}\` value (${i}) is invalid.`,"It should be a number, an array or a function."].join(`
|
|
28
|
-
`)),()=>{})}function Gi(e){return Er(e,"spacing",8,"spacing")}function an(e,t){return typeof t=="string"||t==null?t:e(t)}function Df(e,t){return n=>e.reduce((r,i)=>(r[i]=an(t,n),r),{})}function $f(e,t,n,r){if(!t.includes(n))return null;const i=Of(n),o=Df(i,r),s=e[n];return it(e,s,o)}function Sc(e,t){const n=Gi(e.theme);return Object.keys(e).map(r=>$f(e,t,r,n)).reduce(or,{})}function me(e){return Sc(e,Fi)}me.propTypes=process.env.NODE_ENV!=="production"?Fi.reduce((e,t)=>(e[t]=Bt,e),{}):{};me.filterProps=Fi;function ge(e){return Sc(e,Bi)}ge.propTypes=process.env.NODE_ENV!=="production"?Bi.reduce((e,t)=>(e[t]=Bt,e),{}):{};ge.filterProps=Bi;process.env.NODE_ENV!=="production"&&Pf.reduce((e,t)=>(e[t]=Bt,e),{});function Ec(e=8,t=Gi({spacing:e})){if(e.mui)return e;const n=(...r)=>(process.env.NODE_ENV!=="production"&&(r.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${r.length}`)),(r.length===0?[1]:r).map(o=>{const s=t(o);return typeof s=="number"?`${s}px`:s}).join(" "));return n.mui=!0,n}function Ui(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>t[o]?or(i,t[o](r)):i,{});return n.propTypes=process.env.NODE_ENV!=="production"?e.reduce((r,i)=>Object.assign(r,i.propTypes),{}):{},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function qe(e){return typeof e!="number"?e:`${e}px solid`}function Qe(e,t){return ye({prop:e,themeKey:"borders",transform:t})}const Nf=Qe("border",qe),Lf=Qe("borderTop",qe),zf=Qe("borderRight",qe),Ff=Qe("borderBottom",qe),Bf=Qe("borderLeft",qe),Gf=Qe("borderColor"),Uf=Qe("borderTopColor"),Vf=Qe("borderRightColor"),Yf=Qe("borderBottomColor"),Wf=Qe("borderLeftColor"),Hf=Qe("outline",qe),qf=Qe("outlineColor"),Vi=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Er(e.theme,"shape.borderRadius",4,"borderRadius"),n=r=>({borderRadius:an(t,r)});return it(e,e.borderRadius,n)}return null};Vi.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:Bt}:{};Vi.filterProps=["borderRadius"];Ui(Nf,Lf,zf,Ff,Bf,Gf,Uf,Vf,Yf,Wf,Vi,Hf,qf);const Yi=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Er(e.theme,"spacing",8,"gap"),n=r=>({gap:an(t,r)});return it(e,e.gap,n)}return null};Yi.propTypes=process.env.NODE_ENV!=="production"?{gap:Bt}:{};Yi.filterProps=["gap"];const Wi=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Er(e.theme,"spacing",8,"columnGap"),n=r=>({columnGap:an(t,r)});return it(e,e.columnGap,n)}return null};Wi.propTypes=process.env.NODE_ENV!=="production"?{columnGap:Bt}:{};Wi.filterProps=["columnGap"];const Hi=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Er(e.theme,"spacing",8,"rowGap"),n=r=>({rowGap:an(t,r)});return it(e,e.rowGap,n)}return null};Hi.propTypes=process.env.NODE_ENV!=="production"?{rowGap:Bt}:{};Hi.filterProps=["rowGap"];const Kf=ye({prop:"gridColumn"}),Jf=ye({prop:"gridRow"}),Xf=ye({prop:"gridAutoFlow"}),Zf=ye({prop:"gridAutoColumns"}),Qf=ye({prop:"gridAutoRows"}),ep=ye({prop:"gridTemplateColumns"}),tp=ye({prop:"gridTemplateRows"}),np=ye({prop:"gridTemplateAreas"}),rp=ye({prop:"gridArea"});Ui(Yi,Wi,Hi,Kf,Jf,Xf,Zf,Qf,ep,tp,np,rp);function kn(e,t){return t==="grey"?t:e}const ip=ye({prop:"color",themeKey:"palette",transform:kn}),op=ye({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:kn}),sp=ye({prop:"backgroundColor",themeKey:"palette",transform:kn});Ui(ip,op,sp);function Ve(e){return e<=1&&e!==0?`${e*100}%`:e}const ap=ye({prop:"width",transform:Ve}),zs=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var i,o,s,a,l;const r=((s=(o=(i=e.theme)==null?void 0:i.breakpoints)==null?void 0:o.values)==null?void 0:s[n])||Li[n];return r?((l=(a=e.theme)==null?void 0:a.breakpoints)==null?void 0:l.unit)!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Ve(n)}};return it(e,e.maxWidth,t)}return null};zs.filterProps=["maxWidth"];const lp=ye({prop:"minWidth",transform:Ve}),up=ye({prop:"height",transform:Ve}),cp=ye({prop:"maxHeight",transform:Ve}),dp=ye({prop:"minHeight",transform:Ve});ye({prop:"size",cssProperty:"width",transform:Ve});ye({prop:"size",cssProperty:"height",transform:Ve});const hp=ye({prop:"boxSizing"});Ui(ap,zs,lp,up,cp,dp,hp);const Tr={border:{themeKey:"borders",transform:qe},borderTop:{themeKey:"borders",transform:qe},borderRight:{themeKey:"borders",transform:qe},borderBottom:{themeKey:"borders",transform:qe},borderLeft:{themeKey:"borders",transform:qe},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:qe},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Vi},color:{themeKey:"palette",transform:kn},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:kn},backgroundColor:{themeKey:"palette",transform:kn},p:{style:ge},pt:{style:ge},pr:{style:ge},pb:{style:ge},pl:{style:ge},px:{style:ge},py:{style:ge},padding:{style:ge},paddingTop:{style:ge},paddingRight:{style:ge},paddingBottom:{style:ge},paddingLeft:{style:ge},paddingX:{style:ge},paddingY:{style:ge},paddingInline:{style:ge},paddingInlineStart:{style:ge},paddingInlineEnd:{style:ge},paddingBlock:{style:ge},paddingBlockStart:{style:ge},paddingBlockEnd:{style:ge},m:{style:me},mt:{style:me},mr:{style:me},mb:{style:me},ml:{style:me},mx:{style:me},my:{style:me},margin:{style:me},marginTop:{style:me},marginRight:{style:me},marginBottom:{style:me},marginLeft:{style:me},marginX:{style:me},marginY:{style:me},marginInline:{style:me},marginInlineStart:{style:me},marginInlineEnd:{style:me},marginBlock:{style:me},marginBlockStart:{style:me},marginBlockEnd:{style:me},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:Yi},rowGap:{style:Hi},columnGap:{style:Wi},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Ve},maxWidth:{style:zs},minWidth:{transform:Ve},height:{transform:Ve},maxHeight:{transform:Ve},minHeight:{transform:Ve},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function fp(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function pp(e,t){return typeof e=="function"?e(t):e}function mp(){function e(n,r,i,o){const s={[n]:r,theme:i},a=o[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:u,transform:c,style:d}=a;if(r==null)return null;if(u==="typography"&&r==="inherit")return{[n]:r};const h=zi(i,u)||{};return d?d(s):it(s,r,m=>{let p=pi(h,c,m);return m===p&&typeof m=="string"&&(p=pi(h,c,`${n}${m==="default"?"":$e(m)}`,m)),l===!1?p:{[l]:p}})}function t(n){const{sx:r,theme:i={},nested:o}=n||{};if(!r)return null;const s=i.unstable_sxConfig??Tr;function a(l){let u=l;if(typeof l=="function")u=l(i);else if(typeof l!="object")return l;if(!u)return null;const c=vc(i.breakpoints),d=Object.keys(c);let h=c;return Object.keys(u).forEach(f=>{const m=pp(u[f],i);if(m!=null)if(typeof m=="object")if(s[f])h=or(h,e(f,m,i,s));else{const p=it({theme:i},m,y=>({[f]:y}));fp(p,m)?h[f]=t({sx:m,theme:i,nested:!0}):h=or(h,p)}else h=or(h,e(f,m,i,s))}),!o&&i.modularCssLayers?{"@layer sx":il(i,hs(d,h))}:il(i,hs(d,h))}return Array.isArray(r)?r.map(a):a(r)}return t}const $n=mp();$n.filterProps=["sx"];function gp(e,t){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[e])||typeof n.getColorSchemeSelector!="function")return{};let i=n.getColorSchemeSelector(e);return i==="&"?t:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:t})}return n.palette.mode===e?t:{}}function qi(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:o={},...s}=e,a=Ef(n),l=Ec(i);let u=Le({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...Mf,...o}},s);return u=Cf(u),u.applyStyles=gp,u=t.reduce((c,d)=>Le(c,d),u),u.unstable_sxConfig={...Tr,...s==null?void 0:s.unstable_sxConfig},u.unstable_sx=function(d){return $n({sx:d,theme:this})},u}function yp(e){return Object.keys(e).length===0}function xp(e=null){const t=O.useContext(rf.ThemeContext);return!t||yp(t)?e:t}const bp=qi();function Tc(e=bp){return xp(e)}const vp=e=>{var r;const t={systemProps:{},otherProps:{}},n=((r=e==null?void 0:e.theme)==null?void 0:r.unstable_sxConfig)??Tr;return Object.keys(e).forEach(i=>{n[i]?t.systemProps[i]=e[i]:t.otherProps[i]=e[i]}),t};function Sp(e){const{sx:t,...n}=e,{systemProps:r,otherProps:i}=vp(n);let o;return Array.isArray(t)?o=[r,...t]:typeof t=="function"?o=(...s)=>{const a=t(...s);return ct(a)?{...r,...a}:r}:o={...r,...t},{...i,sx:o}}const al=e=>e,Ep=()=>{let e=al;return{configure(t){e=t},generate(t){return e(t)},reset(){e=al}}},Tp=Ep(),wp={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 hn(e,t,n="Mui"){const r=wp[t];return r?`${n}-${r}`:`${Tp.generate(e)}-${t}`}function Ki(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=hn(e,i,n)}),r}function wc(e,t=""){return e.displayName||e.name||t}function ll(e,t,n){const r=wc(t);return e.displayName||(r!==""?`${n}(${r})`:n)}function Cp(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return wc(e,"Component");if(typeof e=="object")switch(e.$$typeof){case fi.ForwardRef:return ll(e,e.render,"ForwardRef");case fi.Memo:return ll(e,e.type,"memo");default:return}}}function Cc(e){const{variants:t,...n}=e,r={variants:t,style:rn(n),isProcessed:!0};return r.style===n||t&&t.forEach(i=>{typeof i.style!="function"&&(i.style=rn(i.style))}),r}const Mp=qi();function zo(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function Qt(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function Rp(e){return e?(t,n)=>n[e]:null}function Ap(e,t,n){e.theme=jp(e.theme)?n:e.theme[t]||e.theme}function li(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(i=>li(e,i,n));if(Array.isArray(r==null?void 0:r.variants)){let i;if(r.isProcessed)i=n?Qt(r.style,n):r.style;else{const{variants:o,...s}=r;i=n?Qt(rn(s),n):s}return Mc(e,r.variants,[i],n)}return r!=null&&r.isProcessed?n?Qt(rn(r.style),n):r.style:n?Qt(rn(r),n):r}function Mc(e,t,n=[],r=void 0){var o;let i;e:for(let s=0;s<t.length;s+=1){const a=t[s];if(typeof a.props=="function"){if(i??(i={...e,...e.ownerState,ownerState:e.ownerState}),!a.props(i))continue}else for(const l in a.props)if(e[l]!==a.props[l]&&((o=e.ownerState)==null?void 0:o[l])!==a.props[l])continue e;typeof a.style=="function"?(i??(i={...e,...e.ownerState,ownerState:e.ownerState}),n.push(r?Qt(rn(a.style(i)),r):a.style(i))):n.push(r?Qt(rn(a.style),r):a.style)}return n}function Rc(e={}){const{themeId:t,defaultTheme:n=Mp,rootShouldForwardProp:r=zo,slotShouldForwardProp:i=zo}=e;function o(a){Ap(a,t,n)}return(a,l={})=>{yf(a,S=>S.filter(R=>R!==$n));const{name:u,slot:c,skipVariantsResolver:d,skipSx:h,overridesResolver:f=Rp(Ac(c)),...m}=l,p=u&&u.startsWith("Mui")||c?"components":"custom",y=d!==void 0?d:c&&c!=="Root"&&c!=="root"||!1,b=h||!1;let E=zo;c==="Root"||c==="root"?E=r:c?E=i:kp(a)&&(E=void 0);const T=gf(a,{shouldForwardProp:E,label:Ip(u,c),...m}),w=S=>{if(S.__emotion_real===S)return S;if(typeof S=="function")return function(I){return li(I,S,I.theme.modularCssLayers?p:void 0)};if(ct(S)){const R=Cc(S);return function(k){return R.variants?li(k,R,k.theme.modularCssLayers?p:void 0):k.theme.modularCssLayers?Qt(R.style,p):R.style}}return S},C=(...S)=>{const R=[],I=S.map(w),k=[];if(R.push(o),u&&f&&k.push(function(_){var Z,Y;const B=(Y=(Z=_.theme.components)==null?void 0:Z[u])==null?void 0:Y.styleOverrides;if(!B)return null;const G={};for(const te in B)G[te]=li(_,B[te],_.theme.modularCssLayers?"theme":void 0);return f(_,G)}),u&&!y&&k.push(function(_){var G,Z;const A=_.theme,B=(Z=(G=A==null?void 0:A.components)==null?void 0:G[u])==null?void 0:Z.variants;return B?Mc(_,B,[],_.theme.modularCssLayers?"theme":void 0):null}),b||k.push($n),Array.isArray(I[0])){const v=I.shift(),_=new Array(R.length).fill(""),A=new Array(k.length).fill("");let B;B=[..._,...v,...A],B.raw=[..._,...v.raw,...A],R.unshift(B)}const z=[...R,...I,...k],P=T(...z);return a.muiName&&(P.muiName=a.muiName),process.env.NODE_ENV!=="production"&&(P.displayName=_p(u,c,a)),P};return T.withConfig&&(C.withConfig=T.withConfig),C}}function _p(e,t,n){return e?`${e}${$e(t||"")}`:`Styled(${Cp(n)})`}function Ip(e,t){let n;return process.env.NODE_ENV!=="production"&&e&&(n=`${e}-${Ac(t||"Root")}`),n}function jp(e){for(const t in e)return!1;return!0}function kp(e){return typeof e=="string"&&e.charCodeAt(0)>96}function Ac(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}const Op=Rc();function mi(e,t,n=!1){const r={...t};for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const o=i;if(o==="components"||o==="slots")r[o]={...e[o],...r[o]};else if(o==="componentsProps"||o==="slotProps"){const s=e[o],a=t[o];if(!a)r[o]=s||{};else if(!s)r[o]=a;else{r[o]={...a};for(const l in s)if(Object.prototype.hasOwnProperty.call(s,l)){const u=l;r[o][u]=mi(s[u],a[u],n)}}}else o==="className"&&n&&t.className?r.className=Ne(e==null?void 0:e.className,t==null?void 0:t.className):o==="style"&&n&&t.style?r.style={...e==null?void 0:e.style,...t==null?void 0:t.style}:r[o]===void 0&&(r[o]=e[o])}return r}function Pp(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:mi(t.components[n].defaultProps,r)}function _c({props:e,name:t,defaultTheme:n,themeId:r}){let i=Tc(n);return r&&(i=i[r]||i),Pp({theme:i,name:t,props:e})}const ot=typeof window<"u"?O.useLayoutEffect:O.useEffect;function In(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function Fs(e,t=0,n=1){return process.env.NODE_ENV!=="production"&&(e<t||e>n)&&console.error(`MUI: The value provided ${e} is out of range [${t}, ${n}].`),In(e,t,n)}function Dp(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),process.env.NODE_ENV!=="production"&&e.length!==e.trim().length&&console.error(`MUI: The color: "${e}" is invalid. Make sure the color input doesn't contain leading/trailing space.`),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function zt(e){if(e.type)return e;if(e.charAt(0)==="#")return zt(Dp(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(process.env.NODE_ENV!=="production"?`MUI: Unsupported \`${e}\` color.
|
|
28
|
+
`)),()=>{})}function Ui(e){return Tr(e,"spacing",8,"spacing")}function an(e,t){return typeof t=="string"||t==null?t:e(t)}function Df(e,t){return n=>e.reduce((r,i)=>(r[i]=an(t,n),r),{})}function $f(e,t,n,r){if(!t.includes(n))return null;const i=Of(n),o=Df(i,r),s=e[n];return it(e,s,o)}function Su(e,t){const n=Ui(e.theme);return Object.keys(e).map(r=>$f(e,t,r,n)).reduce(sr,{})}function me(e){return Su(e,Bi)}me.propTypes=process.env.NODE_ENV!=="production"?Bi.reduce((e,t)=>(e[t]=Bt,e),{}):{};me.filterProps=Bi;function ge(e){return Su(e,Gi)}ge.propTypes=process.env.NODE_ENV!=="production"?Gi.reduce((e,t)=>(e[t]=Bt,e),{}):{};ge.filterProps=Gi;process.env.NODE_ENV!=="production"&&Pf.reduce((e,t)=>(e[t]=Bt,e),{});function Eu(e=8,t=Ui({spacing:e})){if(e.mui)return e;const n=(...r)=>(process.env.NODE_ENV!=="production"&&(r.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${r.length}`)),(r.length===0?[1]:r).map(o=>{const s=t(o);return typeof s=="number"?`${s}px`:s}).join(" "));return n.mui=!0,n}function Vi(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>t[o]?sr(i,t[o](r)):i,{});return n.propTypes=process.env.NODE_ENV!=="production"?e.reduce((r,i)=>Object.assign(r,i.propTypes),{}):{},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function qe(e){return typeof e!="number"?e:`${e}px solid`}function Qe(e,t){return ye({prop:e,themeKey:"borders",transform:t})}const Nf=Qe("border",qe),Lf=Qe("borderTop",qe),zf=Qe("borderRight",qe),Ff=Qe("borderBottom",qe),Bf=Qe("borderLeft",qe),Gf=Qe("borderColor"),Uf=Qe("borderTopColor"),Vf=Qe("borderRightColor"),Yf=Qe("borderBottomColor"),Wf=Qe("borderLeftColor"),Hf=Qe("outline",qe),qf=Qe("outlineColor"),Yi=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Tr(e.theme,"shape.borderRadius",4,"borderRadius"),n=r=>({borderRadius:an(t,r)});return it(e,e.borderRadius,n)}return null};Yi.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:Bt}:{};Yi.filterProps=["borderRadius"];Vi(Nf,Lf,zf,Ff,Bf,Gf,Uf,Vf,Yf,Wf,Yi,Hf,qf);const Wi=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Tr(e.theme,"spacing",8,"gap"),n=r=>({gap:an(t,r)});return it(e,e.gap,n)}return null};Wi.propTypes=process.env.NODE_ENV!=="production"?{gap:Bt}:{};Wi.filterProps=["gap"];const Hi=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Tr(e.theme,"spacing",8,"columnGap"),n=r=>({columnGap:an(t,r)});return it(e,e.columnGap,n)}return null};Hi.propTypes=process.env.NODE_ENV!=="production"?{columnGap:Bt}:{};Hi.filterProps=["columnGap"];const qi=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Tr(e.theme,"spacing",8,"rowGap"),n=r=>({rowGap:an(t,r)});return it(e,e.rowGap,n)}return null};qi.propTypes=process.env.NODE_ENV!=="production"?{rowGap:Bt}:{};qi.filterProps=["rowGap"];const Kf=ye({prop:"gridColumn"}),Jf=ye({prop:"gridRow"}),Xf=ye({prop:"gridAutoFlow"}),Zf=ye({prop:"gridAutoColumns"}),Qf=ye({prop:"gridAutoRows"}),ep=ye({prop:"gridTemplateColumns"}),tp=ye({prop:"gridTemplateRows"}),np=ye({prop:"gridTemplateAreas"}),rp=ye({prop:"gridArea"});Vi(Wi,Hi,qi,Kf,Jf,Xf,Zf,Qf,ep,tp,np,rp);function kn(e,t){return t==="grey"?t:e}const ip=ye({prop:"color",themeKey:"palette",transform:kn}),op=ye({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:kn}),sp=ye({prop:"backgroundColor",themeKey:"palette",transform:kn});Vi(ip,op,sp);function Ve(e){return e<=1&&e!==0?`${e*100}%`:e}const ap=ye({prop:"width",transform:Ve}),zs=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var i,o,s,a,l;const r=((s=(o=(i=e.theme)==null?void 0:i.breakpoints)==null?void 0:o.values)==null?void 0:s[n])||zi[n];return r?((l=(a=e.theme)==null?void 0:a.breakpoints)==null?void 0:l.unit)!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Ve(n)}};return it(e,e.maxWidth,t)}return null};zs.filterProps=["maxWidth"];const lp=ye({prop:"minWidth",transform:Ve}),cp=ye({prop:"height",transform:Ve}),up=ye({prop:"maxHeight",transform:Ve}),dp=ye({prop:"minHeight",transform:Ve});ye({prop:"size",cssProperty:"width",transform:Ve});ye({prop:"size",cssProperty:"height",transform:Ve});const hp=ye({prop:"boxSizing"});Vi(ap,zs,lp,cp,up,dp,hp);const wr={border:{themeKey:"borders",transform:qe},borderTop:{themeKey:"borders",transform:qe},borderRight:{themeKey:"borders",transform:qe},borderBottom:{themeKey:"borders",transform:qe},borderLeft:{themeKey:"borders",transform:qe},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:qe},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Yi},color:{themeKey:"palette",transform:kn},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:kn},backgroundColor:{themeKey:"palette",transform:kn},p:{style:ge},pt:{style:ge},pr:{style:ge},pb:{style:ge},pl:{style:ge},px:{style:ge},py:{style:ge},padding:{style:ge},paddingTop:{style:ge},paddingRight:{style:ge},paddingBottom:{style:ge},paddingLeft:{style:ge},paddingX:{style:ge},paddingY:{style:ge},paddingInline:{style:ge},paddingInlineStart:{style:ge},paddingInlineEnd:{style:ge},paddingBlock:{style:ge},paddingBlockStart:{style:ge},paddingBlockEnd:{style:ge},m:{style:me},mt:{style:me},mr:{style:me},mb:{style:me},ml:{style:me},mx:{style:me},my:{style:me},margin:{style:me},marginTop:{style:me},marginRight:{style:me},marginBottom:{style:me},marginLeft:{style:me},marginX:{style:me},marginY:{style:me},marginInline:{style:me},marginInlineStart:{style:me},marginInlineEnd:{style:me},marginBlock:{style:me},marginBlockStart:{style:me},marginBlockEnd:{style:me},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:Wi},rowGap:{style:qi},columnGap:{style:Hi},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Ve},maxWidth:{style:zs},minWidth:{transform:Ve},height:{transform:Ve},maxHeight:{transform:Ve},minHeight:{transform:Ve},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function fp(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function pp(e,t){return typeof e=="function"?e(t):e}function mp(){function e(n,r,i,o){const s={[n]:r,theme:i},a=o[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:d}=a;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const h=Fi(i,c)||{};return d?d(s):it(s,r,m=>{let p=mi(h,u,m);return m===p&&typeof m=="string"&&(p=mi(h,u,`${n}${m==="default"?"":$e(m)}`,m)),l===!1?p:{[l]:p}})}function t(n){const{sx:r,theme:i={},nested:o}=n||{};if(!r)return null;const s=i.unstable_sxConfig??wr;function a(l){let c=l;if(typeof l=="function")c=l(i);else if(typeof l!="object")return l;if(!c)return null;const u=vu(i.breakpoints),d=Object.keys(u);let h=u;return Object.keys(c).forEach(f=>{const m=pp(c[f],i);if(m!=null)if(typeof m=="object")if(s[f])h=sr(h,e(f,m,i,s));else{const p=it({theme:i},m,y=>({[f]:y}));fp(p,m)?h[f]=t({sx:m,theme:i,nested:!0}):h=sr(h,p)}else h=sr(h,e(f,m,i,s))}),!o&&i.modularCssLayers?{"@layer sx":il(i,fs(d,h))}:il(i,fs(d,h))}return Array.isArray(r)?r.map(a):a(r)}return t}const $n=mp();$n.filterProps=["sx"];function gp(e,t){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[e])||typeof n.getColorSchemeSelector!="function")return{};let i=n.getColorSchemeSelector(e);return i==="&"?t:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:t})}return n.palette.mode===e?t:{}}function Ki(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:o={},...s}=e,a=Ef(n),l=Eu(i);let c=Le({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...Mf,...o}},s);return c=Cf(c),c.applyStyles=gp,c=t.reduce((u,d)=>Le(u,d),c),c.unstable_sxConfig={...wr,...s==null?void 0:s.unstable_sxConfig},c.unstable_sx=function(d){return $n({sx:d,theme:this})},c}function yp(e){return Object.keys(e).length===0}function xp(e=null){const t=O.useContext(rf.ThemeContext);return!t||yp(t)?e:t}const bp=Ki();function Tu(e=bp){return xp(e)}const vp=e=>{var r;const t={systemProps:{},otherProps:{}},n=((r=e==null?void 0:e.theme)==null?void 0:r.unstable_sxConfig)??wr;return Object.keys(e).forEach(i=>{n[i]?t.systemProps[i]=e[i]:t.otherProps[i]=e[i]}),t};function Sp(e){const{sx:t,...n}=e,{systemProps:r,otherProps:i}=vp(n);let o;return Array.isArray(t)?o=[r,...t]:typeof t=="function"?o=(...s)=>{const a=t(...s);return ut(a)?{...r,...a}:r}:o={...r,...t},{...i,sx:o}}const al=e=>e,Ep=()=>{let e=al;return{configure(t){e=t},generate(t){return e(t)},reset(){e=al}}},Tp=Ep(),wp={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 hn(e,t,n="Mui"){const r=wp[t];return r?`${n}-${r}`:`${Tp.generate(e)}-${t}`}function Ji(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=hn(e,i,n)}),r}function wu(e,t=""){return e.displayName||e.name||t}function ll(e,t,n){const r=wu(t);return e.displayName||(r!==""?`${n}(${r})`:n)}function Cp(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return wu(e,"Component");if(typeof e=="object")switch(e.$$typeof){case pi.ForwardRef:return ll(e,e.render,"ForwardRef");case pi.Memo:return ll(e,e.type,"memo");default:return}}}function Cu(e){const{variants:t,...n}=e,r={variants:t,style:rn(n),isProcessed:!0};return r.style===n||t&&t.forEach(i=>{typeof i.style!="function"&&(i.style=rn(i.style))}),r}const Mp=Ki();function Fo(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function Qt(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function Rp(e){return e?(t,n)=>n[e]:null}function Ap(e,t,n){e.theme=jp(e.theme)?n:e.theme[t]||e.theme}function ci(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(i=>ci(e,i,n));if(Array.isArray(r==null?void 0:r.variants)){let i;if(r.isProcessed)i=n?Qt(r.style,n):r.style;else{const{variants:o,...s}=r;i=n?Qt(rn(s),n):s}return Mu(e,r.variants,[i],n)}return r!=null&&r.isProcessed?n?Qt(rn(r.style),n):r.style:n?Qt(rn(r),n):r}function Mu(e,t,n=[],r=void 0){var o;let i;e:for(let s=0;s<t.length;s+=1){const a=t[s];if(typeof a.props=="function"){if(i??(i={...e,...e.ownerState,ownerState:e.ownerState}),!a.props(i))continue}else for(const l in a.props)if(e[l]!==a.props[l]&&((o=e.ownerState)==null?void 0:o[l])!==a.props[l])continue e;typeof a.style=="function"?(i??(i={...e,...e.ownerState,ownerState:e.ownerState}),n.push(r?Qt(rn(a.style(i)),r):a.style(i))):n.push(r?Qt(rn(a.style),r):a.style)}return n}function Ru(e={}){const{themeId:t,defaultTheme:n=Mp,rootShouldForwardProp:r=Fo,slotShouldForwardProp:i=Fo}=e;function o(a){Ap(a,t,n)}return(a,l={})=>{yf(a,S=>S.filter(R=>R!==$n));const{name:c,slot:u,skipVariantsResolver:d,skipSx:h,overridesResolver:f=Rp(Au(u)),...m}=l,p=c&&c.startsWith("Mui")||u?"components":"custom",y=d!==void 0?d:u&&u!=="Root"&&u!=="root"||!1,b=h||!1;let E=Fo;u==="Root"||u==="root"?E=r:u?E=i:kp(a)&&(E=void 0);const T=gf(a,{shouldForwardProp:E,label:Ip(c,u),...m}),w=S=>{if(S.__emotion_real===S)return S;if(typeof S=="function")return function(I){return ci(I,S,I.theme.modularCssLayers?p:void 0)};if(ut(S)){const R=Cu(S);return function(k){return R.variants?ci(k,R,k.theme.modularCssLayers?p:void 0):k.theme.modularCssLayers?Qt(R.style,p):R.style}}return S},C=(...S)=>{const R=[],I=S.map(w),k=[];if(R.push(o),c&&f&&k.push(function(_){var Z,Y;const B=(Y=(Z=_.theme.components)==null?void 0:Z[c])==null?void 0:Y.styleOverrides;if(!B)return null;const G={};for(const te in B)G[te]=ci(_,B[te],_.theme.modularCssLayers?"theme":void 0);return f(_,G)}),c&&!y&&k.push(function(_){var G,Z;const A=_.theme,B=(Z=(G=A==null?void 0:A.components)==null?void 0:G[c])==null?void 0:Z.variants;return B?Mu(_,B,[],_.theme.modularCssLayers?"theme":void 0):null}),b||k.push($n),Array.isArray(I[0])){const v=I.shift(),_=new Array(R.length).fill(""),A=new Array(k.length).fill("");let B;B=[..._,...v,...A],B.raw=[..._,...v.raw,...A],R.unshift(B)}const z=[...R,...I,...k],P=T(...z);return a.muiName&&(P.muiName=a.muiName),process.env.NODE_ENV!=="production"&&(P.displayName=_p(c,u,a)),P};return T.withConfig&&(C.withConfig=T.withConfig),C}}function _p(e,t,n){return e?`${e}${$e(t||"")}`:`Styled(${Cp(n)})`}function Ip(e,t){let n;return process.env.NODE_ENV!=="production"&&e&&(n=`${e}-${Au(t||"Root")}`),n}function jp(e){for(const t in e)return!1;return!0}function kp(e){return typeof e=="string"&&e.charCodeAt(0)>96}function Au(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}const Op=Ru();function gi(e,t,n=!1){const r={...t};for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const o=i;if(o==="components"||o==="slots")r[o]={...e[o],...r[o]};else if(o==="componentsProps"||o==="slotProps"){const s=e[o],a=t[o];if(!a)r[o]=s||{};else if(!s)r[o]=a;else{r[o]={...a};for(const l in s)if(Object.prototype.hasOwnProperty.call(s,l)){const c=l;r[o][c]=gi(s[c],a[c],n)}}}else o==="className"&&n&&t.className?r.className=Ne(e==null?void 0:e.className,t==null?void 0:t.className):o==="style"&&n&&t.style?r.style={...e==null?void 0:e.style,...t==null?void 0:t.style}:r[o]===void 0&&(r[o]=e[o])}return r}function Pp(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:gi(t.components[n].defaultProps,r)}function _u({props:e,name:t,defaultTheme:n,themeId:r}){let i=Tu(n);return r&&(i=i[r]||i),Pp({theme:i,name:t,props:e})}const ot=typeof window<"u"?O.useLayoutEffect:O.useEffect;function In(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function Fs(e,t=0,n=1){return process.env.NODE_ENV!=="production"&&(e<t||e>n)&&console.error(`MUI: The value provided ${e} is out of range [${t}, ${n}].`),In(e,t,n)}function Dp(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),process.env.NODE_ENV!=="production"&&e.length!==e.trim().length&&console.error(`MUI: The color: "${e}" is invalid. Make sure the color input doesn't contain leading/trailing space.`),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function zt(e){if(e.type)return e;if(e.charAt(0)==="#")return zt(Dp(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(process.env.NODE_ENV!=="production"?`MUI: Unsupported \`${e}\` color.
|
|
29
29
|
The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`:Lt(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(i))throw new Error(process.env.NODE_ENV!=="production"?`MUI: unsupported \`${i}\` color space.
|
|
30
|
-
The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:Lt(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const $p=e=>{const t=zt(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},tr=(e,t)=>{try{return $p(e)}catch{return t&&process.env.NODE_ENV!=="production"&&console.warn(t),e}};function Ji(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((i,o)=>o<3?parseInt(i,10):i):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function Ic(e){e=zt(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),s=(u,c=(u+n/30)%12)=>i-o*Math.max(Math.min(c-3,9-c,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),Ji({type:a,values:l})}function fs(e){e=zt(e);let t=e.type==="hsl"||e.type==="hsla"?zt(Ic(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function ul(e,t){const n=fs(e),r=fs(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function jc(e,t){return e=zt(e),t=Fs(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Ji(e)}function Jt(e,t,n){try{return jc(e,t)}catch{return n&&process.env.NODE_ENV!=="production"&&console.warn(n),e}}function Xi(e,t){if(e=zt(e),t=Fs(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return Ji(e)}function oe(e,t,n){try{return Xi(e,t)}catch{return n&&process.env.NODE_ENV!=="production"&&console.warn(n),e}}function Zi(e,t){if(e=zt(e),t=Fs(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return Ji(e)}function se(e,t,n){try{return Zi(e,t)}catch{return n&&process.env.NODE_ENV!=="production"&&console.warn(n),e}}function Np(e,t=.15){return fs(e)>.5?Xi(e,t):Zi(e,t)}function zr(e,t,n){try{return Np(e,t)}catch{return e}}const Lp=O.createContext();process.env.NODE_ENV!=="production"&&(x.node,x.bool);const zp=()=>O.useContext(Lp)??!1,Fp=O.createContext(void 0);process.env.NODE_ENV!=="production"&&(x.node,x.object);function Bp(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?mi(i.defaultProps,r,t.components.mergeClassNameAndStyle):!i.styleOverrides&&!i.variants?mi(i,r,t.components.mergeClassNameAndStyle):r}function Gp({props:e,name:t}){const n=O.useContext(Fp);return Bp({props:e,name:t,theme:{components:n}})}let cl=0;function Up(e){const[t,n]=O.useState(e),r=t;return O.useEffect(()=>{t==null&&(cl+=1,n(`mui-${cl}`))},[t]),r}const Vp={...O},dl=Vp.useId;function Yp(e){return dl!==void 0?dl():Up(e)}const hl={theme:void 0};function Wp(e){let t,n;return function(i){let o=t;return(o===void 0||i.theme!==n)&&(hl.theme=i.theme,o=Cc(e(hl)),t=o,n=i.theme),o}}function Hp(e=""){function t(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${i}${t(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${e?`${e}-`:""}${r}${t(...i)})`}const fl=(e,t,n,r=[])=>{let i=e;t.forEach((o,s)=>{s===t.length-1?Array.isArray(i)?i[Number(o)]=n:i&&typeof i=="object"&&(i[o]=n):i&&typeof i=="object"&&(i[o]||(i[o]=r.includes(o)?[]:{}),i=i[o])})},qp=(e,t,n)=>{function r(i,o=[],s=[]){Object.entries(i).forEach(([a,l])=>{(!n||n&&!n([...o,a]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...o,a],Array.isArray(l)?[...s,a]:s):t([...o,a],l,s))})}r(e)},Kp=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function Fo(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},o={},s={};return qp(e,(a,l,u)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(a,l))){const c=`--${n?`${n}-`:""}${a.join("-")}`,d=Kp(a,l);Object.assign(i,{[c]:d}),fl(o,a,`var(${c})`,u),fl(s,a,`var(${c}, ${d})`,u)}},a=>a[0]==="vars"),{css:i,vars:o,varsWithDefaults:s}}function Jp(e,t={}){const{getSelector:n=b,disableCssColorScheme:r,colorSchemeSelector:i,enableContrastVars:o}=t,{colorSchemes:s={},components:a,defaultColorScheme:l="light",...u}=e,{vars:c,css:d,varsWithDefaults:h}=Fo(u,t);let f=h;const m={},{[l]:p,...y}=s;if(Object.entries(y||{}).forEach(([w,C])=>{const{vars:S,css:R,varsWithDefaults:I}=Fo(C,t);f=Le(f,I),m[w]={css:R,vars:S}}),p){const{css:w,vars:C,varsWithDefaults:S}=Fo(p,t);f=Le(f,S),m[l]={css:w,vars:C}}function b(w,C){var R,I;let S=i;if(i==="class"&&(S=".%s"),i==="data"&&(S="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(S=`[${i}="%s"]`),w){if(S==="media")return e.defaultColorScheme===w?":root":{[`@media (prefers-color-scheme: ${((I=(R=s[w])==null?void 0:R.palette)==null?void 0:I.mode)||w})`]:{":root":C}};if(S)return e.defaultColorScheme===w?`:root, ${S.replace("%s",String(w))}`:S.replace("%s",String(w))}return":root"}return{vars:f,generateThemeVars:()=>{let w={...c};return Object.entries(m).forEach(([,{vars:C}])=>{w=Le(w,C)}),w},generateStyleSheets:()=>{var k,z;const w=[],C=e.defaultColorScheme||"light";function S(P,v){Object.keys(v).length&&w.push(typeof P=="string"?{[P]:{...v}}:P)}S(n(void 0,{...d}),d);const{[C]:R,...I}=m;if(R){const{css:P}=R,v=(z=(k=s[C])==null?void 0:k.palette)==null?void 0:z.mode,_=!r&&v?{colorScheme:v,...P}:{...P};S(n(C,{..._}),_)}return Object.entries(I).forEach(([P,{css:v}])=>{var B,G;const _=(G=(B=s[P])==null?void 0:B.palette)==null?void 0:G.mode,A=!r&&_?{colorScheme:_,...v}:{...v};S(n(P,{...A}),A)}),o&&w.push({":root":{"--__l-threshold":"0.7","--__l":"clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)","--__a":"clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"}}),w}}}function Xp(e){return function(n){return e==="media"?(process.env.NODE_ENV!=="production"&&n!=="light"&&n!=="dark"&&console.error(`MUI: @media (prefers-color-scheme) supports only 'light' or 'dark', but receive '${n}'.`),`@media (prefers-color-scheme: ${n})`):e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}const Zp=qi(),Qp=Op("div",{name:"MuiStack",slot:"Root"});function em(e){return _c({props:e,name:"MuiStack",defaultTheme:Zp})}function tm(e,t){const n=O.Children.toArray(e).filter(Boolean);return n.reduce((r,i,o)=>(r.push(i),o<n.length-1&&r.push(O.cloneElement(t,{key:`separator-${o}`})),r),[])}const nm=e=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],rm=({ownerState:e,theme:t})=>{let n={display:"flex",flexDirection:"column",...it({theme:t},Lo({values:e.direction,breakpoints:t.breakpoints.values}),r=>({flexDirection:r}))};if(e.spacing){const r=Gi(t),i=Object.keys(t.breakpoints.values).reduce((l,u)=>((typeof e.spacing=="object"&&e.spacing[u]!=null||typeof e.direction=="object"&&e.direction[u]!=null)&&(l[u]=!0),l),{}),o=Lo({values:e.direction,base:i}),s=Lo({values:e.spacing,base:i});typeof o=="object"&&Object.keys(o).forEach((l,u,c)=>{if(!o[l]){const h=u>0?o[c[u-1]]:"column";o[l]=h}}),n=Le(n,it({theme:t},s,(l,u)=>e.useFlexGap?{gap:an(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${nm(u?o[u]:e.direction)}`]:an(r,l)}}))}return n=Af(t.breakpoints,n),n};function im(e={}){const{createStyledComponent:t=Qp,useThemeProps:n=em,componentName:r="MuiStack"}=e,i=()=>Sr({root:["root"]},l=>hn(r,l),{}),o=t(rm),s=O.forwardRef(function(l,u){const c=n(l),d=Sp(c),{component:h="div",direction:f="column",spacing:m=0,divider:p,children:y,className:b,useFlexGap:E=!1,...T}=d,w={direction:f,spacing:m,useFlexGap:E},C=i();return g.jsxRuntimeExports.jsx(o,{as:h,ownerState:w,ref:u,className:Ne(C.root,b),...T,children:p?tm(y,p):y})});return process.env.NODE_ENV!=="production"&&(s.propTypes={children:x.node,direction:x.oneOfType([x.oneOf(["column-reverse","column","row-reverse","row"]),x.arrayOf(x.oneOf(["column-reverse","column","row-reverse","row"])),x.object]),divider:x.node,spacing:x.oneOfType([x.arrayOf(x.oneOfType([x.number,x.string])),x.number,x.object,x.string]),sx:x.oneOfType([x.arrayOf(x.oneOfType([x.func,x.object,x.bool])),x.func,x.object])}),s}const cr={black:"#000",white:"#fff"},om={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"},Sn={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},En={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},Kn={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},Tn={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},wn={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Cn={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function kc(){return{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:cr.white,default:cr.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}}}const Oc=kc();function Pc(){return{text:{primary:cr.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:cr.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}}}const ps=Pc();function pl(e,t,n,r){const i=r.light||r,o=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=Zi(e.main,i):t==="dark"&&(e.dark=Xi(e.main,o)))}function ml(e,t,n,r,i){const o=i.light||i,s=i.dark||i*1.5;t[n]||(t.hasOwnProperty(r)?t[n]=t[r]:n==="light"?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(o*100).toFixed(0)}%)`:n==="dark"&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(s*100).toFixed(0)}%)`))}function sm(e="light"){return e==="dark"?{main:Tn[200],light:Tn[50],dark:Tn[400]}:{main:Tn[700],light:Tn[400],dark:Tn[800]}}function am(e="light"){return e==="dark"?{main:Sn[200],light:Sn[50],dark:Sn[400]}:{main:Sn[500],light:Sn[300],dark:Sn[700]}}function lm(e="light"){return e==="dark"?{main:En[500],light:En[300],dark:En[700]}:{main:En[700],light:En[400],dark:En[800]}}function um(e="light"){return e==="dark"?{main:wn[400],light:wn[300],dark:wn[700]}:{main:wn[700],light:wn[500],dark:wn[900]}}function cm(e="light"){return e==="dark"?{main:Cn[400],light:Cn[300],dark:Cn[700]}:{main:Cn[800],light:Cn[500],dark:Cn[900]}}function dm(e="light"){return e==="dark"?{main:Kn[400],light:Kn[300],dark:Kn[700]}:{main:"#ed6c02",light:Kn[500],dark:Kn[900]}}function hm(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function Bs(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,colorSpace:i,...o}=e,s=e.primary||sm(t),a=e.secondary||am(t),l=e.error||lm(t),u=e.info||um(t),c=e.success||cm(t),d=e.warning||dm(t);function h(y){if(i)return hm(y);const b=ul(y,ps.text.primary)>=n?ps.text.primary:Oc.text.primary;if(process.env.NODE_ENV!=="production"){const E=ul(y,b);E<3&&console.error([`MUI: The contrast ratio of ${E}:1 for ${b} on ${y}`,"falls below the WCAG recommended absolute minimum contrast ratio of 3:1.","https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast"].join(`
|
|
30
|
+
The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:Lt(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const $p=e=>{const t=zt(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},tr=(e,t)=>{try{return $p(e)}catch{return t&&process.env.NODE_ENV!=="production"&&console.warn(t),e}};function Xi(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((i,o)=>o<3?parseInt(i,10):i):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function Iu(e){e=zt(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),s=(c,u=(c+n/30)%12)=>i-o*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),Xi({type:a,values:l})}function ps(e){e=zt(e);let t=e.type==="hsl"||e.type==="hsla"?zt(Iu(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function cl(e,t){const n=ps(e),r=ps(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function ju(e,t){return e=zt(e),t=Fs(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Xi(e)}function Jt(e,t,n){try{return ju(e,t)}catch{return n&&process.env.NODE_ENV!=="production"&&console.warn(n),e}}function Zi(e,t){if(e=zt(e),t=Fs(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return Xi(e)}function ie(e,t,n){try{return Zi(e,t)}catch{return n&&process.env.NODE_ENV!=="production"&&console.warn(n),e}}function Qi(e,t){if(e=zt(e),t=Fs(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return Xi(e)}function oe(e,t,n){try{return Qi(e,t)}catch{return n&&process.env.NODE_ENV!=="production"&&console.warn(n),e}}function Np(e,t=.15){return ps(e)>.5?Zi(e,t):Qi(e,t)}function Fr(e,t,n){try{return Np(e,t)}catch{return e}}const Lp=O.createContext();process.env.NODE_ENV!=="production"&&(x.node,x.bool);const zp=()=>O.useContext(Lp)??!1,Fp=O.createContext(void 0);process.env.NODE_ENV!=="production"&&(x.node,x.object);function Bp(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?gi(i.defaultProps,r,t.components.mergeClassNameAndStyle):!i.styleOverrides&&!i.variants?gi(i,r,t.components.mergeClassNameAndStyle):r}function Gp({props:e,name:t}){const n=O.useContext(Fp);return Bp({props:e,name:t,theme:{components:n}})}let ul=0;function Up(e){const[t,n]=O.useState(e),r=t;return O.useEffect(()=>{t==null&&(ul+=1,n(`mui-${ul}`))},[t]),r}const Vp={...O},dl=Vp.useId;function Yp(e){return dl!==void 0?dl():Up(e)}const hl={theme:void 0};function Wp(e){let t,n;return function(i){let o=t;return(o===void 0||i.theme!==n)&&(hl.theme=i.theme,o=Cu(e(hl)),t=o,n=i.theme),o}}function Hp(e=""){function t(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${i}${t(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${e?`${e}-`:""}${r}${t(...i)})`}const fl=(e,t,n,r=[])=>{let i=e;t.forEach((o,s)=>{s===t.length-1?Array.isArray(i)?i[Number(o)]=n:i&&typeof i=="object"&&(i[o]=n):i&&typeof i=="object"&&(i[o]||(i[o]=r.includes(o)?[]:{}),i=i[o])})},qp=(e,t,n)=>{function r(i,o=[],s=[]){Object.entries(i).forEach(([a,l])=>{(!n||n&&!n([...o,a]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...o,a],Array.isArray(l)?[...s,a]:s):t([...o,a],l,s))})}r(e)},Kp=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function Bo(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},o={},s={};return qp(e,(a,l,c)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(a,l))){const u=`--${n?`${n}-`:""}${a.join("-")}`,d=Kp(a,l);Object.assign(i,{[u]:d}),fl(o,a,`var(${u})`,c),fl(s,a,`var(${u}, ${d})`,c)}},a=>a[0]==="vars"),{css:i,vars:o,varsWithDefaults:s}}function Jp(e,t={}){const{getSelector:n=b,disableCssColorScheme:r,colorSchemeSelector:i,enableContrastVars:o}=t,{colorSchemes:s={},components:a,defaultColorScheme:l="light",...c}=e,{vars:u,css:d,varsWithDefaults:h}=Bo(c,t);let f=h;const m={},{[l]:p,...y}=s;if(Object.entries(y||{}).forEach(([w,C])=>{const{vars:S,css:R,varsWithDefaults:I}=Bo(C,t);f=Le(f,I),m[w]={css:R,vars:S}}),p){const{css:w,vars:C,varsWithDefaults:S}=Bo(p,t);f=Le(f,S),m[l]={css:w,vars:C}}function b(w,C){var R,I;let S=i;if(i==="class"&&(S=".%s"),i==="data"&&(S="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(S=`[${i}="%s"]`),w){if(S==="media")return e.defaultColorScheme===w?":root":{[`@media (prefers-color-scheme: ${((I=(R=s[w])==null?void 0:R.palette)==null?void 0:I.mode)||w})`]:{":root":C}};if(S)return e.defaultColorScheme===w?`:root, ${S.replace("%s",String(w))}`:S.replace("%s",String(w))}return":root"}return{vars:f,generateThemeVars:()=>{let w={...u};return Object.entries(m).forEach(([,{vars:C}])=>{w=Le(w,C)}),w},generateStyleSheets:()=>{var k,z;const w=[],C=e.defaultColorScheme||"light";function S(P,v){Object.keys(v).length&&w.push(typeof P=="string"?{[P]:{...v}}:P)}S(n(void 0,{...d}),d);const{[C]:R,...I}=m;if(R){const{css:P}=R,v=(z=(k=s[C])==null?void 0:k.palette)==null?void 0:z.mode,_=!r&&v?{colorScheme:v,...P}:{...P};S(n(C,{..._}),_)}return Object.entries(I).forEach(([P,{css:v}])=>{var B,G;const _=(G=(B=s[P])==null?void 0:B.palette)==null?void 0:G.mode,A=!r&&_?{colorScheme:_,...v}:{...v};S(n(P,{...A}),A)}),o&&w.push({":root":{"--__l-threshold":"0.7","--__l":"clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)","--__a":"clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"}}),w}}}function Xp(e){return function(n){return e==="media"?(process.env.NODE_ENV!=="production"&&n!=="light"&&n!=="dark"&&console.error(`MUI: @media (prefers-color-scheme) supports only 'light' or 'dark', but receive '${n}'.`),`@media (prefers-color-scheme: ${n})`):e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}const Zp=Ki(),Qp=Op("div",{name:"MuiStack",slot:"Root"});function em(e){return _u({props:e,name:"MuiStack",defaultTheme:Zp})}function tm(e,t){const n=O.Children.toArray(e).filter(Boolean);return n.reduce((r,i,o)=>(r.push(i),o<n.length-1&&r.push(O.cloneElement(t,{key:`separator-${o}`})),r),[])}const nm=e=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],rm=({ownerState:e,theme:t})=>{let n={display:"flex",flexDirection:"column",...it({theme:t},zo({values:e.direction,breakpoints:t.breakpoints.values}),r=>({flexDirection:r}))};if(e.spacing){const r=Ui(t),i=Object.keys(t.breakpoints.values).reduce((l,c)=>((typeof e.spacing=="object"&&e.spacing[c]!=null||typeof e.direction=="object"&&e.direction[c]!=null)&&(l[c]=!0),l),{}),o=zo({values:e.direction,base:i}),s=zo({values:e.spacing,base:i});typeof o=="object"&&Object.keys(o).forEach((l,c,u)=>{if(!o[l]){const h=c>0?o[u[c-1]]:"column";o[l]=h}}),n=Le(n,it({theme:t},s,(l,c)=>e.useFlexGap?{gap:an(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${nm(c?o[c]:e.direction)}`]:an(r,l)}}))}return n=Af(t.breakpoints,n),n};function im(e={}){const{createStyledComponent:t=Qp,useThemeProps:n=em,componentName:r="MuiStack"}=e,i=()=>Er({root:["root"]},l=>hn(r,l),{}),o=t(rm),s=O.forwardRef(function(l,c){const u=n(l),d=Sp(u),{component:h="div",direction:f="column",spacing:m=0,divider:p,children:y,className:b,useFlexGap:E=!1,...T}=d,w={direction:f,spacing:m,useFlexGap:E},C=i();return g.jsxRuntimeExports.jsx(o,{as:h,ownerState:w,ref:c,className:Ne(C.root,b),...T,children:p?tm(y,p):y})});return process.env.NODE_ENV!=="production"&&(s.propTypes={children:x.node,direction:x.oneOfType([x.oneOf(["column-reverse","column","row-reverse","row"]),x.arrayOf(x.oneOf(["column-reverse","column","row-reverse","row"])),x.object]),divider:x.node,spacing:x.oneOfType([x.arrayOf(x.oneOfType([x.number,x.string])),x.number,x.object,x.string]),sx:x.oneOfType([x.arrayOf(x.oneOfType([x.func,x.object,x.bool])),x.func,x.object])}),s}const dr={black:"#000",white:"#fff"},om={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"},Sn={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},En={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},Kn={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},Tn={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},wn={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Cn={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function ku(){return{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:dr.white,default:dr.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}}}const Ou=ku();function Pu(){return{text:{primary:dr.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:dr.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}}}const ms=Pu();function pl(e,t,n,r){const i=r.light||r,o=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=Qi(e.main,i):t==="dark"&&(e.dark=Zi(e.main,o)))}function ml(e,t,n,r,i){const o=i.light||i,s=i.dark||i*1.5;t[n]||(t.hasOwnProperty(r)?t[n]=t[r]:n==="light"?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(o*100).toFixed(0)}%)`:n==="dark"&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(s*100).toFixed(0)}%)`))}function sm(e="light"){return e==="dark"?{main:Tn[200],light:Tn[50],dark:Tn[400]}:{main:Tn[700],light:Tn[400],dark:Tn[800]}}function am(e="light"){return e==="dark"?{main:Sn[200],light:Sn[50],dark:Sn[400]}:{main:Sn[500],light:Sn[300],dark:Sn[700]}}function lm(e="light"){return e==="dark"?{main:En[500],light:En[300],dark:En[700]}:{main:En[700],light:En[400],dark:En[800]}}function cm(e="light"){return e==="dark"?{main:wn[400],light:wn[300],dark:wn[700]}:{main:wn[700],light:wn[500],dark:wn[900]}}function um(e="light"){return e==="dark"?{main:Cn[400],light:Cn[300],dark:Cn[700]}:{main:Cn[800],light:Cn[500],dark:Cn[900]}}function dm(e="light"){return e==="dark"?{main:Kn[400],light:Kn[300],dark:Kn[700]}:{main:"#ed6c02",light:Kn[500],dark:Kn[900]}}function hm(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function Bs(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,colorSpace:i,...o}=e,s=e.primary||sm(t),a=e.secondary||am(t),l=e.error||lm(t),c=e.info||cm(t),u=e.success||um(t),d=e.warning||dm(t);function h(y){if(i)return hm(y);const b=cl(y,ms.text.primary)>=n?ms.text.primary:Ou.text.primary;if(process.env.NODE_ENV!=="production"){const E=cl(y,b);E<3&&console.error([`MUI: The contrast ratio of ${E}:1 for ${b} on ${y}`,"falls below the WCAG recommended absolute minimum contrast ratio of 3:1.","https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast"].join(`
|
|
31
31
|
`))}return b}const f=({color:y,name:b,mainShade:E=500,lightShade:T=300,darkShade:w=700})=>{if(y={...y},!y.main&&y[E]&&(y.main=y[E]),!y.hasOwnProperty("main"))throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${b?` (${b})`:""} provided to augmentColor(color) is invalid.
|
|
32
32
|
The color object needs to have a \`main\` property or a \`${E}\` property.`:Lt(11,b?` (${b})`:"",E));if(typeof y.main!="string")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${b?` (${b})`:""} provided to augmentColor(color) is invalid.
|
|
33
33
|
\`color.main\` should be a string, but \`${JSON.stringify(y.main)}\` was provided instead.
|
|
@@ -42,23 +42,23 @@ const theme1 = createTheme({ palette: {
|
|
|
42
42
|
|
|
43
43
|
const theme2 = createTheme({ palette: {
|
|
44
44
|
primary: { main: green[500] },
|
|
45
|
-
} });`:Lt(12,b?` (${b})`:"",JSON.stringify(y.main)));return i?(ml(i,y,"light",T,r),ml(i,y,"dark",w,r)):(pl(y,"light",T,r),pl(y,"dark",w,r)),y.contrastText||(y.contrastText=h(y.main)),y};let m;return t==="light"?m=
|
|
46
|
-
`)),Object.keys(
|
|
45
|
+
} });`:Lt(12,b?` (${b})`:"",JSON.stringify(y.main)));return i?(ml(i,y,"light",T,r),ml(i,y,"dark",w,r)):(pl(y,"light",T,r),pl(y,"dark",w,r)),y.contrastText||(y.contrastText=h(y.main)),y};let m;return t==="light"?m=ku():t==="dark"&&(m=Pu()),process.env.NODE_ENV!=="production"&&(m||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),Le({common:{...dr},mode:t,primary:f({color:s,name:"primary"}),secondary:f({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:l,name:"error"}),warning:f({color:d,name:"warning"}),info:f({color:c,name:"info"}),success:f({color:u,name:"success"}),grey:om,contrastThreshold:n,getContrastText:h,augmentColor:f,tonalOffset:r,...m},o)}function fm(e){const t={};return Object.entries(e).forEach(r=>{const[i,o]=r;typeof o=="object"&&(t[i]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),t}function pm(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function mm(e){return Math.round(e*1e5)/1e5}const gl={textTransform:"uppercase"},yl='"Roboto", "Helvetica", "Arial", sans-serif';function gm(e,t){const{fontFamily:n=yl,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:o=400,fontWeightMedium:s=500,fontWeightBold:a=700,htmlFontSize:l=16,allVariants:c,pxToRem:u,...d}=typeof t=="function"?t(e):t;process.env.NODE_ENV!=="production"&&(typeof r!="number"&&console.error("MUI: `fontSize` is required to be a number."),typeof l!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const h=r/14,f=u||(y=>`${y/l*h}rem`),m=(y,b,E,T,w)=>({fontFamily:n,fontWeight:y,fontSize:f(b),lineHeight:E,...n===yl?{letterSpacing:`${mm(T/b)}em`}:{},...w,...c}),p={h1:m(i,96,1.167,-1.5),h2:m(i,60,1.2,-.5),h3:m(o,48,1.167,0),h4:m(o,34,1.235,.25),h5:m(o,24,1.334,0),h6:m(s,20,1.6,.15),subtitle1:m(o,16,1.75,.15),subtitle2:m(s,14,1.57,.1),body1:m(o,16,1.5,.15),body2:m(o,14,1.43,.15),button:m(s,14,1.75,.4,gl),caption:m(o,12,1.66,.4),overline:m(o,12,2.66,1,gl),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Le({htmlFontSize:l,pxToRem:f,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:o,fontWeightMedium:s,fontWeightBold:a,...p},d,{clone:!1})}const ym=.2,xm=.14,bm=.12;function fe(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${ym})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${xm})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${bm})`].join(",")}const vm=["none",fe(0,2,1,-1,0,1,1,0,0,1,3,0),fe(0,3,1,-2,0,2,2,0,0,1,5,0),fe(0,3,3,-2,0,3,4,0,0,1,8,0),fe(0,2,4,-1,0,4,5,0,0,1,10,0),fe(0,3,5,-1,0,5,8,0,0,1,14,0),fe(0,3,5,-1,0,6,10,0,0,1,18,0),fe(0,4,5,-2,0,7,10,1,0,2,16,1),fe(0,5,5,-3,0,8,10,1,0,3,14,2),fe(0,5,6,-3,0,9,12,1,0,3,16,2),fe(0,6,6,-3,0,10,14,1,0,4,18,3),fe(0,6,7,-4,0,11,15,1,0,4,20,3),fe(0,7,8,-4,0,12,17,2,0,5,22,4),fe(0,7,8,-4,0,13,19,2,0,5,24,4),fe(0,7,9,-4,0,14,21,2,0,5,26,4),fe(0,8,9,-5,0,15,22,2,0,6,28,5),fe(0,8,10,-5,0,16,24,2,0,6,30,5),fe(0,8,11,-5,0,17,26,2,0,6,32,5),fe(0,9,11,-5,0,18,28,2,0,7,34,6),fe(0,9,12,-6,0,19,29,2,0,7,36,6),fe(0,10,13,-6,0,20,31,3,0,8,38,7),fe(0,10,13,-6,0,21,33,3,0,8,40,7),fe(0,10,14,-6,0,22,35,3,0,8,42,7),fe(0,11,14,-7,0,23,36,3,0,9,44,8),fe(0,11,15,-7,0,24,38,3,0,9,46,8)],Sm={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)"},Em={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function xl(e){return`${Math.round(e)}ms`}function Tm(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function wm(e){const t={...Sm,...e.easing},n={...Em,...e.duration};return{getAutoHeightDuration:Tm,create:(i=["all"],o={})=>{const{duration:s=n.standard,easing:a=t.easeInOut,delay:l=0,...c}=o;if(process.env.NODE_ENV!=="production"){const u=h=>typeof h=="string",d=h=>!Number.isNaN(parseFloat(h));!u(i)&&!Array.isArray(i)&&console.error('MUI: Argument "props" must be a string or Array.'),!d(s)&&!u(s)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${s}.`),u(a)||console.error('MUI: Argument "easing" must be a string.'),!d(l)&&!u(l)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof o!="object"&&console.error(["MUI: Secong argument of transition.create must be an object.","Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
|
|
46
|
+
`)),Object.keys(c).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(c).join(",")}].`)}return(Array.isArray(i)?i:[i]).map(u=>`${u} ${typeof s=="string"?s:xl(s)} ${a} ${typeof l=="string"?l:xl(l)}`).join(",")},...e,easing:t,duration:n}}const Cm={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Mm(e){return ut(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function Du(e={}){const t={...e};function n(r){const i=Object.entries(r);for(let o=0;o<i.length;o++){const[s,a]=i[o];!Mm(a)||s.startsWith("unstable_")?delete r[s]:ut(a)&&(r[s]={...a},n(r[s]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
|
47
47
|
|
|
48
48
|
const theme = ${JSON.stringify(t,null,2)};
|
|
49
49
|
|
|
50
50
|
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
|
51
51
|
theme.transitions = createTransitions(theme.transitions || {});
|
|
52
52
|
|
|
53
|
-
export default theme;`}function bl(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const Rm=e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let r=0;r<t.length;r+=1)n+=+t[r];return n};function Am(e){Object.assign(e,{alpha(t,n){const r=this||e;return r.colorSpace?`oklch(from ${t} l c h / ${typeof n=="string"?`calc(${n})`:n})`:r.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof n=="string"?`calc(${n})`:n})`:
|
|
54
|
-
`))}y[E]={}}}};Object.keys(f.components).forEach(y=>{const b=f.components[y].styleOverrides;b&&y.startsWith("Mui")&&p(b,y)})}return f.unstable_sxConfig={...
|
|
55
|
-
To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function $m(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const at=e=>{try{return e()}catch{}},Nm=(e="mui")=>Hp(e);function Bo(e,t,n,r,i){if(!n)return;n=n===!0?{}:n;const o=i==="dark"?"dark":"light";if(!r){t[i]=jm({...n,palette:{mode:o,...n==null?void 0:n.palette},colorSpace:e});return}const{palette:s,...a}=ms({...r,palette:{mode:o,...n==null?void 0:n.palette},colorSpace:e});return t[i]={...n,palette:s,opacity:{...$c(o),...n==null?void 0:n.opacity},overlays:(n==null?void 0:n.overlays)||Nc(o)},a}function Lm(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:o="mui",nativeColor:s=!1,shouldSkipGeneratingVar:a=km,colorSchemeSelector:l=n.light&&n.dark?"media":void 0,rootSelector:u=":root",...c}=e,d=Object.keys(n)[0],h=r||(n.light&&d!=="light"?"light":d),f=Nm(o),{[h]:m,light:p,dark:y,...b}=n,E={...b};let T=m;if((h==="dark"&&!("dark"in n)||h==="light"&&!("light"in n))&&(T=!0),!T)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${h}\` option is either missing or invalid.`:Lt(21,h));let w;s&&(w="oklch");const C=Bo(w,E,T,c,h);p&&!E.light&&Bo(w,E,p,void 0,"light"),y&&!E.dark&&Bo(w,E,y,void 0,"dark");let S={defaultColorScheme:h,...C,cssVarPrefix:o,colorSchemeSelector:l,rootSelector:u,getCssVar:f,colorSchemes:E,font:{...fm(C.typography),...C.font},spacing:$m(c.spacing)};Object.keys(S.colorSchemes).forEach(P=>{const v=S.colorSchemes[P].palette,_=B=>{const G=B.split("-"),Z=G[1],Y=G[2];return f(B,v[Z][Y])};v.mode==="light"&&(j(v.common,"background","#fff"),j(v.common,"onBackground","#000")),v.mode==="dark"&&(j(v.common,"background","#000"),j(v.common,"onBackground","#fff"));function A(B,G,Z){if(w){let Y;return B===Jt&&(Y=`transparent ${((1-Z)*100).toFixed(0)}%`),B===oe&&(Y=`#000 ${(Z*100).toFixed(0)}%`),B===se&&(Y=`#fff ${(Z*100).toFixed(0)}%`),`color-mix(in ${w}, ${G}, ${Y})`}return B(G,Z)}if(Dm(v,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),v.mode==="light"){j(v.Alert,"errorColor",A(oe,v.error.light,.6)),j(v.Alert,"infoColor",A(oe,v.info.light,.6)),j(v.Alert,"successColor",A(oe,v.success.light,.6)),j(v.Alert,"warningColor",A(oe,v.warning.light,.6)),j(v.Alert,"errorFilledBg",_("palette-error-main")),j(v.Alert,"infoFilledBg",_("palette-info-main")),j(v.Alert,"successFilledBg",_("palette-success-main")),j(v.Alert,"warningFilledBg",_("palette-warning-main")),j(v.Alert,"errorFilledColor",at(()=>v.getContrastText(v.error.main))),j(v.Alert,"infoFilledColor",at(()=>v.getContrastText(v.info.main))),j(v.Alert,"successFilledColor",at(()=>v.getContrastText(v.success.main))),j(v.Alert,"warningFilledColor",at(()=>v.getContrastText(v.warning.main))),j(v.Alert,"errorStandardBg",A(se,v.error.light,.9)),j(v.Alert,"infoStandardBg",A(se,v.info.light,.9)),j(v.Alert,"successStandardBg",A(se,v.success.light,.9)),j(v.Alert,"warningStandardBg",A(se,v.warning.light,.9)),j(v.Alert,"errorIconColor",_("palette-error-main")),j(v.Alert,"infoIconColor",_("palette-info-main")),j(v.Alert,"successIconColor",_("palette-success-main")),j(v.Alert,"warningIconColor",_("palette-warning-main")),j(v.AppBar,"defaultBg",_("palette-grey-100")),j(v.Avatar,"defaultBg",_("palette-grey-400")),j(v.Button,"inheritContainedBg",_("palette-grey-300")),j(v.Button,"inheritContainedHoverBg",_("palette-grey-A100")),j(v.Chip,"defaultBorder",_("palette-grey-400")),j(v.Chip,"defaultAvatarColor",_("palette-grey-700")),j(v.Chip,"defaultIconColor",_("palette-grey-700")),j(v.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),j(v.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),j(v.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),j(v.LinearProgress,"primaryBg",A(se,v.primary.main,.62)),j(v.LinearProgress,"secondaryBg",A(se,v.secondary.main,.62)),j(v.LinearProgress,"errorBg",A(se,v.error.main,.62)),j(v.LinearProgress,"infoBg",A(se,v.info.main,.62)),j(v.LinearProgress,"successBg",A(se,v.success.main,.62)),j(v.LinearProgress,"warningBg",A(se,v.warning.main,.62)),j(v.Skeleton,"bg",w?A(Jt,v.text.primary,.11):`rgba(${_("palette-text-primaryChannel")} / 0.11)`),j(v.Slider,"primaryTrack",A(se,v.primary.main,.62)),j(v.Slider,"secondaryTrack",A(se,v.secondary.main,.62)),j(v.Slider,"errorTrack",A(se,v.error.main,.62)),j(v.Slider,"infoTrack",A(se,v.info.main,.62)),j(v.Slider,"successTrack",A(se,v.success.main,.62)),j(v.Slider,"warningTrack",A(se,v.warning.main,.62));const B=w?A(oe,v.background.default,.6825):zr(v.background.default,.8);j(v.SnackbarContent,"bg",B),j(v.SnackbarContent,"color",at(()=>w?ps.text.primary:v.getContrastText(B))),j(v.SpeedDialAction,"fabHoverBg",zr(v.background.paper,.15)),j(v.StepConnector,"border",_("palette-grey-400")),j(v.StepContent,"border",_("palette-grey-400")),j(v.Switch,"defaultColor",_("palette-common-white")),j(v.Switch,"defaultDisabledColor",_("palette-grey-100")),j(v.Switch,"primaryDisabledColor",A(se,v.primary.main,.62)),j(v.Switch,"secondaryDisabledColor",A(se,v.secondary.main,.62)),j(v.Switch,"errorDisabledColor",A(se,v.error.main,.62)),j(v.Switch,"infoDisabledColor",A(se,v.info.main,.62)),j(v.Switch,"successDisabledColor",A(se,v.success.main,.62)),j(v.Switch,"warningDisabledColor",A(se,v.warning.main,.62)),j(v.TableCell,"border",A(se,A(Jt,v.divider,1),.88)),j(v.Tooltip,"bg",A(Jt,v.grey[700],.92))}if(v.mode==="dark"){j(v.Alert,"errorColor",A(se,v.error.light,.6)),j(v.Alert,"infoColor",A(se,v.info.light,.6)),j(v.Alert,"successColor",A(se,v.success.light,.6)),j(v.Alert,"warningColor",A(se,v.warning.light,.6)),j(v.Alert,"errorFilledBg",_("palette-error-dark")),j(v.Alert,"infoFilledBg",_("palette-info-dark")),j(v.Alert,"successFilledBg",_("palette-success-dark")),j(v.Alert,"warningFilledBg",_("palette-warning-dark")),j(v.Alert,"errorFilledColor",at(()=>v.getContrastText(v.error.dark))),j(v.Alert,"infoFilledColor",at(()=>v.getContrastText(v.info.dark))),j(v.Alert,"successFilledColor",at(()=>v.getContrastText(v.success.dark))),j(v.Alert,"warningFilledColor",at(()=>v.getContrastText(v.warning.dark))),j(v.Alert,"errorStandardBg",A(oe,v.error.light,.9)),j(v.Alert,"infoStandardBg",A(oe,v.info.light,.9)),j(v.Alert,"successStandardBg",A(oe,v.success.light,.9)),j(v.Alert,"warningStandardBg",A(oe,v.warning.light,.9)),j(v.Alert,"errorIconColor",_("palette-error-main")),j(v.Alert,"infoIconColor",_("palette-info-main")),j(v.Alert,"successIconColor",_("palette-success-main")),j(v.Alert,"warningIconColor",_("palette-warning-main")),j(v.AppBar,"defaultBg",_("palette-grey-900")),j(v.AppBar,"darkBg",_("palette-background-paper")),j(v.AppBar,"darkColor",_("palette-text-primary")),j(v.Avatar,"defaultBg",_("palette-grey-600")),j(v.Button,"inheritContainedBg",_("palette-grey-800")),j(v.Button,"inheritContainedHoverBg",_("palette-grey-700")),j(v.Chip,"defaultBorder",_("palette-grey-700")),j(v.Chip,"defaultAvatarColor",_("palette-grey-300")),j(v.Chip,"defaultIconColor",_("palette-grey-300")),j(v.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),j(v.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),j(v.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),j(v.LinearProgress,"primaryBg",A(oe,v.primary.main,.5)),j(v.LinearProgress,"secondaryBg",A(oe,v.secondary.main,.5)),j(v.LinearProgress,"errorBg",A(oe,v.error.main,.5)),j(v.LinearProgress,"infoBg",A(oe,v.info.main,.5)),j(v.LinearProgress,"successBg",A(oe,v.success.main,.5)),j(v.LinearProgress,"warningBg",A(oe,v.warning.main,.5)),j(v.Skeleton,"bg",w?A(Jt,v.text.primary,.13):`rgba(${_("palette-text-primaryChannel")} / 0.13)`),j(v.Slider,"primaryTrack",A(oe,v.primary.main,.5)),j(v.Slider,"secondaryTrack",A(oe,v.secondary.main,.5)),j(v.Slider,"errorTrack",A(oe,v.error.main,.5)),j(v.Slider,"infoTrack",A(oe,v.info.main,.5)),j(v.Slider,"successTrack",A(oe,v.success.main,.5)),j(v.Slider,"warningTrack",A(oe,v.warning.main,.5));const B=w?A(se,v.background.default,.985):zr(v.background.default,.98);j(v.SnackbarContent,"bg",B),j(v.SnackbarContent,"color",at(()=>w?Oc.text.primary:v.getContrastText(B))),j(v.SpeedDialAction,"fabHoverBg",zr(v.background.paper,.15)),j(v.StepConnector,"border",_("palette-grey-600")),j(v.StepContent,"border",_("palette-grey-600")),j(v.Switch,"defaultColor",_("palette-grey-300")),j(v.Switch,"defaultDisabledColor",_("palette-grey-600")),j(v.Switch,"primaryDisabledColor",A(oe,v.primary.main,.55)),j(v.Switch,"secondaryDisabledColor",A(oe,v.secondary.main,.55)),j(v.Switch,"errorDisabledColor",A(oe,v.error.main,.55)),j(v.Switch,"infoDisabledColor",A(oe,v.info.main,.55)),j(v.Switch,"successDisabledColor",A(oe,v.success.main,.55)),j(v.Switch,"warningDisabledColor",A(oe,v.warning.main,.55)),j(v.TableCell,"border",A(oe,A(Jt,v.divider,1),.68)),j(v.Tooltip,"bg",A(Jt,v.grey[700],.92))}St(v.background,"default"),St(v.background,"paper"),St(v.common,"background"),St(v.common,"onBackground"),St(v,"divider"),Object.keys(v).forEach(B=>{const G=v[B];B!=="tonalOffset"&&G&&typeof G=="object"&&(G.main&&j(v[B],"mainChannel",tr(nr(G.main))),G.light&&j(v[B],"lightChannel",tr(nr(G.light))),G.dark&&j(v[B],"darkChannel",tr(nr(G.dark))),G.contrastText&&j(v[B],"contrastTextChannel",tr(nr(G.contrastText))),B==="text"&&(St(v[B],"primary"),St(v[B],"secondary")),B==="action"&&(G.active&&St(v[B],"active"),G.selected&&St(v[B],"selected")))})}),S=t.reduce((P,v)=>Le(P,v),S);const R={prefix:o,disableCssColorScheme:i,shouldSkipGeneratingVar:a,getSelector:Pm(S),enableContrastVars:s},{vars:I,generateThemeVars:k,generateStyleSheets:z}=Jp(S,R);return S.vars=I,Object.entries(S.colorSchemes[S.defaultColorScheme]).forEach(([P,v])=>{S[P]=v}),S.generateThemeVars=k,S.generateStyleSheets=z,S.generateSpacing=function(){return Ec(c.spacing,Gi(this))},S.getColorSchemeSelector=Xp(l),S.spacing=S.generateSpacing(),S.shouldSkipGeneratingVar=a,S.unstable_sxConfig={...Tr,...c==null?void 0:c.unstable_sxConfig},S.unstable_sx=function(v){return $n({sx:v,theme:this})},S.toRuntimeSource=Dc,S}function vl(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Bs({...n===!0?{}:n.palette,mode:t})})}function Lc(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode,...s}=e,a=o||"light",l=i==null?void 0:i[a],u={...i,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return ms(e,...t);let c=n;"palette"in e||u[a]&&(u[a]!==!0?c=u[a].palette:a==="dark"&&(c={mode:"dark"}));const d=ms({...e,palette:c},...t);return d.defaultColorScheme=a,d.colorSchemes=u,d.palette.mode==="light"&&(d.colorSchemes.light={...u.light!==!0&&u.light,palette:d.palette},vl(d,"dark",u.dark)),d.palette.mode==="dark"&&(d.colorSchemes.dark={...u.dark!==!0&&u.dark,palette:d.palette},vl(d,"light",u.light)),d}return!n&&!("light"in u)&&a==="light"&&(u.light=!0),Lm({...s,colorSchemes:u,defaultColorScheme:a,...typeof r!="boolean"&&r},...t)}const Gs=Lc();function zc(){const e=Tc(Gs);return process.env.NODE_ENV!=="production"&&O.useDebugValue(e),e[Ls]||e}function zm({props:e,name:t}){return _c({props:e,name:t,defaultTheme:Gs,themeId:Ls})}function Us(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Fm=e=>Us(e)&&e!=="classes",We=Rc({themeId:Ls,defaultTheme:Gs,rootShouldForwardProp:Fm});function Qi(...e){const t=O.useRef(void 0),n=O.useCallback(r=>{const i=e.map(o=>{if(o==null)return null;if(typeof o=="function"){const s=o,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return o.current=r,()=>{o.current=null}});return()=>{i.forEach(o=>o==null?void 0:o())}},e);return O.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}var Bm=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const i={};e(i)===i&&(r=!0)}catch{}if(r){let i;try{throw new Error}catch(o){({stack:i}=o)}console.warn(`The result function returned its own inputs without modification. e.g
|
|
53
|
+
export default theme;`}function bl(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const Rm=e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let r=0;r<t.length;r+=1)n+=+t[r];return n};function Am(e){Object.assign(e,{alpha(t,n){const r=this||e;return r.colorSpace?`oklch(from ${t} l c h / ${typeof n=="string"?`calc(${n})`:n})`:r.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof n=="string"?`calc(${n})`:n})`:ju(t,Rm(n))},lighten(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #fff ${bl(n)})`:Qi(t,n)},darken(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #000 ${bl(n)})`:Zi(t,n)}})}function gs(e={},...t){const{breakpoints:n,mixins:r={},spacing:i,palette:o={},transitions:s={},typography:a={},shape:l,colorSpace:c,...u}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.":Lt(20));const d=Bs({...o,colorSpace:c}),h=Ki(e);let f=Le(h,{mixins:pm(h.breakpoints,r),palette:d,shadows:vm.slice(),typography:gm(d,a),transitions:wm(s),zIndex:{...Cm}});if(f=Le(f,u),f=t.reduce((m,p)=>Le(m,p),f),process.env.NODE_ENV!=="production"){const m=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],p=(y,b)=>{let E;for(E in y){const T=y[E];if(m.includes(E)&&Object.keys(T).length>0){if(process.env.NODE_ENV!=="production"){const w=hn("",E);console.error([`MUI: The \`${b}\` component increases the CSS specificity of the \`${E}\` internal state.`,"You can not override it like this: ",JSON.stringify(y,null,2),"",`Instead, you need to use the '&.${w}' syntax:`,JSON.stringify({root:{[`&.${w}`]:T}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
|
|
54
|
+
`))}y[E]={}}}};Object.keys(f.components).forEach(y=>{const b=f.components[y].styleOverrides;b&&y.startsWith("Mui")&&p(b,y)})}return f.unstable_sxConfig={...wr,...u==null?void 0:u.unstable_sxConfig},f.unstable_sx=function(p){return $n({sx:p,theme:this})},f.toRuntimeSource=Du,Am(f),f}function _m(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const Im=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=_m(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function $u(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function Nu(e){return e==="dark"?Im:[]}function jm(e){const{palette:t={mode:"light"},opacity:n,overlays:r,colorSpace:i,...o}=e,s=Bs({...t,colorSpace:i});return{palette:s,opacity:{...$u(s.mode),...n},overlays:r||Nu(s.mode),...o}}function km(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const Om=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],Pm=e=>(t,n)=>{const r=e.rootSelector||":root",i=e.colorSchemeSelector;let o=i;if(i==="class"&&(o=".%s"),i==="data"&&(o="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(o=`[${i}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const s={};return Om(e.cssVarPrefix).forEach(a=>{s[a]=n[a],delete n[a]}),o==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:s}}:o?{[o.replace("%s",t)]:s,[`${r}, ${o.replace("%s",t)}`]:n}:{[r]:{...n,...s}}}if(o&&o!=="media")return`${r}, ${o.replace("%s",String(t))}`}else if(t){if(o==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(o)return o.replace("%s",String(t))}return r};function Dm(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function j(e,t,n){!e[t]&&n&&(e[t]=n)}function nr(e){return typeof e!="string"||!e.startsWith("hsl")?e:Iu(e)}function St(e,t){`${t}Channel`in e||(e[`${t}Channel`]=tr(nr(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
|
|
55
|
+
To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function $m(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const at=e=>{try{return e()}catch{}},Nm=(e="mui")=>Hp(e);function Go(e,t,n,r,i){if(!n)return;n=n===!0?{}:n;const o=i==="dark"?"dark":"light";if(!r){t[i]=jm({...n,palette:{mode:o,...n==null?void 0:n.palette},colorSpace:e});return}const{palette:s,...a}=gs({...r,palette:{mode:o,...n==null?void 0:n.palette},colorSpace:e});return t[i]={...n,palette:s,opacity:{...$u(o),...n==null?void 0:n.opacity},overlays:(n==null?void 0:n.overlays)||Nu(o)},a}function Lm(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:o="mui",nativeColor:s=!1,shouldSkipGeneratingVar:a=km,colorSchemeSelector:l=n.light&&n.dark?"media":void 0,rootSelector:c=":root",...u}=e,d=Object.keys(n)[0],h=r||(n.light&&d!=="light"?"light":d),f=Nm(o),{[h]:m,light:p,dark:y,...b}=n,E={...b};let T=m;if((h==="dark"&&!("dark"in n)||h==="light"&&!("light"in n))&&(T=!0),!T)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${h}\` option is either missing or invalid.`:Lt(21,h));let w;s&&(w="oklch");const C=Go(w,E,T,u,h);p&&!E.light&&Go(w,E,p,void 0,"light"),y&&!E.dark&&Go(w,E,y,void 0,"dark");let S={defaultColorScheme:h,...C,cssVarPrefix:o,colorSchemeSelector:l,rootSelector:c,getCssVar:f,colorSchemes:E,font:{...fm(C.typography),...C.font},spacing:$m(u.spacing)};Object.keys(S.colorSchemes).forEach(P=>{const v=S.colorSchemes[P].palette,_=B=>{const G=B.split("-"),Z=G[1],Y=G[2];return f(B,v[Z][Y])};v.mode==="light"&&(j(v.common,"background","#fff"),j(v.common,"onBackground","#000")),v.mode==="dark"&&(j(v.common,"background","#000"),j(v.common,"onBackground","#fff"));function A(B,G,Z){if(w){let Y;return B===Jt&&(Y=`transparent ${((1-Z)*100).toFixed(0)}%`),B===ie&&(Y=`#000 ${(Z*100).toFixed(0)}%`),B===oe&&(Y=`#fff ${(Z*100).toFixed(0)}%`),`color-mix(in ${w}, ${G}, ${Y})`}return B(G,Z)}if(Dm(v,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),v.mode==="light"){j(v.Alert,"errorColor",A(ie,v.error.light,.6)),j(v.Alert,"infoColor",A(ie,v.info.light,.6)),j(v.Alert,"successColor",A(ie,v.success.light,.6)),j(v.Alert,"warningColor",A(ie,v.warning.light,.6)),j(v.Alert,"errorFilledBg",_("palette-error-main")),j(v.Alert,"infoFilledBg",_("palette-info-main")),j(v.Alert,"successFilledBg",_("palette-success-main")),j(v.Alert,"warningFilledBg",_("palette-warning-main")),j(v.Alert,"errorFilledColor",at(()=>v.getContrastText(v.error.main))),j(v.Alert,"infoFilledColor",at(()=>v.getContrastText(v.info.main))),j(v.Alert,"successFilledColor",at(()=>v.getContrastText(v.success.main))),j(v.Alert,"warningFilledColor",at(()=>v.getContrastText(v.warning.main))),j(v.Alert,"errorStandardBg",A(oe,v.error.light,.9)),j(v.Alert,"infoStandardBg",A(oe,v.info.light,.9)),j(v.Alert,"successStandardBg",A(oe,v.success.light,.9)),j(v.Alert,"warningStandardBg",A(oe,v.warning.light,.9)),j(v.Alert,"errorIconColor",_("palette-error-main")),j(v.Alert,"infoIconColor",_("palette-info-main")),j(v.Alert,"successIconColor",_("palette-success-main")),j(v.Alert,"warningIconColor",_("palette-warning-main")),j(v.AppBar,"defaultBg",_("palette-grey-100")),j(v.Avatar,"defaultBg",_("palette-grey-400")),j(v.Button,"inheritContainedBg",_("palette-grey-300")),j(v.Button,"inheritContainedHoverBg",_("palette-grey-A100")),j(v.Chip,"defaultBorder",_("palette-grey-400")),j(v.Chip,"defaultAvatarColor",_("palette-grey-700")),j(v.Chip,"defaultIconColor",_("palette-grey-700")),j(v.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),j(v.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),j(v.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),j(v.LinearProgress,"primaryBg",A(oe,v.primary.main,.62)),j(v.LinearProgress,"secondaryBg",A(oe,v.secondary.main,.62)),j(v.LinearProgress,"errorBg",A(oe,v.error.main,.62)),j(v.LinearProgress,"infoBg",A(oe,v.info.main,.62)),j(v.LinearProgress,"successBg",A(oe,v.success.main,.62)),j(v.LinearProgress,"warningBg",A(oe,v.warning.main,.62)),j(v.Skeleton,"bg",w?A(Jt,v.text.primary,.11):`rgba(${_("palette-text-primaryChannel")} / 0.11)`),j(v.Slider,"primaryTrack",A(oe,v.primary.main,.62)),j(v.Slider,"secondaryTrack",A(oe,v.secondary.main,.62)),j(v.Slider,"errorTrack",A(oe,v.error.main,.62)),j(v.Slider,"infoTrack",A(oe,v.info.main,.62)),j(v.Slider,"successTrack",A(oe,v.success.main,.62)),j(v.Slider,"warningTrack",A(oe,v.warning.main,.62));const B=w?A(ie,v.background.default,.6825):Fr(v.background.default,.8);j(v.SnackbarContent,"bg",B),j(v.SnackbarContent,"color",at(()=>w?ms.text.primary:v.getContrastText(B))),j(v.SpeedDialAction,"fabHoverBg",Fr(v.background.paper,.15)),j(v.StepConnector,"border",_("palette-grey-400")),j(v.StepContent,"border",_("palette-grey-400")),j(v.Switch,"defaultColor",_("palette-common-white")),j(v.Switch,"defaultDisabledColor",_("palette-grey-100")),j(v.Switch,"primaryDisabledColor",A(oe,v.primary.main,.62)),j(v.Switch,"secondaryDisabledColor",A(oe,v.secondary.main,.62)),j(v.Switch,"errorDisabledColor",A(oe,v.error.main,.62)),j(v.Switch,"infoDisabledColor",A(oe,v.info.main,.62)),j(v.Switch,"successDisabledColor",A(oe,v.success.main,.62)),j(v.Switch,"warningDisabledColor",A(oe,v.warning.main,.62)),j(v.TableCell,"border",A(oe,A(Jt,v.divider,1),.88)),j(v.Tooltip,"bg",A(Jt,v.grey[700],.92))}if(v.mode==="dark"){j(v.Alert,"errorColor",A(oe,v.error.light,.6)),j(v.Alert,"infoColor",A(oe,v.info.light,.6)),j(v.Alert,"successColor",A(oe,v.success.light,.6)),j(v.Alert,"warningColor",A(oe,v.warning.light,.6)),j(v.Alert,"errorFilledBg",_("palette-error-dark")),j(v.Alert,"infoFilledBg",_("palette-info-dark")),j(v.Alert,"successFilledBg",_("palette-success-dark")),j(v.Alert,"warningFilledBg",_("palette-warning-dark")),j(v.Alert,"errorFilledColor",at(()=>v.getContrastText(v.error.dark))),j(v.Alert,"infoFilledColor",at(()=>v.getContrastText(v.info.dark))),j(v.Alert,"successFilledColor",at(()=>v.getContrastText(v.success.dark))),j(v.Alert,"warningFilledColor",at(()=>v.getContrastText(v.warning.dark))),j(v.Alert,"errorStandardBg",A(ie,v.error.light,.9)),j(v.Alert,"infoStandardBg",A(ie,v.info.light,.9)),j(v.Alert,"successStandardBg",A(ie,v.success.light,.9)),j(v.Alert,"warningStandardBg",A(ie,v.warning.light,.9)),j(v.Alert,"errorIconColor",_("palette-error-main")),j(v.Alert,"infoIconColor",_("palette-info-main")),j(v.Alert,"successIconColor",_("palette-success-main")),j(v.Alert,"warningIconColor",_("palette-warning-main")),j(v.AppBar,"defaultBg",_("palette-grey-900")),j(v.AppBar,"darkBg",_("palette-background-paper")),j(v.AppBar,"darkColor",_("palette-text-primary")),j(v.Avatar,"defaultBg",_("palette-grey-600")),j(v.Button,"inheritContainedBg",_("palette-grey-800")),j(v.Button,"inheritContainedHoverBg",_("palette-grey-700")),j(v.Chip,"defaultBorder",_("palette-grey-700")),j(v.Chip,"defaultAvatarColor",_("palette-grey-300")),j(v.Chip,"defaultIconColor",_("palette-grey-300")),j(v.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),j(v.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),j(v.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),j(v.LinearProgress,"primaryBg",A(ie,v.primary.main,.5)),j(v.LinearProgress,"secondaryBg",A(ie,v.secondary.main,.5)),j(v.LinearProgress,"errorBg",A(ie,v.error.main,.5)),j(v.LinearProgress,"infoBg",A(ie,v.info.main,.5)),j(v.LinearProgress,"successBg",A(ie,v.success.main,.5)),j(v.LinearProgress,"warningBg",A(ie,v.warning.main,.5)),j(v.Skeleton,"bg",w?A(Jt,v.text.primary,.13):`rgba(${_("palette-text-primaryChannel")} / 0.13)`),j(v.Slider,"primaryTrack",A(ie,v.primary.main,.5)),j(v.Slider,"secondaryTrack",A(ie,v.secondary.main,.5)),j(v.Slider,"errorTrack",A(ie,v.error.main,.5)),j(v.Slider,"infoTrack",A(ie,v.info.main,.5)),j(v.Slider,"successTrack",A(ie,v.success.main,.5)),j(v.Slider,"warningTrack",A(ie,v.warning.main,.5));const B=w?A(oe,v.background.default,.985):Fr(v.background.default,.98);j(v.SnackbarContent,"bg",B),j(v.SnackbarContent,"color",at(()=>w?Ou.text.primary:v.getContrastText(B))),j(v.SpeedDialAction,"fabHoverBg",Fr(v.background.paper,.15)),j(v.StepConnector,"border",_("palette-grey-600")),j(v.StepContent,"border",_("palette-grey-600")),j(v.Switch,"defaultColor",_("palette-grey-300")),j(v.Switch,"defaultDisabledColor",_("palette-grey-600")),j(v.Switch,"primaryDisabledColor",A(ie,v.primary.main,.55)),j(v.Switch,"secondaryDisabledColor",A(ie,v.secondary.main,.55)),j(v.Switch,"errorDisabledColor",A(ie,v.error.main,.55)),j(v.Switch,"infoDisabledColor",A(ie,v.info.main,.55)),j(v.Switch,"successDisabledColor",A(ie,v.success.main,.55)),j(v.Switch,"warningDisabledColor",A(ie,v.warning.main,.55)),j(v.TableCell,"border",A(ie,A(Jt,v.divider,1),.68)),j(v.Tooltip,"bg",A(Jt,v.grey[700],.92))}St(v.background,"default"),St(v.background,"paper"),St(v.common,"background"),St(v.common,"onBackground"),St(v,"divider"),Object.keys(v).forEach(B=>{const G=v[B];B!=="tonalOffset"&&G&&typeof G=="object"&&(G.main&&j(v[B],"mainChannel",tr(nr(G.main))),G.light&&j(v[B],"lightChannel",tr(nr(G.light))),G.dark&&j(v[B],"darkChannel",tr(nr(G.dark))),G.contrastText&&j(v[B],"contrastTextChannel",tr(nr(G.contrastText))),B==="text"&&(St(v[B],"primary"),St(v[B],"secondary")),B==="action"&&(G.active&&St(v[B],"active"),G.selected&&St(v[B],"selected")))})}),S=t.reduce((P,v)=>Le(P,v),S);const R={prefix:o,disableCssColorScheme:i,shouldSkipGeneratingVar:a,getSelector:Pm(S),enableContrastVars:s},{vars:I,generateThemeVars:k,generateStyleSheets:z}=Jp(S,R);return S.vars=I,Object.entries(S.colorSchemes[S.defaultColorScheme]).forEach(([P,v])=>{S[P]=v}),S.generateThemeVars=k,S.generateStyleSheets=z,S.generateSpacing=function(){return Eu(u.spacing,Ui(this))},S.getColorSchemeSelector=Xp(l),S.spacing=S.generateSpacing(),S.shouldSkipGeneratingVar=a,S.unstable_sxConfig={...wr,...u==null?void 0:u.unstable_sxConfig},S.unstable_sx=function(v){return $n({sx:v,theme:this})},S.toRuntimeSource=Du,S}function vl(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Bs({...n===!0?{}:n.palette,mode:t})})}function Lu(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode,...s}=e,a=o||"light",l=i==null?void 0:i[a],c={...i,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return gs(e,...t);let u=n;"palette"in e||c[a]&&(c[a]!==!0?u=c[a].palette:a==="dark"&&(u={mode:"dark"}));const d=gs({...e,palette:u},...t);return d.defaultColorScheme=a,d.colorSchemes=c,d.palette.mode==="light"&&(d.colorSchemes.light={...c.light!==!0&&c.light,palette:d.palette},vl(d,"dark",c.dark)),d.palette.mode==="dark"&&(d.colorSchemes.dark={...c.dark!==!0&&c.dark,palette:d.palette},vl(d,"light",c.light)),d}return!n&&!("light"in c)&&a==="light"&&(c.light=!0),Lm({...s,colorSchemes:c,defaultColorScheme:a,...typeof r!="boolean"&&r},...t)}const Gs=Lu();function zu(){const e=Tu(Gs);return process.env.NODE_ENV!=="production"&&O.useDebugValue(e),e[Ls]||e}function zm({props:e,name:t}){return _u({props:e,name:t,defaultTheme:Gs,themeId:Ls})}function Us(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Fm=e=>Us(e)&&e!=="classes",We=Ru({themeId:Ls,defaultTheme:Gs,rootShouldForwardProp:Fm});function eo(...e){const t=O.useRef(void 0),n=O.useCallback(r=>{const i=e.map(o=>{if(o==null)return null;if(typeof o=="function"){const s=o,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return o.current=r,()=>{o.current=null}});return()=>{i.forEach(o=>o==null?void 0:o())}},e);return O.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}var Bm=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const i={};e(i)===i&&(r=!0)}catch{}if(r){let i;try{throw new Error}catch(o){({stack:i}=o)}console.warn(`The result function returned its own inputs without modification. e.g
|
|
56
56
|
\`createSelector([state => state.todos], todos => todos)\`
|
|
57
57
|
This could lead to inefficient memoization and unnecessary re-renders.
|
|
58
|
-
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:i})}}},Gm=(e,t,n)=>{const{memoize:r,memoizeOptions:i}=t,{inputSelectorResults:o,inputSelectorResultsCopy:s}=e,a=r(()=>({}),...i);if(!(a.apply(null,o)===a.apply(null,s))){let
|
|
58
|
+
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:i})}}},Gm=(e,t,n)=>{const{memoize:r,memoizeOptions:i}=t,{inputSelectorResults:o,inputSelectorResultsCopy:s}=e,a=r(()=>({}),...i);if(!(a.apply(null,o)===a.apply(null,s))){let c;try{throw new Error}catch(u){({stack:c}=u)}console.warn(`An input selector returned a different result when passed same arguments.
|
|
59
59
|
This means your output selector will likely run more frequently than intended.
|
|
60
60
|
Avoid returning a new reference inside your input selector, e.g.
|
|
61
|
-
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:o,secondInputs:s,stack:
|
|
61
|
+
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:o,secondInputs:s,stack:c})}},Um={inputStabilityCheck:"once",identityFunctionCheck:"once"},yi=Symbol("NOT_FOUND");function Vm(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Ym(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Wm(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var Sl=e=>Array.isArray(e)?e:[e];function Hm(e){const t=Array.isArray(e[0])?e[0]:e;return Wm(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function El(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var qm=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...Um,...t};return{identityFunctionCheck:{shouldRun:n==="always"||n==="once"&&e,run:Bm},inputStabilityCheck:{shouldRun:r==="always"||r==="once"&&e,run:Gm}}};function Km(e){let t;return{get(n){return t&&e(t.key,n)?t.value:yi},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function Jm(e,t){let n=[];function r(a){const l=n.findIndex(c=>t(a,c.key));if(l>-1){const c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return yi}function i(a,l){r(a)===yi&&(n.unshift({key:a,value:l}),n.length>e&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var Xm=(e,t)=>e===t;function Zm(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:i}=n;for(let o=0;o<i;o++)if(!e(n[o],r[o]))return!1;return!0}}function Qm(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=Xm,maxSize:i=1,resultEqualityCheck:o}=n,s=Zm(r);let a=0;const l=i<=1?Km(s):Jm(i,s);function c(){let u=l.get(arguments);if(u===yi){if(u=e.apply(null,arguments),a++,o){const h=l.getEntries().find(f=>o(f.value,u));h&&(u=h.value,a!==0&&a--)}l.put(arguments,u)}return u}return c.clearCache=()=>{l.clear(),c.resetResultsCount()},c.resultsCount=()=>a,c.resetResultsCount=()=>{a=0},c}var eg=class{constructor(e){this.value=e}deref(){return this.value}},tg=typeof WeakRef<"u"?WeakRef:eg,ng=0,Tl=1;function Br(){return{s:ng,v:void 0,o:null,p:null}}function Fu(e,t={}){let n=Br();const{resultEqualityCheck:r}=t;let i,o=0;function s(){var d;let a=n;const{length:l}=arguments;for(let h=0,f=l;h<f;h++){const m=arguments[h];if(typeof m=="function"||typeof m=="object"&&m!==null){let p=a.o;p===null&&(a.o=p=new WeakMap);const y=p.get(m);y===void 0?(a=Br(),p.set(m,a)):a=y}else{let p=a.p;p===null&&(a.p=p=new Map);const y=p.get(m);y===void 0?(a=Br(),p.set(m,a)):a=y}}const c=a;let u;if(a.s===Tl)u=a.v;else if(u=e.apply(null,arguments),o++,r){const h=((d=i==null?void 0:i.deref)==null?void 0:d.call(i))??i;h!=null&&r(h,u)&&(u=h,o!==0&&o--),i=typeof u=="object"&&u!==null||typeof u=="function"?new tg(u):u}return c.s=Tl,c.v=u,u}return s.clearCache=()=>{n=Br(),s.resetResultsCount()},s.resultsCount=()=>o,s.resetResultsCount=()=>{o=0},s}function Bu(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let o=0,s=0,a,l={},c=i.pop();typeof c=="object"&&(l=c,c=i.pop()),Vm(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...n,...l},{memoize:d,memoizeOptions:h=[],argsMemoize:f=Fu,argsMemoizeOptions:m=[],devModeChecks:p={}}=u,y=Sl(h),b=Sl(m),E=Hm(i),T=d(function(){return o++,c.apply(null,arguments)},...y);let w=!0;const C=f(function(){s++;const R=El(E,arguments);if(a=T.apply(null,R),process.env.NODE_ENV!=="production"){const{identityFunctionCheck:I,inputStabilityCheck:k}=qm(w,p);if(I.shouldRun&&I.run(c,R,a),k.shouldRun){const z=El(E,arguments);k.run({inputSelectorResults:R,inputSelectorResultsCopy:z},{memoize:d,memoizeOptions:y},arguments)}w&&(w=!1)}return a},...b);return Object.assign(C,{resultFunc:c,memoizedResultFunc:T,dependencies:E,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>a,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:d,argsMemoize:f})};return Object.assign(r,{withTypes:()=>r}),r}var rg=Bu(Fu),ig=Object.assign((e,t=rg)=>{Ym(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((s,a,l)=>(s[n[l]]=a,s),{}))},{withTypes:()=>ig});const og=Bu({memoize:Qm,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),J=(e,t,n,r,i,o,s,a,...l)=>{if(l.length>0)throw new Error("Unsupported number of selectors");let c;if(e&&t&&n&&r&&i&&o&&s&&a)c=(u,d,h,f)=>{const m=e(u,d,h,f),p=t(u,d,h,f),y=n(u,d,h,f),b=r(u,d,h,f),E=i(u,d,h,f),T=o(u,d,h,f),w=s(u,d,h,f);return a(m,p,y,b,E,T,w,d,h,f)};else if(e&&t&&n&&r&&i&&o&&s)c=(u,d,h,f)=>{const m=e(u,d,h,f),p=t(u,d,h,f),y=n(u,d,h,f),b=r(u,d,h,f),E=i(u,d,h,f),T=o(u,d,h,f);return s(m,p,y,b,E,T,d,h,f)};else if(e&&t&&n&&r&&i&&o)c=(u,d,h,f)=>{const m=e(u,d,h,f),p=t(u,d,h,f),y=n(u,d,h,f),b=r(u,d,h,f),E=i(u,d,h,f);return o(m,p,y,b,E,d,h,f)};else if(e&&t&&n&&r&&i)c=(u,d,h,f)=>{const m=e(u,d,h,f),p=t(u,d,h,f),y=n(u,d,h,f),b=r(u,d,h,f);return i(m,p,y,b,d,h,f)};else if(e&&t&&n&&r)c=(u,d,h,f)=>{const m=e(u,d,h,f),p=t(u,d,h,f),y=n(u,d,h,f);return r(m,p,y,d,h,f)};else if(e&&t&&n)c=(u,d,h,f)=>{const m=e(u,d,h,f),p=t(u,d,h,f);return n(m,p,d,h,f)};else if(e&&t)c=(u,d,h,f)=>{const m=e(u,d,h,f);return t(m,d,h,f)};else if(e)c=e;else throw new Error("Missing arguments");return c},Vs=e=>(...t)=>{const n=new WeakMap;let r=1;const i=t[t.length-1],o=t.length-1||1,s=Math.max(i.length-o,0);if(s>3)throw new Error("Unsupported number of arguments");return(l,c,u,d)=>{let h=l.__cacheKey__;h||(h={id:r},l.__cacheKey__=h,r+=1);let f=n.get(h);if(!f){const m=t.length===1?[b=>b,i]:t;let p=t;const y=[void 0,void 0,void 0];switch(s){case 0:break;case 1:{p=[...m.slice(0,-1),()=>y[0],i];break}case 2:{p=[...m.slice(0,-1),()=>y[0],()=>y[1],i];break}case 3:{p=[...m.slice(0,-1),()=>y[0],()=>y[1],()=>y[2],i];break}default:throw new Error("Unsupported number of arguments")}e&&(p=[...p,e]),f=og(...p),f.selectorArgs=y,n.set(h,f)}switch(s){case 3:f.selectorArgs[2]=d;case 2:f.selectorArgs[1]=u;case 1:f.selectorArgs[0]=c}switch(s){case 0:return f(l);case 1:return f(l,c);case 2:return f(l,c,u);case 3:return f(l,c,u,d);default:throw new Error("unreachable")}}},Ee=Vs();var Gr={exports:{}},Uo={};/**
|
|
62
62
|
* @license React
|
|
63
63
|
* use-sync-external-store-shim.production.js
|
|
64
64
|
*
|
|
@@ -66,7 +66,7 @@ Avoid returning a new reference inside your input selector, e.g.
|
|
|
66
66
|
*
|
|
67
67
|
* This source code is licensed under the MIT license found in the
|
|
68
68
|
* LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/var wl;function sg(){if(wl)return
|
|
69
|
+
*/var wl;function sg(){if(wl)return Uo;wl=1;var e=D;function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(d,h){var f=h(),m=r({inst:{value:f,getSnapshot:h}}),p=m[0].inst,y=m[1];return o(function(){p.value=f,p.getSnapshot=h,l(p)&&y({inst:p})},[d,f,h]),i(function(){return l(p)&&y({inst:p}),d(function(){l(p)&&y({inst:p})})},[d]),s(f),f}function l(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!n(d,f)}catch{return!0}}function c(d,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Uo.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Uo}var Vo={};/**
|
|
70
70
|
* @license React
|
|
71
71
|
* use-sync-external-store-shim.development.js
|
|
72
72
|
*
|
|
@@ -74,7 +74,7 @@ Avoid returning a new reference inside your input selector, e.g.
|
|
|
74
74
|
*
|
|
75
75
|
* This source code is licensed under the MIT license found in the
|
|
76
76
|
* LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/var Cl;function ag(){return Cl||(Cl=1,process.env.NODE_ENV!=="production"&&(function(){function e(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}function t(f,m){
|
|
77
|
+
*/var Cl;function ag(){return Cl||(Cl=1,process.env.NODE_ENV!=="production"&&(function(){function e(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}function t(f,m){u||i.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var p=m();if(!d){var y=m();o(p,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}y=s({inst:{value:p,getSnapshot:m}});var b=y[0].inst,E=y[1];return l(function(){b.value=p,b.getSnapshot=m,n(b)&&E({inst:b})},[f,p,m]),a(function(){return n(b)&&E({inst:b}),f(function(){n(b)&&E({inst:b})})},[f]),c(p),p}function n(f){var m=f.getSnapshot;f=f.value;try{var p=m();return!o(f,p)}catch{return!0}}function r(f,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=D,o=typeof Object.is=="function"?Object.is:e,s=i.useState,a=i.useEffect,l=i.useLayoutEffect,c=i.useDebugValue,u=!1,d=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Vo.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Vo}var Ml;function Ys(){return Ml||(Ml=1,process.env.NODE_ENV==="production"?Gr.exports=sg():Gr.exports=ag()),Gr.exports}var lg=Ys(),Ur={exports:{}},Yo={};/**
|
|
78
78
|
* @license React
|
|
79
79
|
* use-sync-external-store-shim/with-selector.production.js
|
|
80
80
|
*
|
|
@@ -82,7 +82,7 @@ Avoid returning a new reference inside your input selector, e.g.
|
|
|
82
82
|
*
|
|
83
83
|
* This source code is licensed under the MIT license found in the
|
|
84
84
|
* LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/var Rl;function
|
|
85
|
+
*/var Rl;function cg(){if(Rl)return Yo;Rl=1;var e=D,t=Ys();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Yo.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var m=o(null);if(m.current===null){var p={hasValue:!1,value:null};m.current=p}else p=m.current;m=a(function(){function b(S){if(!E){if(E=!0,T=S,S=h(S),f!==void 0&&p.hasValue){var R=p.value;if(f(R,S))return w=R}return w=S}if(R=w,r(T,S))return R;var I=h(S);return f!==void 0&&f(R,I)?(T=S,R):(T=S,w=I)}var E=!1,T,w,C=d===void 0?null:d;return[function(){return b(u())},C===null?void 0:function(){return b(C())}]},[u,d,h,f]);var y=i(c,m[0],m[1]);return s(function(){p.hasValue=!0,p.value=y},[y]),l(y),y},Yo}var Wo={};/**
|
|
86
86
|
* @license React
|
|
87
87
|
* use-sync-external-store-shim/with-selector.development.js
|
|
88
88
|
*
|
|
@@ -90,26 +90,26 @@ Avoid returning a new reference inside your input selector, e.g.
|
|
|
90
90
|
*
|
|
91
91
|
* This source code is licensed under the MIT license found in the
|
|
92
92
|
* LICENSE file in the root directory of this source tree.
|
|
93
|
-
*/var Al;function cg(){return Al||(Al=1,process.env.NODE_ENV!=="production"&&(function(){function e(u,c){return u===c&&(u!==0||1/u===1/c)||u!==u&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=D,n=Ys(),r=typeof Object.is=="function"?Object.is:e,i=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;Yo.useSyncExternalStoreWithSelector=function(u,c,d,h,f){var m=o(null);if(m.current===null){var p={hasValue:!1,value:null};m.current=p}else p=m.current;m=a(function(){function b(S){if(!E){if(E=!0,T=S,S=h(S),f!==void 0&&p.hasValue){var R=p.value;if(f(R,S))return w=R}return w=S}if(R=w,r(T,S))return R;var I=h(S);return f!==void 0&&f(R,I)?(T=S,R):(T=S,w=I)}var E=!1,T,w,C=d===void 0?null:d;return[function(){return b(c())},C===null?void 0:function(){return b(C())}]},[c,d,h,f]);var y=i(u,m[0],m[1]);return s(function(){p.hasValue=!0,p.value=y},[y]),l(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Yo}var _l;function dg(){return _l||(_l=1,process.env.NODE_ENV==="production"?Gr.exports=ug():Gr.exports=cg()),Gr.exports}var hg=dg();const fg=parseInt(O.version,10),pg=fg>=19,mg=pg?yg:xg;function gg(e,t,n,r,i){return mg(e,t,n,r,i)}function yg(e,t,n,r,i){const o=O.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return lg.useSyncExternalStore(e.subscribe,o,o)}function xg(e,t,n,r,i){return hg.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,i))}const Il={};function bg(e,t){const n=O.useRef(Il);return n.current===Il&&(n.current=e(t)),n}const vg=[];function Sg(e){O.useEffect(e,vg)}const Eg=()=>{};function Tg(e,t,n){const r=bg(wg,{store:e,selector:t}).current;r.effect=n,Sg(r.onMount)}function wg(e){const{store:t,selector:n}=e;let r=n(t.state);const i={effect:Eg,dispose:null,subscribe:()=>{i.dispose??(i.dispose=t.subscribe(o=>{const s=n(o);if(!Object.is(r,s)){const a=r;r=s,i.effect(a,s)}}))},onMount:()=>(i.subscribe(),()=>{var o;(o=i.dispose)==null||o.call(i),i.dispose=null})};return i.subscribe(),i}class Ws{constructor(t){W(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));W(this,"getSnapshot",()=>this.state);W(this,"use",(t,n,r,i)=>gg(this,t,n,r,i));this.state=t,this.listeners=new Set,this.updateTick=0}static create(t){return new Ws(t)}setState(t){this.state=t,this.updateTick+=1;const n=this.updateTick,r=this.listeners.values();let i;for(;i=r.next(),!i.done;){if(n!==this.updateTick)return;const o=i.value;o(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState(L({},this.state,t));return}}set(t,n){Object.is(this.state[t],n)||this.setState(L({},this.state,{[t]:n}))}}const eo=({params:e,store:t})=>{O.useEffect(()=>{t.set("animation",L({},t.state.animation,{skip:e.skipAnimation}))},[t,e.skipAnimation]);const n=O.useCallback(()=>{let r=!1;return t.set("animation",L({},t.state.animation,{skipAnimationRequests:t.state.animation.skipAnimationRequests+1})),()=>{r||(r=!0,t.set("animation",L({},t.state.animation,{skipAnimationRequests:t.state.animation.skipAnimationRequests-1})))}},[t]);return ot(()=>{if(typeof window>"u"||!(window!=null&&window.matchMedia))return;let i;const o=a=>{a.matches?i=n():i==null||i()},s=window.matchMedia("(prefers-reduced-motion)");return o(s),s.addEventListener("change",o),()=>{s.removeEventListener("change",o)}},[n,t]),{instance:{disableAnimation:n}}};eo.params={skipAnimation:!0};eo.getDefaultizedParams=({params:e})=>L({},e,{skipAnimation:e.skipAnimation??!1});eo.getInitialState=({skipAnimation:e})=>{const t=typeof window>"u"||!(window!=null&&window.matchMedia),n=process.env.NODE_ENV==="test"?t:!1;return{animation:{skip:e,skipAnimationRequests:n?1:0}}};const Cg=e=>e.animation,Mg=J(Cg,e=>e.skip||e.skipAnimationRequests>0);function Gc(e,t){const n=O.useRef(!0);O.useEffect(()=>{if(n.current){n.current=!1;return}return e()},t)}function sr(e){return e&&e.ownerDocument||document}function Rg(e){return sr(e).defaultView||window}const Ag="DEFAULT_X_AXIS_KEY",_g="DEFAULT_Y_AXIS_KEY",Ig={top:20,bottom:20,left:20,right:20},jg=45,kg=25,Uc=20,Gt=e=>{var t;return(t=e.cartesianAxis)==null?void 0:t.x},Ut=e=>{var t;return(t=e.cartesianAxis)==null?void 0:t.y},Og=J(Ut,function(t){return(t??[]).reduce((n,r)=>{var i;return r.position==="left"?n+(r.width||0)+((i=r.zoom)!=null&&i.slider.enabled?r.zoom.slider.size:0):n},0)}),Pg=J(Ut,function(t){return(t??[]).reduce((n,r)=>{var i;return r.position==="right"?n+(r.width||0)+((i=r.zoom)!=null&&i.slider.enabled?r.zoom.slider.size:0):n},0)}),Dg=J(Gt,function(t){return(t??[]).reduce((n,r)=>{var i;return r.position==="top"?n+(r.height||0)+((i=r.zoom)!=null&&i.slider.enabled?r.zoom.slider.size:0):n},0)}),$g=J(Gt,function(t){return(t??[]).reduce((n,r)=>{var i;return r.position==="bottom"?n+(r.height||0)+((i=r.zoom)!=null&&i.slider.enabled?r.zoom.slider.size:0):n},0)}),Ng=Ee(Og,Pg,Dg,$g,function(t,n,r,i){return{left:t,right:n,top:r,bottom:i}}),wr=e=>e.dimensions,Lg=e=>e.dimensions.margin,gt=Ee(wr,Lg,Ng,function({width:t,height:n},{top:r,right:i,bottom:o,left:s},{left:a,right:l,top:u,bottom:c}){return{width:t-s-i-a-l,left:s+a,right:i+l,height:n-r-o-u-c,top:r+u,bottom:o+c}}),zg=J(wr,e=>e.width),Fg=J(wr,e=>e.height),Bg=J(wr,e=>e.propsWidth),Gg=J(wr,e=>e.propsHeight);function Vc(e,t){return typeof e=="number"?{top:e,bottom:e,left:e,right:e}:t?L({},t,e):e}const Ug=10,to=({params:e,store:t,svgRef:n})=>{const r=e.width!==void 0&&e.height!==void 0,i=O.useRef({displayError:!1,initialCompute:!0,computeRun:0}),[o,s]=O.useState(0),[a,l]=O.useState(0),u=O.useCallback(()=>{const m=n==null?void 0:n.current;if(!m)return{};const y=Rg(m).getComputedStyle(m),b=Math.floor(parseFloat(y.height))||0,E=Math.floor(parseFloat(y.width))||0;return(t.state.dimensions.width!==E||t.state.dimensions.height!==b)&&t.set("dimensions",{margin:{top:e.margin.top,right:e.margin.right,bottom:e.margin.bottom,left:e.margin.left},width:e.width??E,height:e.height??b,propsWidth:e.width,propsHeight:e.height}),{height:b,width:E}},[t,n,e.height,e.width,e.margin.left,e.margin.right,e.margin.top,e.margin.bottom]);Gc(()=>{const m=e.width??t.state.dimensions.width,p=e.height??t.state.dimensions.height;t.set("dimensions",{margin:{top:e.margin.top,right:e.margin.right,bottom:e.margin.bottom,left:e.margin.left},width:m,height:p,propsHeight:e.height,propsWidth:e.width})},[t,e.height,e.width,e.margin.left,e.margin.right,e.margin.top,e.margin.bottom]),O.useEffect(()=>{i.current.displayError=!0},[]),ot(()=>{if(r||!i.current.initialCompute||i.current.computeRun>Ug)return;const m=u();m.width!==o||m.height!==a?(i.current.computeRun+=1,m.width!==void 0&&s(m.width),m.height!==void 0&&l(m.height)):i.current.initialCompute&&(i.current.initialCompute=!1)},[a,o,u,r]),ot(()=>{if(r)return()=>{};u();const m=n.current;if(typeof ResizeObserver>"u")return()=>{};let p;const y=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{u()})});return m&&y.observe(m),()=>{p&&cancelAnimationFrame(p),m&&y.unobserve(m)}},[u,r,n]),process.env.NODE_ENV!=="production"&&(i.current.displayError&&e.width===void 0&&o===0&&(console.error("MUI X Charts: ChartContainer does not have `width` prop, and its container has no `width` defined."),i.current.displayError=!1),i.current.displayError&&e.height===void 0&&a===0&&(console.error("MUI X Charts: ChartContainer does not have `height` prop, and its container has no `height` defined."),i.current.displayError=!1));const c=t.use(gt),d=O.useCallback(m=>m>=c.left-1&&m<=c.left+c.width,[c.left,c.width]),h=O.useCallback(m=>m>=c.top-1&&m<=c.top+c.height,[c.height,c.top]);return{instance:{isPointInside:O.useCallback((m,p,y)=>y&&"closest"in y&&y.closest("[data-drawing-container]")?!0:d(m)&&h(p),[d,h]),isXInside:d,isYInside:h}}};to.params={width:!0,height:!0,margin:!0};to.getDefaultizedParams=({params:e})=>L({},e,{margin:Vc(e.margin,Ig)});to.getInitialState=({width:e,height:t,margin:n})=>({dimensions:{margin:n,width:e??0,height:t??0,propsWidth:e,propsHeight:t}});const Hs=({params:e,store:t})=>(ot(()=>{t.set("experimentalFeatures",e.experimentalFeatures)},[t,e.experimentalFeatures]),{});Hs.params={experimentalFeatures:!0};Hs.getInitialState=({experimentalFeatures:e})=>({experimentalFeatures:e});const Vg=e=>e.experimentalFeatures,no=J(Vg,e=>!!(e!=null&&e.preferStrictDomainInLineCharts));let jl=0;const Yg=()=>(jl+=1,`mui-chart-${jl}`),qs=({params:e,store:t})=>(O.useEffect(()=>{e.id===void 0||e.id===t.state.id.providedChartId&&t.state.id.chartId!==void 0||t.set("id",L({},t.state.id,{chartId:e.id??Yg()}))},[t,e.id]),{});qs.params={id:!0};qs.getInitialState=({id:e})=>({id:{chartId:e,providedChartId:e}});const Wg=e=>e.id,Hg=J(Wg,e=>e.chartId);function Ye(e){const t=O.useRef(e);return ot(()=>{t.current=e}),O.useRef((...n)=>(0,t.current)(...n)).current}const qg=["#4254FB","#FFB422","#FA4F58","#0DBEFF","#22BF75","#FA83B4","#FF7511"],Kg=["#495AFB","#FFC758","#F35865","#30C8FF","#44CE8D","#F286B3","#FF8C39"],Yc=e=>e==="dark"?Kg:qg,Wc=({series:e,colors:t,seriesConfig:n})=>{const r={};return e.forEach((i,o)=>{var l;const s=n[i.type].getSeriesWithDefaultValues(i,o,t),a=s.id;if(r[i.type]===void 0&&(r[i.type]={series:{},seriesOrder:[]}),((l=r[i.type])==null?void 0:l.series[a])!==void 0)throw new Error(`MUI X Charts: series' id "${a}" is not unique.`);r[i.type].series[a]=s,r[i.type].seriesOrder.push(a)}),r},Jg=(e,t,n,r)=>{const i={};return Object.keys(t).forEach(o=>{var a,l;const s=e[o];s!==void 0&&(i[o]=((l=(a=t[o])==null?void 0:a.seriesProcessor)==null?void 0:l.call(a,s,n,r))??s)}),i},Xg=(e,t,n)=>{let r=!1;const i={};return Object.keys(e).forEach(o=>{var l;const s=(l=t[o])==null?void 0:l.seriesLayout,a=e[o];if(s!==void 0&&a!==void 0){const u=s(a,n);u&&u!==e[o]&&(r=!0,i[o]=u)}}),r?i:{}},Hc=(e,t)=>{var r;const n=(r=e[t.type])==null?void 0:r.identifierSerializer;if(!n)throw new Error(`MUI X Charts: No identifier serializer found for series type "${t.type}".`);return n(t)},ro=({params:e,store:t,seriesConfig:n})=>{const{series:r,dataset:i,theme:o,colors:s}=e;return Gc(()=>{t.set("series",L({},t.state.series,{defaultizedSeries:Wc({series:r,colors:typeof s=="function"?s(o):s,seriesConfig:n}),dataset:i}))},[s,i,r,o,n,t]),{instance:{serializeIdentifier:Ye(l=>Hc(n,l))}}};ro.params={dataset:!0,series:!0,colors:!0,theme:!0};const Zg=[];ro.getDefaultizedParams=({params:e})=>{var t;return L({},e,{series:(t=e.series)!=null&&t.length?e.series:Zg,colors:e.colors??Yc,theme:e.theme??"light"})};ro.getInitialState=({series:e=[],colors:t,theme:n,dataset:r},i,o)=>({series:{seriesConfig:o,defaultizedSeries:Wc({series:e,colors:typeof t=="function"?t(n):t,seriesConfig:o}),dataset:r}});const Qg=(e,t,n)=>{const r=Hc(n,t);return!e.has(r)},ey=e=>e.visibilityManager,ty=new Map,ny=J(ey,e=>(e==null?void 0:e.visibilityMap)??ty),ry=Ee(ny,e=>(t,n)=>Qg(e,n,t)),Ks=e=>e.series,iy=J(Ks,e=>e.defaultizedSeries),Vt=J(Ks,e=>e.seriesConfig),oy=J(Ks,e=>e.dataset),ze=Ee(iy,Vt,oy,ry,function(t,n,r,i){return Jg(t,n,r,o=>i(n,o))});Ee(ze,Vt,gt,function(t,n,r){return Xg(t,n,r)});const sy={abort:!0,animationcancel:!0,animationend:!0,animationiteration:!0,animationstart:!0,auxclick:!0,beforeinput:!0,beforetoggle:!0,blur:!0,cancel:!0,canplay:!0,canplaythrough:!0,change:!0,click:!0,close:!0,compositionend:!0,compositionstart:!0,compositionupdate:!0,contextlost:!0,contextmenu:!0,contextrestored:!0,copy:!0,cuechange:!0,cut:!0,dblclick:!0,drag:!0,dragend:!0,dragenter:!0,dragleave:!0,dragover:!0,dragstart:!0,drop:!0,durationchange:!0,emptied:!0,ended:!0,error:!0,focus:!0,focusin:!0,focusout:!0,formdata:!0,gotpointercapture:!0,input:!0,invalid:!0,keydown:!0,keypress:!0,keyup:!0,load:!0,loadeddata:!0,loadedmetadata:!0,loadstart:!0,lostpointercapture:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,paste:!0,pause:!0,play:!0,playing:!0,pointercancel:!0,pointerdown:!0,pointerenter:!0,pointerleave:!0,pointermove:!0,pointerout:!0,pointerover:!0,pointerup:!0,progress:!0,ratechange:!0,reset:!0,resize:!0,scroll:!0,scrollend:!0,securitypolicyviolation:!0,seeked:!0,seeking:!0,select:!0,selectionchange:!0,selectstart:!0,slotchange:!0,stalled:!0,submit:!0,suspend:!0,timeupdate:!0,toggle:!0,touchcancel:!0,touchend:!0,touchmove:!0,touchstart:!0,transitioncancel:!0,transitionend:!0,transitionrun:!0,transitionstart:!0,volumechange:!0,waiting:!0,webkitanimationend:!0,webkitanimationiteration:!0,webkitanimationstart:!0,webkittransitionend:!0,wheel:!0,beforematch:!0,pointerrawupdate:!0};class qc{constructor(t){W(this,"customData",{});W(this,"handleOptionsChange",t=>{t&&t.detail&&this.updateOptions(t.detail)});W(this,"handleStateChange",t=>{t&&t.detail&&this.updateState(t.detail)});if(!t||!t.name)throw new Error("Gesture must be initialized with a valid name.");if(t.name in sy)throw new Error(`Gesture can't be created with a native event name. Tried to use "${t.name}". Please use a custom name instead.`);this.name=t.name,this.preventDefault=t.preventDefault??!1,this.stopPropagation=t.stopPropagation??!1,this.preventIf=t.preventIf??[],this.requiredKeys=t.requiredKeys??[],this.pointerMode=t.pointerMode??[],this.pointerOptions=t.pointerOptions??{}}init(t,n,r,i){this.element=t,this.pointerManager=n,this.gesturesRegistry=r,this.keyboardManager=i;const o=`${this.name}ChangeOptions`;this.element.addEventListener(o,this.handleOptionsChange);const s=`${this.name}ChangeState`;this.element.addEventListener(s,this.handleStateChange)}updateOptions(t){this.preventDefault=t.preventDefault??this.preventDefault,this.stopPropagation=t.stopPropagation??this.stopPropagation,this.preventIf=t.preventIf??this.preventIf,this.requiredKeys=t.requiredKeys??this.requiredKeys,this.pointerMode=t.pointerMode??this.pointerMode,this.pointerOptions=t.pointerOptions??this.pointerOptions}getBaseConfig(){return{requiredKeys:this.requiredKeys}}getEffectiveConfig(t,n){if(t!=="mouse"&&t!=="touch"&&t!=="pen")return n;const r=this.pointerOptions[t];return r?L({},n,r):n}updateState(t){Object.assign(this.state,t)}getTargetElement(t){return this.isActive||this.element===t.target||"contains"in this.element&&this.element.contains(t.target)||"getRootNode"in this.element&&this.element.getRootNode()instanceof ShadowRoot&&t.composedPath().includes(this.element)?this.element:null}set isActive(t){t?this.gesturesRegistry.registerActiveGesture(this.element,this):this.gesturesRegistry.unregisterActiveGesture(this.element,this)}get isActive(){return this.gesturesRegistry.isGestureActive(this.element,this)??!1}shouldPreventGesture(t,n){const r=this.getEffectiveConfig(n,this.getBaseConfig());if(!this.keyboardManager.areKeysPressed(r.requiredKeys))return!0;if(this.preventIf.length===0)return!1;const i=this.gesturesRegistry.getActiveGestures(t);return this.preventIf.some(o=>i[o])}isPointerTypeAllowed(t){return!this.pointerMode||this.pointerMode.length===0?!0:this.pointerMode.includes(t)}destroy(){const t=`${this.name}ChangeOptions`;this.element.removeEventListener(t,this.handleOptionsChange);const n=`${this.name}ChangeState`;this.element.removeEventListener(n,this.handleStateChange)}}class ay{constructor(){W(this,"activeGestures",new Map)}registerActiveGesture(t,n){this.activeGestures.has(t)||this.activeGestures.set(t,new Set);const r=this.activeGestures.get(t),i={gesture:n,element:t};r.add(i)}unregisterActiveGesture(t,n){const r=this.activeGestures.get(t);r&&(r.forEach(i=>{i.gesture===n&&r.delete(i)}),r.size===0&&this.activeGestures.delete(t))}getActiveGestures(t){const n=this.activeGestures.get(t);return n?Array.from(n).reduce((r,i)=>(r[i.gesture.name]=!0,r),{}):{}}isGestureActive(t,n){const r=this.activeGestures.get(t);return r?Array.from(r).some(i=>i.gesture===n):!1}destroy(){this.activeGestures.clear()}unregisterElement(t){this.activeGestures.delete(t)}}class ly{constructor(){W(this,"pressedKeys",new Set);W(this,"handleKeyDown",t=>{this.pressedKeys.add(t.key)});W(this,"handleKeyUp",t=>{this.pressedKeys.delete(t.key)});W(this,"clearKeys",()=>{this.pressedKeys.clear()});this.initialize()}initialize(){typeof window>"u"||(window.addEventListener("keydown",this.handleKeyDown),window.addEventListener("keyup",this.handleKeyUp),window.addEventListener("blur",this.clearKeys))}areKeysPressed(t){return!t||t.length===0?!0:t.every(n=>n==="ControlOrMeta"?navigator.platform.includes("Mac")?this.pressedKeys.has("Meta"):this.pressedKeys.has("Control"):this.pressedKeys.has(n))}destroy(){typeof window<"u"&&(window.removeEventListener("keydown",this.handleKeyDown),window.removeEventListener("keyup",this.handleKeyUp),window.removeEventListener("blur",this.clearKeys)),this.clearKeys()}}class uy{constructor(t){W(this,"preventEventInterruption",!0);W(this,"pointers",new Map);W(this,"gestureHandlers",new Set);W(this,"handleInterruptEvents",t=>{if(this.preventEventInterruption&&"pointerType"in t&&t.pointerType==="touch"){t.preventDefault();return}const n=new PointerEvent("forceCancel",{bubbles:!1,cancelable:!1}),r=this.pointers.values().next().value;if(this.pointers.size>0&&r){Object.defineProperties(n,{clientX:{value:r.clientX},clientY:{value:r.clientY},pointerId:{value:r.pointerId},pointerType:{value:r.pointerType}});for(const[i,o]of this.pointers.entries()){const s=L({},o,{type:"forceCancel"});this.pointers.set(i,s)}}this.notifyHandlers(n),this.pointers.clear()});W(this,"handlePointerEvent",t=>{const{type:n,pointerId:r}=t;if(n==="pointerdown"||n==="pointermove")this.pointers.set(r,this.createPointerData(t));else if(n==="pointerup"||n==="pointercancel"||n==="forceCancel"){this.pointers.set(r,this.createPointerData(t)),this.notifyHandlers(t),this.pointers.delete(r);return}this.notifyHandlers(t)});this.root=t.root??document.getRootNode({composed:!0})??document.body,this.touchAction=t.touchAction||"auto",this.passive=t.passive??!1,this.preventEventInterruption=t.preventEventInterruption??!0,this.setupEventListeners()}registerGestureHandler(t){return this.gestureHandlers.add(t),()=>{this.gestureHandlers.delete(t)}}getPointers(){return new Map(this.pointers)}setupEventListeners(){this.touchAction!=="auto"&&(this.root.style.touchAction=this.touchAction),this.root.addEventListener("pointerdown",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("pointermove",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("pointerup",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("pointercancel",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("forceCancel",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("blur",this.handleInterruptEvents),this.root.addEventListener("contextmenu",this.handleInterruptEvents)}notifyHandlers(t){this.gestureHandlers.forEach(n=>n(this.pointers,t))}createPointerData(t){return{pointerId:t.pointerId,clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,target:t.target,timeStamp:t.timeStamp,type:t.type,isPrimary:t.isPrimary,pressure:t.pressure,width:t.width,height:t.height,pointerType:t.pointerType,srcEvent:t}}destroy(){this.root.removeEventListener("pointerdown",this.handlePointerEvent),this.root.removeEventListener("pointermove",this.handlePointerEvent),this.root.removeEventListener("pointerup",this.handlePointerEvent),this.root.removeEventListener("pointercancel",this.handlePointerEvent),this.root.removeEventListener("forceCancel",this.handlePointerEvent),this.root.removeEventListener("blur",this.handleInterruptEvents),this.root.removeEventListener("contextmenu",this.handleInterruptEvents),this.pointers.clear(),this.gestureHandlers.clear()}}class cy{constructor(t){W(this,"gestureTemplates",new Map);W(this,"elementGestureMap",new Map);W(this,"activeGesturesRegistry",new ay);W(this,"keyboardManager",new ly);this.pointerManager=new uy({root:t.root,touchAction:t.touchAction,passive:t.passive}),t.gestures&&t.gestures.length>0&&t.gestures.forEach(n=>{this.addGestureTemplate(n)})}addGestureTemplate(t){this.gestureTemplates.has(t.name)&&console.warn(`Gesture template with name "${t.name}" already exists. It will be overwritten.`),this.gestureTemplates.set(t.name,t)}setGestureOptions(t,n,r){const i=this.elementGestureMap.get(n);if(!i||!i.has(t)){console.error(`Gesture "${t}" not found on the provided element.`);return}const o=new CustomEvent(`${t}ChangeOptions`,{detail:r,bubbles:!1,cancelable:!1,composed:!1});n.dispatchEvent(o)}setGestureState(t,n,r){const i=this.elementGestureMap.get(n);if(!i||!i.has(t)){console.error(`Gesture "${t}" not found on the provided element.`);return}const o=new CustomEvent(`${t}ChangeState`,{detail:r,bubbles:!1,cancelable:!1,composed:!1});n.dispatchEvent(o)}registerElement(t,n,r){return Array.isArray(t)||(t=[t]),t.forEach(i=>{const o=r==null?void 0:r[i];this.registerSingleGesture(i,n,o)}),n}registerSingleGesture(t,n,r){const i=this.gestureTemplates.get(t);if(!i)return console.error(`Gesture template "${t}" not found.`),!1;this.elementGestureMap.has(n)||this.elementGestureMap.set(n,new Map);const o=this.elementGestureMap.get(n);o.has(t)&&(console.warn(`Element already has gesture "${t}" registered. It will be replaced.`),this.unregisterElement(t,n));const s=i.clone(r);return s.init(n,this.pointerManager,this.activeGesturesRegistry,this.keyboardManager),o.set(t,s),!0}unregisterElement(t,n){const r=this.elementGestureMap.get(n);return!r||!r.has(t)?!1:(r.get(t).destroy(),r.delete(t),this.activeGesturesRegistry.unregisterElement(n),r.size===0&&this.elementGestureMap.delete(n),!0)}unregisterAllGestures(t){const n=this.elementGestureMap.get(t);if(n){for(const[,r]of n)r.destroy(),this.activeGesturesRegistry.unregisterElement(t);this.elementGestureMap.delete(t)}}destroy(){for(const[t]of this.elementGestureMap)this.unregisterAllGestures(t);this.gestureTemplates.clear(),this.elementGestureMap.clear(),this.activeGesturesRegistry.destroy(),this.keyboardManager.destroy(),this.pointerManager.destroy()}}class fn extends qc{constructor(n){super(n);W(this,"unregisterHandler",null);W(this,"originalTarget",null);this.minPointers=n.minPointers??1,this.maxPointers=n.maxPointers??1/0}init(n,r,i,o){super.init(n,r,i,o),this.unregisterHandler=this.pointerManager.registerGestureHandler(this.handlePointerEvent)}updateOptions(n){super.updateOptions(n),this.minPointers=n.minPointers??this.minPointers,this.maxPointers=n.maxPointers??this.maxPointers}getBaseConfig(){return{requiredKeys:this.requiredKeys,minPointers:this.minPointers,maxPointers:this.maxPointers}}isWithinPointerCount(n,r){const i=this.getEffectiveConfig(r,this.getBaseConfig());return n.length>=i.minPointers&&n.length<=i.maxPointers}getRelevantPointers(n,r){return n.filter(i=>this.isPointerTypeAllowed(i.pointerType)&&(r===i.target||i.target===this.originalTarget||r===this.originalTarget||"contains"in r&&r.contains(i.target))||"getRootNode"in r&&r.getRootNode()instanceof ShadowRoot&&i.srcEvent.composedPath().includes(r))}destroy(){this.unregisterHandler&&(this.unregisterHandler(),this.unregisterHandler=null),super.destroy()}}function dy(e,t){const n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}function Ur(e){if(e.length<2)return 0;let t=0,n=0;for(let r=0;r<e.length;r+=1)for(let i=r+1;i<e.length;i+=1)t+=dy({x:e[r].clientX,y:e[r].clientY},{x:e[i].clientX,y:e[i].clientY}),n+=1;return n>0?t/n:0}function rt(e){if(e.length===0)return{x:0,y:0};const t=e.reduce((n,r)=>(n.x+=r.clientX,n.y+=r.clientY,n),{x:0,y:0});return{x:t.x/e.length,y:t.y/e.length}}function Ze(e,t){return`${e}${t==="ongoing"?"":t.charAt(0).toUpperCase()+t.slice(1)}`}const Vr=1e-5,Ot=1e-5,kl=.15;function hy(e,t){const n=t.x-e.x,r=t.y-e.y,i={vertical:null,horizontal:null,mainAxis:null},o=fy(t,e),s=Math.abs(n)>Math.abs(r)?"horizontal":"vertical",a=o||s==="horizontal"?Vr:kl,l=o?Vr:s==="horizontal"?kl:Vr;return Math.abs(n)>a&&(i.horizontal=n>0?"right":"left"),Math.abs(r)>l&&(i.vertical=r>0?"down":"up"),i.mainAxis=o?"diagonal":s,i}function fy(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.atan2(r,n)*180/Math.PI;return i>=-45+Ot&&i<=-22.5+Ot||i>=22.5+Ot&&i<=45+Ot||i>=135+Ot&&i<=157.5+Ot||i>=-157.5+Ot&&i<=-135+Ot}function py(e,t){if(!e.vertical&&!e.horizontal)return!1;if(t.length===0)return!0;const n=e.vertical===null||t.includes(e.vertical),r=e.horizontal===null||t.includes(e.horizontal);return n&&r}const Ol=0,my=e=>e>Ol?1:e<-Ol?-1:0,Dt=e=>{e.cancelable&&e.preventDefault()};class Js extends fn{constructor(n){super(n);W(this,"state",{lastPosition:null});W(this,"handleElementEnter",n=>{if(n.pointerType!=="mouse"&&n.pointerType!=="pen")return;const r=this.pointerManager.getPointers()||new Map,i=Array.from(r.values());if(this.isWithinPointerCount(i,n.pointerType)){this.isActive=!0;const o={x:n.clientX,y:n.clientY};this.state.lastPosition=o,this.emitMoveEvent(this.element,"start",i,n),this.emitMoveEvent(this.element,"ongoing",i,n)}});W(this,"handleElementLeave",n=>{if(n.pointerType!=="mouse"&&n.pointerType!=="pen"||!this.isActive)return;const r=this.pointerManager.getPointers()||new Map,i=Array.from(r.values());this.emitMoveEvent(this.element,"end",i,n),this.resetState()});W(this,"handlePointerEvent",(n,r)=>{if(r.type!=="pointermove"||r.pointerType!=="mouse"&&r.pointerType!=="pen")return;this.preventDefault&&r.preventDefault(),this.stopPropagation&&r.stopPropagation();const i=Array.from(n.values()),o=this.getTargetElement(r);if(!o||!this.isWithinPointerCount(i,r.pointerType))return;if(this.shouldPreventGesture(o,r.pointerType)){if(!this.isActive)return;this.resetState(),this.emitMoveEvent(o,"end",i,r);return}const s={x:r.clientX,y:r.clientY};this.state.lastPosition=s,this.isActive||(this.isActive=!0,this.emitMoveEvent(o,"start",i,r)),this.emitMoveEvent(o,"ongoing",i,r)});this.threshold=n.threshold||0}clone(n){return new Js(L({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}init(n,r,i,o){super.init(n,r,i,o),this.element.addEventListener("pointerenter",this.handleElementEnter),this.element.addEventListener("pointerleave",this.handleElementLeave)}destroy(){this.element.removeEventListener("pointerenter",this.handleElementEnter),this.element.removeEventListener("pointerleave",this.handleElementLeave),this.resetState(),super.destroy()}updateOptions(n){super.updateOptions(n)}resetState(){this.isActive=!1,this.state={lastPosition:null}}emitMoveEvent(n,r,i,o){const s=this.state.lastPosition||rt(i),a=this.gesturesRegistry.getActiveGestures(n),l={gestureName:this.name,centroid:s,target:o.target,srcEvent:o,phase:r,pointers:i,timeStamp:o.timeStamp,activeGestures:a,customData:this.customData},u=Ze(this.name,r),c=new CustomEvent(u,{bubbles:!0,cancelable:!0,composed:!0,detail:l});n.dispatchEvent(c)}}class on extends fn{constructor(n){super(n);W(this,"state",{startPointers:new Map,startCentroid:null,lastCentroid:null,movementThresholdReached:!1,totalDeltaX:0,totalDeltaY:0,activeDeltaX:0,activeDeltaY:0,lastDirection:{vertical:null,horizontal:null,mainAxis:null},lastDeltas:null});W(this,"handlePointerEvent",(n,r)=>{var a;const i=Array.from(n.values());if(r.type==="forceCancel"){this.cancel(r.target,i,r);return}const o=this.getTargetElement(r);if(!o)return;if(this.shouldPreventGesture(o,r.pointerType)){this.cancel(o,i,r);return}const s=this.getRelevantPointers(i,o);if(!this.isWithinPointerCount(s,r.pointerType)){this.cancel(o,s,r);return}switch(r.type){case"pointerdown":if(!this.isActive&&!this.state.startCentroid)s.forEach(l=>{this.state.startPointers.set(l.pointerId,l)}),this.originalTarget=o,this.state.startCentroid=rt(s),this.state.lastCentroid=L({},this.state.startCentroid);else if(this.state.startCentroid&&this.state.lastCentroid){const l=this.state.lastCentroid,u=rt(s),c=u.x-l.x,d=u.y-l.y;this.state.startCentroid={x:this.state.startCentroid.x+c,y:this.state.startCentroid.y+d},this.state.lastCentroid=u,s.forEach(h=>{this.state.startPointers.has(h.pointerId)||this.state.startPointers.set(h.pointerId,h)})}break;case"pointermove":if(this.state.startCentroid&&this.isWithinPointerCount(i,r.pointerType)){const l=rt(s),u=l.x-this.state.startCentroid.x,c=l.y-this.state.startCentroid.y,d=Math.sqrt(u*u+c*c),h=hy(this.state.lastCentroid??this.state.startCentroid,l),f=this.state.lastCentroid?l.x-this.state.lastCentroid.x:0,m=this.state.lastCentroid?l.y-this.state.lastCentroid.y:0;!this.state.movementThresholdReached&&d>=this.threshold&&py(h,this.direction)?(this.state.movementThresholdReached=!0,this.isActive=!0,this.state.lastDeltas={x:f,y:m},this.state.totalDeltaX+=f,this.state.totalDeltaY+=m,this.state.activeDeltaX+=f,this.state.activeDeltaY+=m,this.emitPanEvent(o,"start",s,r,l),this.emitPanEvent(o,"ongoing",s,r,l)):this.state.movementThresholdReached&&this.isActive&&(this.state.lastDeltas={x:f,y:m},this.state.totalDeltaX+=f,this.state.totalDeltaY+=m,this.state.activeDeltaX+=f,this.state.activeDeltaY+=m,this.emitPanEvent(o,"ongoing",s,r,l)),this.state.lastCentroid=l,this.state.lastDirection=h}break;case"pointerup":case"pointercancel":case"forceCancel":if(this.isActive&&this.state.movementThresholdReached){const l=s.filter(u=>u.type!=="pointerup"&&u.type!=="pointercancel");if(this.isWithinPointerCount(l,r.pointerType)){if(l.length>=1&&this.state.lastCentroid){const u=rt(l),c=u.x-this.state.lastCentroid.x,d=u.y-this.state.lastCentroid.y;this.state.startCentroid={x:this.state.startCentroid.x+c,y:this.state.startCentroid.y+d},this.state.lastCentroid=u;const h=(a=s.find(f=>f.type==="pointerup"||f.type==="pointercancel"))==null?void 0:a.pointerId;h!==void 0&&this.state.startPointers.delete(h)}}else{const u=this.state.lastCentroid||this.state.startCentroid;r.type==="pointercancel"&&this.emitPanEvent(o,"cancel",s,r,u),this.emitPanEvent(o,"end",s,r,u),this.resetState()}}else this.resetState();break}});this.direction=n.direction||["up","down","left","right"],this.threshold=n.threshold||0}clone(n){return new on(L({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,direction:[...this.direction],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}destroy(){this.resetState(),super.destroy()}updateOptions(n){super.updateOptions(n),this.direction=n.direction||this.direction,this.threshold=n.threshold??this.threshold}resetState(){this.isActive=!1,this.state=L({},this.state,{startPointers:new Map,startCentroid:null,lastCentroid:null,lastDeltas:null,activeDeltaX:0,activeDeltaY:0,movementThresholdReached:!1,lastDirection:{vertical:null,horizontal:null,mainAxis:null}})}emitPanEvent(n,r,i,o,s){var E,T;if(!this.state.startCentroid)return;const a=((E=this.state.lastDeltas)==null?void 0:E.x)??0,l=((T=this.state.lastDeltas)==null?void 0:T.y)??0,u=this.state.startPointers.values().next().value,c=u?(o.timeStamp-u.timeStamp)/1e3:0,d=c>0?a/c:0,h=c>0?l/c:0,f=Math.sqrt(d*d+h*h),m=this.gesturesRegistry.getActiveGestures(n),p={gestureName:this.name,initialCentroid:this.state.startCentroid,centroid:s,target:o.target,srcEvent:o,phase:r,pointers:i,timeStamp:o.timeStamp,deltaX:a,deltaY:l,direction:this.state.lastDirection,velocityX:d,velocityY:h,velocity:f,totalDeltaX:this.state.totalDeltaX,totalDeltaY:this.state.totalDeltaY,activeDeltaX:this.state.activeDeltaX,activeDeltaY:this.state.activeDeltaY,activeGestures:m,customData:this.customData},y=Ze(this.name,r),b=new CustomEvent(y,{bubbles:!0,cancelable:!0,composed:!0,detail:p});n.dispatchEvent(b),this.preventDefault&&o.preventDefault(),this.stopPropagation&&o.stopPropagation()}cancel(n,r,i){if(this.isActive){const o=n??this.element;this.emitPanEvent(o,"cancel",r,i,this.state.lastCentroid),this.emitPanEvent(o,"end",r,i,this.state.lastCentroid)}this.resetState()}}class Xs extends fn{constructor(n){super(L({},n,{minPointers:n.minPointers??2}));W(this,"state",{startDistance:0,lastDistance:0,lastScale:1,lastTime:0,velocity:0,totalScale:1,deltaScale:0});W(this,"handlePointerEvent",(n,r)=>{const i=Array.from(n.values()),o=this.getTargetElement(r);if(!o)return;if(this.shouldPreventGesture(o,r.pointerType)){this.isActive&&(this.emitPinchEvent(o,"cancel",i,r),this.resetState());return}const s=this.getRelevantPointers(i,o);switch(r.type){case"pointerdown":if(s.length>=2&&!this.isActive){const a=Ur(s);this.state.startDistance=a,this.state.lastDistance=a,this.state.lastTime=r.timeStamp,this.originalTarget=o}else if(this.isActive&&s.length>=2){const a=Ur(s);this.state.startDistance=a/this.state.lastScale,this.state.lastDistance=a,this.state.lastTime=r.timeStamp}break;case"pointermove":if(this.state.startDistance&&this.isWithinPointerCount(s,r.pointerType)){const a=Ur(s),l=Math.abs(a-this.state.lastDistance);if(l!==0&&l>=this.threshold){const u=this.state.startDistance?a/this.state.startDistance:1,c=u/this.state.lastScale;this.state.totalScale*=c;const d=(r.timeStamp-this.state.lastTime)/1e3;if(this.state.lastDistance){const f=(a-this.state.lastDistance)/d;this.state.velocity=Number.isNaN(f)?0:f}this.state.lastDistance=a,this.state.deltaScale=u-this.state.lastScale,this.state.lastScale=u,this.state.lastTime=r.timeStamp,this.isActive?this.emitPinchEvent(o,"ongoing",s,r):(this.isActive=!0,this.emitPinchEvent(o,"start",s,r),this.emitPinchEvent(o,"ongoing",s,r))}}break;case"pointerup":case"pointercancel":case"forceCancel":if(this.isActive){const a=s.filter(l=>l.type!=="pointerup"&&l.type!=="pointercancel");if(!this.isWithinPointerCount(a,r.pointerType))r.type==="pointercancel"&&this.emitPinchEvent(o,"cancel",s,r),this.emitPinchEvent(o,"end",s,r),this.resetState();else if(a.length>=2){const l=Ur(a);this.state.startDistance=l/this.state.lastScale,this.state.lastDistance=l,this.state.lastTime=r.timeStamp}}break}});this.threshold=n.threshold??0}clone(n){return new Xs(L({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}destroy(){this.resetState(),super.destroy()}updateOptions(n){super.updateOptions(n)}resetState(){this.isActive=!1,this.state=L({},this.state,{startDistance:0,lastDistance:0,lastScale:1,lastTime:0,velocity:0,deltaScale:0})}emitPinchEvent(n,r,i,o){const s=rt(i),a=this.state.lastDistance,l=this.state.lastScale,u=this.gesturesRegistry.getActiveGestures(n),c={gestureName:this.name,centroid:s,target:o.target,srcEvent:o,phase:r,pointers:i,timeStamp:o.timeStamp,scale:l,deltaScale:this.state.deltaScale,totalScale:this.state.totalScale,distance:a,velocity:this.state.velocity,activeGestures:u,direction:my(this.state.velocity),customData:this.customData};this.preventDefault&&o.preventDefault(),this.stopPropagation&&o.stopPropagation();const d=Ze(this.name,r),h=new CustomEvent(d,{bubbles:!0,cancelable:!0,composed:!0,detail:c});n.dispatchEvent(h)}}class io extends fn{constructor(n){super(n);W(this,"state",{startCentroid:null,lastPosition:null,timerId:null,startTime:0,pressThresholdReached:!1});W(this,"handlePointerEvent",(n,r)=>{const i=Array.from(n.values());if(r.type==="forceCancel"){this.cancelPress(r.target,i,r);return}const o=this.getTargetElement(r);if(!o)return;if(this.shouldPreventGesture(o,r.pointerType)){this.isActive&&this.cancelPress(o,i,r);return}const s=this.getRelevantPointers(i,o);if(!this.isWithinPointerCount(s,r.pointerType)){this.isActive&&this.cancelPress(o,s,r);return}switch(r.type){case"pointerdown":!this.isActive&&!this.state.startCentroid&&(this.state.startCentroid=rt(s),this.state.lastPosition=L({},this.state.startCentroid),this.state.startTime=r.timeStamp,this.isActive=!0,this.originalTarget=o,this.clearPressTimer(),this.state.timerId=setTimeout(()=>{if(this.isActive&&this.state.startCentroid){this.state.pressThresholdReached=!0;const a=this.state.lastPosition;this.emitPressEvent(o,"start",s,r,a),this.emitPressEvent(o,"ongoing",s,r,a)}},this.duration));break;case"pointermove":if(this.isActive&&this.state.startCentroid){const a=rt(s);this.state.lastPosition=a;const l=a.x-this.state.startCentroid.x,u=a.y-this.state.startCentroid.y;Math.sqrt(l*l+u*u)>this.maxDistance&&this.cancelPress(o,s,r)}break;case"pointerup":if(this.isActive){if(this.state.pressThresholdReached){const a=this.state.lastPosition||this.state.startCentroid;this.emitPressEvent(o,"end",s,r,a)}this.resetState()}break;case"pointercancel":case"forceCancel":this.cancelPress(o,s,r);break}});this.duration=n.duration??500,this.maxDistance=n.maxDistance??10}clone(n){return new io(L({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,duration:this.duration,maxDistance:this.maxDistance,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}destroy(){this.clearPressTimer(),this.resetState(),super.destroy()}updateOptions(n){super.updateOptions(n),this.duration=n.duration??this.duration,this.maxDistance=n.maxDistance??this.maxDistance}resetState(){this.clearPressTimer(),this.isActive=!1,this.state=L({},this.state,{startCentroid:null,lastPosition:null,timerId:null,startTime:0,pressThresholdReached:!1})}clearPressTimer(){this.state.timerId!==null&&(clearTimeout(this.state.timerId),this.state.timerId=null)}emitPressEvent(n,r,i,o,s){const a=this.gesturesRegistry.getActiveGestures(n),l=o.timeStamp-this.state.startTime,u={gestureName:this.name,centroid:s,target:o.target,srcEvent:o,phase:r,pointers:i,timeStamp:o.timeStamp,x:s.x,y:s.y,duration:l,activeGestures:a,customData:this.customData},c=Ze(this.name,r),d=new CustomEvent(c,{bubbles:!0,cancelable:!0,composed:!0,detail:u});n.dispatchEvent(d),this.preventDefault&&o.preventDefault(),this.stopPropagation&&o.stopPropagation()}cancelPress(n,r,i){if(this.isActive&&this.state.pressThresholdReached){const o=this.state.lastPosition||this.state.startCentroid;this.emitPressEvent(n??this.element,"cancel",r,i,o),this.emitPressEvent(n??this.element,"end",r,i,o)}this.resetState()}}class Zs extends fn{constructor(n){super(n);W(this,"state",{phase:"waitingForPress",dragTimeoutId:null});W(this,"pressHandler",()=>{this.state.phase==="waitingForPress"&&(this.state.phase="pressDetected",this.setTouchAction(),this.state.dragTimeoutId=setTimeout(()=>{this.resetState()},this.dragTimeout))});W(this,"dragStartHandler",n=>{this.state.phase==="pressDetected"&&(this.state.dragTimeoutId!==null&&(clearTimeout(this.state.dragTimeoutId),this.state.dragTimeoutId=null),this.restoreTouchAction(),this.state.phase="dragging",this.isActive=!0,this.element.dispatchEvent(new CustomEvent(Ze(this.name,n.detail.phase),n)))});W(this,"dragMoveHandler",n=>{this.state.phase==="dragging"&&this.element.dispatchEvent(new CustomEvent(Ze(this.name,n.detail.phase),n))});W(this,"dragEndHandler",n=>{this.state.phase==="dragging"&&(this.resetState(),this.element.dispatchEvent(new CustomEvent(Ze(this.name,n.detail.phase),n)))});this.pressDuration=n.pressDuration??500,this.pressMaxDistance=n.pressMaxDistance??10,this.dragTimeout=n.dragTimeout??1e3,this.dragThreshold=n.dragThreshold??0,this.dragDirection=n.dragDirection||["up","down","left","right"],this.pressGesture=new io({name:`${this.name}-press`,duration:this.pressDuration,maxDistance:this.pressMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}),this.panGesture=new on({name:`${this.name}-pan`,minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)})}clone(n){return new Zs(L({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,pressDuration:this.pressDuration,pressMaxDistance:this.pressMaxDistance,dragTimeout:this.dragTimeout,dragThreshold:this.dragThreshold,dragDirection:[...this.dragDirection],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}init(n,r,i,o){super.init(n,r,i,o),this.pressGesture.init(n,r,i,o),this.panGesture.init(n,r,i,o),this.element.addEventListener(this.pressGesture.name,this.pressHandler),this.element.addEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.addEventListener(this.panGesture.name,this.dragMoveHandler),this.element.addEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.addEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler)}destroy(){this.resetState(),this.pressGesture.destroy(),this.panGesture.destroy(),this.element.removeEventListener(this.pressGesture.name,this.pressHandler),this.element.removeEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.removeEventListener(this.panGesture.name,this.dragMoveHandler),this.element.removeEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.removeEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler),super.destroy()}updateOptions(n){super.updateOptions(n),this.pressDuration=n.pressDuration??this.pressDuration,this.pressMaxDistance=n.pressMaxDistance??this.pressMaxDistance,this.dragTimeout=n.dragTimeout??this.dragTimeout,this.dragThreshold=n.dragThreshold??this.dragThreshold,this.dragDirection=n.dragDirection||this.dragDirection,this.element.dispatchEvent(new CustomEvent(`${this.panGesture.name}ChangeOptions`,{detail:{minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}})),this.element.dispatchEvent(new CustomEvent(`${this.pressGesture.name}ChangeOptions`,{detail:{duration:this.pressDuration,maxDistance:this.pressMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}}))}resetState(){this.state.dragTimeoutId!==null&&clearTimeout(this.state.dragTimeoutId),this.restoreTouchAction(),this.isActive=!1,this.state={phase:"waitingForPress",dragTimeoutId:null}}handlePointerEvent(){}setTouchAction(){this.element.addEventListener("touchstart",Dt,{passive:!1}),this.element.addEventListener("touchmove",Dt,{passive:!1}),this.element.addEventListener("touchend",Dt,{passive:!1})}restoreTouchAction(){this.element.removeEventListener("touchstart",Dt),this.element.removeEventListener("touchmove",Dt),this.element.removeEventListener("touchend",Dt)}}class dr extends fn{constructor(n){super(n);W(this,"state",{startCentroid:null,currentTapCount:0,lastTapTime:0,lastPosition:null});W(this,"handlePointerEvent",(n,r)=>{const i=Array.from(n.values()),o=this.getTargetElement(r);if(!o)return;const s=this.getRelevantPointers(i,o);if(this.shouldPreventGesture(o,r.pointerType)||!this.isWithinPointerCount(s,r.pointerType)){this.isActive&&this.cancelTap(o,s,r);return}switch(r.type){case"pointerdown":this.isActive||(this.state.startCentroid=rt(s),this.state.lastPosition=L({},this.state.startCentroid),this.isActive=!0,this.originalTarget=o);break;case"pointermove":if(this.isActive&&this.state.startCentroid){const a=rt(s);this.state.lastPosition=a;const l=a.x-this.state.startCentroid.x,u=a.y-this.state.startCentroid.y;Math.sqrt(l*l+u*u)>this.maxDistance&&this.cancelTap(o,s,r)}break;case"pointerup":if(this.isActive){this.state.currentTapCount+=1;const a=this.state.lastPosition||this.state.startCentroid;if(!a){this.cancelTap(o,s,r);return}this.state.currentTapCount>=this.taps?(this.fireTapEvent(o,s,r,a),this.resetState()):(this.state.lastTapTime=r.timeStamp,this.isActive=!1,this.state.startCentroid=null,setTimeout(()=>{this.state&&this.state.currentTapCount>0&&this.state.currentTapCount<this.taps&&(this.state.currentTapCount=0)},300))}break;case"pointercancel":case"forceCancel":this.cancelTap(o,s,r);break}});this.maxDistance=n.maxDistance??10,this.taps=n.taps??1}clone(n){return new dr(L({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,maxDistance:this.maxDistance,taps:this.taps,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}destroy(){this.resetState(),super.destroy()}updateOptions(n){super.updateOptions(n),this.maxDistance=n.maxDistance??this.maxDistance,this.taps=n.taps??this.taps}resetState(){this.isActive=!1,this.state={startCentroid:null,currentTapCount:0,lastTapTime:0,lastPosition:null}}fireTapEvent(n,r,i,o){const s=this.gesturesRegistry.getActiveGestures(n),a={gestureName:this.name,centroid:o,target:i.target,srcEvent:i,phase:"end",pointers:r,timeStamp:i.timeStamp,x:o.x,y:o.y,tapCount:this.state.currentTapCount,activeGestures:s,customData:this.customData},l=new CustomEvent(this.name,{bubbles:!0,cancelable:!0,composed:!0,detail:a});n.dispatchEvent(l),this.preventDefault&&i.preventDefault(),this.stopPropagation&&i.stopPropagation()}cancelTap(n,r,i){if(this.state.startCentroid||this.state.lastPosition){const o=this.state.lastPosition||this.state.startCentroid,s=this.gesturesRegistry.getActiveGestures(n),a={gestureName:this.name,centroid:o,target:i.target,srcEvent:i,phase:"cancel",pointers:r,timeStamp:i.timeStamp,x:o.x,y:o.y,tapCount:this.state.currentTapCount,activeGestures:s,customData:this.customData},l=Ze(this.name,"cancel"),u=new CustomEvent(l,{bubbles:!0,cancelable:!0,composed:!0,detail:a});n.dispatchEvent(u)}this.resetState()}}class Qs extends fn{constructor(n){super(n);W(this,"state",{phase:"waitingForTap",dragTimeoutId:null});W(this,"tapHandler",()=>{this.state.phase==="waitingForTap"&&(this.state.phase="tapDetected",this.setTouchAction(),this.state.dragTimeoutId=setTimeout(()=>{this.resetState()},this.dragTimeout))});W(this,"dragStartHandler",n=>{this.state.phase==="tapDetected"&&(this.state.dragTimeoutId!==null&&(clearTimeout(this.state.dragTimeoutId),this.state.dragTimeoutId=null),this.restoreTouchAction(),this.state.phase="dragging",this.isActive=!0,this.element.dispatchEvent(new CustomEvent(Ze(this.name,n.detail.phase),n)))});W(this,"dragMoveHandler",n=>{this.state.phase==="dragging"&&this.element.dispatchEvent(new CustomEvent(Ze(this.name,n.detail.phase),n))});W(this,"dragEndHandler",n=>{this.state.phase==="dragging"&&(this.resetState(),this.element.dispatchEvent(new CustomEvent(Ze(this.name,n.detail.phase),n)))});this.tapMaxDistance=n.tapMaxDistance??10,this.dragTimeout=n.dragTimeout??1e3,this.dragThreshold=n.dragThreshold??0,this.dragDirection=n.dragDirection||["up","down","left","right"],this.tapGesture=new dr({name:`${this.name}-tap`,maxDistance:this.tapMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}),this.panGesture=new on({name:`${this.name}-pan`,minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)})}clone(n){return new Qs(L({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,tapMaxDistance:this.tapMaxDistance,dragTimeout:this.dragTimeout,dragThreshold:this.dragThreshold,dragDirection:[...this.dragDirection],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}init(n,r,i,o){super.init(n,r,i,o),this.tapGesture.init(n,r,i,o),this.panGesture.init(n,r,i,o),this.element.addEventListener(this.tapGesture.name,this.tapHandler),this.element.addEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.addEventListener(this.panGesture.name,this.dragMoveHandler),this.element.addEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.addEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler)}destroy(){this.resetState(),this.tapGesture.destroy(),this.panGesture.destroy(),this.element.removeEventListener(this.tapGesture.name,this.tapHandler),this.element.removeEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.removeEventListener(this.panGesture.name,this.dragMoveHandler),this.element.removeEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.removeEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler),super.destroy()}updateOptions(n){super.updateOptions(n),this.tapMaxDistance=n.tapMaxDistance??this.tapMaxDistance,this.dragTimeout=n.dragTimeout??this.dragTimeout,this.dragThreshold=n.dragThreshold??this.dragThreshold,this.dragDirection=n.dragDirection||this.dragDirection,this.element.dispatchEvent(new CustomEvent(`${this.panGesture.name}ChangeOptions`,{detail:{minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}})),this.element.dispatchEvent(new CustomEvent(`${this.tapGesture.name}ChangeOptions`,{detail:{maxDistance:this.tapMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}}))}resetState(){this.state.dragTimeoutId!==null&&clearTimeout(this.state.dragTimeoutId),this.restoreTouchAction(),this.isActive=!1,this.state={phase:"waitingForTap",dragTimeoutId:null}}handlePointerEvent(){}setTouchAction(){this.element.addEventListener("touchstart",Dt,{passive:!1})}restoreTouchAction(){this.element.removeEventListener("touchstart",Dt)}}class yi extends qc{constructor(n){super(n);W(this,"state",{totalDeltaX:0,totalDeltaY:0,totalDeltaZ:0});W(this,"handleWheelEvent",n=>{if(this.shouldPreventGesture(this.element,"mouse"))return;const r=this.pointerManager.getPointers()||new Map,i=Array.from(r.values());this.state.totalDeltaX+=n.deltaX*this.sensitivity*(this.invert?-1:1),this.state.totalDeltaY+=n.deltaY*this.sensitivity*(this.invert?-1:1),this.state.totalDeltaZ+=n.deltaZ*this.sensitivity*(this.invert?-1:1),["totalDeltaX","totalDeltaY","totalDeltaZ"].forEach(o=>{this.state[o]<this.min&&(this.state[o]=this.min),this.state[o]>this.max&&(this.state[o]=this.max)}),this.emitWheelEvent(i,n)});this.sensitivity=n.sensitivity??1,this.max=n.max??Number.MAX_SAFE_INTEGER,this.min=n.min??Number.MIN_SAFE_INTEGER,this.initialDelta=n.initialDelta??0,this.invert=n.invert??!1,this.state.totalDeltaX=this.initialDelta,this.state.totalDeltaY=this.initialDelta,this.state.totalDeltaZ=this.initialDelta}clone(n){return new yi(L({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,sensitivity:this.sensitivity,max:this.max,min:this.min,initialDelta:this.initialDelta,invert:this.invert,requiredKeys:[...this.requiredKeys],preventIf:[...this.preventIf]},n))}init(n,r,i,o){super.init(n,r,i,o),this.element.addEventListener("wheel",this.handleWheelEvent)}destroy(){this.element.removeEventListener("wheel",this.handleWheelEvent),this.resetState(),super.destroy()}resetState(){this.isActive=!1,this.state={totalDeltaX:0,totalDeltaY:0,totalDeltaZ:0}}updateOptions(n){super.updateOptions(n),this.sensitivity=n.sensitivity??this.sensitivity,this.max=n.max??this.max,this.min=n.min??this.min,this.initialDelta=n.initialDelta??this.initialDelta,this.invert=n.invert??this.invert}emitWheelEvent(n,r){const i=n.length>0?rt(n):{x:r.clientX,y:r.clientY},o=this.gesturesRegistry.getActiveGestures(this.element),s={gestureName:this.name,centroid:i,target:r.target,srcEvent:r,phase:"ongoing",pointers:n,timeStamp:r.timeStamp,deltaX:r.deltaX*this.sensitivity*(this.invert?-1:1),deltaY:r.deltaY*this.sensitivity*(this.invert?-1:1),deltaZ:r.deltaZ*this.sensitivity*(this.invert?-1:1),deltaMode:r.deltaMode,totalDeltaX:this.state.totalDeltaX,totalDeltaY:this.state.totalDeltaY,totalDeltaZ:this.state.totalDeltaZ,activeGestures:o,customData:this.customData};this.preventDefault&&r.preventDefault(),this.stopPropagation&&r.stopPropagation();const a=Ze(this.name,"ongoing"),l=new CustomEvent(a,{bubbles:!0,cancelable:!0,composed:!0,detail:s});this.element.dispatchEvent(l)}}const Mn=e=>e.preventDefault(),ea=({svgRef:e})=>{const t=O.useRef(null);O.useEffect(()=>{const i=e.current;t.current||(t.current=new cy({gestures:[new on({name:"pan",threshold:0,maxPointers:1}),new Js({name:"move",preventIf:["pan","zoomPinch","zoomPan"]}),new dr({name:"tap",preventIf:["pan","zoomPinch","zoomPan"]}),new io({name:"quickPress",duration:50}),new on({name:"brush",threshold:0,maxPointers:1}),new on({name:"zoomPan",threshold:0,preventIf:["zoomTapAndDrag","zoomPressAndDrag"]}),new Xs({name:"zoomPinch",threshold:5}),new yi({name:"zoomTurnWheel",sensitivity:.01,initialDelta:1}),new yi({name:"panTurnWheel",sensitivity:.5}),new Qs({name:"zoomTapAndDrag",dragThreshold:10}),new Zs({name:"zoomPressAndDrag",dragThreshold:10,preventIf:["zoomPinch"]}),new dr({name:"zoomDoubleTapReset",taps:2})]}));const o=t.current;if(!(!i||!o))return o.registerElement(["pan","move","zoomPinch","zoomPan","zoomTurnWheel","panTurnWheel","tap","quickPress","zoomTapAndDrag","zoomPressAndDrag","zoomDoubleTapReset","brush"],i),()=>{o.unregisterAllGestures(i)}},[e,t]);const n=O.useCallback((i,o,s)=>{const a=e.current;return a==null||a.addEventListener(i,o,s),{cleanup:()=>a==null?void 0:a.removeEventListener(i,o)}},[e]),r=O.useCallback((i,o)=>{const s=e.current,a=t.current;!a||!s||a.setGestureOptions(i,s,o??{})},[e,t]);return O.useEffect(()=>{const i=e.current;return i==null||i.addEventListener("gesturestart",Mn),i==null||i.addEventListener("gesturechange",Mn),i==null||i.addEventListener("gestureend",Mn),()=>{i==null||i.removeEventListener("gesturestart",Mn),i==null||i.removeEventListener("gesturechange",Mn),i==null||i.removeEventListener("gestureend",Mn)}},[e]),{instance:{addInteractionListener:n,updateZoomInteractionListeners:r}}};ea.params={};ea.getInitialState=()=>({});const gy=[qs,Hs,to,ro,ea,eo],yy=["apiRef"],xy=e=>{let{plugins:t}=e,n=pt(e.props,yy);const r={};t.forEach(s=>{Object.assign(r,s.params)});const i={};return Object.keys(n).forEach(s=>{const a=n[s];r[s]&&(i[s]=a)}),t.reduce((s,a)=>a.getDefaultizedParams?a.getDefaultizedParams({params:s}):s,i)};let Pl=0;function by(e,t,n){const r=Yp(),i=O.useMemo(()=>[...gy,...e],[e]),o=xy({plugins:i,props:t});o.id=o.id??r;const a=O.useRef({}).current,l=Sy(t.apiRef),u=O.useRef(null),c=O.useRef(null),d=O.useRef(null);if(d.current==null){Pl+=1;const m={cacheKey:{id:Pl}};i.forEach(p=>{p.getInitialState&&Object.assign(m,p.getInitialState(o,m,n))}),d.current=new Ws(m)}const h=m=>{const p=m({instance:a,params:o,plugins:i,store:d.current,svgRef:c,chartRootRef:u,seriesConfig:n});p.publicAPI&&Object.assign(l.current,p.publicAPI),p.instance&&Object.assign(a,p.instance)};return i.forEach(h),{contextValue:O.useMemo(()=>({store:d.current,publicAPI:l.current,instance:a,svgRef:c,chartRootRef:u}),[a,l])}}function vy(e){return e.current==null&&(e.current={}),e}function Sy(e){const t=O.useRef({});return e?vy(e):t}const ta=O.createContext(null);process.env.NODE_ENV!=="production"&&(ta.displayName="ChartContext");const Dl=new Set;function Nn(e,t="warning"){if(process.env.NODE_ENV==="production")return;const n=Array.isArray(e)?e.join(`
|
|
94
|
-
`):e;Dl.has(n)||(Dl.add(n),t==="error"?console.error(n):console.warn(n))}function Ey(e){const{componentName:t,propName:n,controlled:r,defaultValue:i,warningPrefix:o="MUI X"}=e,[{initialDefaultValue:s,isControlled:a}]=O.useState({initialDefaultValue:i,isControlled:r!==void 0});a!==(r!==void 0)&&Nn([`${o}: A component is changing the ${a?"":"un"}controlled ${n} state of ${t} to be ${a?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"],"error"),JSON.stringify(s)!==JSON.stringify(i)&&Nn([`${o}: A component is changing the default ${n} state of an uncontrolled ${t} after being initialized. To suppress this warning opt to use a controlled ${t}.`],"error")}const na=process.env.NODE_ENV==="production"?()=>{}:Ey,Kc=4,Jc=20+2*Kc,Ty=40+2*Kc,wy="hover",Yr={minStart:0,maxEnd:100,step:5,minSpan:10,maxSpan:100,panning:!0,filterMode:"keep",reverse:!1,slider:{enabled:!1,preview:!1,size:Jc,showTooltip:wy}},ra=(e,t,n,r)=>{var i;if(e)return e===!0?L({axisId:t,axisDirection:n},Yr,{reverse:r??!1}):L({axisId:t,axisDirection:n},Yr,{reverse:r??!1},e,{slider:L({},Yr.slider,{size:((i=e.slider)==null?void 0:i.preview)??Yr.slider.preview?Ty:Jc},e.slider)})};function Xc(e,t){const n={top:0,bottom:0,none:0};return(e&&e.length>0?e:[{id:Ag,scaleType:"linear"}]).map((o,s)=>{var f;const a=o.dataKey,l=s===0?"bottom":"none",u=o.position??l,c=kg+(o.label?Uc:0),d=o.id??`defaultized-x-axis-${s}`,h=L({offset:n[u]},o,{id:d,position:u,height:o.height??c,zoom:ra(o.zoom,d,"x",o.reverse)});if(u!=="none"&&(n[u]+=h.height,(f=h.zoom)!=null&&f.slider.enabled&&(n[u]+=h.zoom.slider.size)),a===void 0||o.data!==void 0)return h;if(t===void 0)throw new Error("MUI X Charts: x-axis uses `dataKey` but no `dataset` is provided.");return L({},h,{data:t.map(m=>m[a])})})}function Zc(e,t){const n={right:0,left:0,none:0};return(e&&e.length>0?e:[{id:_g,scaleType:"linear"}]).map((o,s)=>{var f;const a=o.dataKey,l=s===0?"left":"none",u=o.position??l,c=jg+(o.label?Uc:0),d=o.id??`defaultized-y-axis-${s}`,h=L({offset:n[u]},o,{id:d,position:u,width:o.width??c,zoom:ra(o.zoom,d,"y",o.reverse)});if(u!=="none"&&(n[u]+=h.width,(f=h.zoom)!=null&&f.slider.enabled&&(n[u]+=h.zoom.slider.size)),a===void 0||o.data!==void 0)return h;if(t===void 0)throw new Error("MUI X Charts: y-axis uses `dataKey` but no `dataset` is provided.");return L({},h,{data:t.map(m=>m[a])})})}function Cy(e,t){return function(r,i){if(i.location==="tick"){const o=i.scale.domain();return o[0]===o[1]?i.scale.tickFormat(1)(r):i.scale.tickFormat(e)(r)}return i.location==="zoom-slider-tooltip"?t.tickFormat(2)(r):`${r}`}}function Yn(e){return e.scaleType==="band"}function Wn(e){return e.scaleType==="point"}function My(e){return e.scaleType==="symlog"}function ui(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ry(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ia(e){let t,n,r;e.length!==2?(t=ui,n=(a,l)=>ui(e(a),l),r=(a,l)=>e(a)-l):(t=e===ui||e===Ry?e:Ay,n=e,r=e);function i(a,l,u=0,c=a.length){if(u<c){if(t(l,l)!==0)return c;do{const d=u+c>>>1;n(a[d],l)<0?u=d+1:c=d}while(u<c)}return u}function o(a,l,u=0,c=a.length){if(u<c){if(t(l,l)!==0)return c;do{const d=u+c>>>1;n(a[d],l)<=0?u=d+1:c=d}while(u<c)}return u}function s(a,l,u=0,c=a.length){const d=i(a,l,u,c-1);return d>u&&r(a[d-1],l)>-r(a[d],l)?d-1:d}return{left:i,center:s,right:o}}function Ay(){return 0}function _y(e){return e===null?NaN:+e}const Iy=ia(ui),Qc=Iy.right;ia(_y).center;class xi extends Map{constructor(t,n=Oy){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get($l(this,t))}has(t){return super.has($l(this,t))}set(t,n){return super.set(jy(this,t),n)}delete(t){return super.delete(ky(this,t))}}function $l({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function jy({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function ky({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Oy(e){return e!==null&&typeof e=="object"?e.valueOf():e}const Py=Math.sqrt(50),Dy=Math.sqrt(10),$y=Math.sqrt(2);function bi(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=Py?10:o>=Dy?5:o>=$y?2:1;let a,l,u;return i<0?(u=Math.pow(10,-i)/s,a=Math.round(e*u),l=Math.round(t*u),a/u<e&&++a,l/u>t&&--l,u=-u):(u=Math.pow(10,i)*s,a=Math.round(e/u),l=Math.round(t/u),a*u<e&&++a,l*u>t&&--l),l<a&&.5<=n&&n<2?bi(e,t,n*2):[a,l,u]}function gs(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,s]=r?bi(t,e,n):bi(e,t,n);if(!(o>=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let u=0;u<a;++u)l[u]=(o-u)/-s;else for(let u=0;u<a;++u)l[u]=(o-u)*s;else if(s<0)for(let u=0;u<a;++u)l[u]=(i+u)/-s;else for(let u=0;u<a;++u)l[u]=(i+u)*s;return l}function ys(e,t,n){return t=+t,e=+e,n=+n,bi(e,t,n)[2]}function xs(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?ys(t,e,n):ys(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Ny(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function Yt(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ly(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Nl=Symbol("implicit");function bs(){var e=new xi,t=[],n=[],r=Nl;function i(o){let s=e.get(o);if(s===void 0){if(r!==Nl)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new xi;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return bs(t,n).unknown(r)},Yt.apply(i,arguments),i}function oa(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ed(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Cr(){}var hr=.7,vi=1/hr,On="\\s*([+-]?\\d+)\\s*",fr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ft="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zy=/^#([0-9a-f]{3,8})$/,Fy=new RegExp(`^rgb\\(${On},${On},${On}\\)$`),By=new RegExp(`^rgb\\(${ft},${ft},${ft}\\)$`),Gy=new RegExp(`^rgba\\(${On},${On},${On},${fr}\\)$`),Uy=new RegExp(`^rgba\\(${ft},${ft},${ft},${fr}\\)$`),Vy=new RegExp(`^hsl\\(${fr},${ft},${ft}\\)$`),Yy=new RegExp(`^hsla\\(${fr},${ft},${ft},${fr}\\)$`),Ll={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};oa(Cr,pr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:zl,formatHex:zl,formatHex8:Wy,formatHsl:Hy,formatRgb:Fl,toString:Fl});function zl(){return this.rgb().formatHex()}function Wy(){return this.rgb().formatHex8()}function Hy(){return td(this).formatHsl()}function Fl(){return this.rgb().formatRgb()}function pr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=zy.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Bl(t):n===3?new Ge(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Wr(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Wr(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Fy.exec(e))?new Ge(t[1],t[2],t[3],1):(t=By.exec(e))?new Ge(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Gy.exec(e))?Wr(t[1],t[2],t[3],t[4]):(t=Uy.exec(e))?Wr(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Vy.exec(e))?Vl(t[1],t[2]/100,t[3]/100,1):(t=Yy.exec(e))?Vl(t[1],t[2]/100,t[3]/100,t[4]):Ll.hasOwnProperty(e)?Bl(Ll[e]):e==="transparent"?new Ge(NaN,NaN,NaN,0):null}function Bl(e){return new Ge(e>>16&255,e>>8&255,e&255,1)}function Wr(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ge(e,t,n,r)}function qy(e){return e instanceof Cr||(e=pr(e)),e?(e=e.rgb(),new Ge(e.r,e.g,e.b,e.opacity)):new Ge}function vs(e,t,n,r){return arguments.length===1?qy(e):new Ge(e,t,n,r??1)}function Ge(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}oa(Ge,vs,ed(Cr,{brighter(e){return e=e==null?vi:Math.pow(vi,e),new Ge(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?hr:Math.pow(hr,e),new Ge(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ge(sn(this.r),sn(this.g),sn(this.b),Si(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Gl,formatHex:Gl,formatHex8:Ky,formatRgb:Ul,toString:Ul}));function Gl(){return`#${en(this.r)}${en(this.g)}${en(this.b)}`}function Ky(){return`#${en(this.r)}${en(this.g)}${en(this.b)}${en((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ul(){const e=Si(this.opacity);return`${e===1?"rgb(":"rgba("}${sn(this.r)}, ${sn(this.g)}, ${sn(this.b)}${e===1?")":`, ${e})`}`}function Si(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function sn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function en(e){return e=sn(e),(e<16?"0":"")+e.toString(16)}function Vl(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new tt(e,t,n,r)}function td(e){if(e instanceof tt)return new tt(e.h,e.s,e.l,e.opacity);if(e instanceof Cr||(e=pr(e)),!e)return new tt;if(e instanceof tt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(t===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new tt(s,a,l,e.opacity)}function Jy(e,t,n,r){return arguments.length===1?td(e):new tt(e,t,n,r??1)}function tt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}oa(tt,Jy,ed(Cr,{brighter(e){return e=e==null?vi:Math.pow(vi,e),new tt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?hr:Math.pow(hr,e),new tt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ge(Wo(e>=240?e-240:e+120,i,r),Wo(e,i,r),Wo(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new tt(Yl(this.h),Hr(this.s),Hr(this.l),Si(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Si(this.opacity);return`${e===1?"hsl(":"hsla("}${Yl(this.h)}, ${Hr(this.s)*100}%, ${Hr(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Yl(e){return e=(e||0)%360,e<0?e+360:e}function Hr(e){return Math.max(0,Math.min(1,e||0))}function Wo(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const sa=e=>()=>e;function Xy(e,t){return function(n){return e+n*t}}function Zy(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Qy(e){return(e=+e)==1?nd:function(t,n){return n-t?Zy(t,n,e):sa(isNaN(t)?n:t)}}function nd(e,t){var n=t-e;return n?Xy(e,n):sa(isNaN(e)?t:e)}const Wl=(function e(t){var n=Qy(t);function r(i,o){var s=n((i=vs(i)).r,(o=vs(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),u=nd(i.opacity,o.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r})(1);function ex(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function tx(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function nx(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),s;for(s=0;s<r;++s)i[s]=oo(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(a){for(s=0;s<r;++s)o[s]=i[s](a);return o}}function aa(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function nt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function rx(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=oo(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var Ss=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ho=new RegExp(Ss.source,"g");function ix(e){return function(){return e}}function ox(e){return function(t){return e(t)+""}}function sx(e,t){var n=Ss.lastIndex=Ho.lastIndex=0,r,i,o,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=Ss.exec(e))&&(i=Ho.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:nt(r,i)})),n=Ho.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?ox(l[0].x):ix(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)a[(d=l[c]).i]=d.x(u);return a.join("")})}function oo(e,t){var n=typeof t,r;return t==null||n==="boolean"?sa(t):(n==="number"?nt:n==="string"?(r=pr(t))?(t=r,Wl):sx:t instanceof pr?Wl:t instanceof Date?aa:tx(t)?ex:Array.isArray(t)?nx:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?rx:nt)(e,t)}function rd(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function ax(e){return function(){return e}}function lx(e){return+e}var Hl=[0,1];function Ke(e){return e}function Es(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:ax(isNaN(t)?NaN:.5)}function ux(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function cx(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=Es(i,r),o=n(s,o)):(r=Es(r,i),o=n(o,s)),function(a){return o(r(a))}}function dx(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=Es(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(a){var l=Qc(e,a,1,r)-1;return o[l](i[l](a))}}function Mr(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function so(){var e=Hl,t=Hl,n=oo,r,i,o,s=Ke,a,l,u;function c(){var h=Math.min(e.length,t.length);return s!==Ke&&(s=ux(e[0],e[h-1])),a=h>2?dx:cx,l=u=null,d}function d(h){return h==null||isNaN(h=+h)?o:(l||(l=a(e.map(r),t,n)))(r(s(h)))}return d.invert=function(h){return s(i((u||(u=a(t,e.map(r),nt)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,lx),c()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),c()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),n=rd,c()},d.clamp=function(h){return arguments.length?(s=h?!0:Ke,c()):s!==Ke},d.interpolate=function(h){return arguments.length?(n=h,c()):n},d.unknown=function(h){return arguments.length?(o=h,d):o},function(h,f){return r=h,i=f,c()}}function id(){return so()(Ke,Ke)}function hx(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ei(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Ln(e){return e=Ei(Math.abs(e)),e?e[1]:NaN}function fx(e,t){return function(n,r){for(var i=n.length,o=[],s=0,a=e[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(n.substring(i-=a,i+a)),!((l+=a+1)>r));)a=e[s=(s+1)%e.length];return o.reverse().join(t)}}function px(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var mx=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function mr(e){if(!(t=mx.exec(e)))throw new Error("invalid format: "+e);var t;return new la({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}mr.prototype=la.prototype;function la(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}la.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function gx(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var od;function yx(e,t){var n=Ei(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(od=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Ei(e,Math.max(0,t+o-1))[0]}function ql(e,t){var n=Ei(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Kl={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:hx,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>ql(e*100,t),r:ql,s:yx,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Jl(e){return e}var Xl=Array.prototype.map,Zl=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function xx(e){var t=e.grouping===void 0||e.thousands===void 0?Jl:fx(Xl.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?Jl:px(Xl.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(d){d=mr(d);var h=d.fill,f=d.align,m=d.sign,p=d.symbol,y=d.zero,b=d.width,E=d.comma,T=d.precision,w=d.trim,C=d.type;C==="n"?(E=!0,C="g"):Kl[C]||(T===void 0&&(T=12),w=!0,C="g"),(y||h==="0"&&f==="=")&&(y=!0,h="0",f="=");var S=p==="$"?n:p==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():"",R=p==="$"?r:/[%p]/.test(C)?s:"",I=Kl[C],k=/[defgprs%]/.test(C);T=T===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,T)):Math.max(0,Math.min(20,T));function z(P){var v=S,_=R,A,B,G;if(C==="c")_=I(P)+_,P="";else{P=+P;var Z=P<0||1/P<0;if(P=isNaN(P)?l:I(Math.abs(P),T),w&&(P=gx(P)),Z&&+P==0&&m!=="+"&&(Z=!1),v=(Z?m==="("?m:a:m==="-"||m==="("?"":m)+v,_=(C==="s"?Zl[8+od/3]:"")+_+(Z&&m==="("?")":""),k){for(A=-1,B=P.length;++A<B;)if(G=P.charCodeAt(A),48>G||G>57){_=(G===46?i+P.slice(A+1):P.slice(A))+_,P=P.slice(0,A);break}}}E&&!y&&(P=t(P,1/0));var Y=v.length+P.length+_.length,te=Y<b?new Array(b-Y+1).join(h):"";switch(E&&y&&(P=t(te+P,te.length?b-_.length:1/0),te=""),f){case"<":P=v+P+_+te;break;case"=":P=v+te+P+_;break;case"^":P=te.slice(0,Y=te.length>>1)+v+P+_+te.slice(Y);break;default:P=te+v+P+_;break}return o(P)}return z.toString=function(){return d+""},z}function c(d,h){var f=u((d=mr(d),d.type="f",d)),m=Math.max(-8,Math.min(8,Math.floor(Ln(h)/3)))*3,p=Math.pow(10,-m),y=Zl[8+m/3];return function(b){return f(p*b)+y}}return{format:u,formatPrefix:c}}var qr,ua,sd;bx({thousands:",",grouping:[3],currency:["$",""]});function bx(e){return qr=xx(e),ua=qr.format,sd=qr.formatPrefix,qr}function vx(e){return Math.max(0,-Ln(Math.abs(e)))}function Sx(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ln(t)/3)))*3-Ln(Math.abs(e)))}function Ex(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ln(t)-Ln(e))+1}function Tx(e,t,n,r){var i=xs(e,t,n),o;switch(r=mr(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=Sx(i,s))&&(r.precision=o),sd(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Ex(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=vx(i))&&(r.precision=o-(r.type==="%")*2);break}}return ua(r)}function ao(e){var t=e.domain;return e.ticks=function(n){var r=t();return gs(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Tx(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,s=r[i],a=r[o],l,u,c=10;for(a<s&&(u=s,s=a,a=u,u=i,i=o,o=u);c-- >0;){if(u=ys(s,a,n),u===l)return r[i]=s,r[o]=a,t(r);if(u>0)s=Math.floor(s/u)*u,a=Math.ceil(a/u)*u;else if(u<0)s=Math.ceil(s*u)/u,a=Math.floor(a*u)/u;else break;l=u}return e},e}function ca(){var e=id();return e.copy=function(){return Mr(e,ca())},Yt.apply(e,arguments),ao(e)}function ad(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],s;return o<i&&(s=n,n=r,r=s,s=i,i=o,o=s),e[n]=t.floor(i),e[r]=t.ceil(o),e}function Ql(e){return Math.log(e)}function eu(e){return Math.exp(e)}function wx(e){return-Math.log(-e)}function Cx(e){return-Math.exp(-e)}function Mx(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Rx(e){return e===10?Mx:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Ax(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function tu(e){return(t,n)=>-e(-t,n)}function _x(e){const t=e(Ql,eu),n=t.domain;let r=10,i,o;function s(){return i=Ax(r),o=Rx(r),n()[0]<0?(i=tu(i),o=tu(o),e(wx,Cx)):e(Ql,eu),t}return t.base=function(a){return arguments.length?(r=+a,s()):r},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{const l=n();let u=l[0],c=l[l.length-1];const d=c<u;d&&([u,c]=[c,u]);let h=i(u),f=i(c),m,p;const y=a==null?10:+a;let b=[];if(!(r%1)&&f-h<y){if(h=Math.floor(h),f=Math.ceil(f),u>0){for(;h<=f;++h)for(m=1;m<r;++m)if(p=h<0?m/o(-h):m*o(h),!(p<u)){if(p>c)break;b.push(p)}}else for(;h<=f;++h)for(m=r-1;m>=1;--m)if(p=h>0?m/o(-h):m*o(h),!(p<u)){if(p>c)break;b.push(p)}b.length*2<y&&(b=gs(u,c,y))}else b=gs(h,f,Math.min(f-h,y)).map(o);return d?b.reverse():b},t.tickFormat=(a,l)=>{if(a==null&&(a=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=mr(l)).precision==null&&(l.trim=!0),l=ua(l)),a===1/0)return l;const u=Math.max(1,r*a/t.ticks().length);return c=>{let d=c/o(Math.round(i(c)));return d*r<r-.5&&(d*=r),d<=u?l(c):""}},t.nice=()=>n(ad(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),t}function Ti(){const e=_x(so()).domain([1,10]);return e.copy=()=>Mr(e,Ti()).base(e.base()),Yt.apply(e,arguments),e}function nu(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function ru(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Ix(e){var t=1,n=e(nu(t),ru(t));return n.constant=function(r){return arguments.length?e(nu(t=+r),ru(t)):t},ao(n)}function ld(){var e=Ix(so());return e.copy=function(){return Mr(e,ld()).constant(e.constant())},Yt.apply(e,arguments)}function iu(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function jx(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function kx(e){return e<0?-e*e:e*e}function Ox(e){var t=e(Ke,Ke),n=1;function r(){return n===1?e(Ke,Ke):n===.5?e(jx,kx):e(iu(n),iu(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},ao(t)}function da(){var e=Ox(so());return e.copy=function(){return Mr(e,da()).exponent(e.exponent())},Yt.apply(e,arguments),e}function Px(){return da.apply(null,arguments).exponent(.5)}function ud(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[Qc(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return ud().domain(e).range(t).unknown(n)},Yt.apply(i,arguments)}const qo=new Date,Ko=new Date;function Te(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const s=i(o),a=i.ceil(o);return o-s<a-o?s:a},i.offset=(o,s)=>(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{const l=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return l;let u;do l.push(u=new Date(+o)),t(o,a),e(o);while(u<o&&o<s);return l},i.filter=o=>Te(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;t(s,-1),!o(s););else for(;--a>=0;)for(;t(s,1),!o(s););}),n&&(i.count=(o,s)=>(qo.setTime(+o),Ko.setTime(+s),e(qo),e(Ko),Math.floor(n(qo,Ko))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const wi=Te(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);wi.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Te(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):wi);wi.range;const Tt=1e3,Je=Tt*60,wt=Je*60,Mt=wt*24,ha=Mt*7,ou=Mt*30,Jo=Mt*365,tn=Te(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Tt)},(e,t)=>(t-e)/Tt,e=>e.getUTCSeconds());tn.range;const fa=Te(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Tt)},(e,t)=>{e.setTime(+e+t*Je)},(e,t)=>(t-e)/Je,e=>e.getMinutes());fa.range;const pa=Te(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Je)},(e,t)=>(t-e)/Je,e=>e.getUTCMinutes());pa.range;const ma=Te(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Tt-e.getMinutes()*Je)},(e,t)=>{e.setTime(+e+t*wt)},(e,t)=>(t-e)/wt,e=>e.getHours());ma.range;const ga=Te(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*wt)},(e,t)=>(t-e)/wt,e=>e.getUTCHours());ga.range;const Rr=Te(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Je)/Mt,e=>e.getDate()-1);Rr.range;const lo=Te(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Mt,e=>e.getUTCDate()-1);lo.range;const cd=Te(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Mt,e=>Math.floor(e/Mt));cd.range;function pn(e){return Te(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Je)/ha)}const uo=pn(0),Ci=pn(1),Dx=pn(2),$x=pn(3),zn=pn(4),Nx=pn(5),Lx=pn(6);uo.range;Ci.range;Dx.range;$x.range;zn.range;Nx.range;Lx.range;function mn(e){return Te(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/ha)}const co=mn(0),Mi=mn(1),zx=mn(2),Fx=mn(3),Fn=mn(4),Bx=mn(5),Gx=mn(6);co.range;Mi.range;zx.range;Fx.range;Fn.range;Bx.range;Gx.range;const ya=Te(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());ya.range;const xa=Te(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());xa.range;const Rt=Te(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Rt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Te(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Rt.range;const At=Te(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());At.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Te(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});At.range;function dd(e,t,n,r,i,o){const s=[[tn,1,Tt],[tn,5,5*Tt],[tn,15,15*Tt],[tn,30,30*Tt],[o,1,Je],[o,5,5*Je],[o,15,15*Je],[o,30,30*Je],[i,1,wt],[i,3,3*wt],[i,6,6*wt],[i,12,12*wt],[r,1,Mt],[r,2,2*Mt],[n,1,ha],[t,1,ou],[t,3,3*ou],[e,1,Jo]];function a(u,c,d){const h=c<u;h&&([u,c]=[c,u]);const f=d&&typeof d.range=="function"?d:l(u,c,d),m=f?f.range(u,+c+1):[];return h?m.reverse():m}function l(u,c,d){const h=Math.abs(c-u)/d,f=ia(([,,y])=>y).right(s,h);if(f===s.length)return e.every(xs(u/Jo,c/Jo,d));if(f===0)return wi.every(Math.max(xs(u,c,d),1));const[m,p]=s[h/s[f-1][2]<s[f][2]/h?f-1:f];return m.every(p)}return[a,l]}const[Ux,Vx]=dd(At,xa,co,cd,ga,pa),[Yx,Wx]=dd(Rt,ya,uo,Rr,ma,fa);function Xo(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Zo(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Jn(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Hx(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,s=e.shortDays,a=e.months,l=e.shortMonths,u=Xn(i),c=Zn(i),d=Xn(o),h=Zn(o),f=Xn(s),m=Zn(s),p=Xn(a),y=Zn(a),b=Xn(l),E=Zn(l),T={a:Z,A:Y,b:te,B:we,c:null,d:du,e:du,f:g0,g:M0,G:A0,H:f0,I:p0,j:m0,L:hd,m:y0,M:x0,p:V,q:xe,Q:pu,s:mu,S:b0,u:v0,U:S0,V:E0,w:T0,W:w0,x:null,X:null,y:C0,Y:R0,Z:_0,"%":fu},w={a:Pe,A:xt,b:ke,B:bt,c:null,d:hu,e:hu,f:O0,g:U0,G:Y0,H:I0,I:j0,j:k0,L:pd,m:P0,M:D0,p:st,q:Ue,Q:pu,s:mu,S:$0,u:N0,U:L0,V:z0,w:F0,W:B0,x:null,X:null,y:G0,Y:V0,Z:W0,"%":fu},C={a:z,A:P,b:v,B:_,c:A,d:uu,e:uu,f:u0,g:lu,G:au,H:cu,I:cu,j:o0,L:l0,m:i0,M:s0,p:k,q:r0,Q:d0,s:h0,S:a0,u:Zx,U:Qx,V:e0,w:Xx,W:t0,x:B,X:G,y:lu,Y:au,Z:n0,"%":c0};T.x=S(n,T),T.X=S(r,T),T.c=S(t,T),w.x=S(n,w),w.X=S(r,w),w.c=S(t,w);function S(F,q){return function(X){var $=[],re=-1,Q=0,Ae=F.length,Ce,pe,kt;for(X instanceof Date||(X=new Date(+X));++re<Ae;)F.charCodeAt(re)===37&&($.push(F.slice(Q,re)),(pe=su[Ce=F.charAt(++re)])!=null?Ce=F.charAt(++re):pe=Ce==="e"?" ":"0",(kt=q[Ce])&&(Ce=kt(X,pe)),$.push(Ce),Q=re+1);return $.push(F.slice(Q,re)),$.join("")}}function R(F,q){return function(X){var $=Jn(1900,void 0,1),re=I($,F,X+="",0),Q,Ae;if(re!=X.length)return null;if("Q"in $)return new Date($.Q);if("s"in $)return new Date($.s*1e3+("L"in $?$.L:0));if(q&&!("Z"in $)&&($.Z=0),"p"in $&&($.H=$.H%12+$.p*12),$.m===void 0&&($.m="q"in $?$.q:0),"V"in $){if($.V<1||$.V>53)return null;"w"in $||($.w=1),"Z"in $?(Q=Zo(Jn($.y,0,1)),Ae=Q.getUTCDay(),Q=Ae>4||Ae===0?Mi.ceil(Q):Mi(Q),Q=lo.offset(Q,($.V-1)*7),$.y=Q.getUTCFullYear(),$.m=Q.getUTCMonth(),$.d=Q.getUTCDate()+($.w+6)%7):(Q=Xo(Jn($.y,0,1)),Ae=Q.getDay(),Q=Ae>4||Ae===0?Ci.ceil(Q):Ci(Q),Q=Rr.offset(Q,($.V-1)*7),$.y=Q.getFullYear(),$.m=Q.getMonth(),$.d=Q.getDate()+($.w+6)%7)}else("W"in $||"U"in $)&&("w"in $||($.w="u"in $?$.u%7:"W"in $?1:0),Ae="Z"in $?Zo(Jn($.y,0,1)).getUTCDay():Xo(Jn($.y,0,1)).getDay(),$.m=0,$.d="W"in $?($.w+6)%7+$.W*7-(Ae+5)%7:$.w+$.U*7-(Ae+6)%7);return"Z"in $?($.H+=$.Z/100|0,$.M+=$.Z%100,Zo($)):Xo($)}}function I(F,q,X,$){for(var re=0,Q=q.length,Ae=X.length,Ce,pe;re<Q;){if($>=Ae)return-1;if(Ce=q.charCodeAt(re++),Ce===37){if(Ce=q.charAt(re++),pe=C[Ce in su?q.charAt(re++):Ce],!pe||($=pe(F,X,$))<0)return-1}else if(Ce!=X.charCodeAt($++))return-1}return $}function k(F,q,X){var $=u.exec(q.slice(X));return $?(F.p=c.get($[0].toLowerCase()),X+$[0].length):-1}function z(F,q,X){var $=f.exec(q.slice(X));return $?(F.w=m.get($[0].toLowerCase()),X+$[0].length):-1}function P(F,q,X){var $=d.exec(q.slice(X));return $?(F.w=h.get($[0].toLowerCase()),X+$[0].length):-1}function v(F,q,X){var $=b.exec(q.slice(X));return $?(F.m=E.get($[0].toLowerCase()),X+$[0].length):-1}function _(F,q,X){var $=p.exec(q.slice(X));return $?(F.m=y.get($[0].toLowerCase()),X+$[0].length):-1}function A(F,q,X){return I(F,t,q,X)}function B(F,q,X){return I(F,n,q,X)}function G(F,q,X){return I(F,r,q,X)}function Z(F){return s[F.getDay()]}function Y(F){return o[F.getDay()]}function te(F){return l[F.getMonth()]}function we(F){return a[F.getMonth()]}function V(F){return i[+(F.getHours()>=12)]}function xe(F){return 1+~~(F.getMonth()/3)}function Pe(F){return s[F.getUTCDay()]}function xt(F){return o[F.getUTCDay()]}function ke(F){return l[F.getUTCMonth()]}function bt(F){return a[F.getUTCMonth()]}function st(F){return i[+(F.getUTCHours()>=12)]}function Ue(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var q=S(F+="",T);return q.toString=function(){return F},q},parse:function(F){var q=R(F+="",!1);return q.toString=function(){return F},q},utcFormat:function(F){var q=S(F+="",w);return q.toString=function(){return F},q},utcParse:function(F){var q=R(F+="",!0);return q.toString=function(){return F},q}}}var su={"-":"",_:" ",0:"0"},Re=/^\s*\d+/,qx=/^%/,Kx=/[\\^$*+?|[\]().{}]/g;function ne(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function Jx(e){return e.replace(Kx,"\\$&")}function Xn(e){return new RegExp("^(?:"+e.map(Jx).join("|")+")","i")}function Zn(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Xx(e,t,n){var r=Re.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Zx(e,t,n){var r=Re.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Qx(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function e0(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function t0(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function au(e,t,n){var r=Re.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function lu(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function n0(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function r0(e,t,n){var r=Re.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function i0(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function uu(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function o0(e,t,n){var r=Re.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function cu(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function s0(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function a0(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function l0(e,t,n){var r=Re.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function u0(e,t,n){var r=Re.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function c0(e,t,n){var r=qx.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function d0(e,t,n){var r=Re.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function h0(e,t,n){var r=Re.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function du(e,t){return ne(e.getDate(),t,2)}function f0(e,t){return ne(e.getHours(),t,2)}function p0(e,t){return ne(e.getHours()%12||12,t,2)}function m0(e,t){return ne(1+Rr.count(Rt(e),e),t,3)}function hd(e,t){return ne(e.getMilliseconds(),t,3)}function g0(e,t){return hd(e,t)+"000"}function y0(e,t){return ne(e.getMonth()+1,t,2)}function x0(e,t){return ne(e.getMinutes(),t,2)}function b0(e,t){return ne(e.getSeconds(),t,2)}function v0(e){var t=e.getDay();return t===0?7:t}function S0(e,t){return ne(uo.count(Rt(e)-1,e),t,2)}function fd(e){var t=e.getDay();return t>=4||t===0?zn(e):zn.ceil(e)}function E0(e,t){return e=fd(e),ne(zn.count(Rt(e),e)+(Rt(e).getDay()===4),t,2)}function T0(e){return e.getDay()}function w0(e,t){return ne(Ci.count(Rt(e)-1,e),t,2)}function C0(e,t){return ne(e.getFullYear()%100,t,2)}function M0(e,t){return e=fd(e),ne(e.getFullYear()%100,t,2)}function R0(e,t){return ne(e.getFullYear()%1e4,t,4)}function A0(e,t){var n=e.getDay();return e=n>=4||n===0?zn(e):zn.ceil(e),ne(e.getFullYear()%1e4,t,4)}function _0(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ne(t/60|0,"0",2)+ne(t%60,"0",2)}function hu(e,t){return ne(e.getUTCDate(),t,2)}function I0(e,t){return ne(e.getUTCHours(),t,2)}function j0(e,t){return ne(e.getUTCHours()%12||12,t,2)}function k0(e,t){return ne(1+lo.count(At(e),e),t,3)}function pd(e,t){return ne(e.getUTCMilliseconds(),t,3)}function O0(e,t){return pd(e,t)+"000"}function P0(e,t){return ne(e.getUTCMonth()+1,t,2)}function D0(e,t){return ne(e.getUTCMinutes(),t,2)}function $0(e,t){return ne(e.getUTCSeconds(),t,2)}function N0(e){var t=e.getUTCDay();return t===0?7:t}function L0(e,t){return ne(co.count(At(e)-1,e),t,2)}function md(e){var t=e.getUTCDay();return t>=4||t===0?Fn(e):Fn.ceil(e)}function z0(e,t){return e=md(e),ne(Fn.count(At(e),e)+(At(e).getUTCDay()===4),t,2)}function F0(e){return e.getUTCDay()}function B0(e,t){return ne(Mi.count(At(e)-1,e),t,2)}function G0(e,t){return ne(e.getUTCFullYear()%100,t,2)}function U0(e,t){return e=md(e),ne(e.getUTCFullYear()%100,t,2)}function V0(e,t){return ne(e.getUTCFullYear()%1e4,t,4)}function Y0(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Fn(e):Fn.ceil(e),ne(e.getUTCFullYear()%1e4,t,4)}function W0(){return"+0000"}function fu(){return"%"}function pu(e){return+e}function mu(e){return Math.floor(+e/1e3)}var Rn,gd,yd;H0({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function H0(e){return Rn=Hx(e),gd=Rn.format,Rn.parse,yd=Rn.utcFormat,Rn.utcParse,Rn}function q0(e){return new Date(e)}function K0(e){return e instanceof Date?+e:+new Date(+e)}function ba(e,t,n,r,i,o,s,a,l,u){var c=id(),d=c.invert,h=c.domain,f=u(".%L"),m=u(":%S"),p=u("%I:%M"),y=u("%I %p"),b=u("%a %d"),E=u("%b %d"),T=u("%B"),w=u("%Y");function C(S){return(l(S)<S?f:a(S)<S?m:s(S)<S?p:o(S)<S?y:r(S)<S?i(S)<S?b:E:n(S)<S?T:w)(S)}return c.invert=function(S){return new Date(d(S))},c.domain=function(S){return arguments.length?h(Array.from(S,K0)):h().map(q0)},c.ticks=function(S){var R=h();return e(R[0],R[R.length-1],S??10)},c.tickFormat=function(S,R){return R==null?C:u(R)},c.nice=function(S){var R=h();return(!S||typeof S.range!="function")&&(S=t(R[0],R[R.length-1],S??10)),S?h(ad(R,S)):c},c.copy=function(){return Mr(c,ba(e,t,n,r,i,o,s,a,l,u))},c}function xd(){return Yt.apply(ba(Yx,Wx,Rt,ya,uo,Rr,ma,fa,tn,gd).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function J0(){return Yt.apply(ba(Ux,Vx,At,xa,co,lo,ga,pa,tn,yd).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function X0(){var e=0,t=1,n,r,i,o,s=Ke,a=!1,l;function u(d){return d==null||isNaN(d=+d)?l:s(i===0?.5:(d=(o(d)-n)*i,a?Math.max(0,Math.min(1,d)):d))}u.domain=function(d){return arguments.length?([e,t]=d,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(d){return arguments.length?(a=!!d,u):a},u.interpolator=function(d){return arguments.length?(s=d,u):s};function c(d){return function(h){var f,m;return arguments.length?([f,m]=h,s=d(f,m),u):[s(0),s(1)]}}return u.range=c(oo),u.rangeRound=c(rd),u.unknown=function(d){return arguments.length?(l=d,u):l},function(d){return o=d,n=d(e),r=d(t),i=n===r?0:1/(r-n),u}}function Z0(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function bd(){var e=ao(X0()(Ke));return e.copy=function(){return Z0(e,bd())},Ly.apply(e,arguments)}function vd(e){return e.type==="piecewise"?ud(e.thresholds,e.colors):bd([e.min??0,e.max??100],e.color)}function Ri(e){return e.values?bs(e.values,e.colors).unknown(e.unknownColor??null):bs(e.colors.map((t,n)=>n),e.colors).unknown(e.unknownColor??null)}function Ts(e){return e.type==="ordinal"?Ri(e):vd(e)}function va(e,t,n){const{tickMaxStep:r,tickMinStep:i,tickNumber:o}=e,s=i===void 0?999:Math.floor(Math.abs(t[1]-t[0])/i),a=r===void 0?2:Math.ceil(Math.abs(t[1]-t[0])/r);return Math.min(s,Math.max(a,o??n))}function Q0(e,t){return t[1]-t[0]===0?1:e/((t[1]-t[0])/100)}function Sd(e){return Math.floor(Math.abs(e)/50)}function gu(e){return Array.isArray(e)?JSON.stringify(e):typeof e=="object"&&e!==null?e.valueOf():e}function Sa(...e){let t=new xi(void 0,gu),n=[],r=[],i=0,o=1,s,a,l=!1,u=0,c=0,d=.5;const h=y=>{const b=t.get(y);if(b!==void 0)return r[b%r.length]},f=()=>{const y=n.length,b=o<i,E=b?o:i,T=b?i:o;s=(T-E)/Math.max(1,y-u+c*2),l&&(s=Math.floor(s));const w=E+(T-E-s*(y-u))*d;a=s*(1-u);const C=l?Math.round(w):w;a=l?Math.round(a):a;const R=Ny(y).map(I=>C+s*I);return r=b?R.reverse():R,h};h.domain=function(y){if(!arguments.length)return n.slice();n=[],t=new xi(void 0,gu);for(const b of y)t.has(b)||t.set(b,n.push(b)-1);return f()},h.range=function(y){if(!arguments.length)return[i,o];const[b,E]=y;return i=+b,o=+E,f()},h.rangeRound=function(y){const[b,E]=y;return i=+b,o=+E,l=!0,f()},h.bandwidth=function(){return a},h.step=function(){return s},h.round=function(y){return arguments.length?(l=!!y,f()):l},h.padding=function(y){return arguments.length?(u=Math.min(1,c=+y),f()):u},h.paddingInner=function(y){return arguments.length?(u=Math.min(1,y),f()):u},h.paddingOuter=function(y){return arguments.length?(c=+y,f()):c},h.align=function(y){return arguments.length?(d=Math.max(0,Math.min(1,y)),f()):d},h.copy=()=>Sa(n,[i,o]).round(l).paddingInner(u).paddingOuter(c).align(d);const[m,p]=e;return e.length>1?(h.domain(m),h.range(p)):m?h.range(m):f(),h}function eb(...e){const t=Sa(...e).paddingInner(1),n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=()=>{const r=n();return r.padding=r.paddingOuter,delete r.paddingInner,delete r.paddingOuter,r.copy=t.copy,r},t}function Ed(...e){const t=ld(...e),n=t.ticks,{negativeScale:r,linearScale:i,positiveScale:o}=tb(t);return t.ticks=s=>{const a=n(s),l=t.constant();let u=0,c=0,d=0;a.forEach(f=>{f>-l&&f<l&&(c+=1),f<=-l&&(u+=1),f>=l&&(d+=1)});const h=[];if(u>0&&h.push(...r.ticks(u)),c>0){const f=i.ticks(c);h.at(-1)===f[0]?h.push(...f.slice(1)):h.push(...f)}if(d>0){const f=o.ticks(d);h.at(-1)===f[0]?h.push(...f.slice(1)):h.push(...f)}return h},t.tickFormat=(s=10,a)=>{const l=t.constant(),[u,c]=t.domain(),d=c-u,h=r.domain(),f=h[1]-h[0],p=(d===0?0:f/d)*s,y=i.domain(),b=y[1]-y[0],T=(d===0?0:b/d)*s,w=o.domain(),C=w[1]-w[0],R=(d===0?0:C/d)*s,I=r.tickFormat(p,a),k=i.tickFormat(T,a),z=o.tickFormat(R,a);return P=>(P.valueOf()<=-l?I:P.valueOf()>=l?z:k)(P)},t.copy=()=>Ed(t.domain(),t.range()).constant(t.constant()),t}function tb(e){const t=e.constant(),n=e.domain(),r=[n[0],Math.min(n[1],-t)],i=Ti(r,e.range()),o=[Math.max(n[0],-t),Math.min(n[1],t)],s=ca(o,e.range()),a=[Math.max(n[0],t),n[1]],l=Ti(a,e.range());return{negativeScale:i,linearScale:s,positiveScale:l}}function Ea(e,t,n){switch(e){case"log":return Ti(t,n);case"pow":return da(t,n);case"sqrt":return Px(t,n);case"time":return xd(t,n);case"utc":return J0(t,n);case"symlog":return Ed(t,n);default:return ca(t,n)}}const nb=e=>(e==null?void 0:e[0])instanceof Date;function rb(e,t,n){const r=xd(e,t);return(i,{location:o})=>o==="tick"?r.tickFormat(n)(i):`${i.toLocaleString()}`}let yu,xu;class ib{constructor(){W(this,"types",new Set);if(yu)throw new Error("You can only create one instance!");yu=this.types}addType(t){this.types.add(t)}getTypes(){return this.types}}class ob{constructor(){W(this,"types",new Set);if(xu)throw new Error("You can only create one instance!");xu=this.types}addType(t){this.types.add(t)}getTypes(){return this.types}}const ho=new ib;ho.addType("bar");ho.addType("line");ho.addType("scatter");const sb=new ob;sb.addType("radar");function Td(e){return ho.getTypes().has(e)}const ab=(e,t,n,r)=>{const i=new Set;return Object.keys(t).filter(Td).forEach(s=>{var u,c,d;const a=((u=n[s])==null?void 0:u.series)??{},l=(d=(c=t[s]).axisTooltipGetter)==null?void 0:d.call(c,a);l!==void 0&&l.forEach(({axisId:h,direction:f})=>{f===e&&i.add(h??r)})}),i};function Ar(e){return e.bandwidth!==void 0}function lb(e){return Ar(e)&&e.paddingOuter!==void 0}function ub(e,t,n){const r=t==="x"?[e.left,e.left+e.width]:[e.top+e.height,e.top];return n?[r[1],r[0]]:r}function cb(e,t){return e.step()*t<.1}const db=.2,hb=.1;function wd({scales:e,drawingArea:t,formattedSeries:n,axis:r,seriesConfig:i,axisDirection:o,zoomMap:s,domains:a}){if(r===void 0)return{axis:{},axisIds:[]};const l=ab(o,i,n,r[0].id),u={};return r.forEach(c=>{const d=c,h=e[d.id],f=s==null?void 0:s.get(d.id),m=f?[f.start,f.end]:[0,100],p=ub(t,o,d.reverse??!1),y=a[d.id].tickNumber,b=!d.ignoreTooltip&&l.has(d.id),E=Q0(y,m),T=d.data??[];if(Ar(h)){const S=o==="y"?[p[1],p[0]]:p;if(lb(h)&&Yn(d)){const R=d.categoryGapRatio??db,I=cb(h,R),k=I?0:R,z=I?0:d.barGapRatio??hb;u[d.id]=L({offset:0,height:0,categoryGapRatio:k,barGapRatio:z,triggerTooltip:b},d,{data:T,scale:I?h.copy().padding(0):h,tickNumber:E,colorScale:d.colorMap&&(d.colorMap.type==="ordinal"?Ri(L({values:d.data},d.colorMap)):Ts(d.colorMap))})}if(Wn(d)&&(u[d.id]=L({offset:0,height:0,triggerTooltip:b},d,{data:T,scale:h,tickNumber:E,colorScale:d.colorMap&&(d.colorMap.type==="ordinal"?Ri(L({values:d.data},d.colorMap)):Ts(d.colorMap))})),nb(d.data)){const R=rb(d.data,S,d.tickNumber);u[d.id].valueFormatter=d.valueFormatter??R}return}if(d.scaleType==="band"||d.scaleType==="point")return;const w=d,C=w.scaleType??"linear";u[d.id]=L({offset:0,height:0,triggerTooltip:b},w,{data:T,scaleType:C,scale:h,tickNumber:E,colorScale:w.colorMap&&vd(w.colorMap),valueFormatter:d.valueFormatter??Cy(E,Ea(C,p.map(S=>h.invert(S)),p))})}),{axis:u,axisIds:r.map(({id:c})=>c)}}function fb(e){return e!=null}function pb(e,t,n,r){const i=(e==null?void 0:e.length)??0,o=Math.floor(t*i/100),s=Math.ceil(n*i/100);return function(l,u){return(l[r]??(e==null?void 0:e[u]))==null?!0:u>=o&&u<s}}function mb(e,t,n,r,i){const o=e[0].valueOf(),s=e[1].valueOf(),a=o+t*(s-o)/100,l=o+n*(s-o)/100;return function(c,d){const h=c[r]??(i==null?void 0:i[d]);return h==null?!0:h>=a&&h<=l}}const gb=e=>({currentAxisId:t,seriesXAxisId:n,seriesYAxisId:r,isDefaultAxis:i})=>(o,s)=>{var u,c;return!(t===n?r:n)||i?((c=(u=Object.values(e??{}))[0])==null?void 0:c.call(u,o,s))??!0:[r,n].filter(d=>d!==t).map(d=>e[d??""]).filter(fb).every(d=>d(o,s))},bu=e=>(t=[])=>t.reduce((n,r)=>{const{zoom:i,id:o,reverse:s}=r,a=ra(i,o,e,s);return a&&(n[o]=a),n},{}),yb=.2;function Cd(e,t,n){const r=t==="x"?[e.left,e.left+e.width]:[e.top+e.height,e.top];return n.reverse?[r[1],r[0]]:r}function Md(e,t){const n=[0,1];if(Yn(e)){const o=e.categoryGapRatio??yb;return Sa(t,n).paddingInner(o).paddingOuter(o/2)}if(Wn(e))return eb(t,n);const r=e.scaleType??"linear",i=Ea(r,t,n);return My(e)&&e.constant!=null&&i.constant(e.constant),i}const Rd=(e,t)=>{const n=e[1]-e[0],r=t[1]-t[0],i=e[0]-t[0]*n/r,o=e[1]+(100-t[1])*n/r;return[i,o]},xb=(e,t,n,r,i,o,s)=>{var u;const a=n==="x"?r[e].xExtremumGetter:r[e].yExtremumGetter,l=((u=o[e])==null?void 0:u.series)??{};return(a==null?void 0:a({series:l,axis:t,axisIndex:i,isDefaultAxis:i===0,getFilters:s}))??[1/0,-1/0]};function fo(e,t,n,r,i,o){const s=Object.keys(n).filter(Td);let a=[1/0,-1/0];for(const l of s){const[u,c]=xb(l,e,t,n,r,i,o);a=[Math.min(a[0],u),Math.max(a[1],c)]}return Number.isNaN(a[0])||Number.isNaN(a[1])?[1/0,-1/0]:a}const bb=(e,t,n,r)=>{var i;if(e.domainLimit!==void 0)return e.domainLimit;if(t==="x")for(const o of((i=r.line)==null?void 0:i.seriesOrder)??[]){const s=r.line.series[o];if(s.xAxisId===e.id||s.xAxisId===void 0&&n===0)return"strict"}return"nice"};function Ad(e,t,n){return Ea(e??"linear",t,[0,1]).nice(n).domain()}function _d(e,t,n,r,[i,o],s,a){const l=jd(e,t,n,r,a);let u=kd(e,i,o);if(typeof l=="function"){const{min:d,max:h}=l(i.valueOf(),o.valueOf());u[0]=d,u[1]=h}const c=va(e,u,s);return l==="nice"&&(u=Ad(e.scaleType,u,c)),u=["min"in e?e.min??u[0]:u[0],"max"in e?e.max??u[1]:u[1]],{domain:u,tickNumber:c}}function Id(e,t,n,r,[i,o],s,a){const l=jd(e,t,n,r,a);let u=kd(e,i,o);if(typeof l=="function"){const{min:c,max:d}=l(i.valueOf(),o.valueOf());u[0]=c,u[1]=d}return l==="nice"&&(u=Ad(e.scaleType,u,s)),[e.min??u[0],e.max??u[1]]}function jd(e,t,n,r,i){return i?bb(e,t,n,r):e.domainLimit??"nice"}function kd(e,t,n){let r=t,i=n;return"max"in e&&e.max!=null&&e.max<t&&(r=e.max),"min"in e&&e.min!=null&&e.min>t&&(i=e.min),!("min"in e)&&!("max"in e)?[r,i]:[e.min??r,e.max??i]}class vb{constructor(){this.ids=[],this.values=[],this.length=0}clear(){this.length=0}push(t,n){let r=this.length++;for(;r>0;){const i=r-1>>1,o=this.values[i];if(n>=o)break;this.ids[r]=this.ids[i],this.values[r]=o,r=i}this.ids[r]=t,this.values[r]=n}pop(){if(this.length===0)return;const t=this.ids,n=this.values,r=t[0],i=--this.length;if(i>0){const o=t[i],s=n[i];let a=0;const l=i>>1;for(;a<l;){const u=(a<<1)+1,c=u+1,d=u+(+(c<i)&+(n[c]<n[u]));if(n[d]>=s)break;t[a]=t[d],n[a]=n[d],a=d}t[a]=o,n[a]=s}return r}peek(){return this.length>0?this.ids[0]:void 0}peekValue(){return this.length>0?this.values[0]:void 0}shrink(){this.ids.length=this.values.length=this.length}}const vu=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Qo=3;class Ta{static from(t,n=0){if(n%8!==0)throw new Error("byteOffset must be 8-byte aligned.");if(!t||t.byteLength===void 0||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[r,i]=new Uint8Array(t,n+0,2);if(r!==251)throw new Error("Data does not appear to be in a Flatbush format.");const o=i>>4;if(o!==Qo)throw new Error(`Got v${o} data when expected v${Qo}.`);const s=vu[i&15];if(!s)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(t,n+2,1),[l]=new Uint32Array(t,n+4,1);return new Ta(l,a,s,void 0,t,n)}constructor(t,n=16,r=Float64Array,i=ArrayBuffer,o,s=0){if(t===void 0)throw new Error("Missing required argument: numItems.");if(isNaN(t)||t<=0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.byteOffset=s;let a=t,l=a;this._levelBounds=[a*4];do a=Math.ceil(a/this.nodeSize),l+=a,this._levelBounds.push(l*4);while(a!==1);this.ArrayType=r,this.IndexArrayType=l<16384?Uint16Array:Uint32Array;const u=vu.indexOf(r),c=l*4*r.BYTES_PER_ELEMENT;if(u<0)throw new Error(`Unexpected typed array class: ${r}.`);if(o)this.data=o,this._boxes=new r(o,s+8,l*4),this._indices=new this.IndexArrayType(o,s+8+c,l),this._pos=l*4,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1];else{const d=this.data=new i(8+c+l*this.IndexArrayType.BYTES_PER_ELEMENT);this._boxes=new r(d,8,l*4),this._indices=new this.IndexArrayType(d,8+c,l),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(d,0,2).set([251,(Qo<<4)+u]),new Uint16Array(d,2,1)[0]=n,new Uint32Array(d,4,1)[0]=t}this._queue=new vb}add(t,n,r=t,i=n){const o=this._pos>>2,s=this._boxes;return this._indices[o]=o,s[this._pos++]=t,s[this._pos++]=n,s[this._pos++]=r,s[this._pos++]=i,t<this.minX&&(this.minX=t),n<this.minY&&(this.minY=n),r>this.maxX&&(this.maxX=r),i>this.maxY&&(this.maxY=i),o}finish(){if(this._pos>>2!==this.numItems)throw new Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);const t=this._boxes;if(this.numItems<=this.nodeSize){t[this._pos++]=this.minX,t[this._pos++]=this.minY,t[this._pos++]=this.maxX,t[this._pos++]=this.maxY;return}const n=this.maxX-this.minX||1,r=this.maxY-this.minY||1,i=new Uint32Array(this.numItems),o=65535;for(let s=0,a=0;s<this.numItems;s++){const l=t[a++],u=t[a++],c=t[a++],d=t[a++],h=Math.floor(o*((l+c)/2-this.minX)/n),f=Math.floor(o*((u+d)/2-this.minY)/r);i[s]=Tb(h,f)}ws(i,t,this._indices,0,this.numItems-1,this.nodeSize);for(let s=0,a=0;s<this._levelBounds.length-1;s++){const l=this._levelBounds[s];for(;a<l;){const u=a;let c=t[a++],d=t[a++],h=t[a++],f=t[a++];for(let m=1;m<this.nodeSize&&a<l;m++)c=Math.min(c,t[a++]),d=Math.min(d,t[a++]),h=Math.max(h,t[a++]),f=Math.max(f,t[a++]);this._indices[this._pos>>2]=u,t[this._pos++]=c,t[this._pos++]=d,t[this._pos++]=h,t[this._pos++]=f}}}search(t,n,r,i,o){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let s=this._boxes.length-4;const a=[],l=[];for(;s!==void 0;){const u=Math.min(s+this.nodeSize*4,Su(s,this._levelBounds));for(let c=s;c<u;c+=4){if(r<this._boxes[c]||i<this._boxes[c+1]||t>this._boxes[c+2]||n>this._boxes[c+3])continue;const d=this._indices[c>>2]|0;s>=this.numItems*4?a.push(d):(o===void 0||o(d))&&(l.push(d),l.push(this._boxes[c]),l.push(this._boxes[c+1]))}s=a.pop()}return l}neighbors(t,n,r=1/0,i=1/0,o,s=Sb){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let a=this._boxes.length-4;const l=this._queue,u=[];e:for(;a!==void 0;){const c=Math.min(a+this.nodeSize*4,Su(a,this._levelBounds));for(let d=a;d<c;d+=4){const h=this._indices[d>>2]|0,f=this._boxes[d],m=this._boxes[d+1],p=this._boxes[d+2],y=this._boxes[d+3],b=t<f?f-t:t>p?t-p:0,E=n<m?m-n:n>y?n-y:0,T=s(b,E);T>i||(a>=this.numItems*4?l.push(h<<1,T):(o===void 0||o(h))&&l.push((h<<1)+1,T))}for(;l.length&&l.peek()&1;)if(l.peekValue()>i||(u.push(l.pop()>>1),u.length===r))break e;a=l.length?l.pop()>>1:void 0}return l.clear(),u}}function Sb(e,t){return e*e+t*t}function Su(e,t){let n=0,r=t.length-1;for(;n<r;){const i=n+r>>1;t[i]>e?r=i:n=i+1}return t[n]}function ws(e,t,n,r,i,o){if(Math.floor(r/o)>=Math.floor(i/o))return;const s=e[r],a=e[r+i>>1],l=e[i];let u=l;const c=Math.max(s,a);l>c?u=c:c===s?u=Math.max(a,l):c===a&&(u=Math.max(s,l));let d=r-1,h=i+1;for(;;){do d++;while(e[d]<u);do h--;while(e[h]>u);if(d>=h)break;Eb(e,t,n,d,h)}ws(e,t,n,r,h,o),ws(e,t,n,h+1,i,o)}function Eb(e,t,n,r,i){const o=e[r];e[r]=e[i],e[i]=o;const s=4*r,a=4*i,l=t[s],u=t[s+1],c=t[s+2],d=t[s+3];t[s]=t[a],t[s+1]=t[a+1],t[s+2]=t[a+2],t[s+3]=t[a+3],t[a]=l,t[a+1]=u,t[a+2]=c,t[a+3]=d;const h=n[r];n[r]=n[i],n[i]=h}function Tb(e,t){let n=e^t,r=65535^n,i=65535^(e|t),o=e&(t^65535),s=n|r>>1,a=n>>1^n,l=i>>1^r&o>>1^i,u=n&i>>1^o>>1^o;n=s,r=a,i=l,o=u,s=n&n>>2^r&r>>2,a=n&r>>2^r&(n^r)>>2,l^=n&i>>2^r&o>>2,u^=r&i>>2^(n^r)&o>>2,n=s,r=a,i=l,o=u,s=n&n>>4^r&r>>4,a=n&r>>4^r&(n^r)>>4,l^=n&i>>4^r&o>>4,u^=r&i>>4^(n^r)&o>>4,n=s,r=a,i=l,o=u,l^=n&i>>8^r&o>>8,u^=r&i>>8^(n^r)&o>>8,n=l^l>>1,r=u^u>>1;let c=e^t,d=r|65535^(c|n);return c=(c|c<<8)&16711935,c=(c|c<<4)&252645135,c=(c|c<<2)&858993459,c=(c|c<<1)&1431655765,d=(d|d<<8)&16711935,d=(d|d<<4)&252645135,d=(d|d<<2)&858993459,d=(d|d<<1)&1431655765,(d<<1|c)>>>0}const wb=e=>{const t=new Map;return e.forEach(n=>{t.set(n.axisId,n)}),t},Od=e=>e.zoom;J(Od,e=>e==null?void 0:e.isInteracting);const Wt=Ee(Od,function(t){return(t==null?void 0:t.zoomData)&&wb(t==null?void 0:t.zoomData)});J(Wt,(e,t)=>e==null?void 0:e.get(t));const po=Ee(Gt,Ut,function(t,n){return L({},bu("x")(t),bu("y")(n))});J(po,(e,t)=>e[t]);const Cb=J(gt,function(t){return Sd(t.width)}),Mb=J(gt,function(t){return Sd(t.height)}),wa=Ee(Gt,ze,Vt,no,Cb,function(t,n,r,i,o){const a={};return t==null||t.forEach((l,u)=>{var h,f;const c=l;if(Yn(c)||Wn(c)){a[c.id]={domain:c.data},c.ordinalTimeTicks!==void 0&&(a[c.id].tickNumber=va(c,[(h=c.data)==null?void 0:h.find(m=>m!==null),(f=c.data)==null?void 0:f.findLast(m=>m!==null)],o));return}const d=fo(c,"x",r,u,n);a[c.id]=_d(c,"x",u,n,d,o,i)}),{axes:t,domains:a}}),Ca=Ee(Ut,ze,Vt,no,Mb,function(t,n,r,i,o){const a={};return t==null||t.forEach((l,u)=>{var h,f;const c=l;if(Yn(c)||Wn(c)){a[c.id]={domain:c.data},c.ordinalTimeTicks!==void 0&&(a[c.id].tickNumber=va(c,[(h=c.data)==null?void 0:h.find(m=>m!==null),(f=c.data)==null?void 0:f.findLast(m=>m!==null)],o));return}const d=fo(c,"y",r,u,n);a[c.id]=_d(c,"y",u,n,d,o,i)}),{axes:t,domains:a}}),Pd=Ee(Wt,po,wa,Ca,function(t,n,{axes:r,domains:i},{axes:o,domains:s}){if(!t||!n)return;let a=!1;const l={},u=[...r??[],...o??[]];for(let c=0;c<u.length;c+=1){const d=u[c];if(!n[d.id]||n[d.id].filterMode!=="discard")continue;const h=t.get(d.id);if(h===void 0||h.start<=0&&h.end>=100)continue;const f=c<((r==null?void 0:r.length)??0)?"x":"y";if(d.scaleType==="band"||d.scaleType==="point")l[d.id]=pb(d.data,h.start,h.end,f);else{const{domain:m}=f==="x"?i[d.id]:s[d.id];l[d.id]=mb(m,h.start,h.end,f,d.data)}a=!0}if(a)return gb(l)}),Rb=Ee(ze,Vt,Wt,po,Pd,no,wa,function(t,n,r,i,o,s,{axes:a,domains:l}){const u={};return a==null||a.forEach((c,d)=>{const h=l[c.id].domain;if(Yn(c)||Wn(c)){u[c.id]=h;return}const f=r==null?void 0:r.get(c.id),m=i==null?void 0:i[c.id],p=f===void 0&&!m?o:void 0;if(!p){u[c.id]=h;return}const y=l[c.id].tickNumber,b=fo(c,"x",n,d,t,p);u[c.id]=Id(c,"x",d,t,b,y,s)}),u}),Ab=Ee(ze,Vt,Wt,po,Pd,no,Ca,function(t,n,r,i,o,s,{axes:a,domains:l}){const u={};return a==null||a.forEach((c,d)=>{const h=l[c.id].domain;if(Yn(c)||Wn(c)){u[c.id]=h;return}const f=r==null?void 0:r.get(c.id),m=i==null?void 0:i[c.id],p=f===void 0&&!m?o:void 0;if(!p){u[c.id]=h;return}const y=l[c.id].tickNumber,b=fo(c,"y",n,d,t,p);u[c.id]=Id(c,"y",d,t,b,y,s)}),u}),Dd=Ee(Gt,Rb,function(t,n){const r={};return t==null||t.forEach(i=>{const o=i,s=n[o.id];r[o.id]=Md(o,s)}),r}),$d=Ee(Ut,Ab,function(t,n){const r={};return t==null||t.forEach(i=>{const o=i,s=n[o.id];r[o.id]=Md(o,s)}),r}),_b=Ee(Gt,Dd,gt,Wt,function(t,n,r,i){const o={};return t==null||t.forEach(s=>{const a=s,l=i==null?void 0:i.get(a.id),u=l?[l.start,l.end]:[0,100],c=Cd(r,"x",a),d=n[a.id].copy(),h=Rd(c,u);d.range(h),o[a.id]=d}),o}),Ib=Ee(Ut,$d,gt,Wt,function(t,n,r,i){const o={};return t==null||t.forEach(s=>{const a=s,l=i==null?void 0:i.get(a.id),u=l?[l.start,l.end]:[0,100],c=Cd(r,"y",a),d=n[a.id].copy(),h=Ar(d)?c.reverse():c,f=Rd(h,u);d.range(f),o[a.id]=d}),o}),Ht=Ee(gt,ze,Vt,Wt,wa,_b,function(t,n,r,i,{axes:o,domains:s},a){return wd({scales:a,drawingArea:t,formattedSeries:n,axis:o,seriesConfig:r,axisDirection:"x",zoomMap:i,domains:s})}),qt=Ee(gt,ze,Vt,Wt,Ca,Ib,function(t,n,r,i,{axes:o,domains:s},a){return wd({scales:a,drawingArea:t,formattedSeries:n,axis:o,seriesConfig:r,axisDirection:"y",zoomMap:i,domains:s})});J(Ht,qt,(e,t,n)=>(e==null?void 0:e.axis[n])??(t==null?void 0:t.axis[n]));J(Gt,Ut,(e,t,n)=>{const r=(e==null?void 0:e.find(i=>i.id===n))??(t==null?void 0:t.find(i=>i.id===n))??null;if(r)return r});const jb=J(Gt,e=>e[0].id),kb=J(Ut,e=>e[0].id);Ee(ze,Dd,$d,jb,kb,function(t,n,r,i,o){const s=t.scatter,a=new Map;return s&&s.seriesOrder.forEach(l=>{const{data:u,xAxisId:c=i,yAxisId:d=o}=s.series[l],h=new Ta(u.length),f=n[c],m=r[d];for(const p of u)h.add(f(p.x),m(p.y));h.finish(),a.set(l,h)}),a});function An(e){return e instanceof Date?e.getTime():e}function Bn(e,t){const{scale:n,data:r,reverse:i}=e;if(!Ar(n)){const s=n.invert(t);if(r===void 0)return-1;const a=An(s);return r==null?void 0:r.findIndex((u,c)=>{const d=An(u);return d>a&&(c===0||Math.abs(a-d)<=Math.abs(a-An(r[c-1])))||d<=a&&(c===r.length-1||Math.abs(An(s)-d)<Math.abs(An(s)-An(r[c+1])))})}const o=n.bandwidth()===0?Math.floor((t-Math.min(...n.range())+n.step()/2)/n.step()):Math.floor((t-Math.min(...n.range()))/n.step());return o<0||o>=r.length?-1:i?r.length-1-o:o}function Eu(e,t,n,r){if(!Ar(e)){if(r===null){const i=e.invert(n);return Number.isNaN(i)?null:i}return t[r]}return r===null||r<0||r>=t.length?null:t[r]}function Tu(e,t){const n=e.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n.matrixTransform(e.getScreenCTM().inverse())}const Ma=({store:e})=>{const t=Ye(function(){e.update({interaction:L({},e.state.interaction,{pointer:null})})}),n=Ye(function(a){e.state.interaction.lastUpdate!==a&&e.set("interaction",L({},e.state.interaction,{lastUpdate:a}))}),r=Ye(function(a){e.set("interaction",L({},e.state.interaction,{pointer:a,lastUpdate:a!==null?"pointer":e.state.interaction.lastUpdate}))}),i=Ye(function(a){e.set("interaction",L({},e.state.interaction,{pointerType:a.pointerType}))}),o=Ye(function(){e.set("interaction",L({},e.state.interaction,{pointerType:null}))});return{instance:{cleanInteraction:t,setLastUpdateSource:n,setPointerCoordinate:r,handlePointerEnter:i,handlePointerLeave:o}}};Ma.getInitialState=()=>({interaction:{item:null,pointer:null,lastUpdate:"pointer",pointerType:null}});Ma.params={};const mo=e=>e.interaction,Ob=J(mo,e=>e!==void 0),Nd=J(mo,e=>(e==null?void 0:e.pointer)??null),go=J(Nd,e=>e&&e.x),yo=J(Nd,e=>e&&e.y);J(mo,e=>e==null?void 0:e.lastUpdate);J(mo,e=>(e==null?void 0:e.pointerType)??null);function ar(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const i=e.length;if(i!==t.length)return!1;for(let o=0;o<i;o+=1)if(!ar(e[o],t[o]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;const i=Array.from(e.entries());for(let o=0;o<i.length;o+=1)if(!t.has(i[o][0]))return!1;for(let o=0;o<i.length;o+=1){const s=i[o];if(!ar(s[1],t.get(s[0])))return!1}return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;const i=Array.from(e.entries());for(let o=0;o<i.length;o+=1)if(!t.has(i[o][0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){const i=e.length;if(i!==t.length)return!1;for(let o=0;o<i;o+=1)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),r=n.length;if(r!==Object.keys(t).length)return!1;for(let i=0;i<r;i+=1)if(!Object.prototype.hasOwnProperty.call(t,n[i]))return!1;for(let i=0;i<r;i+=1){const o=n[i];if(!ar(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Cs(e,t,n=t.axisIds[0]){return Array.isArray(n)?n.map(r=>Bn(t.axis[r],e)):Bn(t.axis[n],e)}const Ld=(e,t,n)=>{if(e===null)return null;const r=Cs(e,t,n);return r===-1?null:r},Pb=J(go,Ht,Ld),Db=J(yo,qt,Ld),$b=J(go,yo,Ht,qt,(e,t,n,r)=>[...e===null?[]:n.axisIds.map(i=>({axisId:i,dataIndex:Cs(e,n,i)})),...t===null?[]:r.axisIds.map(i=>({axisId:i,dataIndex:Cs(t,r,i)}))].filter(i=>i.dataIndex!==null&&i.dataIndex>=0));function zd(e,t,n,r=t.axisIds[0]){return Array.isArray(r)?r.map((i,o)=>{const s=t.axis[i];return Eu(s.scale,s.data,e,n[o])}):Eu(t.axis[r].scale,t.axis[r].data,e,n)}J(go,Ht,Pb,(e,t,n,r)=>e===null||t.axisIds.length===0?null:zd(e,t,n,r));J(yo,qt,Db,(e,t,n,r)=>e===null||t.axisIds.length===0?null:zd(e,t,n,r));const Fd=[],Nb=Vs({memoizeOptions:{resultEqualityCheck:ar}})(go,Ht,(e,t)=>e===null?Fd:t.axisIds.filter(n=>t.axis[n].triggerTooltip).map(n=>({axisId:n,dataIndex:Bn(t.axis[n],e)})).filter(({dataIndex:n})=>n>=0)),Lb=Vs({memoizeOptions:{resultEqualityCheck:ar}})(yo,qt,(e,t)=>e===null?Fd:t.axisIds.filter(n=>t.axis[n].triggerTooltip).map(n=>({axisId:n,dataIndex:Bn(t.axis[n],e)})).filter(({dataIndex:n})=>n>=0));J(Nb,Lb,(e,t)=>e.length>0||t.length>0);function zb(e){return e.setPointerCoordinate!==void 0}const Fb=new Set(["bar","rangeBar","line"]),xo=({params:e,store:t,seriesConfig:n,svgRef:r,instance:i})=>{const{xAxis:o,yAxis:s,dataset:a,onHighlightedAxisChange:l}=e;if(process.env.NODE_ENV!=="production"){const w=[...o??[],...s??[]].filter(S=>S.id).map(S=>S.id),C=new Set(w.filter((S,R)=>w.indexOf(S)!==R));C.size>0&&Nn([`MUI X Charts: The following axis ids are duplicated: ${Array.from(C).join(", ")}.`,"Please make sure that each axis has a unique id."].join(`
|
|
95
|
-
`),"error")}const
|
|
96
|
-
`))},[e,t.highlightedItem]);const n=Ye(()=>{var o;(o=t.onHighlightChange)==null||o.call(t,null);const i=e.state.highlight;i.item===null||i.isControlled||e.set("highlight",{item:null,lastUpdate:"pointer",isControlled:!1})}),r=Ye(i=>{var s;const o=e.state.highlight;Ai(o.item,i)||((s=t.onHighlightChange)==null||s.call(t,i),!o.isControlled&&e.set("highlight",{item:i,lastUpdate:"pointer",isControlled:!1}))});return{instance:{clearHighlight:n,setHighlight:r}}};_a.getInitialState=e=>({highlight:{item:e.highlightedItem,lastUpdate:"pointer",isControlled:e.highlightedItem!==void 0}});_a.params={highlightedItem:!0,onHighlightChange:!0};function gr(e){let t=1/0,n=-1/0;for(const r of e??[])r<t&&(t=r),r>n&&(n=r);return[t,n]}const Mu=(e,t)=>t==="x"?{x:e,y:null}:{x:null,y:e},Vd=e=>{var s;const{axis:t,getFilters:n,isDefaultAxis:r}=e,i=n==null?void 0:n({currentAxisId:t.id,isDefaultAxis:r}),o=i?(s=t.data)==null?void 0:s.filter((a,l)=>i({x:null,y:null},l)):t.data;return gr(o??[])},Yd=e=>t=>{const{series:n,axis:r,getFilters:i,isDefaultAxis:o}=t;return Object.keys(n).filter(s=>{const a=e==="x"?n[s].xAxisId:n[s].yAxisId;return a===r.id||o&&a===void 0}).reduce((s,a)=>{const{stackedData:l}=n[a],u=i==null?void 0:i({currentAxisId:r.id,isDefaultAxis:o,seriesXAxisId:n[a].xAxisId,seriesYAxisId:n[a].yAxisId}),[c,d]=(l==null?void 0:l.reduce((h,f,m)=>u&&(!u(Mu(f[0],e),m)||!u(Mu(f[1],e),m))?h:[Math.min(...f,h[0]),Math.max(...f,h[1])],[1/0,-1/0]))??[1/0,-1/0];return[Math.min(c,s[0]),Math.max(d,s[1])]},[1/0,-1/0])},Wb=e=>Object.keys(e.series).some(n=>e.series[n].layout==="horizontal")?Yd("x")(e):Vd(e),Hb=e=>Object.keys(e.series).some(n=>e.series[n].layout==="horizontal")?Vd(e):Yd("y")(e);function Se(e){return function(){return e}}const Ru=Math.abs,Oe=Math.atan2,Xt=Math.cos,qb=Math.max,es=Math.min,lt=Math.sin,jn=Math.sqrt,Be=1e-12,yr=Math.PI,_i=yr/2,ci=2*yr;function Kb(e){return e>1?0:e<-1?yr:Math.acos(e)}function Au(e){return e>=1?_i:e<=-1?-_i:Math.asin(e)}const Ms=Math.PI,Rs=2*Ms,Zt=1e-6,Jb=Rs-Zt;function Wd(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Xb(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Wd;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Zb{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Wd:Xb(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,a=this._y1,l=r-t,u=i-n,c=s-t,d=a-n,h=c*c+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>Zt)if(!(Math.abs(d*l-u*c)>Zt)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-s,m=i-a,p=l*l+u*u,y=f*f+m*m,b=Math.sqrt(p),E=Math.sqrt(h),T=o*Math.tan((Ms-Math.acos((p+h-y)/(2*b*E)))/2),w=T/E,C=T/b;Math.abs(w-1)>Zt&&this._append`L${t+w*c},${n+w*d}`,this._append`A${o},${o},0,0,${+(d*f>c*m)},${this._x1=t+C*l},${this._y1=n+C*u}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),l=r*Math.sin(i),u=t+a,c=n+l,d=1^s,h=s?i-o:o-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>Zt||Math.abs(this._y1-c)>Zt)&&this._append`L${u},${c}`,r&&(h<0&&(h=h%Rs+Rs),h>Jb?this._append`A${r},${r},0,1,${d},${t-a},${n-l}A${r},${r},0,1,${d},${this._x1=u},${this._y1=c}`:h>Zt&&this._append`A${r},${r},0,${+(h>=Ms)},${d},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function Qb(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Zb(t)}function ev(e){return e.innerRadius}function tv(e){return e.outerRadius}function nv(e){return e.startAngle}function rv(e){return e.endAngle}function iv(e){return e&&e.padAngle}function ov(e,t,n,r,i,o,s,a){var l=n-e,u=r-t,c=s-i,d=a-o,h=d*l-c*u;if(!(h*h<Be))return h=(c*(t-o)-d*(e-i))/h,[e+h*l,t+h*u]}function Kr(e,t,n,r,i,o,s){var a=e-n,l=t-r,u=(s?o:-o)/jn(a*a+l*l),c=u*l,d=-u*a,h=e+c,f=t+d,m=n+c,p=r+d,y=(h+m)/2,b=(f+p)/2,E=m-h,T=p-f,w=E*E+T*T,C=i-o,S=h*p-m*f,R=(T<0?-1:1)*jn(qb(0,C*C*w-S*S)),I=(S*T-E*R)/w,k=(-S*E-T*R)/w,z=(S*T+E*R)/w,P=(-S*E+T*R)/w,v=I-y,_=k-b,A=z-y,B=P-b;return v*v+_*_>A*A+B*B&&(I=z,k=P),{cx:I,cy:k,x01:-c,y01:-d,x11:I*(i/C-1),y11:k*(i/C-1)}}function Hd(){var e=ev,t=tv,n=Se(0),r=null,i=nv,o=rv,s=iv,a=null,l=Qb(u);function u(){var c,d,h=+e.apply(this,arguments),f=+t.apply(this,arguments),m=i.apply(this,arguments)-_i,p=o.apply(this,arguments)-_i,y=Ru(p-m),b=p>m;if(a||(a=c=l()),f<h&&(d=f,f=h,h=d),!(f>Be))a.moveTo(0,0);else if(y>ci-Be)a.moveTo(f*Xt(m),f*lt(m)),a.arc(0,0,f,m,p,!b),h>Be&&(a.moveTo(h*Xt(p),h*lt(p)),a.arc(0,0,h,p,m,b));else{var E=m,T=p,w=m,C=p,S=y,R=y,I=s.apply(this,arguments)/2,k=I>Be&&(r?+r.apply(this,arguments):jn(h*h+f*f)),z=es(Ru(f-h)/2,+n.apply(this,arguments)),P=z,v=z,_,A;if(k>Be){var B=Au(k/h*lt(I)),G=Au(k/f*lt(I));(S-=B*2)>Be?(B*=b?1:-1,w+=B,C-=B):(S=0,w=C=(m+p)/2),(R-=G*2)>Be?(G*=b?1:-1,E+=G,T-=G):(R=0,E=T=(m+p)/2)}var Z=f*Xt(E),Y=f*lt(E),te=h*Xt(C),we=h*lt(C);if(z>Be){var V=f*Xt(T),xe=f*lt(T),Pe=h*Xt(w),xt=h*lt(w),ke;if(y<yr)if(ke=ov(Z,Y,Pe,xt,V,xe,te,we)){var bt=Z-ke[0],st=Y-ke[1],Ue=V-ke[0],F=xe-ke[1],q=1/lt(Kb((bt*Ue+st*F)/(jn(bt*bt+st*st)*jn(Ue*Ue+F*F)))/2),X=jn(ke[0]*ke[0]+ke[1]*ke[1]);P=es(z,(h-X)/(q-1)),v=es(z,(f-X)/(q+1))}else P=v=0}R>Be?v>Be?(_=Kr(Pe,xt,Z,Y,f,v,b),A=Kr(V,xe,te,we,f,v,b),a.moveTo(_.cx+_.x01,_.cy+_.y01),v<z?a.arc(_.cx,_.cy,v,Oe(_.y01,_.x01),Oe(A.y01,A.x01),!b):(a.arc(_.cx,_.cy,v,Oe(_.y01,_.x01),Oe(_.y11,_.x11),!b),a.arc(0,0,f,Oe(_.cy+_.y11,_.cx+_.x11),Oe(A.cy+A.y11,A.cx+A.x11),!b),a.arc(A.cx,A.cy,v,Oe(A.y11,A.x11),Oe(A.y01,A.x01),!b))):(a.moveTo(Z,Y),a.arc(0,0,f,E,T,!b)):a.moveTo(Z,Y),!(h>Be)||!(S>Be)?a.lineTo(te,we):P>Be?(_=Kr(te,we,V,xe,h,-P,b),A=Kr(Z,Y,Pe,xt,h,-P,b),a.lineTo(_.cx+_.x01,_.cy+_.y01),P<z?a.arc(_.cx,_.cy,P,Oe(_.y01,_.x01),Oe(A.y01,A.x01),!b):(a.arc(_.cx,_.cy,P,Oe(_.y01,_.x01),Oe(_.y11,_.x11),!b),a.arc(0,0,h,Oe(_.cy+_.y11,_.cx+_.x11),Oe(A.cy+A.y11,A.cx+A.x11),b),a.arc(A.cx,A.cy,P,Oe(A.y11,A.x11),Oe(A.y01,A.x01),!b))):a.arc(0,0,h,C,w,b)}if(a.closePath(),c)return a=null,c+""||null}return u.centroid=function(){var c=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-yr/2;return[Xt(d)*c,lt(d)*c]},u.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:Se(+c),u):e},u.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:Se(+c),u):t},u.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:Se(+c),u):n},u.padRadius=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:Se(+c),u):r},u.startAngle=function(c){return arguments.length?(i=typeof c=="function"?c:Se(+c),u):i},u.endAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Se(+c),u):o},u.padAngle=function(c){return arguments.length?(s=typeof c=="function"?c:Se(+c),u):s},u.context=function(c){return arguments.length?(a=c??null,u):a},u}function qd(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function sv(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function av(e){return e}function lv(){var e=av,t=sv,n=null,r=Se(0),i=Se(ci),o=Se(0);function s(a){var l,u=(a=qd(a)).length,c,d,h=0,f=new Array(u),m=new Array(u),p=+r.apply(this,arguments),y=Math.min(ci,Math.max(-ci,i.apply(this,arguments)-p)),b,E=Math.min(Math.abs(y)/u,o.apply(this,arguments)),T=E*(y<0?-1:1),w;for(l=0;l<u;++l)(w=m[f[l]=l]=+e(a[l],l,a))>0&&(h+=w);for(t!=null?f.sort(function(C,S){return t(m[C],m[S])}):n!=null&&f.sort(function(C,S){return n(a[C],a[S])}),l=0,d=h?(y-u*T)/h:0;l<u;++l,p=b)c=f[l],w=m[c],b=p+(w>0?w*d:0)+T,m[c]={data:a[c],index:l,value:w,startAngle:p,endAngle:b,padAngle:E};return m}return s.value=function(a){return arguments.length?(e=typeof a=="function"?a:Se(+a),s):e},s.sortValues=function(a){return arguments.length?(t=a,n=null,s):t},s.sort=function(a){return arguments.length?(n=a,t=null,s):n},s.startAngle=function(a){return arguments.length?(r=typeof a=="function"?a:Se(+a),s):r},s.endAngle=function(a){return arguments.length?(i=typeof a=="function"?a:Se(+a),s):i},s.padAngle=function(a){return arguments.length?(o=typeof a=="function"?a:Se(+a),s):o},s}function Gn(e,t){if((s=e.length)>1)for(var n=1,r,i,o=e[t[0]],s,a=o.length;n<s;++n)for(i=o,o=e[t[n]],r=0;r<a;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Un(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function uv(e,t){return e[t]}function cv(e){const t=[];return t.key=e,t}function Ii(){var e=Se([]),t=Un,n=Gn,r=uv;function i(o){var s=Array.from(e.apply(this,arguments),cv),a,l=s.length,u=-1,c;for(const d of o)for(a=0,++u;a<l;++a)(s[a][u]=[0,+r(d,s[a].key,u,o)]).data=d;for(a=0,c=qd(t(s));a<l;++a)s[c[a]].index=a;return n(s,c),s}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:Se(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:Se(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?Un:typeof o=="function"?o:Se(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??Gn,i):n},i}function dv(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,s;i<o;++i){for(s=n=0;n<r;++n)s+=e[n][i][1]||0;if(s)for(n=0;n<r;++n)e[n][i][1]/=s}Gn(e,t)}}function hv(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var s=0,a=0;s<i;++s)a+=e[s][n][1]||0;r[n][1]+=r[n][0]=-a/2}Gn(e,t)}}function fv(e,t){if(!(!((s=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,s;r<o;++r){for(var a=0,l=0,u=0;a<s;++a){for(var c=e[t[a]],d=c[r][1]||0,h=c[r-1][1]||0,f=(d-h)/2,m=0;m<a;++m){var p=e[t[m]],y=p[r][1]||0,b=p[r-1][1]||0;f+=y-b}l+=d,u+=f*d}i[r-1][1]+=i[r-1][0]=n,l&&(n-=u/l)}i[r-1][1]+=i[r-1][0]=n,Gn(e,t)}}function Kd(e){var t=e.map(pv);return Un(e).sort(function(n,r){return t[n]-t[r]})}function pv(e){for(var t=-1,n=0,r=e.length,i,o=-1/0;++t<r;)(i=+e[t][1])>o&&(o=i,n=t);return n}function Jd(e){var t=e.map(Xd);return Un(e).sort(function(n,r){return t[n]-t[r]})}function Xd(e){for(var t=0,n=-1,r=e.length,i;++n<r;)(i=+e[n][1])&&(t+=i);return t}function mv(e){return Jd(e).reverse()}function gv(e){var t=e.length,n,r,i=e.map(Xd),o=Kd(e),s=0,a=0,l=[],u=[];for(n=0;n<t;++n)r=o[n],s<a?(s+=i[r],l.push(r)):(a+=i[r],u.push(r));return u.reverse().concat(l)}function yv(e){return Un(e).reverse()}function xv(e,t){if(e.length===0)return;const n=e.length,r=t,i=e[r[0]].length;for(let o=0;o<i;o+=1){let s=0,a=0;for(let l=0;l<n;l+=1){const u=e[r[l]],c=u[o],d=c[1]-c[0];d>0?(c[0]=s,s+=d,c[1]=s):d<0?(c[1]=a,a+=d,c[0]=a):c.data[u.key]>0?(c[0]=s,c[1]=s):c.data[u.key]<0?(c[1]=a,c[0]=a):(c[0]=0,c[1]=0)}}}const ts={appearance:Kd,ascending:Jd,descending:mv,insideOut:gv,none:Un,reverse:yv},ns={expand:dv,diverging:xv,none:Gn,silhouette:hv,wiggle:fv},Zd=e=>{const{series:t,seriesOrder:n,defaultStrategy:r}=e,i=[],o={};return n.forEach(s=>{const{stack:a,stackOrder:l,stackOffset:u}=t[s];a===void 0?i.push({ids:[s],stackingOrder:ts.none,stackingOffset:ns.none}):o[a]===void 0?(o[a]=i.length,i.push({ids:[s],stackingOrder:ts[l??(r==null?void 0:r.stackOrder)??"none"],stackingOffset:ns[u??(r==null?void 0:r.stackOffset)??"diverging"]})):(i[o[a]].ids.push(s),l!==void 0&&(i[o[a]].stackingOrder=ts[l]),u!==void 0&&(i[o[a]].stackingOffset=ns[u]))}),i},bv=e=>e==null?"":e.toLocaleString(),vv=(e,t,n)=>{const{seriesOrder:r,series:i}=e,o=Zd(e),s=t??[];r.forEach(l=>{const u=i[l].data;if(u!==void 0)u.forEach((c,d)=>{s.length<=d?s.push({[l]:c}):s[d][l]=c});else if(t===void 0)throw new Error([`MUI X Charts: bar series with id='${l}' has no data.`,"Either provide a data property to the series or use the dataset prop."].join(`
|
|
97
|
-
`));if(process.env.NODE_ENV!=="production"&&!
|
|
98
|
-
`));t.forEach((d,h)=>{const f=d[
|
|
99
|
-
`))})}});const a={};return o.forEach(l=>{const{ids:
|
|
100
|
-
`));const
|
|
101
|
-
`));if(process.env.NODE_ENV!=="production"&&!
|
|
102
|
-
`));t.forEach((d,h)=>{const f=d[
|
|
103
|
-
`))})}});const a={};return o.forEach(l=>{const{ids:
|
|
93
|
+
*/var Al;function ug(){return Al||(Al=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=D,n=Ys(),r=typeof Object.is=="function"?Object.is:e,i=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;Wo.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var m=o(null);if(m.current===null){var p={hasValue:!1,value:null};m.current=p}else p=m.current;m=a(function(){function b(S){if(!E){if(E=!0,T=S,S=h(S),f!==void 0&&p.hasValue){var R=p.value;if(f(R,S))return w=R}return w=S}if(R=w,r(T,S))return R;var I=h(S);return f!==void 0&&f(R,I)?(T=S,R):(T=S,w=I)}var E=!1,T,w,C=d===void 0?null:d;return[function(){return b(u())},C===null?void 0:function(){return b(C())}]},[u,d,h,f]);var y=i(c,m[0],m[1]);return s(function(){p.hasValue=!0,p.value=y},[y]),l(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Wo}var _l;function dg(){return _l||(_l=1,process.env.NODE_ENV==="production"?Ur.exports=cg():Ur.exports=ug()),Ur.exports}var hg=dg();const fg=parseInt(O.version,10),pg=fg>=19,mg=pg?yg:xg;function gg(e,t,n,r,i){return mg(e,t,n,r,i)}function yg(e,t,n,r,i){const o=O.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return lg.useSyncExternalStore(e.subscribe,o,o)}function xg(e,t,n,r,i){return hg.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,i))}const Il={};function bg(e,t){const n=O.useRef(Il);return n.current===Il&&(n.current=e(t)),n}const vg=[];function Sg(e){O.useEffect(e,vg)}const Eg=()=>{};function Tg(e,t,n){const r=bg(wg,{store:e,selector:t}).current;r.effect=n,Sg(r.onMount)}function wg(e){const{store:t,selector:n}=e;let r=n(t.state);const i={effect:Eg,dispose:null,subscribe:()=>{i.dispose??(i.dispose=t.subscribe(o=>{const s=n(o);if(!Object.is(r,s)){const a=r;r=s,i.effect(a,s)}}))},onMount:()=>(i.subscribe(),()=>{var o;(o=i.dispose)==null||o.call(i),i.dispose=null})};return i.subscribe(),i}class Ws{constructor(t){W(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));W(this,"getSnapshot",()=>this.state);W(this,"use",(t,n,r,i)=>gg(this,t,n,r,i));this.state=t,this.listeners=new Set,this.updateTick=0}static create(t){return new Ws(t)}setState(t){this.state=t,this.updateTick+=1;const n=this.updateTick,r=this.listeners.values();let i;for(;i=r.next(),!i.done;){if(n!==this.updateTick)return;const o=i.value;o(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState(L({},this.state,t));return}}set(t,n){Object.is(this.state[t],n)||this.setState(L({},this.state,{[t]:n}))}}const to=({params:e,store:t})=>{O.useEffect(()=>{t.set("animation",L({},t.state.animation,{skip:e.skipAnimation}))},[t,e.skipAnimation]);const n=O.useCallback(()=>{let r=!1;return t.set("animation",L({},t.state.animation,{skipAnimationRequests:t.state.animation.skipAnimationRequests+1})),()=>{r||(r=!0,t.set("animation",L({},t.state.animation,{skipAnimationRequests:t.state.animation.skipAnimationRequests-1})))}},[t]);return ot(()=>{if(typeof window>"u"||!(window!=null&&window.matchMedia))return;let i;const o=a=>{a.matches?i=n():i==null||i()},s=window.matchMedia("(prefers-reduced-motion)");return o(s),s.addEventListener("change",o),()=>{s.removeEventListener("change",o)}},[n,t]),{instance:{disableAnimation:n}}};to.params={skipAnimation:!0};to.getDefaultizedParams=({params:e})=>L({},e,{skipAnimation:e.skipAnimation??!1});to.getInitialState=({skipAnimation:e})=>{const t=typeof window>"u"||!(window!=null&&window.matchMedia),n=process.env.NODE_ENV==="test"?t:!1;return{animation:{skip:e,skipAnimationRequests:n?1:0}}};const Cg=e=>e.animation,Mg=J(Cg,e=>e.skip||e.skipAnimationRequests>0);function Gu(e,t){const n=O.useRef(!0);O.useEffect(()=>{if(n.current){n.current=!1;return}return e()},t)}function ar(e){return e&&e.ownerDocument||document}function Rg(e){return ar(e).defaultView||window}const Ag="DEFAULT_X_AXIS_KEY",_g="DEFAULT_Y_AXIS_KEY",Ig={top:20,bottom:20,left:20,right:20},jg=45,kg=25,Uu=20,Gt=e=>{var t;return(t=e.cartesianAxis)==null?void 0:t.x},Ut=e=>{var t;return(t=e.cartesianAxis)==null?void 0:t.y},Og=J(Ut,function(t){return(t??[]).reduce((n,r)=>{var i;return r.position==="left"?n+(r.width||0)+((i=r.zoom)!=null&&i.slider.enabled?r.zoom.slider.size:0):n},0)}),Pg=J(Ut,function(t){return(t??[]).reduce((n,r)=>{var i;return r.position==="right"?n+(r.width||0)+((i=r.zoom)!=null&&i.slider.enabled?r.zoom.slider.size:0):n},0)}),Dg=J(Gt,function(t){return(t??[]).reduce((n,r)=>{var i;return r.position==="top"?n+(r.height||0)+((i=r.zoom)!=null&&i.slider.enabled?r.zoom.slider.size:0):n},0)}),$g=J(Gt,function(t){return(t??[]).reduce((n,r)=>{var i;return r.position==="bottom"?n+(r.height||0)+((i=r.zoom)!=null&&i.slider.enabled?r.zoom.slider.size:0):n},0)}),Ng=Ee(Og,Pg,Dg,$g,function(t,n,r,i){return{left:t,right:n,top:r,bottom:i}}),Cr=e=>e.dimensions,Lg=e=>e.dimensions.margin,gt=Ee(Cr,Lg,Ng,function({width:t,height:n},{top:r,right:i,bottom:o,left:s},{left:a,right:l,top:c,bottom:u}){return{width:t-s-i-a-l,left:s+a,right:i+l,height:n-r-o-c-u,top:r+c,bottom:o+u}}),zg=J(Cr,e=>e.width),Fg=J(Cr,e=>e.height),Bg=J(Cr,e=>e.propsWidth),Gg=J(Cr,e=>e.propsHeight);function Vu(e,t){return typeof e=="number"?{top:e,bottom:e,left:e,right:e}:t?L({},t,e):e}const Ug=10,no=({params:e,store:t,svgRef:n})=>{const r=e.width!==void 0&&e.height!==void 0,i=O.useRef({displayError:!1,initialCompute:!0,computeRun:0}),[o,s]=O.useState(0),[a,l]=O.useState(0),c=O.useCallback(()=>{const m=n==null?void 0:n.current;if(!m)return{};const y=Rg(m).getComputedStyle(m),b=Math.floor(parseFloat(y.height))||0,E=Math.floor(parseFloat(y.width))||0;return(t.state.dimensions.width!==E||t.state.dimensions.height!==b)&&t.set("dimensions",{margin:{top:e.margin.top,right:e.margin.right,bottom:e.margin.bottom,left:e.margin.left},width:e.width??E,height:e.height??b,propsWidth:e.width,propsHeight:e.height}),{height:b,width:E}},[t,n,e.height,e.width,e.margin.left,e.margin.right,e.margin.top,e.margin.bottom]);Gu(()=>{const m=e.width??t.state.dimensions.width,p=e.height??t.state.dimensions.height;t.set("dimensions",{margin:{top:e.margin.top,right:e.margin.right,bottom:e.margin.bottom,left:e.margin.left},width:m,height:p,propsHeight:e.height,propsWidth:e.width})},[t,e.height,e.width,e.margin.left,e.margin.right,e.margin.top,e.margin.bottom]),O.useEffect(()=>{i.current.displayError=!0},[]),ot(()=>{if(r||!i.current.initialCompute||i.current.computeRun>Ug)return;const m=c();m.width!==o||m.height!==a?(i.current.computeRun+=1,m.width!==void 0&&s(m.width),m.height!==void 0&&l(m.height)):i.current.initialCompute&&(i.current.initialCompute=!1)},[a,o,c,r]),ot(()=>{if(r)return()=>{};c();const m=n.current;if(typeof ResizeObserver>"u")return()=>{};let p;const y=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{c()})});return m&&y.observe(m),()=>{p&&cancelAnimationFrame(p),m&&y.unobserve(m)}},[c,r,n]),process.env.NODE_ENV!=="production"&&(i.current.displayError&&e.width===void 0&&o===0&&(console.error("MUI X Charts: ChartContainer does not have `width` prop, and its container has no `width` defined."),i.current.displayError=!1),i.current.displayError&&e.height===void 0&&a===0&&(console.error("MUI X Charts: ChartContainer does not have `height` prop, and its container has no `height` defined."),i.current.displayError=!1));const u=t.use(gt),d=O.useCallback(m=>m>=u.left-1&&m<=u.left+u.width,[u.left,u.width]),h=O.useCallback(m=>m>=u.top-1&&m<=u.top+u.height,[u.height,u.top]);return{instance:{isPointInside:O.useCallback((m,p,y)=>y&&"closest"in y&&y.closest("[data-drawing-container]")?!0:d(m)&&h(p),[d,h]),isXInside:d,isYInside:h}}};no.params={width:!0,height:!0,margin:!0};no.getDefaultizedParams=({params:e})=>L({},e,{margin:Vu(e.margin,Ig)});no.getInitialState=({width:e,height:t,margin:n})=>({dimensions:{margin:n,width:e??0,height:t??0,propsWidth:e,propsHeight:t}});const Hs=({params:e,store:t})=>(ot(()=>{t.set("experimentalFeatures",e.experimentalFeatures)},[t,e.experimentalFeatures]),{});Hs.params={experimentalFeatures:!0};Hs.getInitialState=({experimentalFeatures:e})=>({experimentalFeatures:e});const Vg=e=>e.experimentalFeatures,ro=J(Vg,e=>!!(e!=null&&e.preferStrictDomainInLineCharts));let jl=0;const Yg=()=>(jl+=1,`mui-chart-${jl}`),qs=({params:e,store:t})=>(O.useEffect(()=>{e.id===void 0||e.id===t.state.id.providedChartId&&t.state.id.chartId!==void 0||t.set("id",L({},t.state.id,{chartId:e.id??Yg()}))},[t,e.id]),{});qs.params={id:!0};qs.getInitialState=({id:e})=>({id:{chartId:e,providedChartId:e}});const Wg=e=>e.id,Hg=J(Wg,e=>e.chartId);function Ye(e){const t=O.useRef(e);return ot(()=>{t.current=e}),O.useRef((...n)=>(0,t.current)(...n)).current}const qg=["#4254FB","#FFB422","#FA4F58","#0DBEFF","#22BF75","#FA83B4","#FF7511"],Kg=["#495AFB","#FFC758","#F35865","#30C8FF","#44CE8D","#F286B3","#FF8C39"],Yu=e=>e==="dark"?Kg:qg,Wu=({series:e,colors:t,seriesConfig:n})=>{const r={};return e.forEach((i,o)=>{var l;const s=n[i.type].getSeriesWithDefaultValues(i,o,t),a=s.id;if(r[i.type]===void 0&&(r[i.type]={series:{},seriesOrder:[]}),((l=r[i.type])==null?void 0:l.series[a])!==void 0)throw new Error(`MUI X Charts: series' id "${a}" is not unique.`);r[i.type].series[a]=s,r[i.type].seriesOrder.push(a)}),r},Jg=(e,t,n,r)=>{const i={};return Object.keys(t).forEach(o=>{var a,l;const s=e[o];s!==void 0&&(i[o]=((l=(a=t[o])==null?void 0:a.seriesProcessor)==null?void 0:l.call(a,s,n,r))??s)}),i},Xg=(e,t,n)=>{let r=!1;const i={};return Object.keys(e).forEach(o=>{var l;const s=(l=t[o])==null?void 0:l.seriesLayout,a=e[o];if(s!==void 0&&a!==void 0){const c=s(a,n);c&&c!==e[o]&&(r=!0,i[o]=c)}}),r?i:{}},Hu=(e,t)=>{var r;const n=(r=e[t.type])==null?void 0:r.identifierSerializer;if(!n)throw new Error(`MUI X Charts: No identifier serializer found for series type "${t.type}".`);return n(t)},io=({params:e,store:t,seriesConfig:n})=>{const{series:r,dataset:i,theme:o,colors:s}=e;return Gu(()=>{t.set("series",L({},t.state.series,{defaultizedSeries:Wu({series:r,colors:typeof s=="function"?s(o):s,seriesConfig:n}),dataset:i}))},[s,i,r,o,n,t]),{instance:{serializeIdentifier:Ye(l=>Hu(n,l))}}};io.params={dataset:!0,series:!0,colors:!0,theme:!0};const Zg=[];io.getDefaultizedParams=({params:e})=>{var t;return L({},e,{series:(t=e.series)!=null&&t.length?e.series:Zg,colors:e.colors??Yu,theme:e.theme??"light"})};io.getInitialState=({series:e=[],colors:t,theme:n,dataset:r},i,o)=>({series:{seriesConfig:o,defaultizedSeries:Wu({series:e,colors:typeof t=="function"?t(n):t,seriesConfig:o}),dataset:r}});const Qg=(e,t,n)=>{const r=Hu(n,t);return!e.has(r)},ey=e=>e.visibilityManager,ty=new Map,ny=J(ey,e=>(e==null?void 0:e.visibilityMap)??ty),ry=Ee(ny,e=>(t,n)=>Qg(e,n,t)),Ks=e=>e.series,iy=J(Ks,e=>e.defaultizedSeries),Vt=J(Ks,e=>e.seriesConfig),oy=J(Ks,e=>e.dataset),ze=Ee(iy,Vt,oy,ry,function(t,n,r,i){return Jg(t,n,r,o=>i(n,o))});Ee(ze,Vt,gt,function(t,n,r){return Xg(t,n,r)});const sy={abort:!0,animationcancel:!0,animationend:!0,animationiteration:!0,animationstart:!0,auxclick:!0,beforeinput:!0,beforetoggle:!0,blur:!0,cancel:!0,canplay:!0,canplaythrough:!0,change:!0,click:!0,close:!0,compositionend:!0,compositionstart:!0,compositionupdate:!0,contextlost:!0,contextmenu:!0,contextrestored:!0,copy:!0,cuechange:!0,cut:!0,dblclick:!0,drag:!0,dragend:!0,dragenter:!0,dragleave:!0,dragover:!0,dragstart:!0,drop:!0,durationchange:!0,emptied:!0,ended:!0,error:!0,focus:!0,focusin:!0,focusout:!0,formdata:!0,gotpointercapture:!0,input:!0,invalid:!0,keydown:!0,keypress:!0,keyup:!0,load:!0,loadeddata:!0,loadedmetadata:!0,loadstart:!0,lostpointercapture:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,paste:!0,pause:!0,play:!0,playing:!0,pointercancel:!0,pointerdown:!0,pointerenter:!0,pointerleave:!0,pointermove:!0,pointerout:!0,pointerover:!0,pointerup:!0,progress:!0,ratechange:!0,reset:!0,resize:!0,scroll:!0,scrollend:!0,securitypolicyviolation:!0,seeked:!0,seeking:!0,select:!0,selectionchange:!0,selectstart:!0,slotchange:!0,stalled:!0,submit:!0,suspend:!0,timeupdate:!0,toggle:!0,touchcancel:!0,touchend:!0,touchmove:!0,touchstart:!0,transitioncancel:!0,transitionend:!0,transitionrun:!0,transitionstart:!0,volumechange:!0,waiting:!0,webkitanimationend:!0,webkitanimationiteration:!0,webkitanimationstart:!0,webkittransitionend:!0,wheel:!0,beforematch:!0,pointerrawupdate:!0};class qu{constructor(t){W(this,"customData",{});W(this,"handleOptionsChange",t=>{t&&t.detail&&this.updateOptions(t.detail)});W(this,"handleStateChange",t=>{t&&t.detail&&this.updateState(t.detail)});if(!t||!t.name)throw new Error("Gesture must be initialized with a valid name.");if(t.name in sy)throw new Error(`Gesture can't be created with a native event name. Tried to use "${t.name}". Please use a custom name instead.`);this.name=t.name,this.preventDefault=t.preventDefault??!1,this.stopPropagation=t.stopPropagation??!1,this.preventIf=t.preventIf??[],this.requiredKeys=t.requiredKeys??[],this.pointerMode=t.pointerMode??[],this.pointerOptions=t.pointerOptions??{}}init(t,n,r,i){this.element=t,this.pointerManager=n,this.gesturesRegistry=r,this.keyboardManager=i;const o=`${this.name}ChangeOptions`;this.element.addEventListener(o,this.handleOptionsChange);const s=`${this.name}ChangeState`;this.element.addEventListener(s,this.handleStateChange)}updateOptions(t){this.preventDefault=t.preventDefault??this.preventDefault,this.stopPropagation=t.stopPropagation??this.stopPropagation,this.preventIf=t.preventIf??this.preventIf,this.requiredKeys=t.requiredKeys??this.requiredKeys,this.pointerMode=t.pointerMode??this.pointerMode,this.pointerOptions=t.pointerOptions??this.pointerOptions}getBaseConfig(){return{requiredKeys:this.requiredKeys}}getEffectiveConfig(t,n){if(t!=="mouse"&&t!=="touch"&&t!=="pen")return n;const r=this.pointerOptions[t];return r?L({},n,r):n}updateState(t){Object.assign(this.state,t)}getTargetElement(t){return this.isActive||this.element===t.target||"contains"in this.element&&this.element.contains(t.target)||"getRootNode"in this.element&&this.element.getRootNode()instanceof ShadowRoot&&t.composedPath().includes(this.element)?this.element:null}set isActive(t){t?this.gesturesRegistry.registerActiveGesture(this.element,this):this.gesturesRegistry.unregisterActiveGesture(this.element,this)}get isActive(){return this.gesturesRegistry.isGestureActive(this.element,this)??!1}shouldPreventGesture(t,n){const r=this.getEffectiveConfig(n,this.getBaseConfig());if(!this.keyboardManager.areKeysPressed(r.requiredKeys))return!0;if(this.preventIf.length===0)return!1;const i=this.gesturesRegistry.getActiveGestures(t);return this.preventIf.some(o=>i[o])}isPointerTypeAllowed(t){return!this.pointerMode||this.pointerMode.length===0?!0:this.pointerMode.includes(t)}destroy(){const t=`${this.name}ChangeOptions`;this.element.removeEventListener(t,this.handleOptionsChange);const n=`${this.name}ChangeState`;this.element.removeEventListener(n,this.handleStateChange)}}class ay{constructor(){W(this,"activeGestures",new Map)}registerActiveGesture(t,n){this.activeGestures.has(t)||this.activeGestures.set(t,new Set);const r=this.activeGestures.get(t),i={gesture:n,element:t};r.add(i)}unregisterActiveGesture(t,n){const r=this.activeGestures.get(t);r&&(r.forEach(i=>{i.gesture===n&&r.delete(i)}),r.size===0&&this.activeGestures.delete(t))}getActiveGestures(t){const n=this.activeGestures.get(t);return n?Array.from(n).reduce((r,i)=>(r[i.gesture.name]=!0,r),{}):{}}isGestureActive(t,n){const r=this.activeGestures.get(t);return r?Array.from(r).some(i=>i.gesture===n):!1}destroy(){this.activeGestures.clear()}unregisterElement(t){this.activeGestures.delete(t)}}class ly{constructor(){W(this,"pressedKeys",new Set);W(this,"handleKeyDown",t=>{this.pressedKeys.add(t.key)});W(this,"handleKeyUp",t=>{this.pressedKeys.delete(t.key)});W(this,"clearKeys",()=>{this.pressedKeys.clear()});this.initialize()}initialize(){typeof window>"u"||(window.addEventListener("keydown",this.handleKeyDown),window.addEventListener("keyup",this.handleKeyUp),window.addEventListener("blur",this.clearKeys))}areKeysPressed(t){return!t||t.length===0?!0:t.every(n=>n==="ControlOrMeta"?navigator.platform.includes("Mac")?this.pressedKeys.has("Meta"):this.pressedKeys.has("Control"):this.pressedKeys.has(n))}destroy(){typeof window<"u"&&(window.removeEventListener("keydown",this.handleKeyDown),window.removeEventListener("keyup",this.handleKeyUp),window.removeEventListener("blur",this.clearKeys)),this.clearKeys()}}class cy{constructor(t){W(this,"preventEventInterruption",!0);W(this,"pointers",new Map);W(this,"gestureHandlers",new Set);W(this,"handleInterruptEvents",t=>{if(this.preventEventInterruption&&"pointerType"in t&&t.pointerType==="touch"){t.preventDefault();return}const n=new PointerEvent("forceCancel",{bubbles:!1,cancelable:!1}),r=this.pointers.values().next().value;if(this.pointers.size>0&&r){Object.defineProperties(n,{clientX:{value:r.clientX},clientY:{value:r.clientY},pointerId:{value:r.pointerId},pointerType:{value:r.pointerType}});for(const[i,o]of this.pointers.entries()){const s=L({},o,{type:"forceCancel"});this.pointers.set(i,s)}}this.notifyHandlers(n),this.pointers.clear()});W(this,"handlePointerEvent",t=>{const{type:n,pointerId:r}=t;if(n==="pointerdown"||n==="pointermove")this.pointers.set(r,this.createPointerData(t));else if(n==="pointerup"||n==="pointercancel"||n==="forceCancel"){this.pointers.set(r,this.createPointerData(t)),this.notifyHandlers(t),this.pointers.delete(r);return}this.notifyHandlers(t)});this.root=t.root??document.getRootNode({composed:!0})??document.body,this.touchAction=t.touchAction||"auto",this.passive=t.passive??!1,this.preventEventInterruption=t.preventEventInterruption??!0,this.setupEventListeners()}registerGestureHandler(t){return this.gestureHandlers.add(t),()=>{this.gestureHandlers.delete(t)}}getPointers(){return new Map(this.pointers)}setupEventListeners(){this.touchAction!=="auto"&&(this.root.style.touchAction=this.touchAction),this.root.addEventListener("pointerdown",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("pointermove",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("pointerup",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("pointercancel",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("forceCancel",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("blur",this.handleInterruptEvents),this.root.addEventListener("contextmenu",this.handleInterruptEvents)}notifyHandlers(t){this.gestureHandlers.forEach(n=>n(this.pointers,t))}createPointerData(t){return{pointerId:t.pointerId,clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,target:t.target,timeStamp:t.timeStamp,type:t.type,isPrimary:t.isPrimary,pressure:t.pressure,width:t.width,height:t.height,pointerType:t.pointerType,srcEvent:t}}destroy(){this.root.removeEventListener("pointerdown",this.handlePointerEvent),this.root.removeEventListener("pointermove",this.handlePointerEvent),this.root.removeEventListener("pointerup",this.handlePointerEvent),this.root.removeEventListener("pointercancel",this.handlePointerEvent),this.root.removeEventListener("forceCancel",this.handlePointerEvent),this.root.removeEventListener("blur",this.handleInterruptEvents),this.root.removeEventListener("contextmenu",this.handleInterruptEvents),this.pointers.clear(),this.gestureHandlers.clear()}}class uy{constructor(t){W(this,"gestureTemplates",new Map);W(this,"elementGestureMap",new Map);W(this,"activeGesturesRegistry",new ay);W(this,"keyboardManager",new ly);this.pointerManager=new cy({root:t.root,touchAction:t.touchAction,passive:t.passive}),t.gestures&&t.gestures.length>0&&t.gestures.forEach(n=>{this.addGestureTemplate(n)})}addGestureTemplate(t){this.gestureTemplates.has(t.name)&&console.warn(`Gesture template with name "${t.name}" already exists. It will be overwritten.`),this.gestureTemplates.set(t.name,t)}setGestureOptions(t,n,r){const i=this.elementGestureMap.get(n);if(!i||!i.has(t)){console.error(`Gesture "${t}" not found on the provided element.`);return}const o=new CustomEvent(`${t}ChangeOptions`,{detail:r,bubbles:!1,cancelable:!1,composed:!1});n.dispatchEvent(o)}setGestureState(t,n,r){const i=this.elementGestureMap.get(n);if(!i||!i.has(t)){console.error(`Gesture "${t}" not found on the provided element.`);return}const o=new CustomEvent(`${t}ChangeState`,{detail:r,bubbles:!1,cancelable:!1,composed:!1});n.dispatchEvent(o)}registerElement(t,n,r){return Array.isArray(t)||(t=[t]),t.forEach(i=>{const o=r==null?void 0:r[i];this.registerSingleGesture(i,n,o)}),n}registerSingleGesture(t,n,r){const i=this.gestureTemplates.get(t);if(!i)return console.error(`Gesture template "${t}" not found.`),!1;this.elementGestureMap.has(n)||this.elementGestureMap.set(n,new Map);const o=this.elementGestureMap.get(n);o.has(t)&&(console.warn(`Element already has gesture "${t}" registered. It will be replaced.`),this.unregisterElement(t,n));const s=i.clone(r);return s.init(n,this.pointerManager,this.activeGesturesRegistry,this.keyboardManager),o.set(t,s),!0}unregisterElement(t,n){const r=this.elementGestureMap.get(n);return!r||!r.has(t)?!1:(r.get(t).destroy(),r.delete(t),this.activeGesturesRegistry.unregisterElement(n),r.size===0&&this.elementGestureMap.delete(n),!0)}unregisterAllGestures(t){const n=this.elementGestureMap.get(t);if(n){for(const[,r]of n)r.destroy(),this.activeGesturesRegistry.unregisterElement(t);this.elementGestureMap.delete(t)}}destroy(){for(const[t]of this.elementGestureMap)this.unregisterAllGestures(t);this.gestureTemplates.clear(),this.elementGestureMap.clear(),this.activeGesturesRegistry.destroy(),this.keyboardManager.destroy(),this.pointerManager.destroy()}}class fn extends qu{constructor(n){super(n);W(this,"unregisterHandler",null);W(this,"originalTarget",null);this.minPointers=n.minPointers??1,this.maxPointers=n.maxPointers??1/0}init(n,r,i,o){super.init(n,r,i,o),this.unregisterHandler=this.pointerManager.registerGestureHandler(this.handlePointerEvent)}updateOptions(n){super.updateOptions(n),this.minPointers=n.minPointers??this.minPointers,this.maxPointers=n.maxPointers??this.maxPointers}getBaseConfig(){return{requiredKeys:this.requiredKeys,minPointers:this.minPointers,maxPointers:this.maxPointers}}isWithinPointerCount(n,r){const i=this.getEffectiveConfig(r,this.getBaseConfig());return n.length>=i.minPointers&&n.length<=i.maxPointers}getRelevantPointers(n,r){return n.filter(i=>this.isPointerTypeAllowed(i.pointerType)&&(r===i.target||i.target===this.originalTarget||r===this.originalTarget||"contains"in r&&r.contains(i.target))||"getRootNode"in r&&r.getRootNode()instanceof ShadowRoot&&i.srcEvent.composedPath().includes(r))}destroy(){this.unregisterHandler&&(this.unregisterHandler(),this.unregisterHandler=null),super.destroy()}}function dy(e,t){const n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}function Vr(e){if(e.length<2)return 0;let t=0,n=0;for(let r=0;r<e.length;r+=1)for(let i=r+1;i<e.length;i+=1)t+=dy({x:e[r].clientX,y:e[r].clientY},{x:e[i].clientX,y:e[i].clientY}),n+=1;return n>0?t/n:0}function rt(e){if(e.length===0)return{x:0,y:0};const t=e.reduce((n,r)=>(n.x+=r.clientX,n.y+=r.clientY,n),{x:0,y:0});return{x:t.x/e.length,y:t.y/e.length}}function Ze(e,t){return`${e}${t==="ongoing"?"":t.charAt(0).toUpperCase()+t.slice(1)}`}const Yr=1e-5,Ot=1e-5,kl=.15;function hy(e,t){const n=t.x-e.x,r=t.y-e.y,i={vertical:null,horizontal:null,mainAxis:null},o=fy(t,e),s=Math.abs(n)>Math.abs(r)?"horizontal":"vertical",a=o||s==="horizontal"?Yr:kl,l=o?Yr:s==="horizontal"?kl:Yr;return Math.abs(n)>a&&(i.horizontal=n>0?"right":"left"),Math.abs(r)>l&&(i.vertical=r>0?"down":"up"),i.mainAxis=o?"diagonal":s,i}function fy(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.atan2(r,n)*180/Math.PI;return i>=-45+Ot&&i<=-22.5+Ot||i>=22.5+Ot&&i<=45+Ot||i>=135+Ot&&i<=157.5+Ot||i>=-157.5+Ot&&i<=-135+Ot}function py(e,t){if(!e.vertical&&!e.horizontal)return!1;if(t.length===0)return!0;const n=e.vertical===null||t.includes(e.vertical),r=e.horizontal===null||t.includes(e.horizontal);return n&&r}const Ol=0,my=e=>e>Ol?1:e<-Ol?-1:0,Dt=e=>{e.cancelable&&e.preventDefault()};class Js extends fn{constructor(n){super(n);W(this,"state",{lastPosition:null});W(this,"handleElementEnter",n=>{if(n.pointerType!=="mouse"&&n.pointerType!=="pen")return;const r=this.pointerManager.getPointers()||new Map,i=Array.from(r.values());if(this.isWithinPointerCount(i,n.pointerType)){this.isActive=!0;const o={x:n.clientX,y:n.clientY};this.state.lastPosition=o,this.emitMoveEvent(this.element,"start",i,n),this.emitMoveEvent(this.element,"ongoing",i,n)}});W(this,"handleElementLeave",n=>{if(n.pointerType!=="mouse"&&n.pointerType!=="pen"||!this.isActive)return;const r=this.pointerManager.getPointers()||new Map,i=Array.from(r.values());this.emitMoveEvent(this.element,"end",i,n),this.resetState()});W(this,"handlePointerEvent",(n,r)=>{if(r.type!=="pointermove"||r.pointerType!=="mouse"&&r.pointerType!=="pen")return;this.preventDefault&&r.preventDefault(),this.stopPropagation&&r.stopPropagation();const i=Array.from(n.values()),o=this.getTargetElement(r);if(!o||!this.isWithinPointerCount(i,r.pointerType))return;if(this.shouldPreventGesture(o,r.pointerType)){if(!this.isActive)return;this.resetState(),this.emitMoveEvent(o,"end",i,r);return}const s={x:r.clientX,y:r.clientY};this.state.lastPosition=s,this.isActive||(this.isActive=!0,this.emitMoveEvent(o,"start",i,r)),this.emitMoveEvent(o,"ongoing",i,r)});this.threshold=n.threshold||0}clone(n){return new Js(L({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}init(n,r,i,o){super.init(n,r,i,o),this.element.addEventListener("pointerenter",this.handleElementEnter),this.element.addEventListener("pointerleave",this.handleElementLeave)}destroy(){this.element.removeEventListener("pointerenter",this.handleElementEnter),this.element.removeEventListener("pointerleave",this.handleElementLeave),this.resetState(),super.destroy()}updateOptions(n){super.updateOptions(n)}resetState(){this.isActive=!1,this.state={lastPosition:null}}emitMoveEvent(n,r,i,o){const s=this.state.lastPosition||rt(i),a=this.gesturesRegistry.getActiveGestures(n),l={gestureName:this.name,centroid:s,target:o.target,srcEvent:o,phase:r,pointers:i,timeStamp:o.timeStamp,activeGestures:a,customData:this.customData},c=Ze(this.name,r),u=new CustomEvent(c,{bubbles:!0,cancelable:!0,composed:!0,detail:l});n.dispatchEvent(u)}}class on extends fn{constructor(n){super(n);W(this,"state",{startPointers:new Map,startCentroid:null,lastCentroid:null,movementThresholdReached:!1,totalDeltaX:0,totalDeltaY:0,activeDeltaX:0,activeDeltaY:0,lastDirection:{vertical:null,horizontal:null,mainAxis:null},lastDeltas:null});W(this,"handlePointerEvent",(n,r)=>{var a;const i=Array.from(n.values());if(r.type==="forceCancel"){this.cancel(r.target,i,r);return}const o=this.getTargetElement(r);if(!o)return;if(this.shouldPreventGesture(o,r.pointerType)){this.cancel(o,i,r);return}const s=this.getRelevantPointers(i,o);if(!this.isWithinPointerCount(s,r.pointerType)){this.cancel(o,s,r);return}switch(r.type){case"pointerdown":if(!this.isActive&&!this.state.startCentroid)s.forEach(l=>{this.state.startPointers.set(l.pointerId,l)}),this.originalTarget=o,this.state.startCentroid=rt(s),this.state.lastCentroid=L({},this.state.startCentroid);else if(this.state.startCentroid&&this.state.lastCentroid){const l=this.state.lastCentroid,c=rt(s),u=c.x-l.x,d=c.y-l.y;this.state.startCentroid={x:this.state.startCentroid.x+u,y:this.state.startCentroid.y+d},this.state.lastCentroid=c,s.forEach(h=>{this.state.startPointers.has(h.pointerId)||this.state.startPointers.set(h.pointerId,h)})}break;case"pointermove":if(this.state.startCentroid&&this.isWithinPointerCount(i,r.pointerType)){const l=rt(s),c=l.x-this.state.startCentroid.x,u=l.y-this.state.startCentroid.y,d=Math.sqrt(c*c+u*u),h=hy(this.state.lastCentroid??this.state.startCentroid,l),f=this.state.lastCentroid?l.x-this.state.lastCentroid.x:0,m=this.state.lastCentroid?l.y-this.state.lastCentroid.y:0;!this.state.movementThresholdReached&&d>=this.threshold&&py(h,this.direction)?(this.state.movementThresholdReached=!0,this.isActive=!0,this.state.lastDeltas={x:f,y:m},this.state.totalDeltaX+=f,this.state.totalDeltaY+=m,this.state.activeDeltaX+=f,this.state.activeDeltaY+=m,this.emitPanEvent(o,"start",s,r,l),this.emitPanEvent(o,"ongoing",s,r,l)):this.state.movementThresholdReached&&this.isActive&&(this.state.lastDeltas={x:f,y:m},this.state.totalDeltaX+=f,this.state.totalDeltaY+=m,this.state.activeDeltaX+=f,this.state.activeDeltaY+=m,this.emitPanEvent(o,"ongoing",s,r,l)),this.state.lastCentroid=l,this.state.lastDirection=h}break;case"pointerup":case"pointercancel":case"forceCancel":if(this.isActive&&this.state.movementThresholdReached){const l=s.filter(c=>c.type!=="pointerup"&&c.type!=="pointercancel");if(this.isWithinPointerCount(l,r.pointerType)){if(l.length>=1&&this.state.lastCentroid){const c=rt(l),u=c.x-this.state.lastCentroid.x,d=c.y-this.state.lastCentroid.y;this.state.startCentroid={x:this.state.startCentroid.x+u,y:this.state.startCentroid.y+d},this.state.lastCentroid=c;const h=(a=s.find(f=>f.type==="pointerup"||f.type==="pointercancel"))==null?void 0:a.pointerId;h!==void 0&&this.state.startPointers.delete(h)}}else{const c=this.state.lastCentroid||this.state.startCentroid;r.type==="pointercancel"&&this.emitPanEvent(o,"cancel",s,r,c),this.emitPanEvent(o,"end",s,r,c),this.resetState()}}else this.resetState();break}});this.direction=n.direction||["up","down","left","right"],this.threshold=n.threshold||0}clone(n){return new on(L({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,direction:[...this.direction],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}destroy(){this.resetState(),super.destroy()}updateOptions(n){super.updateOptions(n),this.direction=n.direction||this.direction,this.threshold=n.threshold??this.threshold}resetState(){this.isActive=!1,this.state=L({},this.state,{startPointers:new Map,startCentroid:null,lastCentroid:null,lastDeltas:null,activeDeltaX:0,activeDeltaY:0,movementThresholdReached:!1,lastDirection:{vertical:null,horizontal:null,mainAxis:null}})}emitPanEvent(n,r,i,o,s){var E,T;if(!this.state.startCentroid)return;const a=((E=this.state.lastDeltas)==null?void 0:E.x)??0,l=((T=this.state.lastDeltas)==null?void 0:T.y)??0,c=this.state.startPointers.values().next().value,u=c?(o.timeStamp-c.timeStamp)/1e3:0,d=u>0?a/u:0,h=u>0?l/u:0,f=Math.sqrt(d*d+h*h),m=this.gesturesRegistry.getActiveGestures(n),p={gestureName:this.name,initialCentroid:this.state.startCentroid,centroid:s,target:o.target,srcEvent:o,phase:r,pointers:i,timeStamp:o.timeStamp,deltaX:a,deltaY:l,direction:this.state.lastDirection,velocityX:d,velocityY:h,velocity:f,totalDeltaX:this.state.totalDeltaX,totalDeltaY:this.state.totalDeltaY,activeDeltaX:this.state.activeDeltaX,activeDeltaY:this.state.activeDeltaY,activeGestures:m,customData:this.customData},y=Ze(this.name,r),b=new CustomEvent(y,{bubbles:!0,cancelable:!0,composed:!0,detail:p});n.dispatchEvent(b),this.preventDefault&&o.preventDefault(),this.stopPropagation&&o.stopPropagation()}cancel(n,r,i){if(this.isActive){const o=n??this.element;this.emitPanEvent(o,"cancel",r,i,this.state.lastCentroid),this.emitPanEvent(o,"end",r,i,this.state.lastCentroid)}this.resetState()}}class Xs extends fn{constructor(n){super(L({},n,{minPointers:n.minPointers??2}));W(this,"state",{startDistance:0,lastDistance:0,lastScale:1,lastTime:0,velocity:0,totalScale:1,deltaScale:0});W(this,"handlePointerEvent",(n,r)=>{const i=Array.from(n.values()),o=this.getTargetElement(r);if(!o)return;if(this.shouldPreventGesture(o,r.pointerType)){this.isActive&&(this.emitPinchEvent(o,"cancel",i,r),this.resetState());return}const s=this.getRelevantPointers(i,o);switch(r.type){case"pointerdown":if(s.length>=2&&!this.isActive){const a=Vr(s);this.state.startDistance=a,this.state.lastDistance=a,this.state.lastTime=r.timeStamp,this.originalTarget=o}else if(this.isActive&&s.length>=2){const a=Vr(s);this.state.startDistance=a/this.state.lastScale,this.state.lastDistance=a,this.state.lastTime=r.timeStamp}break;case"pointermove":if(this.state.startDistance&&this.isWithinPointerCount(s,r.pointerType)){const a=Vr(s),l=Math.abs(a-this.state.lastDistance);if(l!==0&&l>=this.threshold){const c=this.state.startDistance?a/this.state.startDistance:1,u=c/this.state.lastScale;this.state.totalScale*=u;const d=(r.timeStamp-this.state.lastTime)/1e3;if(this.state.lastDistance){const f=(a-this.state.lastDistance)/d;this.state.velocity=Number.isNaN(f)?0:f}this.state.lastDistance=a,this.state.deltaScale=c-this.state.lastScale,this.state.lastScale=c,this.state.lastTime=r.timeStamp,this.isActive?this.emitPinchEvent(o,"ongoing",s,r):(this.isActive=!0,this.emitPinchEvent(o,"start",s,r),this.emitPinchEvent(o,"ongoing",s,r))}}break;case"pointerup":case"pointercancel":case"forceCancel":if(this.isActive){const a=s.filter(l=>l.type!=="pointerup"&&l.type!=="pointercancel");if(!this.isWithinPointerCount(a,r.pointerType))r.type==="pointercancel"&&this.emitPinchEvent(o,"cancel",s,r),this.emitPinchEvent(o,"end",s,r),this.resetState();else if(a.length>=2){const l=Vr(a);this.state.startDistance=l/this.state.lastScale,this.state.lastDistance=l,this.state.lastTime=r.timeStamp}}break}});this.threshold=n.threshold??0}clone(n){return new Xs(L({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}destroy(){this.resetState(),super.destroy()}updateOptions(n){super.updateOptions(n)}resetState(){this.isActive=!1,this.state=L({},this.state,{startDistance:0,lastDistance:0,lastScale:1,lastTime:0,velocity:0,deltaScale:0})}emitPinchEvent(n,r,i,o){const s=rt(i),a=this.state.lastDistance,l=this.state.lastScale,c=this.gesturesRegistry.getActiveGestures(n),u={gestureName:this.name,centroid:s,target:o.target,srcEvent:o,phase:r,pointers:i,timeStamp:o.timeStamp,scale:l,deltaScale:this.state.deltaScale,totalScale:this.state.totalScale,distance:a,velocity:this.state.velocity,activeGestures:c,direction:my(this.state.velocity),customData:this.customData};this.preventDefault&&o.preventDefault(),this.stopPropagation&&o.stopPropagation();const d=Ze(this.name,r),h=new CustomEvent(d,{bubbles:!0,cancelable:!0,composed:!0,detail:u});n.dispatchEvent(h)}}class oo extends fn{constructor(n){super(n);W(this,"state",{startCentroid:null,lastPosition:null,timerId:null,startTime:0,pressThresholdReached:!1});W(this,"handlePointerEvent",(n,r)=>{const i=Array.from(n.values());if(r.type==="forceCancel"){this.cancelPress(r.target,i,r);return}const o=this.getTargetElement(r);if(!o)return;if(this.shouldPreventGesture(o,r.pointerType)){this.isActive&&this.cancelPress(o,i,r);return}const s=this.getRelevantPointers(i,o);if(!this.isWithinPointerCount(s,r.pointerType)){this.isActive&&this.cancelPress(o,s,r);return}switch(r.type){case"pointerdown":!this.isActive&&!this.state.startCentroid&&(this.state.startCentroid=rt(s),this.state.lastPosition=L({},this.state.startCentroid),this.state.startTime=r.timeStamp,this.isActive=!0,this.originalTarget=o,this.clearPressTimer(),this.state.timerId=setTimeout(()=>{if(this.isActive&&this.state.startCentroid){this.state.pressThresholdReached=!0;const a=this.state.lastPosition;this.emitPressEvent(o,"start",s,r,a),this.emitPressEvent(o,"ongoing",s,r,a)}},this.duration));break;case"pointermove":if(this.isActive&&this.state.startCentroid){const a=rt(s);this.state.lastPosition=a;const l=a.x-this.state.startCentroid.x,c=a.y-this.state.startCentroid.y;Math.sqrt(l*l+c*c)>this.maxDistance&&this.cancelPress(o,s,r)}break;case"pointerup":if(this.isActive){if(this.state.pressThresholdReached){const a=this.state.lastPosition||this.state.startCentroid;this.emitPressEvent(o,"end",s,r,a)}this.resetState()}break;case"pointercancel":case"forceCancel":this.cancelPress(o,s,r);break}});this.duration=n.duration??500,this.maxDistance=n.maxDistance??10}clone(n){return new oo(L({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,duration:this.duration,maxDistance:this.maxDistance,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}destroy(){this.clearPressTimer(),this.resetState(),super.destroy()}updateOptions(n){super.updateOptions(n),this.duration=n.duration??this.duration,this.maxDistance=n.maxDistance??this.maxDistance}resetState(){this.clearPressTimer(),this.isActive=!1,this.state=L({},this.state,{startCentroid:null,lastPosition:null,timerId:null,startTime:0,pressThresholdReached:!1})}clearPressTimer(){this.state.timerId!==null&&(clearTimeout(this.state.timerId),this.state.timerId=null)}emitPressEvent(n,r,i,o,s){const a=this.gesturesRegistry.getActiveGestures(n),l=o.timeStamp-this.state.startTime,c={gestureName:this.name,centroid:s,target:o.target,srcEvent:o,phase:r,pointers:i,timeStamp:o.timeStamp,x:s.x,y:s.y,duration:l,activeGestures:a,customData:this.customData},u=Ze(this.name,r),d=new CustomEvent(u,{bubbles:!0,cancelable:!0,composed:!0,detail:c});n.dispatchEvent(d),this.preventDefault&&o.preventDefault(),this.stopPropagation&&o.stopPropagation()}cancelPress(n,r,i){if(this.isActive&&this.state.pressThresholdReached){const o=this.state.lastPosition||this.state.startCentroid;this.emitPressEvent(n??this.element,"cancel",r,i,o),this.emitPressEvent(n??this.element,"end",r,i,o)}this.resetState()}}class Zs extends fn{constructor(n){super(n);W(this,"state",{phase:"waitingForPress",dragTimeoutId:null});W(this,"pressHandler",()=>{this.state.phase==="waitingForPress"&&(this.state.phase="pressDetected",this.setTouchAction(),this.state.dragTimeoutId=setTimeout(()=>{this.resetState()},this.dragTimeout))});W(this,"dragStartHandler",n=>{this.state.phase==="pressDetected"&&(this.state.dragTimeoutId!==null&&(clearTimeout(this.state.dragTimeoutId),this.state.dragTimeoutId=null),this.restoreTouchAction(),this.state.phase="dragging",this.isActive=!0,this.element.dispatchEvent(new CustomEvent(Ze(this.name,n.detail.phase),n)))});W(this,"dragMoveHandler",n=>{this.state.phase==="dragging"&&this.element.dispatchEvent(new CustomEvent(Ze(this.name,n.detail.phase),n))});W(this,"dragEndHandler",n=>{this.state.phase==="dragging"&&(this.resetState(),this.element.dispatchEvent(new CustomEvent(Ze(this.name,n.detail.phase),n)))});this.pressDuration=n.pressDuration??500,this.pressMaxDistance=n.pressMaxDistance??10,this.dragTimeout=n.dragTimeout??1e3,this.dragThreshold=n.dragThreshold??0,this.dragDirection=n.dragDirection||["up","down","left","right"],this.pressGesture=new oo({name:`${this.name}-press`,duration:this.pressDuration,maxDistance:this.pressMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}),this.panGesture=new on({name:`${this.name}-pan`,minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)})}clone(n){return new Zs(L({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,pressDuration:this.pressDuration,pressMaxDistance:this.pressMaxDistance,dragTimeout:this.dragTimeout,dragThreshold:this.dragThreshold,dragDirection:[...this.dragDirection],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}init(n,r,i,o){super.init(n,r,i,o),this.pressGesture.init(n,r,i,o),this.panGesture.init(n,r,i,o),this.element.addEventListener(this.pressGesture.name,this.pressHandler),this.element.addEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.addEventListener(this.panGesture.name,this.dragMoveHandler),this.element.addEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.addEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler)}destroy(){this.resetState(),this.pressGesture.destroy(),this.panGesture.destroy(),this.element.removeEventListener(this.pressGesture.name,this.pressHandler),this.element.removeEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.removeEventListener(this.panGesture.name,this.dragMoveHandler),this.element.removeEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.removeEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler),super.destroy()}updateOptions(n){super.updateOptions(n),this.pressDuration=n.pressDuration??this.pressDuration,this.pressMaxDistance=n.pressMaxDistance??this.pressMaxDistance,this.dragTimeout=n.dragTimeout??this.dragTimeout,this.dragThreshold=n.dragThreshold??this.dragThreshold,this.dragDirection=n.dragDirection||this.dragDirection,this.element.dispatchEvent(new CustomEvent(`${this.panGesture.name}ChangeOptions`,{detail:{minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}})),this.element.dispatchEvent(new CustomEvent(`${this.pressGesture.name}ChangeOptions`,{detail:{duration:this.pressDuration,maxDistance:this.pressMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}}))}resetState(){this.state.dragTimeoutId!==null&&clearTimeout(this.state.dragTimeoutId),this.restoreTouchAction(),this.isActive=!1,this.state={phase:"waitingForPress",dragTimeoutId:null}}handlePointerEvent(){}setTouchAction(){this.element.addEventListener("touchstart",Dt,{passive:!1}),this.element.addEventListener("touchmove",Dt,{passive:!1}),this.element.addEventListener("touchend",Dt,{passive:!1})}restoreTouchAction(){this.element.removeEventListener("touchstart",Dt),this.element.removeEventListener("touchmove",Dt),this.element.removeEventListener("touchend",Dt)}}class hr extends fn{constructor(n){super(n);W(this,"state",{startCentroid:null,currentTapCount:0,lastTapTime:0,lastPosition:null});W(this,"handlePointerEvent",(n,r)=>{const i=Array.from(n.values()),o=this.getTargetElement(r);if(!o)return;const s=this.getRelevantPointers(i,o);if(this.shouldPreventGesture(o,r.pointerType)||!this.isWithinPointerCount(s,r.pointerType)){this.isActive&&this.cancelTap(o,s,r);return}switch(r.type){case"pointerdown":this.isActive||(this.state.startCentroid=rt(s),this.state.lastPosition=L({},this.state.startCentroid),this.isActive=!0,this.originalTarget=o);break;case"pointermove":if(this.isActive&&this.state.startCentroid){const a=rt(s);this.state.lastPosition=a;const l=a.x-this.state.startCentroid.x,c=a.y-this.state.startCentroid.y;Math.sqrt(l*l+c*c)>this.maxDistance&&this.cancelTap(o,s,r)}break;case"pointerup":if(this.isActive){this.state.currentTapCount+=1;const a=this.state.lastPosition||this.state.startCentroid;if(!a){this.cancelTap(o,s,r);return}this.state.currentTapCount>=this.taps?(this.fireTapEvent(o,s,r,a),this.resetState()):(this.state.lastTapTime=r.timeStamp,this.isActive=!1,this.state.startCentroid=null,setTimeout(()=>{this.state&&this.state.currentTapCount>0&&this.state.currentTapCount<this.taps&&(this.state.currentTapCount=0)},300))}break;case"pointercancel":case"forceCancel":this.cancelTap(o,s,r);break}});this.maxDistance=n.maxDistance??10,this.taps=n.taps??1}clone(n){return new hr(L({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,maxDistance:this.maxDistance,taps:this.taps,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}destroy(){this.resetState(),super.destroy()}updateOptions(n){super.updateOptions(n),this.maxDistance=n.maxDistance??this.maxDistance,this.taps=n.taps??this.taps}resetState(){this.isActive=!1,this.state={startCentroid:null,currentTapCount:0,lastTapTime:0,lastPosition:null}}fireTapEvent(n,r,i,o){const s=this.gesturesRegistry.getActiveGestures(n),a={gestureName:this.name,centroid:o,target:i.target,srcEvent:i,phase:"end",pointers:r,timeStamp:i.timeStamp,x:o.x,y:o.y,tapCount:this.state.currentTapCount,activeGestures:s,customData:this.customData},l=new CustomEvent(this.name,{bubbles:!0,cancelable:!0,composed:!0,detail:a});n.dispatchEvent(l),this.preventDefault&&i.preventDefault(),this.stopPropagation&&i.stopPropagation()}cancelTap(n,r,i){if(this.state.startCentroid||this.state.lastPosition){const o=this.state.lastPosition||this.state.startCentroid,s=this.gesturesRegistry.getActiveGestures(n),a={gestureName:this.name,centroid:o,target:i.target,srcEvent:i,phase:"cancel",pointers:r,timeStamp:i.timeStamp,x:o.x,y:o.y,tapCount:this.state.currentTapCount,activeGestures:s,customData:this.customData},l=Ze(this.name,"cancel"),c=new CustomEvent(l,{bubbles:!0,cancelable:!0,composed:!0,detail:a});n.dispatchEvent(c)}this.resetState()}}class Qs extends fn{constructor(n){super(n);W(this,"state",{phase:"waitingForTap",dragTimeoutId:null});W(this,"tapHandler",()=>{this.state.phase==="waitingForTap"&&(this.state.phase="tapDetected",this.setTouchAction(),this.state.dragTimeoutId=setTimeout(()=>{this.resetState()},this.dragTimeout))});W(this,"dragStartHandler",n=>{this.state.phase==="tapDetected"&&(this.state.dragTimeoutId!==null&&(clearTimeout(this.state.dragTimeoutId),this.state.dragTimeoutId=null),this.restoreTouchAction(),this.state.phase="dragging",this.isActive=!0,this.element.dispatchEvent(new CustomEvent(Ze(this.name,n.detail.phase),n)))});W(this,"dragMoveHandler",n=>{this.state.phase==="dragging"&&this.element.dispatchEvent(new CustomEvent(Ze(this.name,n.detail.phase),n))});W(this,"dragEndHandler",n=>{this.state.phase==="dragging"&&(this.resetState(),this.element.dispatchEvent(new CustomEvent(Ze(this.name,n.detail.phase),n)))});this.tapMaxDistance=n.tapMaxDistance??10,this.dragTimeout=n.dragTimeout??1e3,this.dragThreshold=n.dragThreshold??0,this.dragDirection=n.dragDirection||["up","down","left","right"],this.tapGesture=new hr({name:`${this.name}-tap`,maxDistance:this.tapMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}),this.panGesture=new on({name:`${this.name}-pan`,minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)})}clone(n){return new Qs(L({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,tapMaxDistance:this.tapMaxDistance,dragTimeout:this.dragTimeout,dragThreshold:this.dragThreshold,dragDirection:[...this.dragDirection],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},n))}init(n,r,i,o){super.init(n,r,i,o),this.tapGesture.init(n,r,i,o),this.panGesture.init(n,r,i,o),this.element.addEventListener(this.tapGesture.name,this.tapHandler),this.element.addEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.addEventListener(this.panGesture.name,this.dragMoveHandler),this.element.addEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.addEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler)}destroy(){this.resetState(),this.tapGesture.destroy(),this.panGesture.destroy(),this.element.removeEventListener(this.tapGesture.name,this.tapHandler),this.element.removeEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.removeEventListener(this.panGesture.name,this.dragMoveHandler),this.element.removeEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.removeEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler),super.destroy()}updateOptions(n){super.updateOptions(n),this.tapMaxDistance=n.tapMaxDistance??this.tapMaxDistance,this.dragTimeout=n.dragTimeout??this.dragTimeout,this.dragThreshold=n.dragThreshold??this.dragThreshold,this.dragDirection=n.dragDirection||this.dragDirection,this.element.dispatchEvent(new CustomEvent(`${this.panGesture.name}ChangeOptions`,{detail:{minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}})),this.element.dispatchEvent(new CustomEvent(`${this.tapGesture.name}ChangeOptions`,{detail:{maxDistance:this.tapMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}}))}resetState(){this.state.dragTimeoutId!==null&&clearTimeout(this.state.dragTimeoutId),this.restoreTouchAction(),this.isActive=!1,this.state={phase:"waitingForTap",dragTimeoutId:null}}handlePointerEvent(){}setTouchAction(){this.element.addEventListener("touchstart",Dt,{passive:!1})}restoreTouchAction(){this.element.removeEventListener("touchstart",Dt)}}class xi extends qu{constructor(n){super(n);W(this,"state",{totalDeltaX:0,totalDeltaY:0,totalDeltaZ:0});W(this,"handleWheelEvent",n=>{if(this.shouldPreventGesture(this.element,"mouse"))return;const r=this.pointerManager.getPointers()||new Map,i=Array.from(r.values());this.state.totalDeltaX+=n.deltaX*this.sensitivity*(this.invert?-1:1),this.state.totalDeltaY+=n.deltaY*this.sensitivity*(this.invert?-1:1),this.state.totalDeltaZ+=n.deltaZ*this.sensitivity*(this.invert?-1:1),["totalDeltaX","totalDeltaY","totalDeltaZ"].forEach(o=>{this.state[o]<this.min&&(this.state[o]=this.min),this.state[o]>this.max&&(this.state[o]=this.max)}),this.emitWheelEvent(i,n)});this.sensitivity=n.sensitivity??1,this.max=n.max??Number.MAX_SAFE_INTEGER,this.min=n.min??Number.MIN_SAFE_INTEGER,this.initialDelta=n.initialDelta??0,this.invert=n.invert??!1,this.state.totalDeltaX=this.initialDelta,this.state.totalDeltaY=this.initialDelta,this.state.totalDeltaZ=this.initialDelta}clone(n){return new xi(L({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,sensitivity:this.sensitivity,max:this.max,min:this.min,initialDelta:this.initialDelta,invert:this.invert,requiredKeys:[...this.requiredKeys],preventIf:[...this.preventIf]},n))}init(n,r,i,o){super.init(n,r,i,o),this.element.addEventListener("wheel",this.handleWheelEvent)}destroy(){this.element.removeEventListener("wheel",this.handleWheelEvent),this.resetState(),super.destroy()}resetState(){this.isActive=!1,this.state={totalDeltaX:0,totalDeltaY:0,totalDeltaZ:0}}updateOptions(n){super.updateOptions(n),this.sensitivity=n.sensitivity??this.sensitivity,this.max=n.max??this.max,this.min=n.min??this.min,this.initialDelta=n.initialDelta??this.initialDelta,this.invert=n.invert??this.invert}emitWheelEvent(n,r){const i=n.length>0?rt(n):{x:r.clientX,y:r.clientY},o=this.gesturesRegistry.getActiveGestures(this.element),s={gestureName:this.name,centroid:i,target:r.target,srcEvent:r,phase:"ongoing",pointers:n,timeStamp:r.timeStamp,deltaX:r.deltaX*this.sensitivity*(this.invert?-1:1),deltaY:r.deltaY*this.sensitivity*(this.invert?-1:1),deltaZ:r.deltaZ*this.sensitivity*(this.invert?-1:1),deltaMode:r.deltaMode,totalDeltaX:this.state.totalDeltaX,totalDeltaY:this.state.totalDeltaY,totalDeltaZ:this.state.totalDeltaZ,activeGestures:o,customData:this.customData};this.preventDefault&&r.preventDefault(),this.stopPropagation&&r.stopPropagation();const a=Ze(this.name,"ongoing"),l=new CustomEvent(a,{bubbles:!0,cancelable:!0,composed:!0,detail:s});this.element.dispatchEvent(l)}}const Mn=e=>e.preventDefault(),ea=({svgRef:e})=>{const t=O.useRef(null);O.useEffect(()=>{const i=e.current;t.current||(t.current=new uy({gestures:[new on({name:"pan",threshold:0,maxPointers:1}),new Js({name:"move",preventIf:["pan","zoomPinch","zoomPan"]}),new hr({name:"tap",preventIf:["pan","zoomPinch","zoomPan"]}),new oo({name:"quickPress",duration:50}),new on({name:"brush",threshold:0,maxPointers:1}),new on({name:"zoomPan",threshold:0,preventIf:["zoomTapAndDrag","zoomPressAndDrag"]}),new Xs({name:"zoomPinch",threshold:5}),new xi({name:"zoomTurnWheel",sensitivity:.01,initialDelta:1}),new xi({name:"panTurnWheel",sensitivity:.5}),new Qs({name:"zoomTapAndDrag",dragThreshold:10}),new Zs({name:"zoomPressAndDrag",dragThreshold:10,preventIf:["zoomPinch"]}),new hr({name:"zoomDoubleTapReset",taps:2})]}));const o=t.current;if(!(!i||!o))return o.registerElement(["pan","move","zoomPinch","zoomPan","zoomTurnWheel","panTurnWheel","tap","quickPress","zoomTapAndDrag","zoomPressAndDrag","zoomDoubleTapReset","brush"],i),()=>{o.unregisterAllGestures(i)}},[e,t]);const n=O.useCallback((i,o,s)=>{const a=e.current;return a==null||a.addEventListener(i,o,s),{cleanup:()=>a==null?void 0:a.removeEventListener(i,o)}},[e]),r=O.useCallback((i,o)=>{const s=e.current,a=t.current;!a||!s||a.setGestureOptions(i,s,o??{})},[e,t]);return O.useEffect(()=>{const i=e.current;return i==null||i.addEventListener("gesturestart",Mn),i==null||i.addEventListener("gesturechange",Mn),i==null||i.addEventListener("gestureend",Mn),()=>{i==null||i.removeEventListener("gesturestart",Mn),i==null||i.removeEventListener("gesturechange",Mn),i==null||i.removeEventListener("gestureend",Mn)}},[e]),{instance:{addInteractionListener:n,updateZoomInteractionListeners:r}}};ea.params={};ea.getInitialState=()=>({});const gy=[qs,Hs,no,io,ea,to],yy=["apiRef"],xy=e=>{let{plugins:t}=e,n=pt(e.props,yy);const r={};t.forEach(s=>{Object.assign(r,s.params)});const i={};return Object.keys(n).forEach(s=>{const a=n[s];r[s]&&(i[s]=a)}),t.reduce((s,a)=>a.getDefaultizedParams?a.getDefaultizedParams({params:s}):s,i)};let Pl=0;function by(e,t,n){const r=Yp(),i=O.useMemo(()=>[...gy,...e],[e]),o=xy({plugins:i,props:t});o.id=o.id??r;const a=O.useRef({}).current,l=Sy(t.apiRef),c=O.useRef(null),u=O.useRef(null),d=O.useRef(null);if(d.current==null){Pl+=1;const m={cacheKey:{id:Pl}};i.forEach(p=>{p.getInitialState&&Object.assign(m,p.getInitialState(o,m,n))}),d.current=new Ws(m)}const h=m=>{const p=m({instance:a,params:o,plugins:i,store:d.current,svgRef:u,chartRootRef:c,seriesConfig:n});p.publicAPI&&Object.assign(l.current,p.publicAPI),p.instance&&Object.assign(a,p.instance)};return i.forEach(h),{contextValue:O.useMemo(()=>({store:d.current,publicAPI:l.current,instance:a,svgRef:u,chartRootRef:c}),[a,l])}}function vy(e){return e.current==null&&(e.current={}),e}function Sy(e){const t=O.useRef({});return e?vy(e):t}const ta=O.createContext(null);process.env.NODE_ENV!=="production"&&(ta.displayName="ChartContext");const Dl=new Set;function Nn(e,t="warning"){if(process.env.NODE_ENV==="production")return;const n=Array.isArray(e)?e.join(`
|
|
94
|
+
`):e;Dl.has(n)||(Dl.add(n),t==="error"?console.error(n):console.warn(n))}function Ey(e){const{componentName:t,propName:n,controlled:r,defaultValue:i,warningPrefix:o="MUI X"}=e,[{initialDefaultValue:s,isControlled:a}]=O.useState({initialDefaultValue:i,isControlled:r!==void 0});a!==(r!==void 0)&&Nn([`${o}: A component is changing the ${a?"":"un"}controlled ${n} state of ${t} to be ${a?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"],"error"),JSON.stringify(s)!==JSON.stringify(i)&&Nn([`${o}: A component is changing the default ${n} state of an uncontrolled ${t} after being initialized. To suppress this warning opt to use a controlled ${t}.`],"error")}const na=process.env.NODE_ENV==="production"?()=>{}:Ey,Ku=4,Ju=20+2*Ku,Ty=40+2*Ku,wy="hover",Wr={minStart:0,maxEnd:100,step:5,minSpan:10,maxSpan:100,panning:!0,filterMode:"keep",reverse:!1,slider:{enabled:!1,preview:!1,size:Ju,showTooltip:wy}},ra=(e,t,n,r)=>{var i;if(e)return e===!0?L({axisId:t,axisDirection:n},Wr,{reverse:r??!1}):L({axisId:t,axisDirection:n},Wr,{reverse:r??!1},e,{slider:L({},Wr.slider,{size:((i=e.slider)==null?void 0:i.preview)??Wr.slider.preview?Ty:Ju},e.slider)})};function Xu(e,t){const n={top:0,bottom:0,none:0};return(e&&e.length>0?e:[{id:Ag,scaleType:"linear"}]).map((o,s)=>{var f;const a=o.dataKey,l=s===0?"bottom":"none",c=o.position??l,u=kg+(o.label?Uu:0),d=o.id??`defaultized-x-axis-${s}`,h=L({offset:n[c]},o,{id:d,position:c,height:o.height??u,zoom:ra(o.zoom,d,"x",o.reverse)});if(c!=="none"&&(n[c]+=h.height,(f=h.zoom)!=null&&f.slider.enabled&&(n[c]+=h.zoom.slider.size)),a===void 0||o.data!==void 0)return h;if(t===void 0)throw new Error("MUI X Charts: x-axis uses `dataKey` but no `dataset` is provided.");return L({},h,{data:t.map(m=>m[a])})})}function Zu(e,t){const n={right:0,left:0,none:0};return(e&&e.length>0?e:[{id:_g,scaleType:"linear"}]).map((o,s)=>{var f;const a=o.dataKey,l=s===0?"left":"none",c=o.position??l,u=jg+(o.label?Uu:0),d=o.id??`defaultized-y-axis-${s}`,h=L({offset:n[c]},o,{id:d,position:c,width:o.width??u,zoom:ra(o.zoom,d,"y",o.reverse)});if(c!=="none"&&(n[c]+=h.width,(f=h.zoom)!=null&&f.slider.enabled&&(n[c]+=h.zoom.slider.size)),a===void 0||o.data!==void 0)return h;if(t===void 0)throw new Error("MUI X Charts: y-axis uses `dataKey` but no `dataset` is provided.");return L({},h,{data:t.map(m=>m[a])})})}function Cy(e,t){return function(r,i){if(i.location==="tick"){const o=i.scale.domain();return o[0]===o[1]?i.scale.tickFormat(1)(r):i.scale.tickFormat(e)(r)}return i.location==="zoom-slider-tooltip"?t.tickFormat(2)(r):`${r}`}}function Yn(e){return e.scaleType==="band"}function Wn(e){return e.scaleType==="point"}function My(e){return e.scaleType==="symlog"}function ui(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ry(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ia(e){let t,n,r;e.length!==2?(t=ui,n=(a,l)=>ui(e(a),l),r=(a,l)=>e(a)-l):(t=e===ui||e===Ry?e:Ay,n=e,r=e);function i(a,l,c=0,u=a.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(a[d],l)<0?c=d+1:u=d}while(c<u)}return c}function o(a,l,c=0,u=a.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(a[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function s(a,l,c=0,u=a.length){const d=i(a,l,c,u-1);return d>c&&r(a[d-1],l)>-r(a[d],l)?d-1:d}return{left:i,center:s,right:o}}function Ay(){return 0}function _y(e){return e===null?NaN:+e}const Iy=ia(ui),Qu=Iy.right;ia(_y).center;class bi extends Map{constructor(t,n=Oy){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get($l(this,t))}has(t){return super.has($l(this,t))}set(t,n){return super.set(jy(this,t),n)}delete(t){return super.delete(ky(this,t))}}function $l({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function jy({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function ky({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Oy(e){return e!==null&&typeof e=="object"?e.valueOf():e}const Py=Math.sqrt(50),Dy=Math.sqrt(10),$y=Math.sqrt(2);function vi(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=Py?10:o>=Dy?5:o>=$y?2:1;let a,l,c;return i<0?(c=Math.pow(10,-i)/s,a=Math.round(e*c),l=Math.round(t*c),a/c<e&&++a,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*s,a=Math.round(e/c),l=Math.round(t/c),a*c<e&&++a,l*c>t&&--l),l<a&&.5<=n&&n<2?vi(e,t,n*2):[a,l,c]}function ys(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,s]=r?vi(t,e,n):vi(e,t,n);if(!(o>=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let c=0;c<a;++c)l[c]=(o-c)/-s;else for(let c=0;c<a;++c)l[c]=(o-c)*s;else if(s<0)for(let c=0;c<a;++c)l[c]=(i+c)/-s;else for(let c=0;c<a;++c)l[c]=(i+c)*s;return l}function xs(e,t,n){return t=+t,e=+e,n=+n,vi(e,t,n)[2]}function bs(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?xs(t,e,n):xs(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Ny(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function Yt(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ly(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Nl=Symbol("implicit");function vs(){var e=new bi,t=[],n=[],r=Nl;function i(o){let s=e.get(o);if(s===void 0){if(r!==Nl)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new bi;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return vs(t,n).unknown(r)},Yt.apply(i,arguments),i}function oa(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ed(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Mr(){}var fr=.7,Si=1/fr,On="\\s*([+-]?\\d+)\\s*",pr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ft="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zy=/^#([0-9a-f]{3,8})$/,Fy=new RegExp(`^rgb\\(${On},${On},${On}\\)$`),By=new RegExp(`^rgb\\(${ft},${ft},${ft}\\)$`),Gy=new RegExp(`^rgba\\(${On},${On},${On},${pr}\\)$`),Uy=new RegExp(`^rgba\\(${ft},${ft},${ft},${pr}\\)$`),Vy=new RegExp(`^hsl\\(${pr},${ft},${ft}\\)$`),Yy=new RegExp(`^hsla\\(${pr},${ft},${ft},${pr}\\)$`),Ll={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};oa(Mr,mr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:zl,formatHex:zl,formatHex8:Wy,formatHsl:Hy,formatRgb:Fl,toString:Fl});function zl(){return this.rgb().formatHex()}function Wy(){return this.rgb().formatHex8()}function Hy(){return td(this).formatHsl()}function Fl(){return this.rgb().formatRgb()}function mr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=zy.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Bl(t):n===3?new Ge(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Hr(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Hr(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Fy.exec(e))?new Ge(t[1],t[2],t[3],1):(t=By.exec(e))?new Ge(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Gy.exec(e))?Hr(t[1],t[2],t[3],t[4]):(t=Uy.exec(e))?Hr(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Vy.exec(e))?Vl(t[1],t[2]/100,t[3]/100,1):(t=Yy.exec(e))?Vl(t[1],t[2]/100,t[3]/100,t[4]):Ll.hasOwnProperty(e)?Bl(Ll[e]):e==="transparent"?new Ge(NaN,NaN,NaN,0):null}function Bl(e){return new Ge(e>>16&255,e>>8&255,e&255,1)}function Hr(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ge(e,t,n,r)}function qy(e){return e instanceof Mr||(e=mr(e)),e?(e=e.rgb(),new Ge(e.r,e.g,e.b,e.opacity)):new Ge}function Ss(e,t,n,r){return arguments.length===1?qy(e):new Ge(e,t,n,r??1)}function Ge(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}oa(Ge,Ss,ed(Mr,{brighter(e){return e=e==null?Si:Math.pow(Si,e),new Ge(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?fr:Math.pow(fr,e),new Ge(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ge(sn(this.r),sn(this.g),sn(this.b),Ei(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Gl,formatHex:Gl,formatHex8:Ky,formatRgb:Ul,toString:Ul}));function Gl(){return`#${en(this.r)}${en(this.g)}${en(this.b)}`}function Ky(){return`#${en(this.r)}${en(this.g)}${en(this.b)}${en((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ul(){const e=Ei(this.opacity);return`${e===1?"rgb(":"rgba("}${sn(this.r)}, ${sn(this.g)}, ${sn(this.b)}${e===1?")":`, ${e})`}`}function Ei(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function sn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function en(e){return e=sn(e),(e<16?"0":"")+e.toString(16)}function Vl(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new tt(e,t,n,r)}function td(e){if(e instanceof tt)return new tt(e.h,e.s,e.l,e.opacity);if(e instanceof Mr||(e=mr(e)),!e)return new tt;if(e instanceof tt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(t===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new tt(s,a,l,e.opacity)}function Jy(e,t,n,r){return arguments.length===1?td(e):new tt(e,t,n,r??1)}function tt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}oa(tt,Jy,ed(Mr,{brighter(e){return e=e==null?Si:Math.pow(Si,e),new tt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?fr:Math.pow(fr,e),new tt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ge(Ho(e>=240?e-240:e+120,i,r),Ho(e,i,r),Ho(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new tt(Yl(this.h),qr(this.s),qr(this.l),Ei(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ei(this.opacity);return`${e===1?"hsl(":"hsla("}${Yl(this.h)}, ${qr(this.s)*100}%, ${qr(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Yl(e){return e=(e||0)%360,e<0?e+360:e}function qr(e){return Math.max(0,Math.min(1,e||0))}function Ho(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const sa=e=>()=>e;function Xy(e,t){return function(n){return e+n*t}}function Zy(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Qy(e){return(e=+e)==1?nd:function(t,n){return n-t?Zy(t,n,e):sa(isNaN(t)?n:t)}}function nd(e,t){var n=t-e;return n?Xy(e,n):sa(isNaN(e)?t:e)}const Wl=(function e(t){var n=Qy(t);function r(i,o){var s=n((i=Ss(i)).r,(o=Ss(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),c=nd(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r})(1);function ex(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function tx(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function nx(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),s;for(s=0;s<r;++s)i[s]=so(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(a){for(s=0;s<r;++s)o[s]=i[s](a);return o}}function aa(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function nt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function rx(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=so(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var Es=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qo=new RegExp(Es.source,"g");function ix(e){return function(){return e}}function ox(e){return function(t){return e(t)+""}}function sx(e,t){var n=Es.lastIndex=qo.lastIndex=0,r,i,o,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=Es.exec(e))&&(i=qo.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:nt(r,i)})),n=qo.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?ox(l[0].x):ix(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)a[(d=l[u]).i]=d.x(c);return a.join("")})}function so(e,t){var n=typeof t,r;return t==null||n==="boolean"?sa(t):(n==="number"?nt:n==="string"?(r=mr(t))?(t=r,Wl):sx:t instanceof mr?Wl:t instanceof Date?aa:tx(t)?ex:Array.isArray(t)?nx:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?rx:nt)(e,t)}function rd(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function ax(e){return function(){return e}}function lx(e){return+e}var Hl=[0,1];function Ke(e){return e}function Ts(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:ax(isNaN(t)?NaN:.5)}function cx(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function ux(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=Ts(i,r),o=n(s,o)):(r=Ts(r,i),o=n(o,s)),function(a){return o(r(a))}}function dx(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=Ts(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(a){var l=Qu(e,a,1,r)-1;return o[l](i[l](a))}}function Rr(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function ao(){var e=Hl,t=Hl,n=so,r,i,o,s=Ke,a,l,c;function u(){var h=Math.min(e.length,t.length);return s!==Ke&&(s=cx(e[0],e[h-1])),a=h>2?dx:ux,l=c=null,d}function d(h){return h==null||isNaN(h=+h)?o:(l||(l=a(e.map(r),t,n)))(r(s(h)))}return d.invert=function(h){return s(i((c||(c=a(t,e.map(r),nt)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,lx),u()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),n=rd,u()},d.clamp=function(h){return arguments.length?(s=h?!0:Ke,u()):s!==Ke},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(o=h,d):o},function(h,f){return r=h,i=f,u()}}function id(){return ao()(Ke,Ke)}function hx(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ti(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Ln(e){return e=Ti(Math.abs(e)),e?e[1]:NaN}function fx(e,t){return function(n,r){for(var i=n.length,o=[],s=0,a=e[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(n.substring(i-=a,i+a)),!((l+=a+1)>r));)a=e[s=(s+1)%e.length];return o.reverse().join(t)}}function px(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var mx=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function gr(e){if(!(t=mx.exec(e)))throw new Error("invalid format: "+e);var t;return new la({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}gr.prototype=la.prototype;function la(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}la.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function gx(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var od;function yx(e,t){var n=Ti(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(od=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Ti(e,Math.max(0,t+o-1))[0]}function ql(e,t){var n=Ti(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Kl={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:hx,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>ql(e*100,t),r:ql,s:yx,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Jl(e){return e}var Xl=Array.prototype.map,Zl=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function xx(e){var t=e.grouping===void 0||e.thousands===void 0?Jl:fx(Xl.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?Jl:px(Xl.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(d){d=gr(d);var h=d.fill,f=d.align,m=d.sign,p=d.symbol,y=d.zero,b=d.width,E=d.comma,T=d.precision,w=d.trim,C=d.type;C==="n"?(E=!0,C="g"):Kl[C]||(T===void 0&&(T=12),w=!0,C="g"),(y||h==="0"&&f==="=")&&(y=!0,h="0",f="=");var S=p==="$"?n:p==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():"",R=p==="$"?r:/[%p]/.test(C)?s:"",I=Kl[C],k=/[defgprs%]/.test(C);T=T===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,T)):Math.max(0,Math.min(20,T));function z(P){var v=S,_=R,A,B,G;if(C==="c")_=I(P)+_,P="";else{P=+P;var Z=P<0||1/P<0;if(P=isNaN(P)?l:I(Math.abs(P),T),w&&(P=gx(P)),Z&&+P==0&&m!=="+"&&(Z=!1),v=(Z?m==="("?m:a:m==="-"||m==="("?"":m)+v,_=(C==="s"?Zl[8+od/3]:"")+_+(Z&&m==="("?")":""),k){for(A=-1,B=P.length;++A<B;)if(G=P.charCodeAt(A),48>G||G>57){_=(G===46?i+P.slice(A+1):P.slice(A))+_,P=P.slice(0,A);break}}}E&&!y&&(P=t(P,1/0));var Y=v.length+P.length+_.length,te=Y<b?new Array(b-Y+1).join(h):"";switch(E&&y&&(P=t(te+P,te.length?b-_.length:1/0),te=""),f){case"<":P=v+P+_+te;break;case"=":P=v+te+P+_;break;case"^":P=te.slice(0,Y=te.length>>1)+v+P+_+te.slice(Y);break;default:P=te+v+P+_;break}return o(P)}return z.toString=function(){return d+""},z}function u(d,h){var f=c((d=gr(d),d.type="f",d)),m=Math.max(-8,Math.min(8,Math.floor(Ln(h)/3)))*3,p=Math.pow(10,-m),y=Zl[8+m/3];return function(b){return f(p*b)+y}}return{format:c,formatPrefix:u}}var Kr,ca,sd;bx({thousands:",",grouping:[3],currency:["$",""]});function bx(e){return Kr=xx(e),ca=Kr.format,sd=Kr.formatPrefix,Kr}function vx(e){return Math.max(0,-Ln(Math.abs(e)))}function Sx(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ln(t)/3)))*3-Ln(Math.abs(e)))}function Ex(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ln(t)-Ln(e))+1}function Tx(e,t,n,r){var i=bs(e,t,n),o;switch(r=gr(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=Sx(i,s))&&(r.precision=o),sd(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Ex(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=vx(i))&&(r.precision=o-(r.type==="%")*2);break}}return ca(r)}function lo(e){var t=e.domain;return e.ticks=function(n){var r=t();return ys(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Tx(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,s=r[i],a=r[o],l,c,u=10;for(a<s&&(c=s,s=a,a=c,c=i,i=o,o=c);u-- >0;){if(c=xs(s,a,n),c===l)return r[i]=s,r[o]=a,t(r);if(c>0)s=Math.floor(s/c)*c,a=Math.ceil(a/c)*c;else if(c<0)s=Math.ceil(s*c)/c,a=Math.floor(a*c)/c;else break;l=c}return e},e}function ua(){var e=id();return e.copy=function(){return Rr(e,ua())},Yt.apply(e,arguments),lo(e)}function ad(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],s;return o<i&&(s=n,n=r,r=s,s=i,i=o,o=s),e[n]=t.floor(i),e[r]=t.ceil(o),e}function Ql(e){return Math.log(e)}function ec(e){return Math.exp(e)}function wx(e){return-Math.log(-e)}function Cx(e){return-Math.exp(-e)}function Mx(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Rx(e){return e===10?Mx:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Ax(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function tc(e){return(t,n)=>-e(-t,n)}function _x(e){const t=e(Ql,ec),n=t.domain;let r=10,i,o;function s(){return i=Ax(r),o=Rx(r),n()[0]<0?(i=tc(i),o=tc(o),e(wx,Cx)):e(Ql,ec),t}return t.base=function(a){return arguments.length?(r=+a,s()):r},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{const l=n();let c=l[0],u=l[l.length-1];const d=u<c;d&&([c,u]=[u,c]);let h=i(c),f=i(u),m,p;const y=a==null?10:+a;let b=[];if(!(r%1)&&f-h<y){if(h=Math.floor(h),f=Math.ceil(f),c>0){for(;h<=f;++h)for(m=1;m<r;++m)if(p=h<0?m/o(-h):m*o(h),!(p<c)){if(p>u)break;b.push(p)}}else for(;h<=f;++h)for(m=r-1;m>=1;--m)if(p=h>0?m/o(-h):m*o(h),!(p<c)){if(p>u)break;b.push(p)}b.length*2<y&&(b=ys(c,u,y))}else b=ys(h,f,Math.min(f-h,y)).map(o);return d?b.reverse():b},t.tickFormat=(a,l)=>{if(a==null&&(a=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=gr(l)).precision==null&&(l.trim=!0),l=ca(l)),a===1/0)return l;const c=Math.max(1,r*a/t.ticks().length);return u=>{let d=u/o(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=c?l(u):""}},t.nice=()=>n(ad(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),t}function wi(){const e=_x(ao()).domain([1,10]);return e.copy=()=>Rr(e,wi()).base(e.base()),Yt.apply(e,arguments),e}function nc(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function rc(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Ix(e){var t=1,n=e(nc(t),rc(t));return n.constant=function(r){return arguments.length?e(nc(t=+r),rc(t)):t},lo(n)}function ld(){var e=Ix(ao());return e.copy=function(){return Rr(e,ld()).constant(e.constant())},Yt.apply(e,arguments)}function ic(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function jx(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function kx(e){return e<0?-e*e:e*e}function Ox(e){var t=e(Ke,Ke),n=1;function r(){return n===1?e(Ke,Ke):n===.5?e(jx,kx):e(ic(n),ic(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},lo(t)}function da(){var e=Ox(ao());return e.copy=function(){return Rr(e,da()).exponent(e.exponent())},Yt.apply(e,arguments),e}function Px(){return da.apply(null,arguments).exponent(.5)}function cd(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[Qu(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return cd().domain(e).range(t).unknown(n)},Yt.apply(i,arguments)}const Ko=new Date,Jo=new Date;function Te(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const s=i(o),a=i.ceil(o);return o-s<a-o?s:a},i.offset=(o,s)=>(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{const l=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return l;let c;do l.push(c=new Date(+o)),t(o,a),e(o);while(c<o&&o<s);return l},i.filter=o=>Te(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;t(s,-1),!o(s););else for(;--a>=0;)for(;t(s,1),!o(s););}),n&&(i.count=(o,s)=>(Ko.setTime(+o),Jo.setTime(+s),e(Ko),e(Jo),Math.floor(n(Ko,Jo))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const Ci=Te(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ci.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Te(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Ci);Ci.range;const Tt=1e3,Je=Tt*60,wt=Je*60,Mt=wt*24,ha=Mt*7,oc=Mt*30,Xo=Mt*365,tn=Te(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Tt)},(e,t)=>(t-e)/Tt,e=>e.getUTCSeconds());tn.range;const fa=Te(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Tt)},(e,t)=>{e.setTime(+e+t*Je)},(e,t)=>(t-e)/Je,e=>e.getMinutes());fa.range;const pa=Te(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Je)},(e,t)=>(t-e)/Je,e=>e.getUTCMinutes());pa.range;const ma=Te(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Tt-e.getMinutes()*Je)},(e,t)=>{e.setTime(+e+t*wt)},(e,t)=>(t-e)/wt,e=>e.getHours());ma.range;const ga=Te(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*wt)},(e,t)=>(t-e)/wt,e=>e.getUTCHours());ga.range;const Ar=Te(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Je)/Mt,e=>e.getDate()-1);Ar.range;const co=Te(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Mt,e=>e.getUTCDate()-1);co.range;const ud=Te(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Mt,e=>Math.floor(e/Mt));ud.range;function pn(e){return Te(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Je)/ha)}const uo=pn(0),Mi=pn(1),Dx=pn(2),$x=pn(3),zn=pn(4),Nx=pn(5),Lx=pn(6);uo.range;Mi.range;Dx.range;$x.range;zn.range;Nx.range;Lx.range;function mn(e){return Te(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/ha)}const ho=mn(0),Ri=mn(1),zx=mn(2),Fx=mn(3),Fn=mn(4),Bx=mn(5),Gx=mn(6);ho.range;Ri.range;zx.range;Fx.range;Fn.range;Bx.range;Gx.range;const ya=Te(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());ya.range;const xa=Te(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());xa.range;const Rt=Te(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Rt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Te(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Rt.range;const At=Te(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());At.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Te(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});At.range;function dd(e,t,n,r,i,o){const s=[[tn,1,Tt],[tn,5,5*Tt],[tn,15,15*Tt],[tn,30,30*Tt],[o,1,Je],[o,5,5*Je],[o,15,15*Je],[o,30,30*Je],[i,1,wt],[i,3,3*wt],[i,6,6*wt],[i,12,12*wt],[r,1,Mt],[r,2,2*Mt],[n,1,ha],[t,1,oc],[t,3,3*oc],[e,1,Xo]];function a(c,u,d){const h=u<c;h&&([c,u]=[u,c]);const f=d&&typeof d.range=="function"?d:l(c,u,d),m=f?f.range(c,+u+1):[];return h?m.reverse():m}function l(c,u,d){const h=Math.abs(u-c)/d,f=ia(([,,y])=>y).right(s,h);if(f===s.length)return e.every(bs(c/Xo,u/Xo,d));if(f===0)return Ci.every(Math.max(bs(c,u,d),1));const[m,p]=s[h/s[f-1][2]<s[f][2]/h?f-1:f];return m.every(p)}return[a,l]}const[Ux,Vx]=dd(At,xa,ho,ud,ga,pa),[Yx,Wx]=dd(Rt,ya,uo,Ar,ma,fa);function Zo(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Qo(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Jn(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Hx(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,s=e.shortDays,a=e.months,l=e.shortMonths,c=Xn(i),u=Zn(i),d=Xn(o),h=Zn(o),f=Xn(s),m=Zn(s),p=Xn(a),y=Zn(a),b=Xn(l),E=Zn(l),T={a:Z,A:Y,b:te,B:we,c:null,d:dc,e:dc,f:g0,g:M0,G:A0,H:f0,I:p0,j:m0,L:hd,m:y0,M:x0,p:V,q:xe,Q:pc,s:mc,S:b0,u:v0,U:S0,V:E0,w:T0,W:w0,x:null,X:null,y:C0,Y:R0,Z:_0,"%":fc},w={a:Pe,A:xt,b:ke,B:bt,c:null,d:hc,e:hc,f:O0,g:U0,G:Y0,H:I0,I:j0,j:k0,L:pd,m:P0,M:D0,p:st,q:Ue,Q:pc,s:mc,S:$0,u:N0,U:L0,V:z0,w:F0,W:B0,x:null,X:null,y:G0,Y:V0,Z:W0,"%":fc},C={a:z,A:P,b:v,B:_,c:A,d:cc,e:cc,f:c0,g:lc,G:ac,H:uc,I:uc,j:o0,L:l0,m:i0,M:s0,p:k,q:r0,Q:d0,s:h0,S:a0,u:Zx,U:Qx,V:e0,w:Xx,W:t0,x:B,X:G,y:lc,Y:ac,Z:n0,"%":u0};T.x=S(n,T),T.X=S(r,T),T.c=S(t,T),w.x=S(n,w),w.X=S(r,w),w.c=S(t,w);function S(F,q){return function(X){var $=[],re=-1,Q=0,Ae=F.length,Ce,pe,kt;for(X instanceof Date||(X=new Date(+X));++re<Ae;)F.charCodeAt(re)===37&&($.push(F.slice(Q,re)),(pe=sc[Ce=F.charAt(++re)])!=null?Ce=F.charAt(++re):pe=Ce==="e"?" ":"0",(kt=q[Ce])&&(Ce=kt(X,pe)),$.push(Ce),Q=re+1);return $.push(F.slice(Q,re)),$.join("")}}function R(F,q){return function(X){var $=Jn(1900,void 0,1),re=I($,F,X+="",0),Q,Ae;if(re!=X.length)return null;if("Q"in $)return new Date($.Q);if("s"in $)return new Date($.s*1e3+("L"in $?$.L:0));if(q&&!("Z"in $)&&($.Z=0),"p"in $&&($.H=$.H%12+$.p*12),$.m===void 0&&($.m="q"in $?$.q:0),"V"in $){if($.V<1||$.V>53)return null;"w"in $||($.w=1),"Z"in $?(Q=Qo(Jn($.y,0,1)),Ae=Q.getUTCDay(),Q=Ae>4||Ae===0?Ri.ceil(Q):Ri(Q),Q=co.offset(Q,($.V-1)*7),$.y=Q.getUTCFullYear(),$.m=Q.getUTCMonth(),$.d=Q.getUTCDate()+($.w+6)%7):(Q=Zo(Jn($.y,0,1)),Ae=Q.getDay(),Q=Ae>4||Ae===0?Mi.ceil(Q):Mi(Q),Q=Ar.offset(Q,($.V-1)*7),$.y=Q.getFullYear(),$.m=Q.getMonth(),$.d=Q.getDate()+($.w+6)%7)}else("W"in $||"U"in $)&&("w"in $||($.w="u"in $?$.u%7:"W"in $?1:0),Ae="Z"in $?Qo(Jn($.y,0,1)).getUTCDay():Zo(Jn($.y,0,1)).getDay(),$.m=0,$.d="W"in $?($.w+6)%7+$.W*7-(Ae+5)%7:$.w+$.U*7-(Ae+6)%7);return"Z"in $?($.H+=$.Z/100|0,$.M+=$.Z%100,Qo($)):Zo($)}}function I(F,q,X,$){for(var re=0,Q=q.length,Ae=X.length,Ce,pe;re<Q;){if($>=Ae)return-1;if(Ce=q.charCodeAt(re++),Ce===37){if(Ce=q.charAt(re++),pe=C[Ce in sc?q.charAt(re++):Ce],!pe||($=pe(F,X,$))<0)return-1}else if(Ce!=X.charCodeAt($++))return-1}return $}function k(F,q,X){var $=c.exec(q.slice(X));return $?(F.p=u.get($[0].toLowerCase()),X+$[0].length):-1}function z(F,q,X){var $=f.exec(q.slice(X));return $?(F.w=m.get($[0].toLowerCase()),X+$[0].length):-1}function P(F,q,X){var $=d.exec(q.slice(X));return $?(F.w=h.get($[0].toLowerCase()),X+$[0].length):-1}function v(F,q,X){var $=b.exec(q.slice(X));return $?(F.m=E.get($[0].toLowerCase()),X+$[0].length):-1}function _(F,q,X){var $=p.exec(q.slice(X));return $?(F.m=y.get($[0].toLowerCase()),X+$[0].length):-1}function A(F,q,X){return I(F,t,q,X)}function B(F,q,X){return I(F,n,q,X)}function G(F,q,X){return I(F,r,q,X)}function Z(F){return s[F.getDay()]}function Y(F){return o[F.getDay()]}function te(F){return l[F.getMonth()]}function we(F){return a[F.getMonth()]}function V(F){return i[+(F.getHours()>=12)]}function xe(F){return 1+~~(F.getMonth()/3)}function Pe(F){return s[F.getUTCDay()]}function xt(F){return o[F.getUTCDay()]}function ke(F){return l[F.getUTCMonth()]}function bt(F){return a[F.getUTCMonth()]}function st(F){return i[+(F.getUTCHours()>=12)]}function Ue(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var q=S(F+="",T);return q.toString=function(){return F},q},parse:function(F){var q=R(F+="",!1);return q.toString=function(){return F},q},utcFormat:function(F){var q=S(F+="",w);return q.toString=function(){return F},q},utcParse:function(F){var q=R(F+="",!0);return q.toString=function(){return F},q}}}var sc={"-":"",_:" ",0:"0"},Re=/^\s*\d+/,qx=/^%/,Kx=/[\\^$*+?|[\]().{}]/g;function ne(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function Jx(e){return e.replace(Kx,"\\$&")}function Xn(e){return new RegExp("^(?:"+e.map(Jx).join("|")+")","i")}function Zn(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Xx(e,t,n){var r=Re.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Zx(e,t,n){var r=Re.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Qx(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function e0(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function t0(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function ac(e,t,n){var r=Re.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function lc(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function n0(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function r0(e,t,n){var r=Re.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function i0(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function cc(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function o0(e,t,n){var r=Re.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function uc(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function s0(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function a0(e,t,n){var r=Re.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function l0(e,t,n){var r=Re.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function c0(e,t,n){var r=Re.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function u0(e,t,n){var r=qx.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function d0(e,t,n){var r=Re.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function h0(e,t,n){var r=Re.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function dc(e,t){return ne(e.getDate(),t,2)}function f0(e,t){return ne(e.getHours(),t,2)}function p0(e,t){return ne(e.getHours()%12||12,t,2)}function m0(e,t){return ne(1+Ar.count(Rt(e),e),t,3)}function hd(e,t){return ne(e.getMilliseconds(),t,3)}function g0(e,t){return hd(e,t)+"000"}function y0(e,t){return ne(e.getMonth()+1,t,2)}function x0(e,t){return ne(e.getMinutes(),t,2)}function b0(e,t){return ne(e.getSeconds(),t,2)}function v0(e){var t=e.getDay();return t===0?7:t}function S0(e,t){return ne(uo.count(Rt(e)-1,e),t,2)}function fd(e){var t=e.getDay();return t>=4||t===0?zn(e):zn.ceil(e)}function E0(e,t){return e=fd(e),ne(zn.count(Rt(e),e)+(Rt(e).getDay()===4),t,2)}function T0(e){return e.getDay()}function w0(e,t){return ne(Mi.count(Rt(e)-1,e),t,2)}function C0(e,t){return ne(e.getFullYear()%100,t,2)}function M0(e,t){return e=fd(e),ne(e.getFullYear()%100,t,2)}function R0(e,t){return ne(e.getFullYear()%1e4,t,4)}function A0(e,t){var n=e.getDay();return e=n>=4||n===0?zn(e):zn.ceil(e),ne(e.getFullYear()%1e4,t,4)}function _0(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ne(t/60|0,"0",2)+ne(t%60,"0",2)}function hc(e,t){return ne(e.getUTCDate(),t,2)}function I0(e,t){return ne(e.getUTCHours(),t,2)}function j0(e,t){return ne(e.getUTCHours()%12||12,t,2)}function k0(e,t){return ne(1+co.count(At(e),e),t,3)}function pd(e,t){return ne(e.getUTCMilliseconds(),t,3)}function O0(e,t){return pd(e,t)+"000"}function P0(e,t){return ne(e.getUTCMonth()+1,t,2)}function D0(e,t){return ne(e.getUTCMinutes(),t,2)}function $0(e,t){return ne(e.getUTCSeconds(),t,2)}function N0(e){var t=e.getUTCDay();return t===0?7:t}function L0(e,t){return ne(ho.count(At(e)-1,e),t,2)}function md(e){var t=e.getUTCDay();return t>=4||t===0?Fn(e):Fn.ceil(e)}function z0(e,t){return e=md(e),ne(Fn.count(At(e),e)+(At(e).getUTCDay()===4),t,2)}function F0(e){return e.getUTCDay()}function B0(e,t){return ne(Ri.count(At(e)-1,e),t,2)}function G0(e,t){return ne(e.getUTCFullYear()%100,t,2)}function U0(e,t){return e=md(e),ne(e.getUTCFullYear()%100,t,2)}function V0(e,t){return ne(e.getUTCFullYear()%1e4,t,4)}function Y0(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Fn(e):Fn.ceil(e),ne(e.getUTCFullYear()%1e4,t,4)}function W0(){return"+0000"}function fc(){return"%"}function pc(e){return+e}function mc(e){return Math.floor(+e/1e3)}var Rn,gd,yd;H0({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function H0(e){return Rn=Hx(e),gd=Rn.format,Rn.parse,yd=Rn.utcFormat,Rn.utcParse,Rn}function q0(e){return new Date(e)}function K0(e){return e instanceof Date?+e:+new Date(+e)}function ba(e,t,n,r,i,o,s,a,l,c){var u=id(),d=u.invert,h=u.domain,f=c(".%L"),m=c(":%S"),p=c("%I:%M"),y=c("%I %p"),b=c("%a %d"),E=c("%b %d"),T=c("%B"),w=c("%Y");function C(S){return(l(S)<S?f:a(S)<S?m:s(S)<S?p:o(S)<S?y:r(S)<S?i(S)<S?b:E:n(S)<S?T:w)(S)}return u.invert=function(S){return new Date(d(S))},u.domain=function(S){return arguments.length?h(Array.from(S,K0)):h().map(q0)},u.ticks=function(S){var R=h();return e(R[0],R[R.length-1],S??10)},u.tickFormat=function(S,R){return R==null?C:c(R)},u.nice=function(S){var R=h();return(!S||typeof S.range!="function")&&(S=t(R[0],R[R.length-1],S??10)),S?h(ad(R,S)):u},u.copy=function(){return Rr(u,ba(e,t,n,r,i,o,s,a,l,c))},u}function xd(){return Yt.apply(ba(Yx,Wx,Rt,ya,uo,Ar,ma,fa,tn,gd).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function J0(){return Yt.apply(ba(Ux,Vx,At,xa,ho,co,ga,pa,tn,yd).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function X0(){var e=0,t=1,n,r,i,o,s=Ke,a=!1,l;function c(d){return d==null||isNaN(d=+d)?l:s(i===0?.5:(d=(o(d)-n)*i,a?Math.max(0,Math.min(1,d)):d))}c.domain=function(d){return arguments.length?([e,t]=d,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),c):[e,t]},c.clamp=function(d){return arguments.length?(a=!!d,c):a},c.interpolator=function(d){return arguments.length?(s=d,c):s};function u(d){return function(h){var f,m;return arguments.length?([f,m]=h,s=d(f,m),c):[s(0),s(1)]}}return c.range=u(so),c.rangeRound=u(rd),c.unknown=function(d){return arguments.length?(l=d,c):l},function(d){return o=d,n=d(e),r=d(t),i=n===r?0:1/(r-n),c}}function Z0(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function bd(){var e=lo(X0()(Ke));return e.copy=function(){return Z0(e,bd())},Ly.apply(e,arguments)}function vd(e){return e.type==="piecewise"?cd(e.thresholds,e.colors):bd([e.min??0,e.max??100],e.color)}function Ai(e){return e.values?vs(e.values,e.colors).unknown(e.unknownColor??null):vs(e.colors.map((t,n)=>n),e.colors).unknown(e.unknownColor??null)}function ws(e){return e.type==="ordinal"?Ai(e):vd(e)}function va(e,t,n){const{tickMaxStep:r,tickMinStep:i,tickNumber:o}=e,s=i===void 0?999:Math.floor(Math.abs(t[1]-t[0])/i),a=r===void 0?2:Math.ceil(Math.abs(t[1]-t[0])/r);return Math.min(s,Math.max(a,o??n))}function Q0(e,t){return t[1]-t[0]===0?1:e/((t[1]-t[0])/100)}function Sd(e){return Math.floor(Math.abs(e)/50)}function gc(e){return Array.isArray(e)?JSON.stringify(e):typeof e=="object"&&e!==null?e.valueOf():e}function Sa(...e){let t=new bi(void 0,gc),n=[],r=[],i=0,o=1,s,a,l=!1,c=0,u=0,d=.5;const h=y=>{const b=t.get(y);if(b!==void 0)return r[b%r.length]},f=()=>{const y=n.length,b=o<i,E=b?o:i,T=b?i:o;s=(T-E)/Math.max(1,y-c+u*2),l&&(s=Math.floor(s));const w=E+(T-E-s*(y-c))*d;a=s*(1-c);const C=l?Math.round(w):w;a=l?Math.round(a):a;const R=Ny(y).map(I=>C+s*I);return r=b?R.reverse():R,h};h.domain=function(y){if(!arguments.length)return n.slice();n=[],t=new bi(void 0,gc);for(const b of y)t.has(b)||t.set(b,n.push(b)-1);return f()},h.range=function(y){if(!arguments.length)return[i,o];const[b,E]=y;return i=+b,o=+E,f()},h.rangeRound=function(y){const[b,E]=y;return i=+b,o=+E,l=!0,f()},h.bandwidth=function(){return a},h.step=function(){return s},h.round=function(y){return arguments.length?(l=!!y,f()):l},h.padding=function(y){return arguments.length?(c=Math.min(1,u=+y),f()):c},h.paddingInner=function(y){return arguments.length?(c=Math.min(1,y),f()):c},h.paddingOuter=function(y){return arguments.length?(u=+y,f()):u},h.align=function(y){return arguments.length?(d=Math.max(0,Math.min(1,y)),f()):d},h.copy=()=>Sa(n,[i,o]).round(l).paddingInner(c).paddingOuter(u).align(d);const[m,p]=e;return e.length>1?(h.domain(m),h.range(p)):m?h.range(m):f(),h}function eb(...e){const t=Sa(...e).paddingInner(1),n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=()=>{const r=n();return r.padding=r.paddingOuter,delete r.paddingInner,delete r.paddingOuter,r.copy=t.copy,r},t}function Ed(...e){const t=ld(...e),n=t.ticks,{negativeScale:r,linearScale:i,positiveScale:o}=tb(t);return t.ticks=s=>{const a=n(s),l=t.constant();let c=0,u=0,d=0;a.forEach(f=>{f>-l&&f<l&&(u+=1),f<=-l&&(c+=1),f>=l&&(d+=1)});const h=[];if(c>0&&h.push(...r.ticks(c)),u>0){const f=i.ticks(u);h.at(-1)===f[0]?h.push(...f.slice(1)):h.push(...f)}if(d>0){const f=o.ticks(d);h.at(-1)===f[0]?h.push(...f.slice(1)):h.push(...f)}return h},t.tickFormat=(s=10,a)=>{const l=t.constant(),[c,u]=t.domain(),d=u-c,h=r.domain(),f=h[1]-h[0],p=(d===0?0:f/d)*s,y=i.domain(),b=y[1]-y[0],T=(d===0?0:b/d)*s,w=o.domain(),C=w[1]-w[0],R=(d===0?0:C/d)*s,I=r.tickFormat(p,a),k=i.tickFormat(T,a),z=o.tickFormat(R,a);return P=>(P.valueOf()<=-l?I:P.valueOf()>=l?z:k)(P)},t.copy=()=>Ed(t.domain(),t.range()).constant(t.constant()),t}function tb(e){const t=e.constant(),n=e.domain(),r=[n[0],Math.min(n[1],-t)],i=wi(r,e.range()),o=[Math.max(n[0],-t),Math.min(n[1],t)],s=ua(o,e.range()),a=[Math.max(n[0],t),n[1]],l=wi(a,e.range());return{negativeScale:i,linearScale:s,positiveScale:l}}function Ea(e,t,n){switch(e){case"log":return wi(t,n);case"pow":return da(t,n);case"sqrt":return Px(t,n);case"time":return xd(t,n);case"utc":return J0(t,n);case"symlog":return Ed(t,n);default:return ua(t,n)}}const nb=e=>(e==null?void 0:e[0])instanceof Date;function rb(e,t,n){const r=xd(e,t);return(i,{location:o})=>o==="tick"?r.tickFormat(n)(i):`${i.toLocaleString()}`}let yc,xc;class ib{constructor(){W(this,"types",new Set);if(yc)throw new Error("You can only create one instance!");yc=this.types}addType(t){this.types.add(t)}getTypes(){return this.types}}class ob{constructor(){W(this,"types",new Set);if(xc)throw new Error("You can only create one instance!");xc=this.types}addType(t){this.types.add(t)}getTypes(){return this.types}}const fo=new ib;fo.addType("bar");fo.addType("line");fo.addType("scatter");const sb=new ob;sb.addType("radar");function Td(e){return fo.getTypes().has(e)}const ab=(e,t,n,r)=>{const i=new Set;return Object.keys(t).filter(Td).forEach(s=>{var c,u,d;const a=((c=n[s])==null?void 0:c.series)??{},l=(d=(u=t[s]).axisTooltipGetter)==null?void 0:d.call(u,a);l!==void 0&&l.forEach(({axisId:h,direction:f})=>{f===e&&i.add(h??r)})}),i};function _r(e){return e.bandwidth!==void 0}function lb(e){return _r(e)&&e.paddingOuter!==void 0}function cb(e,t,n){const r=t==="x"?[e.left,e.left+e.width]:[e.top+e.height,e.top];return n?[r[1],r[0]]:r}function ub(e,t){return e.step()*t<.1}const db=.2,hb=.1;function wd({scales:e,drawingArea:t,formattedSeries:n,axis:r,seriesConfig:i,axisDirection:o,zoomMap:s,domains:a}){if(r===void 0)return{axis:{},axisIds:[]};const l=ab(o,i,n,r[0].id),c={};return r.forEach(u=>{const d=u,h=e[d.id],f=s==null?void 0:s.get(d.id),m=f?[f.start,f.end]:[0,100],p=cb(t,o,d.reverse??!1),y=a[d.id].tickNumber,b=!d.ignoreTooltip&&l.has(d.id),E=Q0(y,m),T=d.data??[];if(_r(h)){const S=o==="y"?[p[1],p[0]]:p;if(lb(h)&&Yn(d)){const R=d.categoryGapRatio??db,I=ub(h,R),k=I?0:R,z=I?0:d.barGapRatio??hb;c[d.id]=L({offset:0,height:0,categoryGapRatio:k,barGapRatio:z,triggerTooltip:b},d,{data:T,scale:I?h.copy().padding(0):h,tickNumber:E,colorScale:d.colorMap&&(d.colorMap.type==="ordinal"?Ai(L({values:d.data},d.colorMap)):ws(d.colorMap))})}if(Wn(d)&&(c[d.id]=L({offset:0,height:0,triggerTooltip:b},d,{data:T,scale:h,tickNumber:E,colorScale:d.colorMap&&(d.colorMap.type==="ordinal"?Ai(L({values:d.data},d.colorMap)):ws(d.colorMap))})),nb(d.data)){const R=rb(d.data,S,d.tickNumber);c[d.id].valueFormatter=d.valueFormatter??R}return}if(d.scaleType==="band"||d.scaleType==="point")return;const w=d,C=w.scaleType??"linear";c[d.id]=L({offset:0,height:0,triggerTooltip:b},w,{data:T,scaleType:C,scale:h,tickNumber:E,colorScale:w.colorMap&&vd(w.colorMap),valueFormatter:d.valueFormatter??Cy(E,Ea(C,p.map(S=>h.invert(S)),p))})}),{axis:c,axisIds:r.map(({id:u})=>u)}}function fb(e){return e!=null}function pb(e,t,n,r){const i=(e==null?void 0:e.length)??0,o=Math.floor(t*i/100),s=Math.ceil(n*i/100);return function(l,c){return(l[r]??(e==null?void 0:e[c]))==null?!0:c>=o&&c<s}}function mb(e,t,n,r,i){const o=e[0].valueOf(),s=e[1].valueOf(),a=o+t*(s-o)/100,l=o+n*(s-o)/100;return function(u,d){const h=u[r]??(i==null?void 0:i[d]);return h==null?!0:h>=a&&h<=l}}const gb=e=>({currentAxisId:t,seriesXAxisId:n,seriesYAxisId:r,isDefaultAxis:i})=>(o,s)=>{var c,u;return!(t===n?r:n)||i?((u=(c=Object.values(e??{}))[0])==null?void 0:u.call(c,o,s))??!0:[r,n].filter(d=>d!==t).map(d=>e[d??""]).filter(fb).every(d=>d(o,s))},bc=e=>(t=[])=>t.reduce((n,r)=>{const{zoom:i,id:o,reverse:s}=r,a=ra(i,o,e,s);return a&&(n[o]=a),n},{}),yb=.2;function Cd(e,t,n){const r=t==="x"?[e.left,e.left+e.width]:[e.top+e.height,e.top];return n.reverse?[r[1],r[0]]:r}function Md(e,t){const n=[0,1];if(Yn(e)){const o=e.categoryGapRatio??yb;return Sa(t,n).paddingInner(o).paddingOuter(o/2)}if(Wn(e))return eb(t,n);const r=e.scaleType??"linear",i=Ea(r,t,n);return My(e)&&e.constant!=null&&i.constant(e.constant),i}const Rd=(e,t)=>{const n=e[1]-e[0],r=t[1]-t[0],i=e[0]-t[0]*n/r,o=e[1]+(100-t[1])*n/r;return[i,o]},xb=(e,t,n,r,i,o,s)=>{var c;const a=n==="x"?r[e].xExtremumGetter:r[e].yExtremumGetter,l=((c=o[e])==null?void 0:c.series)??{};return(a==null?void 0:a({series:l,axis:t,axisIndex:i,isDefaultAxis:i===0,getFilters:s}))??[1/0,-1/0]};function po(e,t,n,r,i,o){const s=Object.keys(n).filter(Td);let a=[1/0,-1/0];for(const l of s){const[c,u]=xb(l,e,t,n,r,i,o);a=[Math.min(a[0],c),Math.max(a[1],u)]}return Number.isNaN(a[0])||Number.isNaN(a[1])?[1/0,-1/0]:a}const bb=(e,t,n,r)=>{var i;if(e.domainLimit!==void 0)return e.domainLimit;if(t==="x")for(const o of((i=r.line)==null?void 0:i.seriesOrder)??[]){const s=r.line.series[o];if(s.xAxisId===e.id||s.xAxisId===void 0&&n===0)return"strict"}return"nice"};function Ad(e,t,n){return Ea(e??"linear",t,[0,1]).nice(n).domain()}function _d(e,t,n,r,[i,o],s,a){const l=jd(e,t,n,r,a);let c=kd(e,i,o);if(typeof l=="function"){const{min:d,max:h}=l(i.valueOf(),o.valueOf());c[0]=d,c[1]=h}const u=va(e,c,s);return l==="nice"&&(c=Ad(e.scaleType,c,u)),c=["min"in e?e.min??c[0]:c[0],"max"in e?e.max??c[1]:c[1]],{domain:c,tickNumber:u}}function Id(e,t,n,r,[i,o],s,a){const l=jd(e,t,n,r,a);let c=kd(e,i,o);if(typeof l=="function"){const{min:u,max:d}=l(i.valueOf(),o.valueOf());c[0]=u,c[1]=d}return l==="nice"&&(c=Ad(e.scaleType,c,s)),[e.min??c[0],e.max??c[1]]}function jd(e,t,n,r,i){return i?bb(e,t,n,r):e.domainLimit??"nice"}function kd(e,t,n){let r=t,i=n;return"max"in e&&e.max!=null&&e.max<t&&(r=e.max),"min"in e&&e.min!=null&&e.min>t&&(i=e.min),!("min"in e)&&!("max"in e)?[r,i]:[e.min??r,e.max??i]}class vb{constructor(){this.ids=[],this.values=[],this.length=0}clear(){this.length=0}push(t,n){let r=this.length++;for(;r>0;){const i=r-1>>1,o=this.values[i];if(n>=o)break;this.ids[r]=this.ids[i],this.values[r]=o,r=i}this.ids[r]=t,this.values[r]=n}pop(){if(this.length===0)return;const t=this.ids,n=this.values,r=t[0],i=--this.length;if(i>0){const o=t[i],s=n[i];let a=0;const l=i>>1;for(;a<l;){const c=(a<<1)+1,u=c+1,d=c+(+(u<i)&+(n[u]<n[c]));if(n[d]>=s)break;t[a]=t[d],n[a]=n[d],a=d}t[a]=o,n[a]=s}return r}peek(){return this.length>0?this.ids[0]:void 0}peekValue(){return this.length>0?this.values[0]:void 0}shrink(){this.ids.length=this.values.length=this.length}}const vc=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],es=3;class Ta{static from(t,n=0){if(n%8!==0)throw new Error("byteOffset must be 8-byte aligned.");if(!t||t.byteLength===void 0||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[r,i]=new Uint8Array(t,n+0,2);if(r!==251)throw new Error("Data does not appear to be in a Flatbush format.");const o=i>>4;if(o!==es)throw new Error(`Got v${o} data when expected v${es}.`);const s=vc[i&15];if(!s)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(t,n+2,1),[l]=new Uint32Array(t,n+4,1);return new Ta(l,a,s,void 0,t,n)}constructor(t,n=16,r=Float64Array,i=ArrayBuffer,o,s=0){if(t===void 0)throw new Error("Missing required argument: numItems.");if(isNaN(t)||t<=0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.byteOffset=s;let a=t,l=a;this._levelBounds=[a*4];do a=Math.ceil(a/this.nodeSize),l+=a,this._levelBounds.push(l*4);while(a!==1);this.ArrayType=r,this.IndexArrayType=l<16384?Uint16Array:Uint32Array;const c=vc.indexOf(r),u=l*4*r.BYTES_PER_ELEMENT;if(c<0)throw new Error(`Unexpected typed array class: ${r}.`);if(o)this.data=o,this._boxes=new r(o,s+8,l*4),this._indices=new this.IndexArrayType(o,s+8+u,l),this._pos=l*4,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1];else{const d=this.data=new i(8+u+l*this.IndexArrayType.BYTES_PER_ELEMENT);this._boxes=new r(d,8,l*4),this._indices=new this.IndexArrayType(d,8+u,l),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(d,0,2).set([251,(es<<4)+c]),new Uint16Array(d,2,1)[0]=n,new Uint32Array(d,4,1)[0]=t}this._queue=new vb}add(t,n,r=t,i=n){const o=this._pos>>2,s=this._boxes;return this._indices[o]=o,s[this._pos++]=t,s[this._pos++]=n,s[this._pos++]=r,s[this._pos++]=i,t<this.minX&&(this.minX=t),n<this.minY&&(this.minY=n),r>this.maxX&&(this.maxX=r),i>this.maxY&&(this.maxY=i),o}finish(){if(this._pos>>2!==this.numItems)throw new Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);const t=this._boxes;if(this.numItems<=this.nodeSize){t[this._pos++]=this.minX,t[this._pos++]=this.minY,t[this._pos++]=this.maxX,t[this._pos++]=this.maxY;return}const n=this.maxX-this.minX||1,r=this.maxY-this.minY||1,i=new Uint32Array(this.numItems),o=65535;for(let s=0,a=0;s<this.numItems;s++){const l=t[a++],c=t[a++],u=t[a++],d=t[a++],h=Math.floor(o*((l+u)/2-this.minX)/n),f=Math.floor(o*((c+d)/2-this.minY)/r);i[s]=Tb(h,f)}Cs(i,t,this._indices,0,this.numItems-1,this.nodeSize);for(let s=0,a=0;s<this._levelBounds.length-1;s++){const l=this._levelBounds[s];for(;a<l;){const c=a;let u=t[a++],d=t[a++],h=t[a++],f=t[a++];for(let m=1;m<this.nodeSize&&a<l;m++)u=Math.min(u,t[a++]),d=Math.min(d,t[a++]),h=Math.max(h,t[a++]),f=Math.max(f,t[a++]);this._indices[this._pos>>2]=c,t[this._pos++]=u,t[this._pos++]=d,t[this._pos++]=h,t[this._pos++]=f}}}search(t,n,r,i,o){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let s=this._boxes.length-4;const a=[],l=[];for(;s!==void 0;){const c=Math.min(s+this.nodeSize*4,Sc(s,this._levelBounds));for(let u=s;u<c;u+=4){if(r<this._boxes[u]||i<this._boxes[u+1]||t>this._boxes[u+2]||n>this._boxes[u+3])continue;const d=this._indices[u>>2]|0;s>=this.numItems*4?a.push(d):(o===void 0||o(d))&&(l.push(d),l.push(this._boxes[u]),l.push(this._boxes[u+1]))}s=a.pop()}return l}neighbors(t,n,r=1/0,i=1/0,o,s=Sb){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let a=this._boxes.length-4;const l=this._queue,c=[];e:for(;a!==void 0;){const u=Math.min(a+this.nodeSize*4,Sc(a,this._levelBounds));for(let d=a;d<u;d+=4){const h=this._indices[d>>2]|0,f=this._boxes[d],m=this._boxes[d+1],p=this._boxes[d+2],y=this._boxes[d+3],b=t<f?f-t:t>p?t-p:0,E=n<m?m-n:n>y?n-y:0,T=s(b,E);T>i||(a>=this.numItems*4?l.push(h<<1,T):(o===void 0||o(h))&&l.push((h<<1)+1,T))}for(;l.length&&l.peek()&1;)if(l.peekValue()>i||(c.push(l.pop()>>1),c.length===r))break e;a=l.length?l.pop()>>1:void 0}return l.clear(),c}}function Sb(e,t){return e*e+t*t}function Sc(e,t){let n=0,r=t.length-1;for(;n<r;){const i=n+r>>1;t[i]>e?r=i:n=i+1}return t[n]}function Cs(e,t,n,r,i,o){if(Math.floor(r/o)>=Math.floor(i/o))return;const s=e[r],a=e[r+i>>1],l=e[i];let c=l;const u=Math.max(s,a);l>u?c=u:u===s?c=Math.max(a,l):u===a&&(c=Math.max(s,l));let d=r-1,h=i+1;for(;;){do d++;while(e[d]<c);do h--;while(e[h]>c);if(d>=h)break;Eb(e,t,n,d,h)}Cs(e,t,n,r,h,o),Cs(e,t,n,h+1,i,o)}function Eb(e,t,n,r,i){const o=e[r];e[r]=e[i],e[i]=o;const s=4*r,a=4*i,l=t[s],c=t[s+1],u=t[s+2],d=t[s+3];t[s]=t[a],t[s+1]=t[a+1],t[s+2]=t[a+2],t[s+3]=t[a+3],t[a]=l,t[a+1]=c,t[a+2]=u,t[a+3]=d;const h=n[r];n[r]=n[i],n[i]=h}function Tb(e,t){let n=e^t,r=65535^n,i=65535^(e|t),o=e&(t^65535),s=n|r>>1,a=n>>1^n,l=i>>1^r&o>>1^i,c=n&i>>1^o>>1^o;n=s,r=a,i=l,o=c,s=n&n>>2^r&r>>2,a=n&r>>2^r&(n^r)>>2,l^=n&i>>2^r&o>>2,c^=r&i>>2^(n^r)&o>>2,n=s,r=a,i=l,o=c,s=n&n>>4^r&r>>4,a=n&r>>4^r&(n^r)>>4,l^=n&i>>4^r&o>>4,c^=r&i>>4^(n^r)&o>>4,n=s,r=a,i=l,o=c,l^=n&i>>8^r&o>>8,c^=r&i>>8^(n^r)&o>>8,n=l^l>>1,r=c^c>>1;let u=e^t,d=r|65535^(u|n);return u=(u|u<<8)&16711935,u=(u|u<<4)&252645135,u=(u|u<<2)&858993459,u=(u|u<<1)&1431655765,d=(d|d<<8)&16711935,d=(d|d<<4)&252645135,d=(d|d<<2)&858993459,d=(d|d<<1)&1431655765,(d<<1|u)>>>0}const wb=e=>{const t=new Map;return e.forEach(n=>{t.set(n.axisId,n)}),t},Od=e=>e.zoom;J(Od,e=>e==null?void 0:e.isInteracting);const Wt=Ee(Od,function(t){return(t==null?void 0:t.zoomData)&&wb(t==null?void 0:t.zoomData)});J(Wt,(e,t)=>e==null?void 0:e.get(t));const mo=Ee(Gt,Ut,function(t,n){return L({},bc("x")(t),bc("y")(n))});J(mo,(e,t)=>e[t]);const Cb=J(gt,function(t){return Sd(t.width)}),Mb=J(gt,function(t){return Sd(t.height)}),wa=Ee(Gt,ze,Vt,ro,Cb,function(t,n,r,i,o){const a={};return t==null||t.forEach((l,c)=>{var h,f;const u=l;if(Yn(u)||Wn(u)){a[u.id]={domain:u.data},u.ordinalTimeTicks!==void 0&&(a[u.id].tickNumber=va(u,[(h=u.data)==null?void 0:h.find(m=>m!==null),(f=u.data)==null?void 0:f.findLast(m=>m!==null)],o));return}const d=po(u,"x",r,c,n);a[u.id]=_d(u,"x",c,n,d,o,i)}),{axes:t,domains:a}}),Ca=Ee(Ut,ze,Vt,ro,Mb,function(t,n,r,i,o){const a={};return t==null||t.forEach((l,c)=>{var h,f;const u=l;if(Yn(u)||Wn(u)){a[u.id]={domain:u.data},u.ordinalTimeTicks!==void 0&&(a[u.id].tickNumber=va(u,[(h=u.data)==null?void 0:h.find(m=>m!==null),(f=u.data)==null?void 0:f.findLast(m=>m!==null)],o));return}const d=po(u,"y",r,c,n);a[u.id]=_d(u,"y",c,n,d,o,i)}),{axes:t,domains:a}}),Pd=Ee(Wt,mo,wa,Ca,function(t,n,{axes:r,domains:i},{axes:o,domains:s}){if(!t||!n)return;let a=!1;const l={},c=[...r??[],...o??[]];for(let u=0;u<c.length;u+=1){const d=c[u];if(!n[d.id]||n[d.id].filterMode!=="discard")continue;const h=t.get(d.id);if(h===void 0||h.start<=0&&h.end>=100)continue;const f=u<((r==null?void 0:r.length)??0)?"x":"y";if(d.scaleType==="band"||d.scaleType==="point")l[d.id]=pb(d.data,h.start,h.end,f);else{const{domain:m}=f==="x"?i[d.id]:s[d.id];l[d.id]=mb(m,h.start,h.end,f,d.data)}a=!0}if(a)return gb(l)}),Rb=Ee(ze,Vt,Wt,mo,Pd,ro,wa,function(t,n,r,i,o,s,{axes:a,domains:l}){const c={};return a==null||a.forEach((u,d)=>{const h=l[u.id].domain;if(Yn(u)||Wn(u)){c[u.id]=h;return}const f=r==null?void 0:r.get(u.id),m=i==null?void 0:i[u.id],p=f===void 0&&!m?o:void 0;if(!p){c[u.id]=h;return}const y=l[u.id].tickNumber,b=po(u,"x",n,d,t,p);c[u.id]=Id(u,"x",d,t,b,y,s)}),c}),Ab=Ee(ze,Vt,Wt,mo,Pd,ro,Ca,function(t,n,r,i,o,s,{axes:a,domains:l}){const c={};return a==null||a.forEach((u,d)=>{const h=l[u.id].domain;if(Yn(u)||Wn(u)){c[u.id]=h;return}const f=r==null?void 0:r.get(u.id),m=i==null?void 0:i[u.id],p=f===void 0&&!m?o:void 0;if(!p){c[u.id]=h;return}const y=l[u.id].tickNumber,b=po(u,"y",n,d,t,p);c[u.id]=Id(u,"y",d,t,b,y,s)}),c}),Dd=Ee(Gt,Rb,function(t,n){const r={};return t==null||t.forEach(i=>{const o=i,s=n[o.id];r[o.id]=Md(o,s)}),r}),$d=Ee(Ut,Ab,function(t,n){const r={};return t==null||t.forEach(i=>{const o=i,s=n[o.id];r[o.id]=Md(o,s)}),r}),_b=Ee(Gt,Dd,gt,Wt,function(t,n,r,i){const o={};return t==null||t.forEach(s=>{const a=s,l=i==null?void 0:i.get(a.id),c=l?[l.start,l.end]:[0,100],u=Cd(r,"x",a),d=n[a.id].copy(),h=Rd(u,c);d.range(h),o[a.id]=d}),o}),Ib=Ee(Ut,$d,gt,Wt,function(t,n,r,i){const o={};return t==null||t.forEach(s=>{const a=s,l=i==null?void 0:i.get(a.id),c=l?[l.start,l.end]:[0,100],u=Cd(r,"y",a),d=n[a.id].copy(),h=_r(d)?u.reverse():u,f=Rd(h,c);d.range(f),o[a.id]=d}),o}),Ht=Ee(gt,ze,Vt,Wt,wa,_b,function(t,n,r,i,{axes:o,domains:s},a){return wd({scales:a,drawingArea:t,formattedSeries:n,axis:o,seriesConfig:r,axisDirection:"x",zoomMap:i,domains:s})}),qt=Ee(gt,ze,Vt,Wt,Ca,Ib,function(t,n,r,i,{axes:o,domains:s},a){return wd({scales:a,drawingArea:t,formattedSeries:n,axis:o,seriesConfig:r,axisDirection:"y",zoomMap:i,domains:s})});J(Ht,qt,(e,t,n)=>(e==null?void 0:e.axis[n])??(t==null?void 0:t.axis[n]));J(Gt,Ut,(e,t,n)=>{const r=(e==null?void 0:e.find(i=>i.id===n))??(t==null?void 0:t.find(i=>i.id===n))??null;if(r)return r});const jb=J(Gt,e=>e[0].id),kb=J(Ut,e=>e[0].id);Ee(ze,Dd,$d,jb,kb,function(t,n,r,i,o){const s=t.scatter,a=new Map;return s&&s.seriesOrder.forEach(l=>{const{data:c,xAxisId:u=i,yAxisId:d=o}=s.series[l],h=new Ta(c.length),f=n[u],m=r[d];for(const p of c)h.add(f(p.x),m(p.y));h.finish(),a.set(l,h)}),a});function An(e){return e instanceof Date?e.getTime():e}function Bn(e,t){const{scale:n,data:r,reverse:i}=e;if(!_r(n)){const s=n.invert(t);if(r===void 0)return-1;const a=An(s);return r==null?void 0:r.findIndex((c,u)=>{const d=An(c);return d>a&&(u===0||Math.abs(a-d)<=Math.abs(a-An(r[u-1])))||d<=a&&(u===r.length-1||Math.abs(An(s)-d)<Math.abs(An(s)-An(r[u+1])))})}const o=n.bandwidth()===0?Math.floor((t-Math.min(...n.range())+n.step()/2)/n.step()):Math.floor((t-Math.min(...n.range()))/n.step());return o<0||o>=r.length?-1:i?r.length-1-o:o}function Ec(e,t,n,r){if(!_r(e)){if(r===null){const i=e.invert(n);return Number.isNaN(i)?null:i}return t[r]}return r===null||r<0||r>=t.length?null:t[r]}function Tc(e,t){const n=e.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n.matrixTransform(e.getScreenCTM().inverse())}const Ma=({store:e})=>{const t=Ye(function(){e.update({interaction:L({},e.state.interaction,{pointer:null})})}),n=Ye(function(a){e.state.interaction.lastUpdate!==a&&e.set("interaction",L({},e.state.interaction,{lastUpdate:a}))}),r=Ye(function(a){e.set("interaction",L({},e.state.interaction,{pointer:a,lastUpdate:a!==null?"pointer":e.state.interaction.lastUpdate}))}),i=Ye(function(a){e.set("interaction",L({},e.state.interaction,{pointerType:a.pointerType}))}),o=Ye(function(){e.set("interaction",L({},e.state.interaction,{pointerType:null}))});return{instance:{cleanInteraction:t,setLastUpdateSource:n,setPointerCoordinate:r,handlePointerEnter:i,handlePointerLeave:o}}};Ma.getInitialState=()=>({interaction:{item:null,pointer:null,lastUpdate:"pointer",pointerType:null}});Ma.params={};const go=e=>e.interaction,Ob=J(go,e=>e!==void 0),Nd=J(go,e=>(e==null?void 0:e.pointer)??null),yo=J(Nd,e=>e&&e.x),xo=J(Nd,e=>e&&e.y);J(go,e=>e==null?void 0:e.lastUpdate);J(go,e=>(e==null?void 0:e.pointerType)??null);function lr(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const i=e.length;if(i!==t.length)return!1;for(let o=0;o<i;o+=1)if(!lr(e[o],t[o]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;const i=Array.from(e.entries());for(let o=0;o<i.length;o+=1)if(!t.has(i[o][0]))return!1;for(let o=0;o<i.length;o+=1){const s=i[o];if(!lr(s[1],t.get(s[0])))return!1}return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;const i=Array.from(e.entries());for(let o=0;o<i.length;o+=1)if(!t.has(i[o][0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){const i=e.length;if(i!==t.length)return!1;for(let o=0;o<i;o+=1)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),r=n.length;if(r!==Object.keys(t).length)return!1;for(let i=0;i<r;i+=1)if(!Object.prototype.hasOwnProperty.call(t,n[i]))return!1;for(let i=0;i<r;i+=1){const o=n[i];if(!lr(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Ms(e,t,n=t.axisIds[0]){return Array.isArray(n)?n.map(r=>Bn(t.axis[r],e)):Bn(t.axis[n],e)}const Ld=(e,t,n)=>{if(e===null)return null;const r=Ms(e,t,n);return r===-1?null:r},Pb=J(yo,Ht,Ld),Db=J(xo,qt,Ld),$b=J(yo,xo,Ht,qt,(e,t,n,r)=>[...e===null?[]:n.axisIds.map(i=>({axisId:i,dataIndex:Ms(e,n,i)})),...t===null?[]:r.axisIds.map(i=>({axisId:i,dataIndex:Ms(t,r,i)}))].filter(i=>i.dataIndex!==null&&i.dataIndex>=0));function zd(e,t,n,r=t.axisIds[0]){return Array.isArray(r)?r.map((i,o)=>{const s=t.axis[i];return Ec(s.scale,s.data,e,n[o])}):Ec(t.axis[r].scale,t.axis[r].data,e,n)}J(yo,Ht,Pb,(e,t,n,r)=>e===null||t.axisIds.length===0?null:zd(e,t,n,r));J(xo,qt,Db,(e,t,n,r)=>e===null||t.axisIds.length===0?null:zd(e,t,n,r));const Fd=[],Nb=Vs({memoizeOptions:{resultEqualityCheck:lr}})(yo,Ht,(e,t)=>e===null?Fd:t.axisIds.filter(n=>t.axis[n].triggerTooltip).map(n=>({axisId:n,dataIndex:Bn(t.axis[n],e)})).filter(({dataIndex:n})=>n>=0)),Lb=Vs({memoizeOptions:{resultEqualityCheck:lr}})(xo,qt,(e,t)=>e===null?Fd:t.axisIds.filter(n=>t.axis[n].triggerTooltip).map(n=>({axisId:n,dataIndex:Bn(t.axis[n],e)})).filter(({dataIndex:n})=>n>=0));J(Nb,Lb,(e,t)=>e.length>0||t.length>0);function zb(e){return e.setPointerCoordinate!==void 0}const Fb=new Set(["bar","rangeBar","line"]),bo=({params:e,store:t,seriesConfig:n,svgRef:r,instance:i})=>{const{xAxis:o,yAxis:s,dataset:a,onHighlightedAxisChange:l}=e;if(process.env.NODE_ENV!=="production"){const w=[...o??[],...s??[]].filter(S=>S.id).map(S=>S.id),C=new Set(w.filter((S,R)=>w.indexOf(S)!==R));C.size>0&&Nn([`MUI X Charts: The following axis ids are duplicated: ${Array.from(C).join(", ")}.`,"Please make sure that each axis has a unique id."].join(`
|
|
95
|
+
`),"error")}const c=t.use(gt),u=t.use(ze),d=t.use(Ob),{axis:h,axisIds:f}=t.use(Ht),{axis:m,axisIds:p}=t.use(qt);na({warningPrefix:"MUI X Charts",componentName:"Chart",propName:"highlightedAxis",controlled:e.highlightedAxis,defaultValue:void 0}),ot(()=>{e.highlightedAxis!==void 0&&t.set("controlledCartesianAxisHighlight",e.highlightedAxis)},[t,e.highlightedAxis]);const y=O.useRef(!0);O.useEffect(()=>{if(y.current){y.current=!1;return}t.set("cartesianAxis",{x:Xu(o,a),y:Zu(s,a)})},[n,c,o,s,a,t]);const b=f[0],E=p[0];Tg(t,$b,(w,C)=>{if(l&&!Object.is(w,C)){if(w.length!==C.length){l(C);return}w!=null&&w.some(({axisId:S,dataIndex:R},I)=>C[I].axisId!==S||C[I].dataIndex!==R)&&l(C)}});const T=zb(i);return O.useEffect(()=>{const w=r.current;if(!d||!T||!w||e.disableAxisListener)return()=>{};const C=i.addInteractionListener("moveEnd",v=>{v.detail.activeGestures.pan||i.cleanInteraction()}),S=i.addInteractionListener("panEnd",v=>{v.detail.activeGestures.move||i.cleanInteraction()}),R=i.addInteractionListener("quickPressEnd",v=>{!v.detail.activeGestures.move&&!v.detail.activeGestures.pan&&i.cleanInteraction()}),I=v=>{var G;const _=v.detail.srcEvent,A=v.detail.target,B=Tc(w,_);if(v.detail.srcEvent.buttons>=1&&(A!=null&&A.hasPointerCapture(v.detail.srcEvent.pointerId))&&!(A!=null&&A.closest("[data-charts-zoom-slider]"))&&(A==null||A.releasePointerCapture(v.detail.srcEvent.pointerId)),!i.isPointInside(B.x,B.y,A)){(G=i.cleanInteraction)==null||G.call(i);return}i.setPointerCoordinate(B)},k=i.addInteractionListener("move",I),z=i.addInteractionListener("pan",I),P=i.addInteractionListener("quickPress",I);return()=>{k.cleanup(),C.cleanup(),z.cleanup(),S.cleanup(),P.cleanup(),R.cleanup()}},[r,t,h,b,m,E,i,e.disableAxisListener,d,T]),O.useEffect(()=>{const w=r.current,C=e.onAxisClick;if(w===null||!C)return()=>{};const S=i.addInteractionListener("tap",R=>{let I=null,k=!1;const z=Tc(w,R.detail.srcEvent),P=Bn(h[b],z.x);k=P!==-1,I=k?P:Bn(m[E],z.y);const v=k?f[0]:p[0];if(I==null||I===-1)return;const _=(k?h:m)[v].data[I],A={};Object.keys(u).filter(B=>Fb.has(B)).forEach(B=>{const G=u[B];G==null||G.seriesOrder.forEach(Z=>{const Y=G.series[Z],te=Y.xAxisId,we=Y.yAxisId,V=k?te:we;(V===void 0||V===v)&&(A[Z]=Y.data[I])})}),C(R.detail.srcEvent,{dataIndex:I,axisValue:_,seriesValues:A})});return()=>{S.cleanup()}},[e.onAxisClick,u,r,h,f,m,p,b,E,i]),{}};bo.params={xAxis:!0,yAxis:!0,dataset:!0,onAxisClick:!0,disableAxisListener:!0,onHighlightedAxisChange:!0,highlightedAxis:!0};bo.getDefaultizedParams=({params:e})=>L({},e,{colors:e.colors??Yu,theme:e.theme??"light",defaultizedXAxis:Xu(e.xAxis,e.dataset),defaultizedYAxis:Zu(e.yAxis,e.dataset)});bo.getInitialState=e=>L({cartesianAxis:{x:e.defaultizedXAxis,y:e.defaultizedYAxis}},e.highlightedAxis===void 0?{}:{controlledCartesianAxisHighlight:e.highlightedAxis});const Bb=Object.is;function _i(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=0,r=0;for(const i in e)if(n+=1,!Bb(e[i],t[i])||!(i in t))return!1;for(const i in t)r+=1;return n===r}const Ir=e=>e.keyboardNavigation;J(Ir,(e,t)=>(e==null?void 0:e.item)!=null&&_i(e.item,t));const Gb=J(Ir,e=>(e==null?void 0:e.item)!=null),Bd=J(Ir,e=>(e==null?void 0:e.item)??null),Ub=J(Ir,e=>!!(e!=null&&e.enableKeyboardNavigation)),Gd=e=>(t,n,r)=>{var s;if(t==null||!("dataIndex"in t)||t.dataIndex===void 0)return;const i=(s=r[t.type])==null?void 0:s.series[t.seriesId];if(!i)return;let o=e==="x"?"xAxisId"in i&&i.xAxisId:"yAxisId"in i&&i.yAxisId;return(o===void 0||o===!1)&&(o=n.axisIds[0]),{axisId:o,dataIndex:t.dataIndex}};J(Bd,Ht,ze,Gd("x"));J(Bd,qt,ze,Gd("y"));J(Ir,function(t){if((t==null?void 0:t.item)==null)return null;const{type:n,seriesId:r}=t.item;return n===void 0||r===void 0?null:t.item});const Ra=({store:e,params:t})=>{na({warningPrefix:"MUI X Charts",componentName:"Chart",propName:"tooltipItem",controlled:t.tooltipItem,defaultValue:null}),ot(()=>{e.state.tooltip.item!==t.tooltipItem&&e.set("tooltip",L({},e.state.tooltip,{item:t.tooltipItem}))},[e,t.tooltipItem]);const n=Ye(function(o){var a;const s=e.state.tooltip.item;if(s!==null&&(!o||_i(s,o))){(a=t.onTooltipItemChange)==null||a.call(t,null),e.state.tooltip.itemIsControlled||e.set("tooltip",L({},e.state.tooltip,{item:null}));return}});return{instance:{setTooltipItem:Ye(function(o){var s;_i(e.state.tooltip.item,o)||((s=t.onTooltipItemChange)==null||s.call(t,o),e.state.tooltip.itemIsControlled||e.set("tooltip",L({},e.state.tooltip,{item:o})))}),removeTooltipItem:n}}};Ra.getInitialState=e=>({tooltip:{itemIsControlled:e.tooltipItem!==void 0,item:e.tooltipItem??null}});Ra.params={tooltipItem:!0,onTooltipItemChange:!0};const nn=(e,t)=>e===void 0?t:Math.PI*e/180;function wc(e,t){return e.id!==void 0?e:L({id:t},e)}function Cc(e){return e.colorMap?L({},e,{colorScale:e.colorMap.type==="ordinal"&&e.data?Ai(L({values:e.data},e.colorMap)):ws(e.colorMap.type==="continuous"?L({min:e.min,max:e.max},e.colorMap):e.colorMap)}):e}function Ud(e,t){if(!e||e.length===0)return{axis:{},axisIds:[]};const n={},r=[];return e.forEach((i,o)=>{const s=i.dataKey,a=i.id??`defaultized-z-axis-${o}`;if(s===void 0||i.data!==void 0){n[a]=Cc(wc(i,a)),r.push(a);return}if(t===void 0)throw new Error("MUI X Charts: z-axis uses `dataKey` but no `dataset` is provided.");n[a]=Cc(wc(L({},i,{data:t.map(l=>l[s])}),a)),r.push(a)}),{axis:n,axisIds:r}}const Aa=({params:e,store:t})=>{const{zAxis:n,dataset:r}=e,i=O.useRef(!0);return O.useEffect(()=>{if(i.current){i.current=!1;return}t.set("zAxis",Ud(n,r))},[n,r,t]),{}};Aa.params={zAxis:!0,dataset:!0};Aa.getInitialState=e=>({zAxis:Ud(e.zAxis,e.dataset)});const Vb=e=>e,Yb=J(Vb,e=>e.zAxis),_a=({store:e,params:t})=>{na({warningPrefix:"MUI X Charts",componentName:"Chart",propName:"highlightedItem",controlled:t.highlightedItem,defaultValue:null}),ot(()=>{e.state.highlight.item!==t.highlightedItem&&e.set("highlight",L({},e.state.highlight,{item:t.highlightedItem})),process.env.NODE_ENV!=="production"&&t.highlightedItem!==void 0&&!e.state.highlight.isControlled&&Nn(["MUI X Charts: The `highlightedItem` switched between controlled and uncontrolled state.","To remove the highlight when using controlled state, you must provide `null` to the `highlightedItem` prop instead of `undefined`."].join(`
|
|
96
|
+
`))},[e,t.highlightedItem]);const n=Ye(()=>{var o;(o=t.onHighlightChange)==null||o.call(t,null);const i=e.state.highlight;i.item===null||i.isControlled||e.set("highlight",{item:null,lastUpdate:"pointer",isControlled:!1})}),r=Ye(i=>{var s;const o=e.state.highlight;_i(o.item,i)||((s=t.onHighlightChange)==null||s.call(t,i),!o.isControlled&&e.set("highlight",{item:i,lastUpdate:"pointer",isControlled:!1}))});return{instance:{clearHighlight:n,setHighlight:r}}};_a.getInitialState=e=>({highlight:{item:e.highlightedItem,lastUpdate:"pointer",isControlled:e.highlightedItem!==void 0}});_a.params={highlightedItem:!0,onHighlightChange:!0};function yr(e){let t=1/0,n=-1/0;for(const r of e??[])r<t&&(t=r),r>n&&(n=r);return[t,n]}const Mc=(e,t)=>t==="x"?{x:e,y:null}:{x:null,y:e},Vd=e=>{var s;const{axis:t,getFilters:n,isDefaultAxis:r}=e,i=n==null?void 0:n({currentAxisId:t.id,isDefaultAxis:r}),o=i?(s=t.data)==null?void 0:s.filter((a,l)=>i({x:null,y:null},l)):t.data;return yr(o??[])},Yd=e=>t=>{const{series:n,axis:r,getFilters:i,isDefaultAxis:o}=t;return Object.keys(n).filter(s=>{const a=e==="x"?n[s].xAxisId:n[s].yAxisId;return a===r.id||o&&a===void 0}).reduce((s,a)=>{const{stackedData:l}=n[a],c=i==null?void 0:i({currentAxisId:r.id,isDefaultAxis:o,seriesXAxisId:n[a].xAxisId,seriesYAxisId:n[a].yAxisId}),[u,d]=(l==null?void 0:l.reduce((h,f,m)=>c&&(!c(Mc(f[0],e),m)||!c(Mc(f[1],e),m))?h:[Math.min(...f,h[0]),Math.max(...f,h[1])],[1/0,-1/0]))??[1/0,-1/0];return[Math.min(u,s[0]),Math.max(d,s[1])]},[1/0,-1/0])},Wb=e=>Object.keys(e.series).some(n=>e.series[n].layout==="horizontal")?Yd("x")(e):Vd(e),Hb=e=>Object.keys(e.series).some(n=>e.series[n].layout==="horizontal")?Vd(e):Yd("y")(e);function Se(e){return function(){return e}}const Rc=Math.abs,Oe=Math.atan2,Xt=Math.cos,qb=Math.max,ts=Math.min,lt=Math.sin,jn=Math.sqrt,Be=1e-12,xr=Math.PI,Ii=xr/2,di=2*xr;function Kb(e){return e>1?0:e<-1?xr:Math.acos(e)}function Ac(e){return e>=1?Ii:e<=-1?-Ii:Math.asin(e)}const Rs=Math.PI,As=2*Rs,Zt=1e-6,Jb=As-Zt;function Wd(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Xb(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Wd;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Zb{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Wd:Xb(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,a=this._y1,l=r-t,c=i-n,u=s-t,d=a-n,h=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>Zt)if(!(Math.abs(d*l-c*u)>Zt)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-s,m=i-a,p=l*l+c*c,y=f*f+m*m,b=Math.sqrt(p),E=Math.sqrt(h),T=o*Math.tan((Rs-Math.acos((p+h-y)/(2*b*E)))/2),w=T/E,C=T/b;Math.abs(w-1)>Zt&&this._append`L${t+w*u},${n+w*d}`,this._append`A${o},${o},0,0,${+(d*f>u*m)},${this._x1=t+C*l},${this._y1=n+C*c}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),l=r*Math.sin(i),c=t+a,u=n+l,d=1^s,h=s?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Zt||Math.abs(this._y1-u)>Zt)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%As+As),h>Jb?this._append`A${r},${r},0,1,${d},${t-a},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:h>Zt&&this._append`A${r},${r},0,${+(h>=Rs)},${d},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function Qb(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Zb(t)}function ev(e){return e.innerRadius}function tv(e){return e.outerRadius}function nv(e){return e.startAngle}function rv(e){return e.endAngle}function iv(e){return e&&e.padAngle}function ov(e,t,n,r,i,o,s,a){var l=n-e,c=r-t,u=s-i,d=a-o,h=d*l-u*c;if(!(h*h<Be))return h=(u*(t-o)-d*(e-i))/h,[e+h*l,t+h*c]}function Jr(e,t,n,r,i,o,s){var a=e-n,l=t-r,c=(s?o:-o)/jn(a*a+l*l),u=c*l,d=-c*a,h=e+u,f=t+d,m=n+u,p=r+d,y=(h+m)/2,b=(f+p)/2,E=m-h,T=p-f,w=E*E+T*T,C=i-o,S=h*p-m*f,R=(T<0?-1:1)*jn(qb(0,C*C*w-S*S)),I=(S*T-E*R)/w,k=(-S*E-T*R)/w,z=(S*T+E*R)/w,P=(-S*E+T*R)/w,v=I-y,_=k-b,A=z-y,B=P-b;return v*v+_*_>A*A+B*B&&(I=z,k=P),{cx:I,cy:k,x01:-u,y01:-d,x11:I*(i/C-1),y11:k*(i/C-1)}}function Hd(){var e=ev,t=tv,n=Se(0),r=null,i=nv,o=rv,s=iv,a=null,l=Qb(c);function c(){var u,d,h=+e.apply(this,arguments),f=+t.apply(this,arguments),m=i.apply(this,arguments)-Ii,p=o.apply(this,arguments)-Ii,y=Rc(p-m),b=p>m;if(a||(a=u=l()),f<h&&(d=f,f=h,h=d),!(f>Be))a.moveTo(0,0);else if(y>di-Be)a.moveTo(f*Xt(m),f*lt(m)),a.arc(0,0,f,m,p,!b),h>Be&&(a.moveTo(h*Xt(p),h*lt(p)),a.arc(0,0,h,p,m,b));else{var E=m,T=p,w=m,C=p,S=y,R=y,I=s.apply(this,arguments)/2,k=I>Be&&(r?+r.apply(this,arguments):jn(h*h+f*f)),z=ts(Rc(f-h)/2,+n.apply(this,arguments)),P=z,v=z,_,A;if(k>Be){var B=Ac(k/h*lt(I)),G=Ac(k/f*lt(I));(S-=B*2)>Be?(B*=b?1:-1,w+=B,C-=B):(S=0,w=C=(m+p)/2),(R-=G*2)>Be?(G*=b?1:-1,E+=G,T-=G):(R=0,E=T=(m+p)/2)}var Z=f*Xt(E),Y=f*lt(E),te=h*Xt(C),we=h*lt(C);if(z>Be){var V=f*Xt(T),xe=f*lt(T),Pe=h*Xt(w),xt=h*lt(w),ke;if(y<xr)if(ke=ov(Z,Y,Pe,xt,V,xe,te,we)){var bt=Z-ke[0],st=Y-ke[1],Ue=V-ke[0],F=xe-ke[1],q=1/lt(Kb((bt*Ue+st*F)/(jn(bt*bt+st*st)*jn(Ue*Ue+F*F)))/2),X=jn(ke[0]*ke[0]+ke[1]*ke[1]);P=ts(z,(h-X)/(q-1)),v=ts(z,(f-X)/(q+1))}else P=v=0}R>Be?v>Be?(_=Jr(Pe,xt,Z,Y,f,v,b),A=Jr(V,xe,te,we,f,v,b),a.moveTo(_.cx+_.x01,_.cy+_.y01),v<z?a.arc(_.cx,_.cy,v,Oe(_.y01,_.x01),Oe(A.y01,A.x01),!b):(a.arc(_.cx,_.cy,v,Oe(_.y01,_.x01),Oe(_.y11,_.x11),!b),a.arc(0,0,f,Oe(_.cy+_.y11,_.cx+_.x11),Oe(A.cy+A.y11,A.cx+A.x11),!b),a.arc(A.cx,A.cy,v,Oe(A.y11,A.x11),Oe(A.y01,A.x01),!b))):(a.moveTo(Z,Y),a.arc(0,0,f,E,T,!b)):a.moveTo(Z,Y),!(h>Be)||!(S>Be)?a.lineTo(te,we):P>Be?(_=Jr(te,we,V,xe,h,-P,b),A=Jr(Z,Y,Pe,xt,h,-P,b),a.lineTo(_.cx+_.x01,_.cy+_.y01),P<z?a.arc(_.cx,_.cy,P,Oe(_.y01,_.x01),Oe(A.y01,A.x01),!b):(a.arc(_.cx,_.cy,P,Oe(_.y01,_.x01),Oe(_.y11,_.x11),!b),a.arc(0,0,h,Oe(_.cy+_.y11,_.cx+_.x11),Oe(A.cy+A.y11,A.cx+A.x11),b),a.arc(A.cx,A.cy,P,Oe(A.y11,A.x11),Oe(A.y01,A.x01),!b))):a.arc(0,0,h,C,w,b)}if(a.closePath(),u)return a=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-xr/2;return[Xt(d)*u,lt(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:Se(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:Se(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:Se(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:Se(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:Se(+u),c):i},c.endAngle=function(u){return arguments.length?(o=typeof u=="function"?u:Se(+u),c):o},c.padAngle=function(u){return arguments.length?(s=typeof u=="function"?u:Se(+u),c):s},c.context=function(u){return arguments.length?(a=u??null,c):a},c}function qd(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function sv(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function av(e){return e}function lv(){var e=av,t=sv,n=null,r=Se(0),i=Se(di),o=Se(0);function s(a){var l,c=(a=qd(a)).length,u,d,h=0,f=new Array(c),m=new Array(c),p=+r.apply(this,arguments),y=Math.min(di,Math.max(-di,i.apply(this,arguments)-p)),b,E=Math.min(Math.abs(y)/c,o.apply(this,arguments)),T=E*(y<0?-1:1),w;for(l=0;l<c;++l)(w=m[f[l]=l]=+e(a[l],l,a))>0&&(h+=w);for(t!=null?f.sort(function(C,S){return t(m[C],m[S])}):n!=null&&f.sort(function(C,S){return n(a[C],a[S])}),l=0,d=h?(y-c*T)/h:0;l<c;++l,p=b)u=f[l],w=m[u],b=p+(w>0?w*d:0)+T,m[u]={data:a[u],index:l,value:w,startAngle:p,endAngle:b,padAngle:E};return m}return s.value=function(a){return arguments.length?(e=typeof a=="function"?a:Se(+a),s):e},s.sortValues=function(a){return arguments.length?(t=a,n=null,s):t},s.sort=function(a){return arguments.length?(n=a,t=null,s):n},s.startAngle=function(a){return arguments.length?(r=typeof a=="function"?a:Se(+a),s):r},s.endAngle=function(a){return arguments.length?(i=typeof a=="function"?a:Se(+a),s):i},s.padAngle=function(a){return arguments.length?(o=typeof a=="function"?a:Se(+a),s):o},s}function Gn(e,t){if((s=e.length)>1)for(var n=1,r,i,o=e[t[0]],s,a=o.length;n<s;++n)for(i=o,o=e[t[n]],r=0;r<a;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Un(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function cv(e,t){return e[t]}function uv(e){const t=[];return t.key=e,t}function ji(){var e=Se([]),t=Un,n=Gn,r=cv;function i(o){var s=Array.from(e.apply(this,arguments),uv),a,l=s.length,c=-1,u;for(const d of o)for(a=0,++c;a<l;++a)(s[a][c]=[0,+r(d,s[a].key,c,o)]).data=d;for(a=0,u=qd(t(s));a<l;++a)s[u[a]].index=a;return n(s,u),s}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:Se(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:Se(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?Un:typeof o=="function"?o:Se(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??Gn,i):n},i}function dv(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,s;i<o;++i){for(s=n=0;n<r;++n)s+=e[n][i][1]||0;if(s)for(n=0;n<r;++n)e[n][i][1]/=s}Gn(e,t)}}function hv(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var s=0,a=0;s<i;++s)a+=e[s][n][1]||0;r[n][1]+=r[n][0]=-a/2}Gn(e,t)}}function fv(e,t){if(!(!((s=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,s;r<o;++r){for(var a=0,l=0,c=0;a<s;++a){for(var u=e[t[a]],d=u[r][1]||0,h=u[r-1][1]||0,f=(d-h)/2,m=0;m<a;++m){var p=e[t[m]],y=p[r][1]||0,b=p[r-1][1]||0;f+=y-b}l+=d,c+=f*d}i[r-1][1]+=i[r-1][0]=n,l&&(n-=c/l)}i[r-1][1]+=i[r-1][0]=n,Gn(e,t)}}function Kd(e){var t=e.map(pv);return Un(e).sort(function(n,r){return t[n]-t[r]})}function pv(e){for(var t=-1,n=0,r=e.length,i,o=-1/0;++t<r;)(i=+e[t][1])>o&&(o=i,n=t);return n}function Jd(e){var t=e.map(Xd);return Un(e).sort(function(n,r){return t[n]-t[r]})}function Xd(e){for(var t=0,n=-1,r=e.length,i;++n<r;)(i=+e[n][1])&&(t+=i);return t}function mv(e){return Jd(e).reverse()}function gv(e){var t=e.length,n,r,i=e.map(Xd),o=Kd(e),s=0,a=0,l=[],c=[];for(n=0;n<t;++n)r=o[n],s<a?(s+=i[r],l.push(r)):(a+=i[r],c.push(r));return c.reverse().concat(l)}function yv(e){return Un(e).reverse()}function xv(e,t){if(e.length===0)return;const n=e.length,r=t,i=e[r[0]].length;for(let o=0;o<i;o+=1){let s=0,a=0;for(let l=0;l<n;l+=1){const c=e[r[l]],u=c[o],d=u[1]-u[0];d>0?(u[0]=s,s+=d,u[1]=s):d<0?(u[1]=a,a+=d,u[0]=a):u.data[c.key]>0?(u[0]=s,u[1]=s):u.data[c.key]<0?(u[1]=a,u[0]=a):(u[0]=0,u[1]=0)}}}const ns={appearance:Kd,ascending:Jd,descending:mv,insideOut:gv,none:Un,reverse:yv},rs={expand:dv,diverging:xv,none:Gn,silhouette:hv,wiggle:fv},Zd=e=>{const{series:t,seriesOrder:n,defaultStrategy:r}=e,i=[],o={};return n.forEach(s=>{const{stack:a,stackOrder:l,stackOffset:c}=t[s];a===void 0?i.push({ids:[s],stackingOrder:ns.none,stackingOffset:rs.none}):o[a]===void 0?(o[a]=i.length,i.push({ids:[s],stackingOrder:ns[l??(r==null?void 0:r.stackOrder)??"none"],stackingOffset:rs[c??(r==null?void 0:r.stackOffset)??"diverging"]})):(i[o[a]].ids.push(s),l!==void 0&&(i[o[a]].stackingOrder=ns[l]),c!==void 0&&(i[o[a]].stackingOffset=rs[c]))}),i},bv=e=>e==null?"":e.toLocaleString(),vv=(e,t,n)=>{const{seriesOrder:r,series:i}=e,o=Zd(e),s=t??[];r.forEach(l=>{const c=i[l].data;if(c!==void 0)c.forEach((u,d)=>{s.length<=d?s.push({[l]:u}):s[d][l]=u});else if(t===void 0)throw new Error([`MUI X Charts: bar series with id='${l}' has no data.`,"Either provide a data property to the series or use the dataset prop."].join(`
|
|
97
|
+
`));if(process.env.NODE_ENV!=="production"&&!c&&t){const u=i[l].dataKey;if(!u)throw new Error([`MUI X Charts: bar series with id='${l}' has no data and no dataKey.`,"You must provide a dataKey when using the dataset prop."].join(`
|
|
98
|
+
`));t.forEach((d,h)=>{const f=d[u];f!=null&&typeof f!="number"&&Nn([`MUI X Charts: your dataset key "${u}" is used for plotting bars, but the dataset contains the non-null non-numerical element "${f}" at index ${h}.`,"Bar plots only support numeric and null values."].join(`
|
|
99
|
+
`))})}});const a={};return o.forEach(l=>{const{ids:c,stackingOffset:u,stackingOrder:d}=l,h=c.map(b=>{const E=i[b].dataKey;return i[b].data===void 0&&E!==void 0?E:b}),f=ji().keys(h).value((b,E)=>b[E]??0).order(d).offset(u)(s),m=f.map(b=>b.index),p=()=>m,y=ji().keys(h).value((b,E)=>{const T=h.indexOf(E),w=c[T];return n!=null&&n({type:"bar",seriesId:w})?b[E]??0:0}).order(p).offset(u)(s);c.forEach((b,E)=>{const T=i[b].dataKey,w=T?t.map(S=>{const R=S[T];return typeof R=="number"?R:null}):i[b].data,C=!(n!=null&&n({type:"bar",seriesId:b}));a[b]=L({layout:"vertical",labelMarkType:"square",minBarSize:0,valueFormatter:i[b].valueFormatter??bv},i[b],{data:w,hidden:C,stackedData:f[E],visibleStackedData:y[E]})})}),{seriesOrder:r,stackingGroups:o,series:a}};function _t(e,t){return typeof e=="function"?e(t):e}const Sv=e=>{const{seriesOrder:t,series:n}=e;return t.reduce((r,i)=>{const o=_t(n[i].label,"legend");return o===void 0||r.push({type:"bar",markType:n[i].labelMarkType,id:i,seriesId:i,color:n[i].color,label:o}),r},[])};function Ia(e){return e.colorGetter?e.colorGetter:()=>e.color}const Ev=(e,t,n)=>{const r=e.layout==="vertical",i=r?t==null?void 0:t.colorScale:n==null?void 0:n.colorScale,o=r?n==null?void 0:n.colorScale:t==null?void 0:t.colorScale,s=r?t==null?void 0:t.data:n==null?void 0:n.data,a=Ia(e);return o?l=>{if(l===void 0)return e.color;const c=e.data[l],u=c===null?a({value:c,dataIndex:l}):o(c);return u===null?a({value:c,dataIndex:l}):u}:i&&s?l=>{if(l===void 0)return e.color;const c=s[l],u=c===null?a({value:c,dataIndex:l}):i(c);return u===null?a({value:c,dataIndex:l}):u}:l=>{if(l===void 0)return e.color;const c=e.data[l];return a({value:c,dataIndex:l})}};function Qd(e,t){return Object.keys(e).filter(n=>t.has(n)).flatMap(n=>{const r=e[n];return r.seriesOrder.filter(i=>r.series[i].data.length>0&&r.series[i].data.some(o=>o!=null)).map(i=>({type:n,seriesId:i}))})}function eh(e,t,n,r){const i=Qd(e,t);if(i.length===0)return null;const o=n!==void 0&&r!==void 0?i.findIndex(s=>s.type===n&&s.seriesId===r):-1;return o<=0?i[i.length-1]:i[(o-1+i.length)%i.length]}function th(e,t){return Object.keys(e).filter(n=>t.has(n)).flatMap(n=>{const r=e[n];return r.seriesOrder.filter(i=>r.series[i].data.length>0&&r.series[i].data.some(o=>o!=null)).map(i=>r.series[i].data.length)}).reduce((n,r)=>Math.max(n,r),0)}function nh(e,t,n,r){const i=Qd(e,t);if(i.length===0)return null;const o=n!==void 0&&r!==void 0?i.findIndex(s=>s.type===n&&s.seriesId===r):-1;return i[(o+1)%i.length]}function rh(e,t,n){var i,o;if(t==="sankey")return!1;const r=(o=(i=e[t])==null?void 0:i.series[n])==null?void 0:o.data;return r!=null&&r.length>0}function vo(e,t=!1){return function(r,i){const o=ze(i);let s=r==null?void 0:r.seriesId,a=r==null?void 0:r.type;if(!a||s==null||!rh(o,a,s)){const u=nh(o,e,a,s);if(u===null)return null;a=u.type,s=u.seriesId}const l=th(o,e);let c=(r==null?void 0:r.dataIndex)==null?0:r.dataIndex+1;return t?c=c%l:c=Math.min(l-1,c),{type:a,seriesId:s,dataIndex:c}}}function So(e,t=!1){return function(r,i){const o=ze(i);let s=r==null?void 0:r.seriesId,a=r==null?void 0:r.type;if(!a||s==null||!rh(o,a,s)){const u=eh(o,e,a,s);if(u===null)return null;a=u.type,s=u.seriesId}const l=th(o,e);let c=(r==null?void 0:r.dataIndex)==null?l-1:r.dataIndex-1;return t?c=(l+c)%l:c=Math.max(0,c),{type:a,seriesId:s,dataIndex:c}}}function Eo(e){return function(n,r){const i=ze(r);let o=n==null?void 0:n.seriesId,s=n==null?void 0:n.type;const a=nh(i,e,s,o);if(a===null)return null;s=a.type,o=a.seriesId;const l=(n==null?void 0:n.dataIndex)==null?0:n.dataIndex;return{type:s,seriesId:o,dataIndex:l}}}function To(e){return function(n,r){const i=ze(r);let o=n==null?void 0:n.seriesId,s=n==null?void 0:n.type;const a=eh(i,e,s,o);if(a===null)return null;s=a.type,o=a.seriesId;const l=i[s].series[o].data,c=(n==null?void 0:n.dataIndex)==null?l.length-1:n.dataIndex;return{type:s,seriesId:o,dataIndex:c}}}const Xr=new Set(["bar","line","scatter"]),Tv=e=>{switch(e.key){case"ArrowRight":return vo(Xr);case"ArrowLeft":return So(Xr);case"ArrowDown":return To(Xr);case"ArrowUp":return Eo(Xr);default:return null}},wv=e=>{const{series:t,getColor:n,identifier:r}=e;if(!r||r.dataIndex===void 0)return null;const i=_t(t.label,"tooltip"),o=t.data[r.dataIndex];if(o==null)return null;const s=t.valueFormatter(o,{dataIndex:r.dataIndex});return{identifier:r,color:n(r.dataIndex),label:i,value:o,formattedValue:s,markType:t.labelMarkType}},Cv=e=>Object.values(e).map(t=>t.layout==="horizontal"?{direction:"y",axisId:t.yAxisId}:{direction:"x",axisId:t.xAxisId});function Mv(e,t,n){if(n===0)return{barWidth:e/t,offset:0};const r=e/(t+(t-1)*n),i=n*r;return{barWidth:r,offset:i}}function Rv(e,t,n){const r=e&&t>0,i=!e&&t<0,o=r||i;return n?!o:o}function Av(e){const{verticalLayout:t,xAxisConfig:n,yAxisConfig:r,series:i,dataIndex:o,numberOfGroups:s,groupIndex:a}=e,l=t?n:r,c=(t?r.reverse:n.reverse)??!1,{barWidth:u,offset:d}=Mv(l.scale.bandwidth(),s,l.barGapRatio),h=a*(u+d),f=n.scale,m=r.scale,p=l.data[o],y=i.data[o];if(y==null)return null;const E=i.visibleStackedData[o].map(I=>t?m(I):f(I)),[T,w]=yr(E).map(I=>Math.round(I));let C=0;y!==0&&(i.hidden||(C=Math.max(i.minBarSize,w-T)));const S=Rv(t,y,c);let R=0;return S?R=w-C:R=T,{x:t?f(p)+h:R,y:t?R:m(p)+h,height:t?C:u,width:t?u:C}}const _v=e=>{var d;const{series:t,identifier:n,axesConfig:r,placement:i}=e;if(!n||n.dataIndex===void 0)return null;const o=(d=t.bar)==null?void 0:d.series[n.seriesId];if(t.bar==null||o==null||r.x===void 0||r.y===void 0)return null;const s=Av({verticalLayout:o.layout==="vertical",xAxisConfig:r.x,yAxisConfig:r.y,series:o,dataIndex:n.dataIndex,numberOfGroups:t.bar.stackingGroups.length,groupIndex:t.bar.stackingGroups.findIndex(h=>h.ids.includes(o.id))});if(s==null)return null;const{x:a,y:l,width:c,height:u}=s;switch(i){case"right":return{x:a+c,y:l+u/2};case"bottom":return{x:a+c/2,y:l+u};case"left":return{x:a,y:l+u/2};case"top":default:return{x:a+c/2,y:l}}};function Iv(e,t,n){return L({},e,{id:e.id??`auto-generated-id-${t}`,color:e.color??n[t%n.length]})}const jv=e=>`Type(${e})`,kv=e=>`Series(${e})`,Ov=e=>e===void 0?"":`Index(${e})`,wo=e=>`${jv(e.type)}${kv(e.seriesId)}${Ov(e.dataIndex)}`,Pv={seriesProcessor:vv,colorProcessor:Ev,legendGetter:Sv,tooltipGetter:wv,tooltipItemPositionGetter:_v,axisTooltipGetter:Cv,xExtremumGetter:Wb,yExtremumGetter:Hb,getSeriesWithDefaultValues:Iv,keyboardFocusHandler:Tv,identifierSerializer:wo},Dv=e=>{const{series:t,axis:n,isDefaultAxis:r,getFilters:i}=e;let o=1/0,s=-1/0;for(const a in t){if(!Object.hasOwn(t,a))continue;const l=t[a].xAxisId;if(!(l===n.id||l===void 0&&r))continue;const c=i==null?void 0:i({currentAxisId:n.id,isDefaultAxis:r,seriesXAxisId:t[a].xAxisId,seriesYAxisId:t[a].yAxisId}),u=t[a].data??[];for(let d=0;d<u.length;d+=1){const h=u[d];c&&!c(h,d)||h.x!==null&&(h.x<o&&(o=h.x),h.x>s&&(s=h.x))}}return[o,s]},$v=e=>{const{series:t,axis:n,isDefaultAxis:r,getFilters:i}=e;let o=1/0,s=-1/0;for(const a in t){if(!Object.hasOwn(t,a))continue;const l=t[a].yAxisId;if(!(l===n.id||l===void 0&&r))continue;const c=i==null?void 0:i({currentAxisId:n.id,isDefaultAxis:r,seriesXAxisId:t[a].xAxisId,seriesYAxisId:t[a].yAxisId}),u=t[a].data??[];for(let d=0;d<u.length;d+=1){const h=u[d];c&&!c(h,d)||h.y!==null&&(h.y<o&&(o=h.y),h.y>s&&(s=h.y))}}return[o,s]},Nv=({series:e,seriesOrder:t},n,r)=>({series:Object.fromEntries(Object.entries(e).map(([o,s])=>{const a=s==null?void 0:s.datasetKeys,l=["x","y"].filter(u=>typeof(a==null?void 0:a[u])!="string");if(s!=null&&s.datasetKeys&&l.length>0)throw new Error([`MUI X Charts: scatter series with id='${o}' has incomplete datasetKeys.`,`Properties ${l.map(u=>`"${u}"`).join(", ")} are missing.`].join(`
|
|
100
|
+
`));const c=a?(n==null?void 0:n.map(u=>({x:u[a.x]??null,y:u[a.y]??null,z:a.z&&u[a.z],id:a.id&&u[a.id]})))??[]:s.data??[];return[o,L({labelMarkType:"circle",markerSize:4},s,{preview:L({markerSize:1},s==null?void 0:s.preview),data:c,hidden:!(r!=null&&r({type:"scatter",seriesId:o})),valueFormatter:s.valueFormatter??(u=>u&&`(${u.x}, ${u.y})`)})]})),seriesOrder:t}),Lv=(e,t,n,r)=>{const i=r==null?void 0:r.colorScale,o=n==null?void 0:n.colorScale,s=t==null?void 0:t.colorScale,a=Ia(e);return i?l=>{var d,h;if(l===void 0)return e.color;if(((d=r==null?void 0:r.data)==null?void 0:d[l])!==void 0){const f=i((h=r==null?void 0:r.data)==null?void 0:h[l]);if(f!==null)return f}const c=e.data[l],u=c===null?a({value:c,dataIndex:l}):i(c.z);return u===null?a({value:c,dataIndex:l}):u}:o?l=>{if(l===void 0)return e.color;const c=e.data[l],u=c===null?a({value:c,dataIndex:l}):o(c.y);return u===null?a({value:c,dataIndex:l}):u}:s?l=>{if(l===void 0)return e.color;const c=e.data[l],u=c===null?a({value:c,dataIndex:l}):s(c.x);return u===null?a({value:c,dataIndex:l}):u}:l=>{if(l===void 0)return e.color;const c=e.data[l];return a({value:c,dataIndex:l})}},zv=e=>{const{seriesOrder:t,series:n}=e;return t.reduce((r,i)=>{const o=_t(n[i].label,"legend");return o===void 0||r.push({type:"scatter",markType:n[i].labelMarkType,id:i,seriesId:i,color:n[i].color,label:o}),r},[])},Fv=e=>{const{series:t,getColor:n,identifier:r}=e;if(!r||r.dataIndex===void 0)return null;const i=_t(t.label,"tooltip"),o=t.data[r.dataIndex],s=t.valueFormatter(o,{dataIndex:r.dataIndex});return{identifier:r,color:n(r.dataIndex),label:i,value:o,formattedValue:s,markType:t.labelMarkType}},Bv=(e,t,n)=>L({},e,{id:e.id??`auto-generated-id-${t}`,color:e.color??n[t%n.length]}),Gv=e=>{var a,l,c;const{series:t,identifier:n,axesConfig:r}=e;if(!n||n.dataIndex===void 0)return null;const i=(a=t.scatter)==null?void 0:a.series[n.seriesId];if(i==null||r.x===void 0||r.y===void 0)return null;const o=(l=i.data)==null?void 0:l[n.dataIndex].x,s=(c=i.data)==null?void 0:c[n.dataIndex].y;return o==null||s==null?null:{x:r.x.scale(o),y:r.y.scale(s)}},Zr=new Set(["bar","line","scatter"]),Uv=e=>{switch(e.key){case"ArrowRight":return vo(Zr);case"ArrowLeft":return So(Zr);case"ArrowDown":return To(Zr);case"ArrowUp":return Eo(Zr);default:return null}},Vv={seriesProcessor:Nv,colorProcessor:Lv,legendGetter:zv,tooltipGetter:Fv,tooltipItemPositionGetter:Gv,xExtremumGetter:Dv,yExtremumGetter:$v,getSeriesWithDefaultValues:Bv,keyboardFocusHandler:Uv,identifierSerializer:wo},Yv=e=>{const{axis:t}=e;return yr(t.data??[])};function Wv(e,t,n,r){return n.reduce((i,o,s)=>{if(t[s]===null)return i;const[a,l]=e(o);return r&&(!r({y:a,x:null},s)||!r({y:l,x:null},s))?i:[Math.min(a,l,i[0]),Math.max(a,l,i[1])]},[1/0,-1/0])}const Hv=e=>{const{series:t,axis:n,isDefaultAxis:r,getFilters:i}=e;return Object.keys(t).filter(o=>{const s=t[o].yAxisId;return s===n.id||r&&s===void 0}).reduce((o,s)=>{const{area:a,stackedData:l,data:c}=t[s],u=a!==void 0,d=i==null?void 0:i({currentAxisId:n.id,isDefaultAxis:r,seriesXAxisId:t[s].xAxisId,seriesYAxisId:t[s].yAxisId}),h=u&&n.scaleType!=="log"&&typeof t[s].baseline!="string"?y=>y:y=>[y[1],y[1]],f=Wv(h,c,l,d),[m,p]=f;return[Math.min(m,o[0]),Math.max(p,o[1])]},[1/0,-1/0])},qv=e=>e==null?"":e.toLocaleString(),Kv=(e,t,n)=>{const{seriesOrder:r,series:i}=e,o=Zd(L({},e,{defaultStrategy:{stackOffset:"none"}})),s=t??[];r.forEach(l=>{const c=i[l].data;if(c!==void 0)c.forEach((u,d)=>{s.length<=d?s.push({[l]:u}):s[d][l]=u});else if(t===void 0&&process.env.NODE_ENV!=="production")throw new Error([`MUI X Charts: line series with id='${l}' has no data.`,"Either provide a data property to the series or use the dataset prop."].join(`
|
|
101
|
+
`));if(process.env.NODE_ENV!=="production"&&!c&&t){const u=i[l].dataKey;if(!u)throw new Error([`MUI X Charts: line series with id='${l}' has no data and no dataKey.`,"You must provide a dataKey when using the dataset prop."].join(`
|
|
102
|
+
`));t.forEach((d,h)=>{const f=d[u];f!=null&&typeof f!="number"&&Nn([`MUI X Charts: your dataset key "${u}" is used for plotting lines, but the dataset contains the non-null non-numerical element "${f}" at index ${h}.`,"Line plots only support numeric and null values."].join(`
|
|
103
|
+
`))})}});const a={};return o.forEach(l=>{const{ids:c,stackingOffset:u,stackingOrder:d}=l,h=c.map(b=>{const E=i[b].dataKey;return i[b].data===void 0&&E!==void 0?E:b}),f=ji().keys(h).value((b,E)=>b[E]??0).order(d).offset(u)(s),m=f.map(b=>b.index),p=()=>m,y=ji().keys(h).value((b,E)=>{const T=h.indexOf(E),w=c[T];return n!=null&&n({type:"line",seriesId:w})?b[E]??0:0}).order(p).offset(u)(s);c.forEach((b,E)=>{const T=i[b].dataKey,w=T?t.map(S=>{const R=S[T];return typeof R=="number"?R:null}):i[b].data,C=!(n!=null&&n({type:"line",seriesId:b}));a[b]=L({labelMarkType:"line"},i[b],{data:w,valueFormatter:i[b].valueFormatter??qv,hidden:C,stackedData:f[E],visibleStackedData:y[E]})})}),{seriesOrder:r,stackingGroups:o,series:a}},Jv=(e,t,n)=>{const r=n==null?void 0:n.colorScale,i=t==null?void 0:t.colorScale,o=Ia(e);return r?s=>{if(s===void 0)return e.color;const a=e.data[s],l=a===null?o({value:a,dataIndex:s}):r(a);return l===null?o({value:a,dataIndex:s}):l}:i?s=>{var c;if(s===void 0)return e.color;const a=(c=t.data)==null?void 0:c[s],l=a===null?o({value:a,dataIndex:s}):i(a);return l===null?o({value:a,dataIndex:s}):l}:s=>{if(s===void 0)return e.color;const a=e.data[s];return o({value:a,dataIndex:s})}},Xv=e=>{const{seriesOrder:t,series:n}=e;return t.reduce((r,i)=>{const o=_t(n[i].label,"legend");return o===void 0||r.push({type:"line",markType:n[i].labelMarkType,id:i,seriesId:i,color:n[i].color,label:o}),r},[])},Zv=e=>{const{series:t,getColor:n,identifier:r}=e;if(!r||r.dataIndex===void 0)return null;const i=_t(t.label,"tooltip"),o=t.data[r.dataIndex],s=t.valueFormatter(o,{dataIndex:r.dataIndex});return{identifier:r,color:n(r.dataIndex),label:i,value:o,formattedValue:s,markType:t.labelMarkType}},Qv=e=>Object.values(e).map(t=>({direction:"x",axisId:t.xAxisId})),e1=(e,t,n)=>L({},e,{id:e.id??`auto-generated-id-${t}`,color:e.color??n[t%n.length]}),t1=e=>{var a,l;const{series:t,identifier:n,axesConfig:r}=e;if(!n||n.dataIndex===void 0)return null;const i=(a=t.line)==null?void 0:a.series[n.seriesId];if(i==null||r.x===void 0||r.y===void 0)return null;const o=(l=r.x.data)==null?void 0:l[n.dataIndex],s=i.data[n.dataIndex]==null?null:i.visibleStackedData[n.dataIndex][1];return o==null||s==null?null:{x:r.x.scale(o),y:r.y.scale(s)}},Qr=new Set(["bar","line","scatter"]),n1=e=>{switch(e.key){case"ArrowRight":return vo(Qr);case"ArrowLeft":return So(Qr);case"ArrowDown":return To(Qr);case"ArrowUp":return Eo(Qr);default:return null}},r1={colorProcessor:Jv,seriesProcessor:Kv,legendGetter:Xv,tooltipGetter:Zv,tooltipItemPositionGetter:t1,axisTooltipGetter:Qv,xExtremumGetter:Yv,yExtremumGetter:Hv,getSeriesWithDefaultValues:e1,keyboardFocusHandler:n1,identifierSerializer:wo},i1=(e="none")=>{if(typeof e=="function")return e;switch(e){case"none":return null;case"desc":return(t,n)=>n-t;case"asc":return(t,n)=>t-n;default:return null}},o1=(e,t,n)=>{const{seriesOrder:r,series:i}=e,o={};return r.forEach(s=>{const a=i[s].data.filter((u,d)=>n==null?void 0:n({type:"pie",seriesId:s,dataIndex:d})),l=lv().startAngle(nn(i[s].startAngle??0)).endAngle(nn(i[s].endAngle??360)).padAngle(nn(i[s].paddingAngle??0)).sortValues(i1(i[s].sortingValues??"none"))(a.map(u=>u.value));let c=0;o[s]=L({labelMarkType:"circle",valueFormatter:u=>u.value.toLocaleString()},i[s],{data:i[s].data.map((u,d)=>{var y,b;const h=u.id??`auto-generated-pie-id-${s}-${d}`,f=!(n!=null&&n({type:"pie",seriesId:s,dataIndex:d}));let m;if(f){const E=c>0?l[c-1].endAngle:nn(i[s].startAngle??0);m={startAngle:E,endAngle:E,padAngle:0,value:u.value,index:d}}else m=l[c],c+=1;const p=L({},u,{id:h,hidden:f},m);return L({labelMarkType:"circle"},p,{formattedValue:((b=(y=i[s]).valueFormatter)==null?void 0:b.call(y,L({},p,{label:_t(p.label,"arc")}),{dataIndex:d}))??p.value.toLocaleString()})})})}),{seriesOrder:r,series:o}},s1=e=>t=>e.data[t].color,a1=e=>{const{seriesOrder:t,series:n}=e;return t.reduce((r,i)=>(n[i].data.forEach((o,s)=>{const a=_t(o.label,"legend");if(a===void 0)return;const l=o.id??s;r.push({type:"pie",markType:o.labelMarkType??n[i].labelMarkType,seriesId:i,id:l,itemId:l,dataIndex:s,color:o.color,label:a})}),r),[])},l1=e=>{const{series:t,getColor:n,identifier:r}=e;if(!r||r.dataIndex===void 0)return null;const i=t.data[r.dataIndex];if(i==null)return null;const o=_t(i.label,"tooltip"),s=L({},i,{label:o}),a=t.valueFormatter(s,{dataIndex:r.dataIndex});return{identifier:r,color:n(r.dataIndex),label:o,value:s,formattedValue:a,markType:i.labelMarkType??t.labelMarkType}};function dt(e,t){if(typeof e=="number")return e;if(e==="100%")return t;if(e.endsWith("%")){const n=Number.parseFloat(e.slice(0,e.length-1));if(!Number.isNaN(n))return n*t/100}if(e.endsWith("px")){const n=Number.parseFloat(e.slice(0,e.length-2));if(!Number.isNaN(n))return n}throw new Error(`MUI X Charts: Received an unknown value "${e}". It should be a number, or a string with a percentage value.`)}function c1(e,t){const{height:n,width:r}=t,{cx:i,cy:o}=e,s=Math.min(r,n)/2,a=dt(i??"50%",r),l=dt(o??"50%",n);return{cx:a,cy:l,availableRadius:s}}const u1=(e,t)=>{const n={};for(const r of e.seriesOrder){const{innerRadius:i,outerRadius:o,arcLabelRadius:s,cx:a,cy:l}=e.series[r],{cx:c,cy:u,availableRadius:d}=c1({cx:a,cy:l},{width:t.width,height:t.height}),h=dt(o??d,d),f=dt(i??0,d),m=s===void 0?(f+h)/2:dt(s,d);n[r]={radius:{available:d,inner:f,outer:h,label:m},center:{x:t.left+c,y:t.top+u}}}return n},d1=(e,t,n)=>L({},e,{id:e.id??`auto-generated-id-${t}`,data:e.data.map((r,i)=>L({},r,{color:r.color??n[i%n.length]}))}),h1=e=>{var y,b;const{series:t,identifier:n,placement:r,seriesLayout:i}=e;if(!n||n.dataIndex===void 0)return null;const o=(y=t.pie)==null?void 0:y.series[n.seriesId],s=(b=i.pie)==null?void 0:b[n.seriesId];if(o==null||s==null)return null;const{center:a,radius:l}=s,{data:c}=o,u=c[n.dataIndex];if(!u)return null;const d=[[l.inner,u.startAngle],[l.inner,u.endAngle],[l.outer,u.startAngle],[l.outer,u.endAngle]].map(([E,T])=>({x:a.x+E*Math.sin(T),y:a.y-E*Math.cos(T)})),[h,f]=yr(d.map(E=>E.x)),[m,p]=yr(d.map(E=>E.y));switch(r){case"bottom":return{x:(f+h)/2,y:p};case"left":return{x:h,y:(p+m)/2};case"right":return{x:f,y:(p+m)/2};case"top":default:return{x:(f+h)/2,y:m}}},ei=new Set(["pie"]),f1=e=>{switch(e.key){case"ArrowRight":return vo(ei);case"ArrowLeft":return So(ei);case"ArrowDown":return To(ei);case"ArrowUp":return Eo(ei);default:return null}},p1={colorProcessor:s1,seriesProcessor:o1,seriesLayout:u1,legendGetter:a1,tooltipGetter:l1,tooltipItemPositionGetter:h1,getSeriesWithDefaultValues:d1,keyboardFocusHandler:f1,identifierSerializer:wo},m1={bar:Pv,scatter:Vv,line:r1,pie:p1},g1=[Aa,Ra,Ma,bo,_a];function y1(e){const{children:t,plugins:n=g1,pluginParams:r={},seriesConfig:i=m1}=e,{contextValue:o}=by(n,r,i);return g.jsxRuntimeExports.jsx(ta.Provider,{value:o,children:t})}const ja=()=>{const e=O.useContext(ta);if(e==null)throw new Error(["MUI X Charts: Could not find the Chart context.","It looks like you rendered your component outside of a ChartDataProvider.","This can also happen if you are bundling multiple versions of the library."].join(`
|
|
104
104
|
`));return e};function Hn(){const e=ja();if(!e)throw new Error(["MUI X Charts: Could not find the charts context.","It looks like you rendered your component outside of a ChartContainer parent component."].join(`
|
|
105
105
|
`));return e.store}function ih(){return Hn().use(gt)}function oh(){return Hn().use(Hg)}function x1(){const e=Hn(),{axis:t,axisIds:n}=e.use(Ht);return{xAxis:t,xAxisIds:n}}function b1(){const e=Hn(),{axis:t,axisIds:n}=e.use(qt);return{yAxis:t,yAxisIds:n}}function v1(){const e=Hn(),{axis:t,axisIds:n}=e.use(Yb)??{axis:{},axisIds:[]};return{zAxis:t,zAxisIds:n}}function S1(){const e=ja();if(!e)throw new Error(["MUI X Charts: Could not find the svg ref context.","It looks like you rendered your component outside of a ChartContainer parent component."].join(`
|
|
106
|
-
`));return e.svgRef}function E1(){const e=oh();return O.useCallback(t=>`${e}-gradient-${t}`,[e])}function T1(){const e=oh();return O.useCallback(t=>`${e}-gradient-${t}-object-bound`,[e])}var rs,_u;function w1(){if(_u)return rs;_u=1;var e=4,t=.001,n=1e-7,r=10,i=11,o=1/(i-1),s=typeof Float32Array=="function";function a(p,y){return 1-3*y+3*p}function l(p,y){return 3*y-6*p}function u(p){return 3*p}function c(p,y,b){return((a(y,b)*p+l(y,b))*p+u(y))*p}function d(p,y,b){return 3*a(y,b)*p*p+2*l(y,b)*p+u(y)}function h(p,y,b,E,T){var w,C,S=0;do C=y+(b-y)/2,w=c(C,E,T)-p,w>0?b=C:y=C;while(Math.abs(w)>n&&++S<r);return C}function f(p,y,b,E){for(var T=0;T<e;++T){var w=d(y,b,E);if(w===0)return y;var C=c(y,b,E)-p;y-=C/w}return y}function m(p){return p}return rs=function(y,b,E,T){if(!(0<=y&&y<=1&&0<=E&&E<=1))throw new Error("bezier x values must be in [0, 1] range");if(y===b&&E===T)return m;for(var w=s?new Float32Array(i):new Array(i),C=0;C<i;++C)w[C]=c(C*o,y,E);function S(R){for(var I=0,k=1,z=i-1;k!==z&&w[k]<=R;++k)I+=o;--k;var P=(R-w[k])/(w[k+1]-w[k]),v=I+P*o,_=d(v,y,E);return _>=t?f(R,v,y,E):_===0?v:h(R,I,I+o,y,E)}return function(I){return I===0?0:I===1?1:c(S(I),b,T)}},rs}var C1=w1();const M1=sf(C1),R1=300,A1=M1(.66,0,.34,1);var Vn=0,rr=0,Qn=0,sh=1e3,ji,ir,ki=0,ln=0,wo=0,xr=typeof performance=="object"&&performance.now?performance:Date,ah=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ka(){return ln||(ah(_1),ln=xr.now()+wo)}function _1(){ln=0}function Oi(){this._call=this._time=this._next=null}Oi.prototype=lh.prototype={constructor:Oi,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ka():+n)+(t==null?0:+t),!this._next&&ir!==this&&(ir?ir._next=this:ji=this,ir=this),this._call=e,this._time=n,As()},stop:function(){this._call&&(this._call=null,this._time=1/0,As())}};function lh(e,t,n){var r=new Oi;return r.restart(e,t,n),r}function I1(){ka(),++Vn;for(var e=ji,t;e;)(t=ln-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Vn}function Iu(){ln=(ki=xr.now())+wo,Vn=rr=0;try{I1()}finally{Vn=0,k1(),ln=0}}function j1(){var e=xr.now(),t=e-ki;t>sh&&(wo-=t,ki=e)}function k1(){for(var e,t=ji,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ji=n);ir=e,As(r)}function As(e){if(!Vn){rr&&(rr=clearTimeout(rr));var t=e-ln;t>24?(e<1/0&&(rr=setTimeout(Iu,e-xr.now()-wo)),Qn&&(Qn=clearInterval(Qn))):(Qn||(ki=xr.now(),Qn=setInterval(j1,sh)),Vn=1,ah(Iu))}}function O1(e,t,n){var r=new Oi;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}class P1{constructor(t,n,r){W(this,"elapsed",0);W(this,"timer",null);this.duration=t,this.easingFn=n,this.onTickCallback=r,this.resume()}get running(){return this.timer!==null}timerCallback(t){this.elapsed=Math.min(t,this.duration);const n=this.duration===0?1:this.elapsed/this.duration,r=this.easingFn(n);this.onTickCallback(r),this.elapsed>=this.duration&&this.stop()}resume(){if(this.running||this.elapsed>=this.duration)return this;const t=ka()-this.elapsed;return this.timer=lh(n=>this.timerCallback(n),0,t),this}stop(){return this.running?(this.timer&&(this.timer.stop(),this.timer=null),this):this}finish(){return this.stop(),O1(()=>this.timerCallback(this.duration)),this}}function D1(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i+=1){const o=n[i];if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1}return!0}function $1(e,{createInterpolator:t,applyProps:n,skip:r,initialProps:i=e}){const o=O.useRef(i),s=O.useRef(null),a=O.useRef(null),l=O.useRef(e);ot(()=>{l.current=e},[e]),ot(()=>{var d;r&&((d=s.current)==null||d.finish(),s.current=null,a.current=null,o.current=e)},[e,r]);const u=O.useCallback(d=>{const h=o.current,f=t(h,e);s.current=new P1(R1,A1,m=>{const p=f(m);o.current=p,n(d,p)})},[n,t,e]);return[O.useCallback(d=>{var f,m,p,y;if(d===null){(f=s.current)==null||f.stop();return}const h=a.current;if(h===d){if(D1(l.current,e)){(m=s.current)==null||m.resume();return}(p=s.current)==null||p.stop()}h&&((y=s.current)==null||y.stop()),a.current=d,(s.current||!r)&&u(d)},[u,e,r]),o.current]}function N1(e,{createInterpolator:t,transformProps:n,applyProps:r,skip:i,initialProps:o=e,ref:s}){const a=n??(d=>d),[l,u]=$1(e,{initialProps:o,createInterpolator:t,applyProps:(d,h)=>r(d,a(h)),skip:i}),c=n(i?e:u);return L({},c,{ref:Qi(l,s)})}function ju(e){const{isReversed:t,gradientId:n,size:r,direction:i,scale:o,colorMap:s}=e;return r<=0?null:g.jsxRuntimeExports.jsx("linearGradient",{id:n,x1:"0",x2:"0",y1:"0",y2:"0",[`${i}${t?1:2}`]:`${r}px`,gradientUnits:"userSpaceOnUse",children:s.thresholds.map((a,l)=>{const u=o(a);if(u===void 0)return null;const c=t?1-u/r:u/r;return Number.isNaN(c)?null:g.jsxRuntimeExports.jsxs(O.Fragment,{children:[g.jsxRuntimeExports.jsx("stop",{offset:c,stopColor:s.colors[l],stopOpacity:1}),g.jsxRuntimeExports.jsx("stop",{offset:c,stopColor:s.colors[l+1],stopOpacity:1})]},a.toString()+l)})})}const L1=10;function ku(e){const{gradientUnits:t,isReversed:n,gradientId:r,size:i,direction:o,scale:s,colorScale:a,colorMap:l}=e,u=[l.min??0,l.max??100],c=u.map(s).filter(m=>m!==void 0);if(c.length!==2)return null;const d=typeof u[0]=="number"?nt(u[0],u[1]):aa(u[0],u[1]),h=Math.round((Math.max(...c)-Math.min(...c))/L1),f=`${u[0]}-${u[1]}-`;return g.jsxRuntimeExports.jsx("linearGradient",{id:r,x1:"0",x2:"0",y1:"0",y2:"0",[`${o}${n?1:2}`]:t==="objectBoundingBox"?1:`${i}px`,gradientUnits:t??"userSpaceOnUse",children:Array.from({length:h+1},(m,p)=>{const y=d(p/h);if(y===void 0)return null;const b=s(y);if(b===void 0)return null;const E=n?1-b/i:b/i,T=a(y);return T===null?null:g.jsxRuntimeExports.jsx("stop",{offset:E,stopColor:T,stopOpacity:1},f+p)})})}const z1=10,F1=e=>e?{x1:"1",x2:"0",y1:"0",y2:"0"}:{x1:"0",x2:"1",y1:"0",y2:"0"};function is(e){const{isReversed:t,gradientId:n,colorScale:r,colorMap:i}=e,o=[i.min??0,i.max??100],s=typeof o[0]=="number"?nt(o[0],o[1]):aa(o[0],o[1]),a=z1,l=`${o[0]}-${o[1]}-`;return g.jsxRuntimeExports.jsx("linearGradient",L({id:n},F1(t),{gradientUnits:"objectBoundingBox",children:Array.from({length:a+1},(u,c)=>{const d=c/a,h=s(d);if(h===void 0)return null;const f=r(h);return f===null?null:g.jsxRuntimeExports.jsx("stop",{offset:d,stopColor:f,stopOpacity:1},l+c)})}))}function B1(){const{top:e,height:t,bottom:n,left:r,width:i,right:o}=ih(),s=e+t+n,a=r+i+o,l=E1(),u=T1(),{xAxis:c,xAxisIds:d}=x1(),{yAxis:h,yAxisIds:f}=b1(),{zAxis:m,zAxisIds:p}=v1(),y=f.filter(T=>h[T].colorMap!==void 0),b=d.filter(T=>c[T].colorMap!==void 0),E=p.filter(T=>m[T].colorMap!==void 0);return y.length===0&&b.length===0&&E.length===0?null:g.jsxRuntimeExports.jsxs("defs",{children:[y.map(T=>{const w=l(T),C=u(T),{colorMap:S,scale:R,colorScale:I,reverse:k}=h[T];return(S==null?void 0:S.type)==="piecewise"?g.jsxRuntimeExports.jsx(ju,{isReversed:!k,scale:R,colorMap:S,size:s,gradientId:w,direction:"y"},w):(S==null?void 0:S.type)==="continuous"?g.jsxRuntimeExports.jsxs(O.Fragment,{children:[g.jsxRuntimeExports.jsx(ku,{isReversed:!k,scale:R,colorScale:I,colorMap:S,size:s,gradientId:w,direction:"y"}),g.jsxRuntimeExports.jsx(is,{isReversed:k,colorScale:I,colorMap:S,gradientId:C})]},w):null}),b.map(T=>{const w=l(T),C=u(T),{colorMap:S,scale:R,reverse:I,colorScale:k}=c[T];return(S==null?void 0:S.type)==="piecewise"?g.jsxRuntimeExports.jsx(ju,{isReversed:I,scale:R,colorMap:S,size:a,gradientId:w,direction:"x"},w):(S==null?void 0:S.type)==="continuous"?g.jsxRuntimeExports.jsxs(O.Fragment,{children:[g.jsxRuntimeExports.jsx(ku,{isReversed:I,scale:R,colorScale:k,colorMap:S,size:a,gradientId:w,direction:"x"}),g.jsxRuntimeExports.jsx(is,{isReversed:I,colorScale:k,colorMap:S,gradientId:C})]},w):null}),E.map(T=>{const w=u(T),{colorMap:C,colorScale:S}=m[T];return(C==null?void 0:C.type)==="continuous"?g.jsxRuntimeExports.jsx(is,{colorScale:S,colorMap:C,gradientId:w},w):null})]})}function G1(e){return hn("MuiChartsSurface",e)}const U1=()=>Sr({root:["root"]},G1);Ki("MuiChartsSurface",["root"]);const V1=["children","className","title","desc"],Y1=We("svg",{name:"MuiChartsSurface",slot:"Root"})(({ownerState:e})=>({width:e.width??"100%",height:e.height??"100%",display:"flex",position:"relative",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden",touchAction:"pan-y",userSelect:"none",gridArea:"chart","&:focus":{outline:"none"}})),Oa=O.forwardRef(function(t,n){const{store:r,instance:i}=ja(),o=r.use(zg),s=r.use(Fg),a=r.use(Bg),l=r.use(Gg),u=r.use(Ub),c=r.use(Gb),d=S1(),h=Qi(d,n),f=zm({props:t,name:"MuiChartsSurface"}),{children:m,className:p,title:y,desc:b}=f,E=pt(f,V1),T=U1(),w=s>0&&o>0;return g.jsxRuntimeExports.jsxs(Y1,L({ownerState:{width:a,height:l},viewBox:`0 0 ${o} ${s}`,className:Ne(T.root,p),tabIndex:u?0:void 0,"data-has-focused-item":c||void 0},E,{onPointerEnter:C=>{var S,R;(S=E.onPointerEnter)==null||S.call(E,C),(R=i.handlePointerEnter)==null||R.call(i,C)},onPointerLeave:C=>{var S,R;(S=E.onPointerLeave)==null||S.call(E,C),(R=i.handlePointerLeave)==null||R.call(i,C)},onClick:C=>{var S,R;(S=E.onClick)==null||S.call(E,C),(R=i.handleClick)==null||R.call(i,C)},ref:h,children:[y&&g.jsxRuntimeExports.jsx("title",{children:y}),b&&g.jsxRuntimeExports.jsx("desc",{children:b}),g.jsxRuntimeExports.jsx(B1,{}),w&&m]}))});process.env.NODE_ENV!=="production"&&(Oa.displayName="ChartsSurface");process.env.NODE_ENV!=="production"&&(Oa.propTypes={children:x.node,className:x.string,desc:x.string,sx:x.oneOfType([x.arrayOf(x.oneOfType([x.func,x.object,x.bool])),x.func,x.object]),title:x.string});function os(e){const t=nn(e);return[Math.sin(t),-Math.cos(t)]}function W1(e,t){const n=[[0,0],os(e),os(t)],r=Math.min(e,t),i=Math.max(e,t),o=Math.floor(r/90)*90;for(let c=1;c<=4;c+=1){const d=o+c*90;d<i&&n.push(os(d))}const s=Math.min(...n.map(([c])=>c)),a=Math.max(...n.map(([c])=>c)),l=Math.min(...n.map(([,c])=>c)),u=Math.max(...n.map(([,c])=>c));return{cx:-s/(a-s),cy:-l/(u-l),minX:s,maxX:a,minY:l,maxY:u}}function H1(e,t,n,r,{minX:i,maxX:o,minY:s,maxY:a}){return Math.min(...[{ratio:Math.abs(i),space:e},{ratio:Math.abs(o),space:n-e},{ratio:Math.abs(s),space:t},{ratio:Math.abs(a),space:r-t}].map(({ratio:l,space:u})=>l<1e-5?1/0:u/l))}const Pa=O.createContext({value:null,valueMin:0,valueMax:0,startAngle:0,endAngle:0,innerRadius:0,outerRadius:0,cornerRadius:0,cx:0,cy:0,maxRadius:0,valueAngle:null});process.env.NODE_ENV!=="production"&&(Pa.displayName="GaugeContext");function q1(e){const{value:t=null,valueMin:n=0,valueMax:r=100,startAngle:i=0,endAngle:o=360,outerRadius:s,innerRadius:a,cornerRadius:l,cx:u,cy:c,children:d}=e,{left:h,top:f,width:m,height:p}=ih(),y=W1(i,o),b=u?dt(u,m):y.cx*m,E=c?dt(c,p):y.cy*p;let T=h+b,w=f+E;const C=H1(b,E,m,p,y);if(u===void 0){const z=C*(y.maxX-y.minX);T=h+(m-z)/2+y.cx*z}if(c===void 0){const z=C*(y.maxY-y.minY);w=f+(p-z)/2+y.cy*z}const S=dt(s??C,C),R=dt(a??"80%",C),I=dt(l??0,S-R),k=O.useMemo(()=>{const z=nn(i),P=nn(o);return{value:t,valueMin:n,valueMax:r,startAngle:z,endAngle:P,outerRadius:S,innerRadius:R,cornerRadius:I,cx:T,cy:w,maxRadius:C,valueAngle:t===null?null:z+(P-z)*(t-n)/(r-n)}},[t,n,r,i,o,S,R,I,T,w,C]);return g.jsxRuntimeExports.jsx(Pa.Provider,{value:k,children:d})}function Da(){return O.useContext(Pa)}const K1=["width","height","margin","title","desc","value","valueMin","valueMax","startAngle","endAngle","outerRadius","innerRadius","cornerRadius","cx","cy","children"],J1=We("g",{slot:"internal",shouldForwardProp:void 0})(({theme:e})=>({"& text":{fill:(e.vars||e).palette.text.primary}})),$a=O.forwardRef(function(t,n){const{width:r,height:i,margin:o,title:s,desc:a,value:l,valueMin:u=0,valueMax:c=100,startAngle:d,endAngle:h,outerRadius:f,innerRadius:m,cornerRadius:p,cx:y,cy:b,children:E}=t,T=pt(t,K1);return g.jsxRuntimeExports.jsx(y1,{pluginParams:{width:r,height:i,margin:Vc(o,{left:10,right:10,top:10,bottom:10})},plugins:[],children:g.jsxRuntimeExports.jsx(q1,{value:l,valueMin:u,valueMax:c,startAngle:d,endAngle:h,outerRadius:f,innerRadius:m,cornerRadius:p,cx:y,cy:b,children:g.jsxRuntimeExports.jsx(Oa,L({title:s,desc:a,role:"meter","aria-valuenow":l===null?void 0:l,"aria-valuemin":u,"aria-valuemax":c},T,{ref:n,children:g.jsxRuntimeExports.jsx(J1,{"aria-hidden":"true",children:E})}))})})});process.env.NODE_ENV!=="production"&&($a.displayName="GaugeContainer");process.env.NODE_ENV!=="production"&&($a.propTypes={children:x.node,className:x.string,cornerRadius:x.oneOfType([x.number,x.string]),cx:x.oneOfType([x.number,x.string]),cy:x.oneOfType([x.number,x.string]),desc:x.string,endAngle:x.number,height:x.number,id:x.string,innerRadius:x.oneOfType([x.number,x.string]),margin:x.oneOfType([x.number,x.shape({bottom:x.number,left:x.number,right:x.number,top:x.number})]),outerRadius:x.oneOfType([x.number,x.string]),skipAnimation:x.bool,startAngle:x.number,sx:x.oneOfType([x.arrayOf(x.oneOfType([x.func,x.object,x.bool])),x.func,x.object]),title:x.string,value:x.number,valueMax:x.number,valueMin:x.number,width:x.number});function X1(e){const n=Hn().use(Mg);return e||n}function Z1(e,t){const n=nt(e.startAngle,t.startAngle),r=nt(e.endAngle,t.endAngle),i=nt(e.innerRadius,t.innerRadius),o=nt(e.outerRadius,t.outerRadius),s=nt(e.cornerRadius,t.cornerRadius);return a=>({startAngle:n(a),endAngle:r(a),innerRadius:i(a),outerRadius:o(a),cornerRadius:s(a)})}function Q1(e){return N1({startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,cornerRadius:e.cornerRadius},{createInterpolator:Z1,transformProps:t=>({d:Hd().cornerRadius(t.cornerRadius)({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle})}),applyProps(t,n){t.setAttribute("d",n.d)},initialProps:{startAngle:e.startAngle,endAngle:e.startAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,cornerRadius:e.cornerRadius},skip:e.skipAnimation,ref:e.ref})}function eS(e){return hn("MuiGauge",e)}const Na=Ki("MuiGauge",["root","valueArc","referenceArc","valueText"]),tS=["className"],nS=["cx","cy","startAngle","endAngle","cornerRadius","innerRadius","outerRadius","skipAnimation"],rS=We("path",{name:"MuiGauge",slot:"ValueArc"})(({theme:e})=>({fill:(e.vars||e).palette.primary.main}));function uh(e){let{className:t}=e,n=pt(e,tS);const{value:r,valueMin:i,valueMax:o,startAngle:s,endAngle:a,outerRadius:l,innerRadius:u,cornerRadius:c,cx:d,cy:h}=Da();if(r===null)return null;const f=s+(r-i)/(o-i)*(a-s);return g.jsxRuntimeExports.jsx(ch,L({},n,{className:Ne(Na.valueArc,t),cx:d,cy:h,startAngle:s,endAngle:f,cornerRadius:c,innerRadius:u,outerRadius:l}))}process.env.NODE_ENV!=="production"&&(uh.propTypes={skipAnimation:x.bool});function ch(e){let{cx:t,cy:n,startAngle:r,endAngle:i,cornerRadius:o,innerRadius:s,outerRadius:a,skipAnimation:l}=e,u=pt(e,nS);const c=X1(l),d=Q1({startAngle:r,endAngle:i,cornerRadius:o,innerRadius:s,outerRadius:a,skipAnimation:c});return g.jsxRuntimeExports.jsx(rS,L({},d,{transform:`translate(${t}, ${n})`},u))}process.env.NODE_ENV!=="production"&&(ch.propTypes={cornerRadius:x.number.isRequired,cx:x.number.isRequired,cy:x.number.isRequired,endAngle:x.number.isRequired,innerRadius:x.number.isRequired,outerRadius:x.number.isRequired,skipAnimation:x.bool,startAngle:x.number.isRequired});const iS=["className"],oS=We("path",{name:"MuiGauge",slot:"ReferenceArc"})(({theme:e})=>({fill:(e.vars||e).palette.divider}));function sS(e){let{className:t}=e,n=pt(e,iS);const{startAngle:r,endAngle:i,outerRadius:o,innerRadius:s,cornerRadius:a,cx:l,cy:u}=Da();return g.jsxRuntimeExports.jsx(oS,L({className:Ne(Na.referenceArc,t),transform:`translate(${l}, ${u})`,d:Hd().cornerRadius(a)({startAngle:r,endAngle:i,innerRadius:s,outerRadius:o})},n))}function aS(){return typeof window>"u"}const ei=new Map,lS=2e3,uS=new Set(["minWidth","maxWidth","width","minHeight","maxHeight","height","top","left","fontSize","padding","margin","paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom"]);function dh(e,t){return uS.has(e)&&t===+t?`${t}px`:t}const cS=/([A-Z])/g;function hh(e){return String(e).replace(cS,t=>`-${t.toLowerCase()}`)}function dS(e){let t="";for(const n in e)if(Object.hasOwn(e,n)){const r=n,i=e[r];if(i===void 0)continue;t+=`${hh(r)}:${dh(r,i)};`}return t}const hS=(e,t={})=>{if(e==null||aS())return{width:0,height:0};const n=String(e),r=dS(t),i=`${n}-${r}`,o=ei.get(i);if(o)return o;try{const s=pS(),a=document.createElementNS("http://www.w3.org/2000/svg","text");Object.keys(t).map(u=>(a.style[hh(u)]=dh(u,t[u]),u)),a.textContent=n,s.replaceChildren(a);const l=fS(a);return ei.set(i,l),ei.size+1>lS&&ei.clear(),process.env.NODE_ENV==="test"&&s.replaceChildren(),l}catch{return{width:0,height:0}}};function fS(e){try{const t=e.getBBox();return{width:t.width,height:t.height}}catch{const t=e.getBoundingClientRect();return{width:t.width,height:t.height}}}let Fe=null;function pS(){return Fe===null&&(Fe=document.createElementNS("http://www.w3.org/2000/svg","svg"),Fe.setAttribute("aria-hidden","true"),Fe.style.position="absolute",Fe.style.top="-20000px",Fe.style.left="0",Fe.style.padding="0",Fe.style.margin="0",Fe.style.border="none",Fe.style.pointerEvents="none",Fe.style.visibility="hidden",Fe.style.contain="strict",document.body.appendChild(Fe)),Fe}function mS({style:e,needsComputation:t,text:n}){return n.split(`
|
|
107
|
-
`).map(r=>L({text:r},t?hS(r,e):{width:0,height:0}))}function gS(){const[e,t]=O.useState(!1);return O.useEffect(()=>{t(!0)},[]),e}const yS=["x","y","style","text","ownerState"],xS=["angle","textAnchor","dominantBaseline"];function fh(e){const{x:t,y:n,style:r,text:i}=e,o=pt(e,yS),s=r??{},{angle:a,textAnchor:l,dominantBaseline:
|
|
108
|
-
`),text:i}),[c,i,d]);let f;switch(u){case"hanging":case"text-before-edge":f=0;break;case"central":f=(h.length-1)/2*-h[0].height;break;default:f=(h.length-1)*-h[0].height;break}return g.jsxRuntimeExports.jsx("text",L({},o,{transform:a?`rotate(${a}, ${t}, ${n})`:void 0,x:t,y:n,textAnchor:l,dominantBaseline:u,style:c,children:h.map((m,p)=>g.jsxRuntimeExports.jsx("tspan",{x:t,dy:`${p===0?f:h[0].height}px`,dominantBaseline:u,children:m.text},p))}))}process.env.NODE_ENV!=="production"&&(fh.propTypes={lineHeight:x.number,needsComputation:x.bool,ownerState:x.any,style:x.object,text:x.string.isRequired});const bS=["text","className"];function vS({value:e}){return e===null?null:e.toLocaleString()}function ph(e){const{text:t=vS,className:n}=e,r=pt(e,bS),{value:i,valueMin:o,valueMax:s,cx:a,cy:l}=Da(),u=typeof t=="function"?t({value:i,valueMin:o,valueMax:s}):t;return u===null?null:g.jsxRuntimeExports.jsx("g",{className:Ne(Na.valueText,n),children:g.jsxRuntimeExports.jsx(fh,L({x:a,y:l,text:u,style:{textAnchor:"middle",dominantBaseline:"central"}},r))})}process.env.NODE_ENV!=="production"&&(ph.propTypes={lineHeight:x.number,needsComputation:x.bool,ownerState:x.any,style:x.object,text:x.oneOfType([x.func,x.string])});const SS=["text","children","classes","className","skipAnimation"],ES=e=>{const{classes:t}=e;return Sr({root:["root"]},eS,t)},La=O.forwardRef(function(t,n){const{text:r,children:i,className:o,skipAnimation:s}=t,a=pt(t,SS),l=ES(t);return g.jsxRuntimeExports.jsxs($a,L({},a,{className:Ne(l.root,o),ref:n,children:[g.jsxRuntimeExports.jsx(sS,{}),g.jsxRuntimeExports.jsx(uh,{skipAnimation:s}),g.jsxRuntimeExports.jsx(ph,{text:r}),i]}))});process.env.NODE_ENV!=="production"&&(La.displayName="Gauge");process.env.NODE_ENV!=="production"&&(La.propTypes={children:x.node,classes:x.object,className:x.string,cornerRadius:x.oneOfType([x.number,x.string]),cx:x.oneOfType([x.number,x.string]),cy:x.oneOfType([x.number,x.string]),desc:x.string,endAngle:x.number,height:x.number,id:x.string,innerRadius:x.oneOfType([x.number,x.string]),margin:x.oneOfType([x.number,x.shape({bottom:x.number,left:x.number,right:x.number,top:x.number})]),outerRadius:x.oneOfType([x.number,x.string]),skipAnimation:x.bool,startAngle:x.number,sx:x.oneOfType([x.arrayOf(x.oneOfType([x.func,x.object,x.bool])),x.func,x.object]),text:x.oneOfType([x.func,x.string]),title:x.string,value:x.number,valueMax:x.number,valueMin:x.number,width:x.number});const TS=e=>{const t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60),i=e%60,o=[];return t>0?(o.push(t.toString()),o.push(n.toString().padStart(2,"0")),o.push(r.toString().padStart(2,"0")),o.push(i.toString().padStart(2,"0"))):n>0?(o.push(n.toString()),o.push(r.toString().padStart(2,"0")),o.push(i.toString().padStart(2,"0"))):(o.push(r.toString()),o.push(i.toString().padStart(2,"0"))),o.join(":")},ut=(e,t)=>{const n=Math.floor(e/86400),r=Math.floor(e%86400/3600),i=Math.floor(e%3600/60),o=e%60;if(typeof Intl<"u"&&"DurationFormat"in Intl)try{const a={};return n>0&&(a.days=n),r>0&&(a.hours=r),i>0&&(a.minutes=i),(o>0||Object.keys(a).length===0)&&(a.seconds=o),new Intl.DurationFormat(t,{style:"narrow"}).format(a)}catch{}const s=[];return n>0&&s.push(`${n}d`),r>0&&s.push(`${r}h`),i>0&&s.push(`${i}m`),(o>0||s.length===0)&&s.push(`${o}s`),s.join(" ")},wS=(e,t,n)=>e==="countdown"&&n!==null?Math.min(100,t/n*100):e==="measuring"?t/60%1*100:0,CS=({timerState:e,animationState:t,hasError:n,className:r})=>{const{t:i,i18n:o}=de.useTranslation(),s=M.useTheme(),{currentState:a,remainingTime:l,maxTime:u,currentProgress:c}=e,{showErrorAnimation:d,showPauseAnimation:h,showPulsatingText:f,pulsatingFinished:m,showLabels:p,showMainText:y,showIdlePulsating:b,idleDotsCount:E}=t;return g.jsxRuntimeExports.jsxs(M.Box,{className:r,sx:{position:"relative",width:264,height:264,display:"flex",alignItems:"center",justifyContent:"center"},children:[g.jsxRuntimeExports.jsx(La,{width:264,height:264,value:a==="idle"?0:c,valueMin:0,valueMax:100,innerRadius:"85%",outerRadius:"100%",margin:0,skipAnimation:!0,text:()=>"",sx:{opacity:h||d?.6:1,transition:"opacity 0.5s ease-out","& .MuiGauge-valueArc":{fill:n?s.palette.error.light:s.palette.success.main,transition:"fill 0.5s ease-out"},"& .MuiGauge-referenceArc":{fill:"#171927",stroke:"transparent",strokeWidth:0,transition:"fill 0.5s ease-out, stroke 0.5s ease-out, stroke-width 0.5s ease-out"},"& .MuiGauge-valueText":{display:"none"},"& .MuiGauge-text":{display:"none"}}}),g.jsxRuntimeExports.jsxs(M.Box,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:225,height:225,borderRadius:"50%",backgroundColor:"#292B3F",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",gap:1,transition:"background-color 0.5s ease-out"},children:[g.jsxRuntimeExports.jsx(M.Box,{sx:{height:"16px",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:1},children:g.jsxRuntimeExports.jsx(M.Fade,{in:p&&!n&&a!=="idle"&&a!=="success",timeout:300,children:g.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{fontSize:"12px",color:a==="measured"&&(f||m)?s.palette.success.main:s.palette.text.secondary,transition:"color 0.8s ease-in-out"},children:g.jsxRuntimeExports.jsx("span",{style:{opacity:a==="measured"&&m?f?1:.6:1,transition:"opacity 2s ease-in-out"},children:a==="measuring"||a==="measured"?i("CycleTimer.CycleTime.lb","Cycle Time"):a==="countdown"?i("CycleTimer.RemainingTime.lb","Remaining Time"):""})})})}),g.jsxRuntimeExports.jsxs(M.Box,{sx:{position:"relative",height:"48px",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:.5},children:[g.jsxRuntimeExports.jsx(M.Fade,{in:y&&a==="idle"&&!n,timeout:200,children:g.jsxRuntimeExports.jsxs(M.Typography,{variant:"body2",sx:{position:"absolute",fontSize:"12px",fontWeight:400,color:"rgba(255, 255, 255, 0.7)",lineHeight:"166%",letterSpacing:"0.17px",textAlign:"center",width:"200px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center"},children:[g.jsxRuntimeExports.jsx("span",{style:{opacity:b?1:.6,transition:"opacity 2s ease-in-out"},children:i("CycleTimer.WaitingForCycle.lb","Waiting for program cycle")}),g.jsxRuntimeExports.jsx("span",{style:{display:"inline-block",width:"18px",textAlign:"left",opacity:b?1:.6,transition:"opacity 2s ease-in-out"},children:".".repeat(E)})]})}),g.jsxRuntimeExports.jsx(M.Fade,{in:y&&n,timeout:200,children:g.jsxRuntimeExports.jsx(M.Typography,{variant:"h3",sx:{position:"absolute",fontSize:"40px",fontWeight:400,color:"#FFFFFF",lineHeight:"116.7%"},children:i("CycleTimer.Error.lb","Error")})}),g.jsxRuntimeExports.jsx(M.Fade,{in:y&&!n&&a!=="idle"&&a!=="success",timeout:300,children:g.jsxRuntimeExports.jsx(M.Typography,{variant:"h1",sx:{position:"absolute",fontSize:"48px",fontWeight:500,color:s.palette.text.primary,lineHeight:1,transition:"color 0.8s ease-in-out"},children:g.jsxRuntimeExports.jsx("span",{style:{opacity:1,transition:"opacity 2s ease-in-out"},children:TS(l)})})})]}),g.jsxRuntimeExports.jsx(M.Box,{sx:{height:"16px",display:"flex",marginTop:.5,alignItems:"center",justifyContent:"center"},children:g.jsxRuntimeExports.jsx(M.Fade,{in:p&&!n&&a!=="idle"&&a!=="success",timeout:300,children:g.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{fontSize:"12px",color:a==="measured"&&(f||m)?s.palette.success.main:s.palette.text.secondary,transition:"color 0.8s ease-in-out"},children:g.jsxRuntimeExports.jsx("span",{style:{opacity:a==="measured"&&m?f?1:.6:1,transition:"opacity 2s ease-in-out"},children:a==="measuring"?i("CycleTimer.Measuring.lb","measuring..."):a==="measured"?i("CycleTimer.Determined.lb","determined"):a==="countdown"&&u!==null?i("CycleTimer.OfTime.lb",{time:ut(u,o.language)}):""})})})})]})]})},MS=({timerState:e,animationState:t,hasError:n,compact:r,className:i})=>{const{t:o,i18n:s}=de.useTranslation(),a=M.useTheme(),{currentState:l,remainingTime:u,maxTime:c}=e,{showErrorAnimation:d,showPauseAnimation:h,showPulsatingText:f,pulsatingFinished:m,showIdlePulsating:p,idleDotsCount:y}=t;return r&&l==="idle"?g.jsxRuntimeExports.jsx(M.Box,{className:i,sx:{display:"flex",alignItems:"center",m:0},children:g.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{color:n?a.palette.error.light:a.palette.text.primary,fontSize:"14px",transition:"color 0.5s ease-out"},children:n?o("CycleTimer.Error.lb","Error"):l==="idle"?"0s":ut(u,s.language)})}):g.jsxRuntimeExports.jsxs(M.Box,{className:i,sx:{display:"flex",alignItems:"center",m:0,gap:1},children:[!(l==="idle"&&r)&&g.jsxRuntimeExports.jsx(M.Box,{sx:{width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",opacity:h||d?.6:1,transition:"opacity 0.5s ease-out"},children:g.jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",style:{transform:"rotate(-90deg)"},role:"img","aria-label":"Timer progress",children:[g.jsxRuntimeExports.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?a.palette.error.light:l==="measured"?f||m?a.palette.success.main:a.palette.text.secondary:a.palette.success.main,strokeWidth:"2",opacity:l==="measured"&&m?f?1:.6:.3,style:{transition:"stroke 0.8s ease-in-out, opacity 2s ease-in-out"}}),g.jsxRuntimeExports.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?a.palette.error.light:l==="measured"?f||m?a.palette.success.main:a.palette.text.secondary:a.palette.success.main,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:`${2*Math.PI*8}`,strokeDashoffset:`${2*Math.PI*8*(1-(l==="idle"?0:e.currentProgress)/100)}`,style:{opacity:l==="measured"&&m?f?1:.6:1,transition:"stroke-dashoffset 0.1s ease-out, stroke 0.8s ease-in-out, opacity 2s ease-in-out"}})]})}),g.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{color:n?a.palette.error.light:l==="idle"?"rgba(255, 255, 255, 0.7)":l==="measured"?f||m?a.palette.success.main:a.palette.text.secondary:a.palette.text.primary,fontSize:"14px",lineHeight:"normal",letterSpacing:"normal",opacity:l==="idle"?p?1:.6:l==="measured"&&m?f?1:.6:1,transition:"color 0.8s ease-in-out, font-size 0.3s ease-out, opacity 2s ease-in-out"},children:n?o("CycleTimer.Error.lb","Error"):l==="idle"?g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[g.jsxRuntimeExports.jsx("span",{children:o("CycleTimer.WaitingForCycle.lb","Waiting for program cycle")}),g.jsxRuntimeExports.jsx("span",{style:{display:"inline-block",width:"18px",textAlign:"left"},children:".".repeat(y)})]}):l==="measuring"?r?ut(u,s.language):`${ut(u,s.language)} / ${o("CycleTimer.Measuring.lb","measuring...")}`:l==="measured"?r?ut(u,s.language):`${ut(u,s.language)} / ${o("CycleTimer.Determined.lb","determined")}`:l==="countdown"&&c!==null?r?ut(u,s.language):`${ut(u,s.language)} / ${o("CycleTimer.Time.lb",{time:ut(c,s.language)})}`:ut(u,s.language)})]})},RS=()=>{const[e,t]=D.useState({showPauseAnimation:!1,showErrorAnimation:!1,showPulsatingText:!1,pulsatingFinished:!1,showLabels:!0,showMainText:!0,showIdlePulsating:!1,idleDotsCount:0}),n=D.useRef(null),r=D.useRef(null),i=D.useRef(null),o=D.useRef(null),s=D.useRef(0),a=D.useRef(null),l=D.useRef(null),u=D.useCallback(()=>{t(T=>({...T,showPauseAnimation:!0})),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{t(T=>({...T,showPauseAnimation:!1}))},800)},[]),c=D.useCallback(()=>{t(T=>({...T,showErrorAnimation:!0})),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{t(T=>({...T,showErrorAnimation:!1}))},600)},[]),d=D.useCallback(()=>{t(T=>({...T,showErrorAnimation:!1})),r.current&&clearTimeout(r.current)},[]),h=D.useCallback(T=>{s.current=0,t(w=>({...w,showPulsatingText:!0,pulsatingFinished:!1})),setTimeout(()=>{t(w=>({...w,pulsatingFinished:!0})),i.current=setInterval(()=>{t(w=>({...w,showPulsatingText:!w.showPulsatingText}))},2e3),T&&T()},800)},[]),f=D.useCallback(()=>{i.current&&(clearInterval(i.current),i.current=null),t(T=>({...T,showPulsatingText:!1,pulsatingFinished:!1})),s.current=0},[]),m=D.useCallback(()=>{t(T=>({...T,showIdlePulsating:!0})),a.current=setInterval(()=>{t(T=>({...T,showIdlePulsating:!T.showIdlePulsating}))},2e3),l.current=setInterval(()=>{t(T=>({...T,idleDotsCount:(T.idleDotsCount+1)%4}))},800)},[]),p=D.useCallback(()=>{a.current&&(clearInterval(a.current),a.current=null),l.current&&(clearInterval(l.current),l.current=null),t(T=>({...T,showIdlePulsating:!1,idleDotsCount:0}))},[]),y=D.useCallback(()=>{t(T=>({...T,showLabels:!1,showMainText:!1})),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{t(T=>({...T,showLabels:!0,showMainText:!0}))},200)},[]),b=D.useCallback(()=>{t(T=>({...T,showLabels:!0,showMainText:!0}))},[]),E=D.useCallback(()=>{n.current&&clearTimeout(n.current),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current),i.current&&clearInterval(i.current),a.current&&clearInterval(a.current),l.current&&clearInterval(l.current)},[]);return{animationState:e,triggerPauseAnimation:u,triggerErrorAnimation:c,clearErrorAnimation:d,startPulsatingAnimation:h,stopPulsatingAnimation:f,startIdleAnimations:m,stopIdleAnimations:p,triggerFadeTransition:y,setInitialAnimationState:b,cleanup:E}},AS=({autoStart:e,onCycleEnd:t,onMeasuringComplete:n,hasError:r,onPauseAnimation:i,onErrorAnimation:o,onClearErrorAnimation:s,onStartPulsating:a})=>{const[l,u]=D.useState({currentState:"idle",remainingTime:0,maxTime:null,isRunning:!1,isPausedState:!1,currentProgress:0,wasRunningBeforeError:!1}),c=D.useRef(null),d=D.useRef(null),h=D.useRef(0),[f]=g.useInterpolation([0],{tension:80,friction:18,onChange:([C])=>{u(S=>({...S,currentProgress:C}))}}),m=D.useCallback(()=>{u(C=>({...C,currentState:"idle",maxTime:null,isRunning:!1,isPausedState:!1,currentProgress:0})),h.current=0,d.current=null,f.setImmediate([0])},[f]),p=D.useCallback((C=0)=>{const S=C/60%1*100;u(R=>({...R,currentState:"measuring",maxTime:null,remainingTime:C,isPausedState:!1,currentProgress:S})),h.current=0,f.setImmediate([S]),e?(d.current=Date.now()-C*1e3,u(R=>({...R,isRunning:!0}))):d.current=null},[e,f]),y=D.useCallback((C,S=0)=>{u(k=>({...k,isRunning:!1})),d.current=null,u(k=>({...k,currentState:"countdown",maxTime:C,isPausedState:!1})),h.current=0;const R=Math.max(0,C-S),I=S>0?S/C*100:0;u(k=>({...k,remainingTime:R,currentProgress:I})),f.setImmediate([I]),R===0?(u(k=>({...k,isRunning:!1})),d.current=null,t&&queueMicrotask(()=>t())):e?setTimeout(()=>{d.current=Date.now()-S*1e3,u(k=>({...k,isRunning:!0}))},0):d.current=null},[e,t,f]),b=D.useCallback(()=>{u(C=>({...C,isRunning:!1,currentState:"measured"})),d.current=null,a(()=>{n&&n()})},[a,n]),E=D.useCallback(()=>{if(d.current&&l.isRunning){const S=Date.now()-d.current;h.current+=S;const R=h.current/1e3,I=wS(l.currentState,R,l.maxTime);f.setTarget([I])}u(C=>({...C,isRunning:!1,isPausedState:!0})),i()},[l.isRunning,l.currentState,l.maxTime,f,i]),T=D.useCallback(()=>{l.isPausedState&&(l.remainingTime>0||l.currentState!=="countdown")&&(d.current=Date.now(),u(C=>({...C,isRunning:!0,isPausedState:!1})))},[l.isPausedState,l.remainingTime,l.currentState]),w=D.useCallback(()=>l.isPausedState,[l.isPausedState]);return D.useEffect(()=>{r?(l.isRunning&&!l.isPausedState&&(u(C=>({...C,wasRunningBeforeError:!0})),E()),o()):(l.wasRunningBeforeError&&l.isPausedState&&(u(C=>({...C,wasRunningBeforeError:!1})),T()),s())},[r,l.isRunning,l.isPausedState,l.wasRunningBeforeError,E,T,o,s]),D.useEffect(()=>{if(l.isRunning){const C=()=>{if(d.current){const R=(Date.now()-d.current+h.current)/1e3;if(l.currentState==="countdown"&&l.maxTime!==null){const I=Math.max(0,l.maxTime-R);u(z=>({...z,remainingTime:Math.ceil(I)}));const k=Math.min(100,R/l.maxTime*100);if(f.setTarget([k]),I<=0){u(z=>({...z,isRunning:!1,remainingTime:0})),d.current=null,f.setTarget([100]),t&&queueMicrotask(()=>t());return}}else if(l.currentState==="measuring"){u(k=>({...k,remainingTime:Math.floor(R)}));const I=R/60%1*100;f.setTarget([I])}l.isRunning&&(c.current=requestAnimationFrame(C))}};c.current=requestAnimationFrame(C)}else c.current&&(cancelAnimationFrame(c.current),c.current=null);return()=>{c.current&&cancelAnimationFrame(c.current)}},[l.isRunning,t,l.currentState,l.maxTime,f]),D.useEffect(()=>{let C=null;const S=()=>{f.update(1/60),C=requestAnimationFrame(S)};return C=requestAnimationFrame(S),()=>{C&&cancelAnimationFrame(C)}},[f]),{timerState:l,controls:{startNewCycle:y,startMeasuring:p,setIdle:m,completeMeasuring:b,pause:E,resume:T,isPaused:w}}},_S=g.externalizeComponent(ie.observer(({onCycleComplete:e,onCycleEnd:t,onMeasuringComplete:n,autoStart:r=!0,variant:i="default",compact:o=!1,className:s,hasError:a=!1})=>{const l=D.useRef(void 0),{animationState:u,triggerPauseAnimation:c,triggerErrorAnimation:d,clearErrorAnimation:h,startPulsatingAnimation:f,stopPulsatingAnimation:m,startIdleAnimations:p,stopIdleAnimations:y,triggerFadeTransition:b,setInitialAnimationState:E,cleanup:T}=RS(),{timerState:w,controls:C}=AS({autoStart:r,onCycleEnd:t,onMeasuringComplete:n,hasError:a,onPauseAnimation:c,onErrorAnimation:d,onClearErrorAnimation:h,onStartPulsating:f});return D.useEffect(()=>{const S=l.current;l.current!==void 0&&S!==w.currentState?(S==="measured"&&m(),S==="idle"&&y(),b()):E(),w.currentState==="idle"&&p(),l.current=w.currentState},[w.currentState,m,y,p,b,E]),D.useEffect(()=>{let S=!0;const R=setTimeout(()=>{S&&e(C)},0);return()=>{S=!1,clearTimeout(R)}},[e,C]),D.useEffect(()=>T,[T]),i==="small"?g.jsxRuntimeExports.jsx(MS,{timerState:w,animationState:u,hasError:a,compact:o,className:s}):g.jsxRuntimeExports.jsx(CS,{timerState:w,animationState:u,hasError:a,className:s})})),gn=Wp;process.env.NODE_ENV!=="production"&&(x.node,x.object.isRequired);function za(e){return Gp(e)}function IS(e){return hn("MuiSvgIcon",e)}Ki("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const jS=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${$e(t)}`,`fontSize${$e(n)}`]};return Sr(i,IS,r)},kS=We("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${$e(n.color)}`],t[`fontSize${$e(n.fontSize)}`]]}})(gn(({theme:e})=>{var t,n,r,i,o,s,a,l,u,c,d,h,f,m;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(i=(t=e.transitions)==null?void 0:t.create)==null?void 0:i.call(t,"fill",{duration:(r=(n=(e.vars??e).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:p=>!p.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(o=e.typography)==null?void 0:o.pxToRem)==null?void 0:s.call(o,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((l=(a=e.typography)==null?void 0:a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((c=(u=e.typography)==null?void 0:u.pxToRem)==null?void 0:c.call(u,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,p])=>p&&p.main).map(([p])=>{var y,b;return{props:{color:p},style:{color:(b=(y=(e.vars??e).palette)==null?void 0:y[p])==null?void 0:b.main}}}),{props:{color:"action"},style:{color:(h=(d=(e.vars??e).palette)==null?void 0:d.action)==null?void 0:h.active}},{props:{color:"disabled"},style:{color:(m=(f=(e.vars??e).palette)==null?void 0:f.action)==null?void 0:m.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),Pi=O.forwardRef(function(t,n){const r=za({props:t,name:"MuiSvgIcon"}),{children:i,className:o,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:u,inheritViewBox:c=!1,titleAccess:d,viewBox:h="0 0 24 24",...f}=r,m=O.isValidElement(i)&&i.type==="svg",p={...r,color:s,component:a,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:c,viewBox:h,hasSvgAsChild:m},y={};c||(y.viewBox=h);const b=jS(p);return g.jsxRuntimeExports.jsxs(kS,{as:a,className:Ne(b.root,o),focusable:"false",color:u,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:n,...y,...f,...m&&i.props,ownerState:p,children:[m?i.props.children:i,d?g.jsxRuntimeExports.jsx("title",{children:d}):null]})});process.env.NODE_ENV!=="production"&&(Pi.propTypes={children:x.node,classes:x.object,className:x.string,color:x.oneOfType([x.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),x.string]),component:x.elementType,fontSize:x.oneOfType([x.oneOf(["inherit","large","medium","small"]),x.string]),htmlColor:x.string,inheritViewBox:x.bool,shapeRendering:x.string,sx:x.oneOfType([x.arrayOf(x.oneOfType([x.func,x.object,x.bool])),x.func,x.object]),titleAccess:x.string,viewBox:x.string});Pi.muiName="SvgIcon";function Kt(e,t){function n(r,i){return g.jsxRuntimeExports.jsx(Pi,{"data-testid":process.env.NODE_ENV!=="production"?`${t}Icon`:void 0,ref:i,...r,children:e})}return process.env.NODE_ENV!=="production"&&(n.displayName=`${t}Icon`),n.muiName=Pi.muiName,O.memo(O.forwardRef(n))}function OS(e){const{controlled:t,default:n,name:r,state:i="value"}=e,{current:o}=O.useRef(t!==void 0),[s,a]=O.useState(n),l=o?t:s;if(process.env.NODE_ENV!=="production"){O.useEffect(()=>{o!==(t!==void 0)&&console.error([`MUI: A component is changing the ${o?"":"un"}controlled ${i} state of ${r} to be ${o?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${r} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
|
|
109
|
-
`))},[i,r,t]);const{current:
|
|
110
|
-
`))},[JSON.stringify(n)])}const u=O.useCallback(c=>{o||a(c)},[]);return[l,u]}const PS=Kt(g.jsxRuntimeExports.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"}),"Clear"),DS=Kt(g.jsxRuntimeExports.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList"),Ou=Kt(g.jsxRuntimeExports.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"),mh=g.externalizeComponent(ie.observer(({data:e,columns:t,getRowData:n,onRowClick:r,selectedItem:i,getItemId:o,title:s,showCount:a=!0,searchPlaceholder:l="Search programs",dataGridProps:u,CustomToolbar:c,selectFirstByDefault:d=!1,sx:h})=>{var I;const f=M.useTheme(),m=et.useGridApiRef(),p=D.useRef(null),[y,b]=D.useState(null),E=D.useMemo(()=>e.map(n),[e,n]);D.useEffect(()=>{m.current&&E.length>0&&m.current.autosizeColumns({includeOutliers:!0,includeHeaders:!0,expand:!0,columns:t.map(k=>k.field)})},[E,t,m]),D.useEffect(()=>{if(!p.current||!m.current)return;const k=new ResizeObserver(()=>{setTimeout(()=>{m.current&&E.length>0&&m.current.autosizeColumns({includeOutliers:!0,includeHeaders:!0,expand:!0,columns:t.map(z=>z.field)})},100)});return k.observe(p.current),()=>{k.disconnect()}},[m,E.length,t]);const T=D.useMemo(()=>{if(i!==void 0)return i;if(y!==null)return y;if(d&&e.length>0){const k=e[0];return b(k),k}return null},[d,e,i,y]),w=k=>{const z=e.find(P=>n(P).id===k.id);z&&(i===void 0&&b(z),r&&r(z,k))},C=D.useMemo(()=>!T||!o?null:o(T),[T,o]);function S(){return g.jsxRuntimeExports.jsx(et.Toolbar,{children:g.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",width:"100%",gap:1,p:.5,alignItems:"center"},children:[s&&g.jsxRuntimeExports.jsxs(M.Typography,{variant:"h6",sx:{fontWeight:500,color:"white"},children:[s,a&&` (${e.length})`]}),g.jsxRuntimeExports.jsxs(M.Box,{sx:{ml:"auto",display:"flex",gap:.5,alignItems:"center",pr:1},children:[g.jsxRuntimeExports.jsx(et.FilterPanelTrigger,{render:g.jsxRuntimeExports.jsx(et.ToolbarButton,{"aria-label":"Show filters",children:g.jsxRuntimeExports.jsx(DS,{fontSize:"small"})})}),g.jsxRuntimeExports.jsx(M.Divider,{orientation:"vertical",flexItem:!0,sx:{height:"24px",alignSelf:"center"}}),g.jsxRuntimeExports.jsx(et.QuickFilter,{render:(k,z)=>g.jsxRuntimeExports.jsxs(M.Box,{...k,sx:{display:"flex",overflow:"hidden"},children:[!z.expanded&&g.jsxRuntimeExports.jsx(et.QuickFilterTrigger,{render:g.jsxRuntimeExports.jsx(et.ToolbarButton,{"aria-label":"Search",children:g.jsxRuntimeExports.jsx(Ou,{fontSize:"small"})})}),g.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",overflow:"hidden",transition:"all 0.3s ease-in-out",width:z.expanded?"200px":"0px",position:"relative"},children:[g.jsxRuntimeExports.jsxs(M.Box,{sx:{flex:1,position:"relative","& .MuiInputBase-root":{height:"32px",borderRadius:"16px",backgroundColor:"#171927",paddingLeft:"40px",paddingRight:z.expanded&&z.value!==""?"40px":"12px",color:"white",fontSize:"14px",border:"none !important",outline:"none !important",boxShadow:"none !important","&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"},"&:hover":{"&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"}},"&:focus-within":{outline:"none !important",boxShadow:"none !important","&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"}},"&.Mui-focused":{outline:"none !important",boxShadow:"none !important","&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"}},"& .MuiInputBase-input":{padding:"8px 0",border:"none !important",outline:"none !important",boxShadow:"none !important","&:focus":{outline:"none !important",boxShadow:"none !important",border:"none !important"},"&::placeholder":{color:"rgba(255, 255, 255, 0.3)",opacity:1}},"& fieldset":{border:"none !important",display:"none !important"},"& .MuiOutlinedInput-notchedOutline":{border:"none !important",display:"none !important"}}},children:[z.expanded&&g.jsxRuntimeExports.jsx(Ou,{fontSize:"small",sx:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:"rgba(255, 255, 255, 0.6)",zIndex:1,pointerEvents:"none"}}),g.jsxRuntimeExports.jsx(et.QuickFilterControl,{placeholder:l})]}),z.expanded&&z.value!==""&&g.jsxRuntimeExports.jsx(et.QuickFilterClear,{render:g.jsxRuntimeExports.jsx(M.Box,{sx:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)",zIndex:1},children:g.jsxRuntimeExports.jsx(M.Box,{sx:{minWidth:"24px",width:"24px",height:"24px",padding:0,color:"rgba(255, 255, 255, 0.6)","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.1)"}},children:g.jsxRuntimeExports.jsx(et.ToolbarButton,{"aria-label":"Clear",children:g.jsxRuntimeExports.jsx(PS,{fontSize:"small"})})})})})]})]})})]})]})})}const R=c||S;return g.jsxRuntimeExports.jsx(M.Box,{ref:p,sx:{height:"100%",display:"flex",flexDirection:"column","& *":{scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none"}},"&:hover *":{scrollbarWidth:"thin",scrollbarColor:`${f.palette.divider} transparent`,"&::-webkit-scrollbar":{display:"block",width:"8px",height:"8px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:f.palette.divider,borderRadius:"4px"},"&::-webkit-scrollbar-thumb:hover":{background:f.palette.action.hover}},...h},children:g.jsxRuntimeExports.jsx(et.DataGrid,{apiRef:m,rows:E,columns:t,onRowClick:w,disableColumnMenu:!1,disableRowSelectionOnClick:!0,disableMultipleRowSelection:!0,hideFooterSelectedRowCount:!0,filterMode:"client",sortingOrder:["desc","asc"],hideFooter:!1,showToolbar:!0,slots:{toolbar:R},initialState:{sorting:{sortModel:[]},filter:{filterModel:{items:[]}},...u==null?void 0:u.initialState},...u,autosizeOnMount:!0,autosizeOptions:{...(u==null?void 0:u.autosizeOptions)||{},includeOutliers:!0,includeHeaders:!0,expand:!0,columns:((I=u==null?void 0:u.autosizeOptions)==null?void 0:I.columns)||t.map(k=>k.field)},sx:{border:"none",width:"100%","& .MuiPaper-root":{boxShadow:"none !important"},"& .MuiDataGrid-overlay":{},"& .MuiDataGrid-main":{border:"none","& .MuiPaper-root":{}},"& .MuiDataGrid-container--top [role=row]":{},"& .MuiDataGrid-topContainer":{borderBottom:"none !important"},"& .MuiDataGrid-columnHeaders":{border:"none",borderBottom:"none !important"},"& .MuiDataGrid-row":{cursor:r?"pointer":"default",border:"none",margin:"1px 0",position:"relative",backgroundColor:"transparent !important","&:hover":{backgroundColor:"transparent !important","&::before":{content:'""',position:"absolute",top:0,left:"16px",right:"16px",bottom:0,backgroundColor:"action.hover",borderRadius:"16px",zIndex:0}},"&.Mui-selected":{backgroundColor:"transparent !important","&:hover":{backgroundColor:"transparent !important"}},...C!==null&&{[`&[data-id="${C}"]`]:{backgroundColor:"transparent !important","&::before":{content:'""',position:"absolute",top:0,left:"16px",right:"16px",bottom:0,backgroundColor:"rgba(255, 255, 255, 0.08) !important",borderRadius:"16px",zIndex:0},"&:hover":{backgroundColor:"transparent !important"},"&:hover::before":{backgroundColor:"rgba(255, 255, 255, 0.12) !important"}}}},"& .MuiDataGrid-cell--textLeft":{paddingLeft:"40px"},"& .MuiDataGrid-cell":{border:"none",position:"relative",zIndex:1,"&:focus":{outline:"none"},"&:focus-within":{outline:"none"},"&:hover":{backgroundColor:"transparent !important"}},"& .MuiDataGrid-columnHeader":{border:"none",paddingLeft:"40px",paddingRight:"40px","& .MuiDataGrid-columnHeaderTitle":{color:"rgba(255, 255, 255, 0.6)"}},"& .MuiDataGrid-toolbarContainer":{padding:"8px",border:"none !important",borderBottom:"none !important","& .MuiBox-root":{},"& .MuiFormControl-root":{},"& .MuiInputBase-root":{},"& .MuiPaper-root":{boxShadow:"none !important"},"& *":{borderBottom:"none !important"}},"& .MuiDataGrid-toolbar":{borderBottom:"none !important"},"& .MuiDataGrid-toolbarFilterList":{border:"none"},"& .MuiDataGrid-withBorderColor":{borderColor:"transparent !important"},"& .MuiDataGrid-columnSeparator":{display:"none"},"& .MuiDataGrid-footerContainer":{display:"none"},"& .MuiDataGrid-filler":{border:"none !important",borderTop:"none !important",borderBottom:"none !important",borderLeft:"none !important",borderRight:"none !important","--rowBorderColor":"none !important"},"& .MuiBackdrop-root":{},"& .MuiModal-backdrop":{},...u==null?void 0:u.sx}})})}));mh.displayName="WandelbotsDataGrid";const Pn=im({createStyledComponent:We("div",{name:"MuiStack",slot:"Root"}),useThemeProps:e=>za({props:e,name:"MuiStack"})});process.env.NODE_ENV!=="production"&&(Pn.propTypes={children:x.node,component:x.elementType,direction:x.oneOfType([x.oneOf(["column-reverse","column","row-reverse","row"]),x.arrayOf(x.oneOf(["column-reverse","column","row-reverse","row"])),x.object]),divider:x.node,spacing:x.oneOfType([x.arrayOf(x.oneOfType([x.number,x.string])),x.number,x.object,x.string]),sx:x.oneOfType([x.arrayOf(x.oneOfType([x.func,x.object,x.bool])),x.func,x.object]),useFlexGap:x.bool});const _s=g.externalizeComponent(ie.observer(({colors:e,label:t,getDisplayedValue:n,startJogging:r,stopJogging:i,disabled:o,activeJoggingDirection:s,...a})=>{var T,w,C,S,R,I,k;g.useAnimationFrame(()=>{const z=n(),P=h.current;P&&(P.textContent=z)});const l=M.useTheme(),[u,c]=D.useState(null);D.useEffect(()=>{o&&E()},[o]);const d=s||u,h=D.useRef(null);e||(e={color:"#fff",backgroundColor:"#000",borderColor:"#000",buttonBackgroundColor:{disabled:"#000",default:"#000",hovered:"#000",pressed:"#000"},labelColor:"#000"});const f=d?(T=e.buttonBackgroundColor)==null?void 0:T.pressed:e.borderColor,m={width:"55px",color:e.color,path:{fill:e.color},alignContent:"center",fontSize:"37px",svg:{pointerEvents:"none"}},p={...m,backgroundColor:(w=e.buttonBackgroundColor)==null?void 0:w.default,":hover":{backgroundColor:(C=e.buttonBackgroundColor)==null?void 0:C.hovered},":active":{backgroundColor:(S=e.buttonBackgroundColor)==null?void 0:S.pressed,color:e.backgroundColor,path:{fill:e.backgroundColor}},":disabled":{backgroundColor:(R=e.buttonBackgroundColor)==null?void 0:R.disabled,"svg path":{fill:l.palette.action.disabled}}},y={...m,backgroundColor:(I=e.buttonBackgroundColor)==null?void 0:I.pressed,color:e.backgroundColor,path:{fill:e.backgroundColor},":disabled":{backgroundColor:(k=e.buttonBackgroundColor)==null?void 0:k.pressed,"svg path":{fill:l.palette.action.disabled}}};function b(z,P){o||z.button===0&&(c(P),r(P))}function E(){c(null),i()}return g.jsxRuntimeExports.jsxs(Pn,{height:"64px",direction:"row",justifyContent:"center",...a,children:[g.jsxRuntimeExports.jsx(M.IconButton,{disabled:o,disableRipple:!0,onPointerDown:z=>b(z,"-"),onPointerUp:E,onPointerOut:E,size:"large",sx:{...d==="-"?y:p,borderRadius:"16px 0px 0px 16px",borderLeft:`2px solid ${f??"#fff"}`,borderBottom:`2px solid ${f??"#fff"}`,borderTop:`2px solid ${f??"#fff"}`},children:g.jsxRuntimeExports.jsx(je.ForwardRef$13,{})}),g.jsxRuntimeExports.jsxs(Pn,{spacing:"6px",sx:{width:"150px",backgroundColor:e.backgroundColor,alignItems:"center",justifyContent:"center",opacity:"0.9",borderBottom:`2px solid ${f??"#fff"}`,borderTop:`2px solid ${f??"#fff"}`},children:[g.jsxRuntimeExports.jsx(Pn,{height:"22px",direction:"row",alignItems:"center",justifyItems:"center",spacing:1,sx:{userSelect:"none",color:e.color,".MuiTypography-root":{fontWeight:700,...o?{color:l.palette.action.disabled}:{}},...o?{"svg path":{fill:l.palette.action.disabled}}:{}},children:t}),g.jsxRuntimeExports.jsx(M.Typography,{height:"22px",sx:{fontSize:"15px",color:o?l.palette.action.disabled:e.color,fontWeight:700},ref:h,children:n()})]}),g.jsxRuntimeExports.jsx(M.IconButton,{disableRipple:!0,disabled:o,onPointerDown:z=>b(z,"+"),onPointerUp:E,onPointerOut:E,size:"large",sx:{...d==="+"?y:p,borderRadius:"0px 16px 16px 0px",borderRight:`2px solid ${f??"#fff"}`,borderBottom:`2px solid ${f??"#fff"}`,borderTop:`2px solid ${f??"#fff"}`},children:g.jsxRuntimeExports.jsx(je.ForwardRef$14,{})})]})})),$S=Kt(g.jsxRuntimeExports.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),NS=Kt(g.jsxRuntimeExports.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");function un(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var gh=typeof global=="object"&&global&&global.Object===Object&&global,LS=typeof self=="object"&&self&&self.Object===Object&&self,yt=gh||LS||Function("return this")(),ss=function(){return yt.Date.now()},zS=/\s/;function FS(e){for(var t=e.length;t--&&zS.test(e.charAt(t)););return t}var BS=/^\s+/;function GS(e){return e&&e.slice(0,FS(e)+1).replace(BS,"")}var Ft=yt.Symbol,yh=Object.prototype,US=yh.hasOwnProperty,VS=yh.toString,er=Ft?Ft.toStringTag:void 0;function YS(e){var t=US.call(e,er),n=e[er];try{e[er]=void 0;var r=!0}catch{}var i=VS.call(e);return r&&(t?e[er]=n:delete e[er]),i}var WS=Object.prototype,HS=WS.toString;function qS(e){return HS.call(e)}var KS="[object Null]",JS="[object Undefined]",Pu=Ft?Ft.toStringTag:void 0;function yn(e){return e==null?e===void 0?JS:KS:Pu&&Pu in Object(e)?YS(e):qS(e)}function cn(e){return e!=null&&typeof e=="object"}var XS="[object Symbol]";function Co(e){return typeof e=="symbol"||cn(e)&&yn(e)==XS}var Du=NaN,ZS=/^[-+]0x[0-9a-f]+$/i,QS=/^0b[01]+$/i,eE=/^0o[0-7]+$/i,tE=parseInt;function $u(e){if(typeof e=="number")return e;if(Co(e))return Du;if(un(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=un(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=GS(e);var n=QS.test(e);return n||eE.test(e)?tE(e.slice(2),n?2:8):ZS.test(e)?Du:+e}var nE="Expected a function",rE=Math.max,iE=Math.min;function oE(e,t,n){var r,i,o,s,a,l,u=0,c=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(nE);t=$u(t)||0,un(n)&&(c=!!n.leading,d="maxWait"in n,o=d?rE($u(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h);function f(S){var R=r,I=i;return r=i=void 0,u=S,s=e.apply(I,R),s}function m(S){return u=S,a=setTimeout(b,t),c?f(S):s}function p(S){var R=S-l,I=S-u,k=t-R;return d?iE(k,o-I):k}function y(S){var R=S-l,I=S-u;return l===void 0||R>=t||R<0||d&&I>=o}function b(){var S=ss();if(y(S))return E(S);a=setTimeout(b,p(S))}function E(S){return a=void 0,h&&r?f(S):(r=i=void 0,s)}function T(){a!==void 0&&clearTimeout(a),u=0,r=l=i=a=void 0}function w(){return a===void 0?s:E(ss())}function C(){var S=ss(),R=y(S);if(r=arguments,i=this,l=S,R){if(a===void 0)return m(l);if(d)return clearTimeout(a),a=setTimeout(b,t),f(l)}return a===void 0&&(a=setTimeout(b,t)),s}return C.cancel=T,C.flush=w,C}var sE="Expected a function";function aE(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(sE);return un(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),oE(e,t,{leading:r,maxWait:t,trailing:i})}const xh=g.externalizeComponent(ie.observer(({startJogging:e,stopJogging:t,lowerLimit:n,upperLimit:r,useDegree:i,getValue:o,disabled:s,...a})=>{var S,R,I,k,z,P,v,_,A,B,G,Z,Y,te,we;const{t:l}=de.useTranslation(),[u,c]=D.useState(),d=M.useTheme(),h={background:(S=d.palette.backgroundPaperElevation)==null?void 0:S[4],color:(R=d.palette.backgroundPaperElevation)==null?void 0:R[11]},f=ie.useLocalObservable(()=>({activeJoggingDir:null,startJogging(V){this.activeJoggingDir=V,e(V)},stopJogging(){this.activeJoggingDir=null,t()}})),m=aE(()=>{c(i?p(o()):o())},50);g.useAnimationFrame(m);function p(V){if(V!=null)return Ie.radiansToDegrees(V)}function y(V){V.button===0&&f.startJogging("-")}function b(V){V.button===0&&f.startJogging("+")}function E(V){f.stopJogging()}function T(V){f.stopJogging()}function w(V,xe=1){if(V===void 0||isNaN(V))return"";const Pe=l("General.degree.variable",{amount:V.toFixed(xe)});return V>0&&xe===0?`+${Pe}`:Pe}function C(V,xe=1){if(V===void 0||isNaN(V))return"";const Pe=l("General.mm.variable",{amount:V.toFixed(xe)});return V>0&&xe===0?`+${Pe}`:Pe}return g.jsxRuntimeExports.jsxs(Pn,{height:"64px",width:"100%",maxWidth:"260px",direction:"row",...a,sx:{"& .MuiIconButton-root":{width:"52px",color:d.palette.text.primary,alignContent:"center",backgroundColor:(I=d.palette.backgroundPaperElevation)==null?void 0:I[11],"& svg":{width:"42px",height:"42px"},"&.Mui-disabled":{backgroundColor:(k=d.palette.backgroundPaperElevation)==null?void 0:k[11],color:d.palette.action.disabled,opacity:1},"&:hover":{backgroundColor:(z=d.palette.backgroundPaperElevation)==null?void 0:z[9]},"&:active":{...h}}},children:[g.jsxRuntimeExports.jsx(M.IconButton,{onPointerDown:y,onPointerUp:E,onPointerOut:T,disabled:s,disableRipple:!0,sx:{borderRadius:"16px 0px 0px 16px",...f.activeJoggingDir==="-"?h:{}},children:g.jsxRuntimeExports.jsx($S,{sx:{pointerEvents:"none",color:(A=(_=(v=(P=d.componentsExt)==null?void 0:P.JoggingPanel)==null?void 0:v.JoggingJoint)==null?void 0:_.Joint)==null?void 0:A.arrowColor}})}),g.jsxRuntimeExports.jsxs(Pn,{flexGrow:1,alignItems:"center",justifyContent:"center",sx:{borderStyle:"solid",borderLeftWidth:0,borderRightWidth:0,border:"none",backgroundColor:(B=d.palette.backgroundPaperElevation)==null?void 0:B[11],paddingLeft:"20px",paddingRight:"20px",zIndex:1},children:[g.jsxRuntimeExports.jsx(M.Typography,{sx:{fontSize:"15px",fontWeight:700,position:"relative",top:"5px",color:s?d.palette.action.disabled:d.palette.text.primary},children:i?w(u):C(u)}),g.jsxRuntimeExports.jsx(M.Slider,{disabled:!0,"aria-label":"Joint position",min:i?p(n):n,max:i?p(r):r,value:u||0,track:!1,sx:{"& .MuiSlider-mark":{display:"none"},"& .MuiSlider-thumb":{width:"5px",height:"12px",borderRadius:"2px",color:s?d.palette.action.disabled:d.palette.text.primary},"& .MuiSlider-markLabel":{top:"20px",fontSize:"12px",color:s?d.palette.action.disabled:d.palette.text.secondary},"& .MuiSlider-rail":{backgroundColor:(G=d.palette.backgroundPaperElevation)==null?void 0:G[5],opacity:1}},marks:n!==void 0&&r!==void 0&&[{value:i?p(n):n,label:i?w(p(n),0):C(n)},{value:i?p(r):r,label:i?w(p(r),0):C(r)}]})]}),g.jsxRuntimeExports.jsx(M.IconButton,{onPointerDown:b,onPointerUp:E,onPointerOut:T,disabled:s,disableRipple:!0,sx:{borderRadius:"0px 16px 16px 0px",...f.activeJoggingDir==="+"?h:{}},children:g.jsxRuntimeExports.jsx(NS,{sx:{pointerEvents:"none",color:(we=(te=(Y=(Z=d.componentsExt)==null?void 0:Z.JoggingPanel)==null?void 0:Y.JoggingJoint)==null?void 0:te.Joint)==null?void 0:we.arrowColor}})})]})})),lE=Kt(g.jsxRuntimeExports.jsx("path",{d:"M10 9h4V6h3l-5-5-5 5h3zm-1 1H6V7l-5 5 5 5v-3h3zm14 2-5-5v3h-3v4h3v3zm-9 3h-4v3H7l5 5 5-5h-3z"}),"OpenWith"),uE=Kt(g.jsxRuntimeExports.jsx("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92"}),"Share");function cE(...e){const t="THREE."+e.shift();console.warn(t,...e)}function Et(e,t,n){return Math.max(t,Math.min(n,e))}class dE{constructor(t=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=t,this._y=n,this._z=r,this._w=i}static slerpFlat(t,n,r,i,o,s,a){let l=r[i+0],u=r[i+1],c=r[i+2],d=r[i+3],h=o[s+0],f=o[s+1],m=o[s+2],p=o[s+3];if(a<=0){t[n+0]=l,t[n+1]=u,t[n+2]=c,t[n+3]=d;return}if(a>=1){t[n+0]=h,t[n+1]=f,t[n+2]=m,t[n+3]=p;return}if(d!==p||l!==h||u!==f||c!==m){let y=l*h+u*f+c*m+d*p;y<0&&(h=-h,f=-f,m=-m,p=-p,y=-y);let b=1-a;if(y<.9995){const E=Math.acos(y),T=Math.sin(E);b=Math.sin(b*E)/T,a=Math.sin(a*E)/T,l=l*b+h*a,u=u*b+f*a,c=c*b+m*a,d=d*b+p*a}else{l=l*b+h*a,u=u*b+f*a,c=c*b+m*a,d=d*b+p*a;const E=1/Math.sqrt(l*l+u*u+c*c+d*d);l*=E,u*=E,c*=E,d*=E}}t[n]=l,t[n+1]=u,t[n+2]=c,t[n+3]=d}static multiplyQuaternionsFlat(t,n,r,i,o,s){const a=r[i],l=r[i+1],u=r[i+2],c=r[i+3],d=o[s],h=o[s+1],f=o[s+2],m=o[s+3];return t[n]=a*m+c*d+l*f-u*h,t[n+1]=l*m+c*h+u*d-a*f,t[n+2]=u*m+c*f+a*h-l*d,t[n+3]=c*m-a*d-l*h-u*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,n,r,i){return this._x=t,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,n=!0){const r=t._x,i=t._y,o=t._z,s=t._order,a=Math.cos,l=Math.sin,u=a(r/2),c=a(i/2),d=a(o/2),h=l(r/2),f=l(i/2),m=l(o/2);switch(s){case"XYZ":this._x=h*c*d+u*f*m,this._y=u*f*d-h*c*m,this._z=u*c*m+h*f*d,this._w=u*c*d-h*f*m;break;case"YXZ":this._x=h*c*d+u*f*m,this._y=u*f*d-h*c*m,this._z=u*c*m-h*f*d,this._w=u*c*d+h*f*m;break;case"ZXY":this._x=h*c*d-u*f*m,this._y=u*f*d+h*c*m,this._z=u*c*m+h*f*d,this._w=u*c*d-h*f*m;break;case"ZYX":this._x=h*c*d-u*f*m,this._y=u*f*d+h*c*m,this._z=u*c*m-h*f*d,this._w=u*c*d+h*f*m;break;case"YZX":this._x=h*c*d+u*f*m,this._y=u*f*d+h*c*m,this._z=u*c*m-h*f*d,this._w=u*c*d-h*f*m;break;case"XZY":this._x=h*c*d-u*f*m,this._y=u*f*d-h*c*m,this._z=u*c*m+h*f*d,this._w=u*c*d+h*f*m;break;default:cE("Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,n){const r=n/2,i=Math.sin(r);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(t){const n=t.elements,r=n[0],i=n[4],o=n[8],s=n[1],a=n[5],l=n[9],u=n[2],c=n[6],d=n[10],h=r+a+d;if(h>0){const f=.5/Math.sqrt(h+1);this._w=.25/f,this._x=(c-l)*f,this._y=(o-u)*f,this._z=(s-i)*f}else if(r>a&&r>d){const f=2*Math.sqrt(1+r-a-d);this._w=(c-l)/f,this._x=.25*f,this._y=(i+s)/f,this._z=(o+u)/f}else if(a>d){const f=2*Math.sqrt(1+a-r-d);this._w=(o-u)/f,this._x=(i+s)/f,this._y=.25*f,this._z=(l+c)/f}else{const f=2*Math.sqrt(1+d-r-a);this._w=(s-i)/f,this._x=(o+u)/f,this._y=(l+c)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,n){let r=t.dot(n)+1;return r<1e-8?(r=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=r):(this._x=0,this._y=-t.z,this._z=t.y,this._w=r)):(this._x=t.y*n.z-t.z*n.y,this._y=t.z*n.x-t.x*n.z,this._z=t.x*n.y-t.y*n.x,this._w=r),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Et(this.dot(t),-1,1)))}rotateTowards(t,n){const r=this.angleTo(t);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,n){const r=t._x,i=t._y,o=t._z,s=t._w,a=n._x,l=n._y,u=n._z,c=n._w;return this._x=r*c+s*a+i*u-o*l,this._y=i*c+s*l+o*a-r*u,this._z=o*c+s*u+r*l-i*a,this._w=s*c-r*a-i*l-o*u,this._onChangeCallback(),this}slerp(t,n){if(n<=0)return this;if(n>=1)return this.copy(t);let r=t._x,i=t._y,o=t._z,s=t._w,a=this.dot(t);a<0&&(r=-r,i=-i,o=-o,s=-s,a=-a);let l=1-n;if(a<.9995){const u=Math.acos(a),c=Math.sin(u);l=Math.sin(l*u)/c,n=Math.sin(n*u)/c,this._x=this._x*l+r*n,this._y=this._y*l+i*n,this._z=this._z*l+o*n,this._w=this._w*l+s*n,this._onChangeCallback()}else this._x=this._x*l+r*n,this._y=this._y*l+i*n,this._z=this._z*l+o*n,this._w=this._w*l+s*n,this.normalize();return this}slerpQuaternions(t,n,r){return this.copy(t).slerp(n,r)}random(){const t=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),o=Math.sqrt(r);return this.set(i*Math.sin(t),i*Math.cos(t),o*Math.sin(n),o*Math.cos(n))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,n=0){return this._x=t[n],this._y=t[n+1],this._z=t[n+2],this._w=t[n+3],this._onChangeCallback(),this}toArray(t=[],n=0){return t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+3]=this._w,t}fromBufferAttribute(t,n){return this._x=t.getX(n),this._y=t.getY(n),this._z=t.getZ(n),this._w=t.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Dn{constructor(t=0,n=0,r=0){Dn.prototype.isVector3=!0,this.x=t,this.y=n,this.z=r}set(t,n,r){return r===void 0&&(r=this.z),this.x=t,this.y=n,this.z=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,n){return this.x=t.x*n.x,this.y=t.y*n.y,this.z=t.z*n.z,this}applyEuler(t){return this.applyQuaternion(Nu.setFromEuler(t))}applyAxisAngle(t,n){return this.applyQuaternion(Nu.setFromAxisAngle(t,n))}applyMatrix3(t){const n=this.x,r=this.y,i=this.z,o=t.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const n=this.x,r=this.y,i=this.z,o=t.elements,s=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*s,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*s,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*s,this}applyQuaternion(t){const n=this.x,r=this.y,i=this.z,o=t.x,s=t.y,a=t.z,l=t.w,u=2*(s*i-a*r),c=2*(a*n-o*i),d=2*(o*r-s*n);return this.x=n+l*u+s*d-a*c,this.y=r+l*c+a*u-o*d,this.z=i+l*d+o*c-s*u,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const n=this.x,r=this.y,i=this.z,o=t.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,n){return this.x=Et(this.x,t.x,n.x),this.y=Et(this.y,t.y,n.y),this.z=Et(this.z,t.z,n.z),this}clampScalar(t,n){return this.x=Et(this.x,t,n),this.y=Et(this.y,t,n),this.z=Et(this.z,t,n),this}clampLength(t,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Et(r,t,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this}lerpVectors(t,n,r){return this.x=t.x+(n.x-t.x)*r,this.y=t.y+(n.y-t.y)*r,this.z=t.z+(n.z-t.z)*r,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,n){const r=t.x,i=t.y,o=t.z,s=n.x,a=n.y,l=n.z;return this.x=i*l-o*a,this.y=o*s-r*l,this.z=r*a-i*s,this}projectOnVector(t){const n=t.lengthSq();if(n===0)return this.set(0,0,0);const r=t.dot(this)/n;return this.copy(t).multiplyScalar(r)}projectOnPlane(t){return as.copy(this).projectOnVector(t),this.sub(as)}reflect(t){return this.sub(as.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const n=Math.sqrt(this.lengthSq()*t.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(t)/n;return Math.acos(Et(r,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const n=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return n*n+r*r+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,n,r){const i=Math.sin(n)*t;return this.x=i*Math.sin(r),this.y=Math.cos(n)*t,this.z=i*Math.cos(r),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,n,r){return this.x=t*Math.sin(n),this.y=r,this.z=t*Math.cos(n),this}setFromMatrixPosition(t){const n=t.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(t){const n=this.setFromMatrixColumn(t,0).length(),r=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(t,n){return this.fromArray(t.elements,n*4)}setFromMatrix3Column(t,n){return this.fromArray(t.elements,n*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this.z=t[n+2],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t}fromBufferAttribute(t,n){return this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,n=Math.random()*2-1,r=Math.sqrt(1-n*n);return this.x=r*Math.cos(t),this.y=n,this.z=r*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const as=new Dn,Nu=new dE;function Fa(e,t,n){if(t.length!==e.length)return!0;for(let r=0;r<t.length;r++)if(Math.abs(t[r]-e[r])>n)return!1;return!0}function bh(e,t,n){if(e===void 0&&t||e&&t===void 0||(e==null?void 0:e.orientation)===void 0||(t==null?void 0:t.orientation)===void 0||(e==null?void 0:e.position)===void 0||(t==null?void 0:t.position)===void 0)return!1;if(e===void 0||t===void 0)return!0;let r=0;return r+=Math.abs(e.orientation[0]-t.orientation[0]),r+=Math.abs(e.orientation[1]-t.orientation[1]),r+=Math.abs(e.orientation[2]-t.orientation[2]),r+=Math.abs(e.position[0]-t.position[0]),r+=Math.abs(e.position[1]-t.position[1]),r+=Math.abs(e.position[2]-t.position[2]),r<=n}function Ba(e,t,n){return e.coordinate_system===t.coordinate_system&&e.tcp===t.tcp&&bh(e.tcp_pose,t.tcp_pose,n)}function vh(e,t){const n=new ds.Vector3(t[0],t[1],t[2]),r=new ds.Vector3(e[0],e[1],e[2]),i=n.length(),o=n.normalize();let s=r.length(),a=r.normalize();a.dot(o)<0&&(s=-s,a=a.multiplyScalar(-1));let l=s-i;return l-=2*Math.PI*Math.floor((l+Math.PI)/(2*Math.PI)),s=i+l,[...a.multiplyScalar(s)]}const Lu=1e-4;class Mo{constructor(t,n,r,i,o,s){this.nova=t,this.controller=n,this.motionGroup=r,this.description=i,this.initialMotionState=o,this.motionStateSocket=s,this.rapidlyChangingMotionState=o,s.addEventListener("message",a=>{var u;const l=(u=Ie.tryParseJson(a.data))==null?void 0:u.result;if(!l)throw new Error(`Failed to get motion state for ${this.motionGroupId}: ${a.data}`);Fa(this.rapidlyChangingMotionState.joint_position,l.joint_position,Lu)||ce.runInAction(()=>{this.rapidlyChangingMotionState.joint_position=l.joint_position}),Ba(this.rapidlyChangingMotionState,l,Lu)||ce.runInAction(()=>{var c,d,h;this.rapidlyChangingMotionState.tcp_pose==null?this.rapidlyChangingMotionState.tcp_pose=l.tcp_pose:(c=l.tcp_pose)!=null&&c.orientation&&((d=l.tcp_pose)!=null&&d.position)&&((h=this.rapidlyChangingMotionState.tcp_pose)!=null&&h.orientation)?this.rapidlyChangingMotionState.tcp_pose={position:l.tcp_pose.position,orientation:vh(l.tcp_pose.orientation,this.rapidlyChangingMotionState.tcp_pose.orientation)}:console.warn("Received incomplete tcp_pose, ignoring",l.tcp_pose)}),this.rapidlyChangingMotionState.standstill!==l.standstill&&ce.runInAction(()=>{this.rapidlyChangingMotionState.standstill=l.standstill})}),ce.makeAutoObservable(this)}static async open(t,n){var d;const[r,i]=n.split("@"),o=await t.api.controller.getCurrentRobotControllerState(i),s=o==null?void 0:o.motion_groups.find(h=>h.motion_group===n);if(!o||!s)throw new Error(`Controller ${i} or motion group ${n} not found`);const a=t.openReconnectingWebsocket(`/controllers/${i}/motion-groups/${n}/state-stream`),l=await a.firstMessage(),u=(d=Ie.tryParseJson(l.data))==null?void 0:d.result;if(!u)throw new Error(`Unable to parse initial motion state message ${l.data}`);console.log(`Connected motion state websocket to motion group ${s.motion_group}. Initial state:
|
|
111
|
-
`,u);const c=await t.api.motionGroup.getMotionGroupDescription(i,s.motion_group);return new Mo(t,o,s,c,u,a)}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get joints(){return this.initialMotionState.joint_position.map((t,n)=>({index:n}))}dispose(){this.motionStateSocket.close()}}const zu="Movement request rejected. Another client is currently executing a 'Jogging' motion!";class Ro{constructor(t,n={}){this.motionStream=t,this.options=n,this.ENDPOINT_JOGGING="/execution/jogging",this.ENDPOINT_TRAJECTORY="/execution/trajectory",this.DEFAULT_MODE="off",this.DEFAULT_TCP="Flange",this.DEFAULT_INIT_TIMEOUT=5e3,this.DEFAULT_ORIENTATION="coordsys",this.mode="off",this.joggingSocket=null,this.trajectorySocket=null,this.timeout=this.DEFAULT_INIT_TIMEOUT,this.tcp=(n==null?void 0:n.tcp)||t.motionGroup.tcp||this.DEFAULT_TCP,this.orientation=(n==null?void 0:n.orientation)||this.DEFAULT_ORIENTATION,this.timeout=(n==null?void 0:n.timeout)||this.DEFAULT_INIT_TIMEOUT,this.mode=(n==null?void 0:n.mode)||this.DEFAULT_MODE,this.onError=n==null?void 0:n.onError}static async open(t,n,r={}){const i=await Mo.open(t,n),o=new Ro(i,r);return await o.setJoggingMode(o.mode),o}async setOptions(t){t.tcp&&(this.tcp=t.tcp),t.orientation&&(this.orientation=t.orientation),t.timeout&&(this.timeout=t.timeout),t.mode&&(this.mode=t.mode),t.onError&&(this.onError=t.onError),this.setJoggingMode(this.mode,!1)}get motionGroupId(){return this.motionStream.motionGroupId}get nova(){return this.motionStream.nova}get numJoints(){return this.motionStream.joints.length}async stop(){if(this.joggingSocket){const t=new Array(this.numJoints).fill(0);this.joggingSocket.sendJson({message_type:"JointVelocityRequest",velocity:t})}this.trajectorySocket&&this.trajectorySocket.sendJson({message_type:"PauseMovementRequest"})}async dispose(){const t=[this.joggingSocket,this.trajectorySocket].filter(n=>n!==null);return t.forEach(n=>{n.dispose()}),this.joggingSocket=null,this.trajectorySocket=null,Promise.all(t.map(n=>n.closed()))}async setJoggingMode(t,n=!0){if(!(this.mode===t&&n)&&(this.dispose(),this.mode=t,this.mode==="jogging"))return this.initializeJoggingWebsocket()}async initializeJoggingWebsocket(){return new Promise((t,n)=>{const r=setTimeout(()=>{n(new Error(`Jogging initialization timeout after ${this.timeout} seconds`))},this.timeout);this.joggingSocket=this.nova.openReconnectingWebsocket(this.ENDPOINT_JOGGING),this.joggingSocket.addEventListener("message",i=>{var s,a,l,u;const o=Ie.tryParseJson(i.data);if(((s=o==null?void 0:o.result)==null?void 0:s.kind)==="INITIALIZE_RECEIVED"){clearTimeout(r),t();return}if(((a=o==null?void 0:o.result)==null?void 0:a.kind)==="MOTION_ERROR")if(clearTimeout(r),this.onBlocked&&((l=o==null?void 0:o.result)!=null&&l.message.includes(zu))){(u=this.joggingSocket)==null||u.dispose(),this.onBlocked();return}else this.onError?this.onError(i.data):n(new Error(i.data))}),this.joggingSocket.sendJson({message_type:"InitializeJoggingRequest",motion_group:this.motionGroupId,tcp:this.tcp})})}async rotateJoints({joint:t,direction:n,velocityValue:r,velocityUnit:i}){if(!this.joggingSocket||this.mode!=="jogging")throw new Error("Joint jogging websocket not connected; create one by setting jogging mode to 'jogging'");const o=new Array(this.numJoints).fill(0);o[t]=n==="-"?-r:r,this.joggingSocket.sendJson({message_type:"JointVelocityRequest",velocity:o})}async translateTCP({axis:t,direction:n,velocityMmPerSec:r}){if(!this.joggingSocket||this.mode!=="jogging")throw new Error("Continuous jogging websocket not connected; create one by setting jogging mode to 'jogging'");const i=[0,0,0],o=[0,0,0];o[Ie.XYZ_TO_VECTOR[t]]=n==="-"?-r:r,this.joggingSocket.sendJson({message_type:"TcpVelocityRequest",translation:o,rotation:i,use_tool_coordinate_system:this.orientation==="tool"})}async rotateTCP({axis:t,direction:n,velocityRadsPerSec:r}){if(!this.joggingSocket||this.mode!=="jogging")throw new Error("Continuous jogging websocket not connected; create one by setting jogging mode to 'jogging'");const i=[0,0,0],o=[0,0,0];i[Ie.XYZ_TO_VECTOR[t]]=n==="-"?-r:r,this.joggingSocket.sendJson({message_type:"TcpVelocityRequest",translation:o,rotation:i})}async runIncrementalCartesianMotion({currentTcpPose:t,currentJoints:n,velocityInRelevantUnits:r,axis:i,direction:o,motion:s}){const a=[];if(this.mode!=="trajectory")throw new Error("Set jogging mode to 'trajectory' to run incremental cartesian motions");if(s.type==="translate"){if(!t.position)throw new Error("Current pose has no position, cannot perform translation");const y=[...t.position];y[Ie.XYZ_TO_VECTOR[i]]+=s.distanceMm*(o==="-"?-1:1),a.push({limits_override:{tcp_velocity_limit:r},path:{path_definition_name:"PathLine",target_pose:{position:y,orientation:t.orientation}}})}else if(s.type==="rotate"){if(!t.orientation)throw new Error("Current pose has no orientation, cannot perform rotation");const y=new Dn(t.orientation[0],t.orientation[1],t.orientation[2]),b=y.length(),E=y.clone().normalize(),T=s.distanceRads*(o==="-"?-1:1),w=new Dn(0,0,0);w[i]=1;const C=Math.cos(.5*T)*Math.cos(.5*b),S=Math.sin(.5*T)*Math.sin(.5*b),R=Math.sin(.5*T)*Math.cos(.5*b),I=Math.cos(.5*T)*Math.sin(.5*b),k=w.dot(E),z=w.clone().cross(E),P=2*Math.acos(C-S*k),v=P/Math.sin(.5*P),_=new Dn().addScaledVector(z,S).addScaledVector(w,R).addScaledVector(E,I).multiplyScalar(v);a.push({limits_override:{tcp_orientation_velocity_limit:r},path:{path_definition_name:"PathLine",target_pose:{position:t.position,orientation:[..._]}}})}const l=this.motionStream.description;if(l.cycle_time===void 0){console.warn("Current motion group has no cycle time, cannot plan jogging motion");return}const u={motion_group_model:l.motion_group_model,cycle_time:l.cycle_time,mounting:l.mounting,global:l.operation_limits.auto_limits},c=await this.nova.api.trajectoryPlanning.planTrajectory({motion_group_setup:u,start_joint_position:n,motion_commands:a}),d=c.response;if(!d)throw new Error(`Failed to plan jogging increment motion ${JSON.stringify(c)}`);this.trajectorySocket&&(console.warn("Trajectory jogging websocket already open; will close"),this.trajectorySocket.dispose()),this.trajectorySocket=this.nova.openReconnectingWebsocket(this.ENDPOINT_TRAJECTORY);const h=y=>{var b;if(!y||y.add_trajectory_error||y.message)if(this.onError)this.onError(y);else throw new Error(((b=y==null?void 0:y.add_trajectory_error)==null?void 0:b.message)||(y==null?void 0:y.message)||"Failed to execute trajectory, unknown error");if(!this.trajectorySocket)throw new Error("Failed to execute trajectory, websocket not available anymore");this.trajectorySocket.sendJson({message_type:"StartMovementRequest",direction:"DIRECTION_FORWARD"})},f=async()=>{var y;await ce.when(()=>!this.motionStream.rapidlyChangingMotionState.standstill),await ce.when(()=>this.motionStream.rapidlyChangingMotionState.standstill),(y=this.trajectorySocket)==null||y.dispose(),this.trajectorySocket=null},m=async()=>{var y;await ce.when(()=>this.motionStream.rapidlyChangingMotionState.standstill),(y=this.trajectorySocket)==null||y.dispose(),this.trajectorySocket=null},p=async y=>{if(y!=null&&y.message)if(this.onError){this.onError(y);return}else throw new Error(y.message||"Failed to execute trajectory, unknown error");this.motionStream.rapidlyChangingMotionState.standstill?await f():await m()};this.trajectorySocket.addEventListener("message",y=>{var E,T;const b=Ie.tryParseJson(y.data);if(!((E=b==null?void 0:b.result)!=null&&E.kind))throw new Error(`Failed to execute trajectory: Received invalid message ${y.data}`);if(this.onBlocked&&((T=b.result.message)!=null&&T.includes(zu))){this.onBlocked();return}if(b.result.kind==="INITIALIZE_RECEIVED")h(b.result);else if(b.result.kind==="START_RECEIVED")p(b);else if(b.result.kind!=="PAUSE_RECEIVED")if(b.result.kind==="MOTION_ERROR"&&b.result.message)if(this.onError){this.onError(b);return}else throw new Error(b.result.message);else throw new Error(`Failed to execute trajectory, cannot handle message type "${b.result.kind}"`)}),this.trajectorySocket.sendJson({message_type:"InitializeMovementRequest",trajectory:{message_type:"TrajectoryData",motion_group:this.motionGroupId,data:d,tcp:this.tcp}})}}function hE(e,t){throw new Error(t+` ${JSON.stringify(e)}`)}function fE(e){var t,n,r,i;return e instanceof Ka.AxiosError&&e.code==="ERR_NETWORK"?"Failed to connect to the server. Please check your internet connection.":e instanceof Ka.AxiosError&&e.response?`${(t=e.response)==null?void 0:t.status} ${(n=e.response)==null?void 0:n.statusText} from ${(r=e.response)==null?void 0:r.config.url}: ${JSON.stringify((i=e.response)==null?void 0:i.data)}`:e instanceof Error?e.message:`Unexpected error: ${g.tryStringifyJson(e)||e}`}const Sh=e=>{const t=e.softTimeout||3e3,[n,r]=D.useState(!1),i=M.useTheme();return D.useEffect(()=>{const o=setTimeout(()=>{r(!0)},t);return()=>clearTimeout(o)}),g.jsxRuntimeExports.jsx(M.Stack,{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",sx:{color:i.palette.text.primary},children:e.error?g.jsxRuntimeExports.jsx(Eh,{loadingMessage:e.message,error:e.error}):g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[g.jsxRuntimeExports.jsx(M.CircularProgress,{sx:{marginBottom:"24px"}}),!!e.message&&g.jsxRuntimeExports.jsx("div",{children:e.message}),g.jsxRuntimeExports.jsx(M.Stack,{sx:{visibility:n?"visible":"hidden",marginTop:"1rem",color:i.palette.text.secondary},children:"This is taking longer than expected..."})]})})},Eh=e=>{const t=fE(e.error),n=e.error instanceof Error?e.error.stack:null,r=M.useTheme();return g.jsxRuntimeExports.jsxs(M.Stack,{sx:{maxHeight:"100%",maxWidth:"min(100%, 800px)",padding:2,overflow:"auto",color:r.palette.error.main,"& pre":{whiteSpace:"pre-wrap",wordBreak:"break-word",paddingBottom:"3rem"}},children:[(e.loadingMessage?`Error while ${Ns.lowerFirst(M.capitalize(e.loadingMessage))} - `:"")+t,g.jsxRuntimeExports.jsx("br",{}),n&&g.jsxRuntimeExports.jsx("pre",{children:n})]})};var pE="[object AsyncFunction]",mE="[object Function]",gE="[object GeneratorFunction]",yE="[object Proxy]";function Th(e){if(!un(e))return!1;var t=yn(e);return t==mE||t==gE||t==pE||t==yE}var ls=yt["__core-js_shared__"],Fu=(function(){var e=/[^.]+$/.exec(ls&&ls.keys&&ls.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function xE(e){return!!Fu&&Fu in e}var bE=Function.prototype,vE=bE.toString;function xn(e){if(e!=null){try{return vE.call(e)}catch{}try{return e+""}catch{}}return""}var SE=/[\\^$.*+?()[\]{}|]/g,EE=/^\[object .+?Constructor\]$/,TE=Function.prototype,wE=Object.prototype,CE=TE.toString,ME=wE.hasOwnProperty,RE=RegExp("^"+CE.call(ME).replace(SE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function AE(e){if(!un(e)||xE(e))return!1;var t=Th(e)?RE:EE;return t.test(xn(e))}function _E(e,t){return e==null?void 0:e[t]}function bn(e,t){var n=_E(e,t);return AE(n)?n:void 0}var Bu=(function(){try{var e=bn(Object,"defineProperty");return e({},"",{}),e}catch{}})();function IE(e,t,n){t=="__proto__"&&Bu?Bu(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function jE(e,t,n,r){for(var i=-1,o=e==null?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function kE(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var l=s[++i];if(n(o[l],l,o)===!1)break}return t}}var OE=kE();function PE(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var DE="[object Arguments]";function Gu(e){return cn(e)&&yn(e)==DE}var wh=Object.prototype,$E=wh.hasOwnProperty,NE=wh.propertyIsEnumerable,Ch=Gu((function(){return arguments})())?Gu:function(e){return cn(e)&&$E.call(e,"callee")&&!NE.call(e,"callee")},mt=Array.isArray;function LE(){return!1}var Mh=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Uu=Mh&&typeof module=="object"&&module&&!module.nodeType&&module,zE=Uu&&Uu.exports===Mh,Vu=zE?yt.Buffer:void 0,FE=Vu?Vu.isBuffer:void 0,Is=FE||LE,BE=9007199254740991,GE=/^(?:0|[1-9]\d*)$/;function Rh(e,t){var n=typeof e;return t=t??BE,!!t&&(n=="number"||n!="symbol"&&GE.test(e))&&e>-1&&e%1==0&&e<t}var UE=9007199254740991;function Ga(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=UE}var VE="[object Arguments]",YE="[object Array]",WE="[object Boolean]",HE="[object Date]",qE="[object Error]",KE="[object Function]",JE="[object Map]",XE="[object Number]",ZE="[object Object]",QE="[object RegExp]",eT="[object Set]",tT="[object String]",nT="[object WeakMap]",rT="[object ArrayBuffer]",iT="[object DataView]",oT="[object Float32Array]",sT="[object Float64Array]",aT="[object Int8Array]",lT="[object Int16Array]",uT="[object Int32Array]",cT="[object Uint8Array]",dT="[object Uint8ClampedArray]",hT="[object Uint16Array]",fT="[object Uint32Array]",he={};he[oT]=he[sT]=he[aT]=he[lT]=he[uT]=he[cT]=he[dT]=he[hT]=he[fT]=!0;he[VE]=he[YE]=he[rT]=he[WE]=he[iT]=he[HE]=he[qE]=he[KE]=he[JE]=he[XE]=he[ZE]=he[QE]=he[eT]=he[tT]=he[nT]=!1;function pT(e){return cn(e)&&Ga(e.length)&&!!he[yn(e)]}function mT(e){return function(t){return e(t)}}var Ah=typeof exports=="object"&&exports&&!exports.nodeType&&exports,lr=Ah&&typeof module=="object"&&module&&!module.nodeType&&module,gT=lr&&lr.exports===Ah,us=gT&&gh.process,Yu=(function(){try{var e=lr&&lr.require&&lr.require("util").types;return e||us&&us.binding&&us.binding("util")}catch{}})(),Wu=Yu&&Yu.isTypedArray,_h=Wu?mT(Wu):pT,yT=Object.prototype,xT=yT.hasOwnProperty;function bT(e,t){var n=mt(e),r=!n&&Ch(e),i=!n&&!r&&Is(e),o=!n&&!r&&!i&&_h(e),s=n||r||i||o,a=s?PE(e.length,String):[],l=a.length;for(var u in e)xT.call(e,u)&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Rh(u,l)))&&a.push(u);return a}var vT=Object.prototype;function ST(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||vT;return e===n}function ET(e,t){return function(n){return e(t(n))}}var TT=ET(Object.keys,Object),wT=Object.prototype,CT=wT.hasOwnProperty;function MT(e){if(!ST(e))return TT(e);var t=[];for(var n in Object(e))CT.call(e,n)&&n!="constructor"&&t.push(n);return t}function Ih(e){return e!=null&&Ga(e.length)&&!Th(e)}function Ua(e){return Ih(e)?bT(e):MT(e)}function RT(e,t){return e&&OE(e,t,Ua)}function AT(e,t){return function(n,r){if(n==null)return n;if(!Ih(n))return e(n,r);for(var i=n.length,o=-1,s=Object(n);++o<i&&r(s[o],o,s)!==!1;);return n}}var _T=AT(RT);function IT(e,t,n,r){return _T(e,function(i,o,s){t(r,i,n(i),s)}),r}function jT(){this.__data__=[],this.size=0}function jh(e,t){return e===t||e!==e&&t!==t}function Ao(e,t){for(var n=e.length;n--;)if(jh(e[n][0],t))return n;return-1}var kT=Array.prototype,OT=kT.splice;function PT(e){var t=this.__data__,n=Ao(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():OT.call(t,n,1),--this.size,!0}function DT(e){var t=this.__data__,n=Ao(t,e);return n<0?void 0:t[n][1]}function $T(e){return Ao(this.__data__,e)>-1}function NT(e,t){var n=this.__data__,r=Ao(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function It(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}It.prototype.clear=jT;It.prototype.delete=PT;It.prototype.get=DT;It.prototype.has=$T;It.prototype.set=NT;function LT(){this.__data__=new It,this.size=0}function zT(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function FT(e){return this.__data__.get(e)}function BT(e){return this.__data__.has(e)}var br=bn(yt,"Map"),vr=bn(Object,"create");function GT(){this.__data__=vr?vr(null):{},this.size=0}function UT(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var VT="__lodash_hash_undefined__",YT=Object.prototype,WT=YT.hasOwnProperty;function HT(e){var t=this.__data__;if(vr){var n=t[e];return n===VT?void 0:n}return WT.call(t,e)?t[e]:void 0}var qT=Object.prototype,KT=qT.hasOwnProperty;function JT(e){var t=this.__data__;return vr?t[e]!==void 0:KT.call(t,e)}var XT="__lodash_hash_undefined__";function ZT(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=vr&&t===void 0?XT:t,this}function dn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dn.prototype.clear=GT;dn.prototype.delete=UT;dn.prototype.get=HT;dn.prototype.has=JT;dn.prototype.set=ZT;function QT(){this.size=0,this.__data__={hash:new dn,map:new(br||It),string:new dn}}function ew(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function _o(e,t){var n=e.__data__;return ew(t)?n[typeof t=="string"?"string":"hash"]:n.map}function tw(e){var t=_o(this,e).delete(e);return this.size-=t?1:0,t}function nw(e){return _o(this,e).get(e)}function rw(e){return _o(this,e).has(e)}function iw(e,t){var n=_o(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function jt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}jt.prototype.clear=QT;jt.prototype.delete=tw;jt.prototype.get=nw;jt.prototype.has=rw;jt.prototype.set=iw;var ow=200;function sw(e,t){var n=this.__data__;if(n instanceof It){var r=n.__data__;if(!br||r.length<ow-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new jt(r)}return n.set(e,t),this.size=n.size,this}function Ct(e){var t=this.__data__=new It(e);this.size=t.size}Ct.prototype.clear=LT;Ct.prototype.delete=zT;Ct.prototype.get=FT;Ct.prototype.has=BT;Ct.prototype.set=sw;var aw="__lodash_hash_undefined__";function lw(e){return this.__data__.set(e,aw),this}function uw(e){return this.__data__.has(e)}function Di(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new jt;++t<n;)this.add(e[t])}Di.prototype.add=Di.prototype.push=lw;Di.prototype.has=uw;function cw(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function dw(e,t){return e.has(t)}var hw=1,fw=2;function kh(e,t,n,r,i,o){var s=n&hw,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var d=-1,h=!0,f=n&fw?new Di:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var m=e[d],p=t[d];if(r)var y=s?r(p,m,d,t,e,o):r(m,p,d,e,t,o);if(y!==void 0){if(y)continue;h=!1;break}if(f){if(!cw(t,function(b,E){if(!dw(f,E)&&(m===b||i(m,b,n,r,o)))return f.push(E)})){h=!1;break}}else if(!(m===p||i(m,p,n,r,o))){h=!1;break}}return o.delete(e),o.delete(t),h}var Hu=yt.Uint8Array;function pw(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function mw(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var gw=1,yw=2,xw="[object Boolean]",bw="[object Date]",vw="[object Error]",Sw="[object Map]",Ew="[object Number]",Tw="[object RegExp]",ww="[object Set]",Cw="[object String]",Mw="[object Symbol]",Rw="[object ArrayBuffer]",Aw="[object DataView]",qu=Ft?Ft.prototype:void 0,cs=qu?qu.valueOf:void 0;function _w(e,t,n,r,i,o,s){switch(n){case Aw:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Rw:return!(e.byteLength!=t.byteLength||!o(new Hu(e),new Hu(t)));case xw:case bw:case Ew:return jh(+e,+t);case vw:return e.name==t.name&&e.message==t.message;case Tw:case Cw:return e==t+"";case Sw:var a=pw;case ww:var l=r&gw;if(a||(a=mw),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;r|=yw,s.set(e,t);var c=kh(a(e),a(t),r,i,o,s);return s.delete(e),c;case Mw:if(cs)return cs.call(e)==cs.call(t)}return!1}function Iw(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function jw(e,t,n){var r=t(e);return mt(e)?r:Iw(r,n(e))}function kw(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function Ow(){return[]}var Pw=Object.prototype,Dw=Pw.propertyIsEnumerable,Ku=Object.getOwnPropertySymbols,$w=Ku?function(e){return e==null?[]:(e=Object(e),kw(Ku(e),function(t){return Dw.call(e,t)}))}:Ow;function Ju(e){return jw(e,Ua,$w)}var Nw=1,Lw=Object.prototype,zw=Lw.hasOwnProperty;function Fw(e,t,n,r,i,o){var s=n&Nw,a=Ju(e),l=a.length,u=Ju(t),c=u.length;if(l!=c&&!s)return!1;for(var d=l;d--;){var h=a[d];if(!(s?h in t:zw.call(t,h)))return!1}var f=o.get(e),m=o.get(t);if(f&&m)return f==t&&m==e;var p=!0;o.set(e,t),o.set(t,e);for(var y=s;++d<l;){h=a[d];var b=e[h],E=t[h];if(r)var T=s?r(E,b,h,t,e,o):r(b,E,h,e,t,o);if(!(T===void 0?b===E||i(b,E,n,r,o):T)){p=!1;break}y||(y=h=="constructor")}if(p&&!y){var w=e.constructor,C=t.constructor;w!=C&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof C=="function"&&C instanceof C)&&(p=!1)}return o.delete(e),o.delete(t),p}var js=bn(yt,"DataView"),ks=bn(yt,"Promise"),Os=bn(yt,"Set"),Ps=bn(yt,"WeakMap"),Xu="[object Map]",Bw="[object Object]",Zu="[object Promise]",Qu="[object Set]",ec="[object WeakMap]",tc="[object DataView]",Gw=xn(js),Uw=xn(br),Vw=xn(ks),Yw=xn(Os),Ww=xn(Ps),$t=yn;(js&&$t(new js(new ArrayBuffer(1)))!=tc||br&&$t(new br)!=Xu||ks&&$t(ks.resolve())!=Zu||Os&&$t(new Os)!=Qu||Ps&&$t(new Ps)!=ec)&&($t=function(e){var t=yn(e),n=t==Bw?e.constructor:void 0,r=n?xn(n):"";if(r)switch(r){case Gw:return tc;case Uw:return Xu;case Vw:return Zu;case Yw:return Qu;case Ww:return ec}return t});var Hw=1,nc="[object Arguments]",rc="[object Array]",ti="[object Object]",qw=Object.prototype,ic=qw.hasOwnProperty;function Kw(e,t,n,r,i,o){var s=mt(e),a=mt(t),l=s?rc:$t(e),u=a?rc:$t(t);l=l==nc?ti:l,u=u==nc?ti:u;var c=l==ti,d=u==ti,h=l==u;if(h&&Is(e)){if(!Is(t))return!1;s=!0,c=!1}if(h&&!c)return o||(o=new Ct),s||_h(e)?kh(e,t,n,r,i,o):_w(e,t,l,n,r,i,o);if(!(n&Hw)){var f=c&&ic.call(e,"__wrapped__"),m=d&&ic.call(t,"__wrapped__");if(f||m){var p=f?e.value():e,y=m?t.value():t;return o||(o=new Ct),i(p,y,n,r,o)}}return h?(o||(o=new Ct),Fw(e,t,n,r,i,o)):!1}function Io(e,t,n,r,i){return e===t?!0:e==null||t==null||!cn(e)&&!cn(t)?e!==e&&t!==t:Kw(e,t,n,r,Io,i)}var Jw=1,Xw=2;function Zw(e,t,n,r){var i=n.length,o=i;if(e==null)return!o;for(e=Object(e);i--;){var s=n[i];if(s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){s=n[i];var a=s[0],l=e[a],u=s[1];if(s[2]){if(l===void 0&&!(a in e))return!1}else{var c=new Ct,d;if(!(d===void 0?Io(u,l,Jw|Xw,r,c):d))return!1}}return!0}function Oh(e){return e===e&&!un(e)}function Qw(e){for(var t=Ua(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Oh(i)]}return t}function Ph(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function eC(e){var t=Qw(e);return t.length==1&&t[0][2]?Ph(t[0][0],t[0][1]):function(n){return n===e||Zw(n,e,t)}}var tC=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nC=/^\w*$/;function Va(e,t){if(mt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Co(e)?!0:nC.test(e)||!tC.test(e)||t!=null&&e in Object(t)}var rC="Expected a function";function Ya(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(rC);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Ya.Cache||jt),n}Ya.Cache=jt;var iC=500;function oC(e){var t=Ya(e,function(r){return n.size===iC&&n.clear(),r}),n=t.cache;return t}var sC=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,aC=/\\(\\)?/g,lC=oC(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(sC,function(n,r,i,o){t.push(i?o.replace(aC,"$1"):r||n)}),t});function uC(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var oc=Ft?Ft.prototype:void 0,sc=oc?oc.toString:void 0;function Dh(e){if(typeof e=="string")return e;if(mt(e))return uC(e,Dh)+"";if(Co(e))return sc?sc.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function $h(e){return e==null?"":Dh(e)}function Nh(e,t){return mt(e)?e:Va(e,t)?[e]:lC($h(e))}function jo(e){if(typeof e=="string"||Co(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Lh(e,t){t=Nh(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[jo(t[n++])];return n&&n==r?e:void 0}function cC(e,t,n){var r=e==null?void 0:Lh(e,t);return r===void 0?n:r}function dC(e,t){return e!=null&&t in Object(e)}function hC(e,t,n){t=Nh(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=jo(t[r]);if(!(o=e!=null&&n(e,s)))break;e=e[s]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&Ga(i)&&Rh(s,i)&&(mt(e)||Ch(e)))}function fC(e,t){return e!=null&&hC(e,t,dC)}var pC=1,mC=2;function gC(e,t){return Va(e)&&Oh(t)?Ph(jo(e),t):function(n){var r=cC(n,e);return r===void 0&&r===t?fC(n,e):Io(t,r,pC|mC)}}function yC(e){return e}function xC(e){return function(t){return t==null?void 0:t[e]}}function bC(e){return function(t){return Lh(t,e)}}function vC(e){return Va(e)?xC(jo(e)):bC(e)}function SC(e){return typeof e=="function"?e:e==null?yC:typeof e=="object"?mt(e)?gC(e[0],e[1]):eC(e):vC(e)}function EC(e,t){return function(n,r){var i=mt(n)?jE:IT,o={};return i(n,e,SC(r),o)}}var ni=EC(function(e,t,n){IE(e,n,t)}),TC=0;function wC(e){var t=++TC;return $h(e)+t}const Ds=[{id:"0.1",mm:.1,degrees:.05},{id:"1",mm:1,degrees:.5},{id:"5",mm:5,degrees:2.5},{id:"10",mm:10,degrees:5}],CC=[{id:"continuous"},...Ds],MC=["coordsys","tool"];var $s=(e=>(e.REVOLUTE="REVOLUTE",e.PRISMATIC="PRISMATIC",e))($s||{});class ko{constructor(t,n,r,i){var o,s;this.jogger=t,this.coordSystems=n,this.motionGroupDescription=r,this.tcps=i,this.selectedTabId="cartesian",this.activationState="inactive",this.activationError=null,this.activationCounter=0,this.locks=new Set,this.blocked=!1,this.selectedCoordSystemId="world",this.selectedTcpId="",this.selectedOrientation="coordsys",this.selectedIncrementId="continuous",this.selectedCartesianMotionType="translate",this.incrementJogInProgress=null,this.translationVelocityMmPerSec=10,this.rotationVelocityDegPerSec=1,this.minTranslationVelocityMmPerSec=5,this.maxTranslationVelocityMmPerSec=250,this.minRotationVelocityDegPerSec=1,this.maxRotationVelocityDegPerSec=60,this.showCoordSystemSelect=!1,this.showTcpSelect=!0,this.showOrientationSelect=!0,this.showIncrementSelect=!0,this.showTabIcons=!1,this.showVelocitySliderLabel=!0,this.showVelocityLegend=!1,this.showJointsLegend=!1,this.disposers=[];for(const a of n)if(a.coordinate_system===""){a.coordinate_system="world";break}this.selectedCoordSystemId=((o=n[0])==null?void 0:o.coordinate_system)||"world",this.selectedTcpId=((s=i[0])==null?void 0:s.id)||"",ce.makeAutoObservable(this,{},{autoBind:!0}),this.jogger.onBlocked=()=>{this.block()},this.loadFromLocalStorage(),this.disposers.push(ce.autorun(()=>this.saveToLocalStorage())),window.joggingStore=this}static async loadFor(t){const{nova:n}=t,[r,i]=await Promise.all([n.api.controller.listCoordinateSystems(t.motionStream.controllerId,"ROTATION_VECTOR"),n.api.motionGroup.getMotionGroupDescription(t.motionStream.controllerId,t.motionGroupId)]),o=Object.entries(i.tcps||{}).map(([s,a])=>({id:s,readable_name:a.name,position:a.pose.position,orientation:a.pose.orientation}));return new ko(t,r||[],i,o)}dispose(){for(const t of this.disposers)t();this.jogger.dispose()}get coordSystemCountByName(){return Ns.countBy(this.coordSystems,t=>t.name)}async deactivate(){if(this.jogger.mode==="jogging")return this.jogger.stop()}async activate(){return this.currentTab.id==="cartesian"?((this.jogger.tcp!==this.selectedTcpId||this.jogger.orientation!==this.selectedOrientation)&&this.jogger.setOptions({tcp:this.selectedTcpId,orientation:this.selectedOrientation}),this.activeDiscreteIncrement?this.jogger.setJoggingMode("trajectory"):this.jogger.setJoggingMode("jogging")):this.jogger.setJoggingMode("jogging"),this.jogger}loadFromLocalStorage(){const t=Ie.tryParseJson(localStorage.getItem("joggingToolStore"));t&&(this.tabsById[t.selectedTabId]&&(this.selectedTabId=t.selectedTabId),this.coordSystemsById[t.selectedCoordSystemId]&&(this.selectedCoordSystemId=t.selectedCoordSystemId),this.tcpsById[t.selectedTcpId]&&(this.selectedTcpId=t.selectedTcpId),this.incrementOptionsById[t.selectedIncrementId]&&(this.selectedIncrementId=t.selectedIncrementId),["translate","rotate"].includes(t.selectedCartesianMotionType)&&(this.selectedCartesianMotionType=t.selectedCartesianMotionType),["coordsys","tool"].includes(t.selectedOrientation)&&(this.selectedOrientation=t.selectedOrientation))}saveToLocalStorage(){localStorage.setItem("joggingToolStore",JSON.stringify(this.localStorageSave))}get isLocked(){return this.locks.size>0}get localStorageSave(){return{selectedTabId:this.selectedTabId,selectedCoordSystemId:this.selectedCoordSystemId,selectedTcpId:this.selectedTcpId,selectedOrientation:this.selectedOrientation,selectedIncrementId:this.selectedIncrementId,selectedCartesianMotionType:this.selectedCartesianMotionType}}get tabs(){const t=[{id:"joint",label:"Joints"}];return this.isTcpCartesianMoveable&&t.unshift({id:"cartesian",label:"Cartesian"}),t}get incrementOptions(){return CC}get discreteIncrementOptions(){return Ds}get incrementOptionsById(){return ni(this.incrementOptions,t=>t.id)}get tabsById(){return ni(this.tabs,t=>t.id)}get currentTab(){return this.tabsById[this.selectedTabId]||this.tabs[0]}get tabIndex(){return this.tabs.indexOf(this.currentTab)}get coordSystemsById(){return ni(this.coordSystems,t=>t.coordinate_system)}get selectedCoordSystem(){return this.coordSystemsById[this.selectedCoordSystemId]}get activeCoordSystemId(){return this.selectedOrientation==="tool"?"tool":this.selectedCoordSystemId}get tcpsById(){return ni(this.tcps,t=>t.id)}get activeDiscreteIncrement(){return this.selectedOrientation==="tool"?void 0:Ds.find(t=>t.id===this.selectedIncrementId)}get rotationVelocityRadsPerSec(){return this.rotationVelocityDegPerSec*Math.PI/180}get velocityInDisplayUnits(){return this.currentMotionType==="translate"?this.translationVelocityMmPerSec:this.rotationVelocityDegPerSec}get minVelocityInDisplayUnits(){return this.currentMotionType==="translate"?this.minTranslationVelocityMmPerSec:this.minRotationVelocityDegPerSec}get maxVelocityInDisplayUnits(){return this.currentMotionType==="translate"?this.maxTranslationVelocityMmPerSec:this.maxRotationVelocityDegPerSec}get currentMotionType(){return this.selectedTabId==="cartesian"&&this.selectedCartesianMotionType==="translate"||this.jointCategory==="PRISMATIC"?"translate":"rotate"}get jointCategory(){return this.motionGroupDescription.motion_group_model==="ABB_IRT710"?"PRISMATIC":"REVOLUTE"}get isTcpCartesianMoveable(){return this.motionGroupDescription.motion_group_model!=="ABB_IRT710"}onTabChange(t,n){const r=this.tabs[n]||this.tabs[0];this.selectedTabId=r.id}setSelectedCoordSystemId(t){this.selectedCoordSystemId=t}setSelectedTcpId(t){this.selectedTcpId=t}setSelectedOrientation(t){this.selectedOrientation=t}setSelectedIncrementId(t){this.selectedIncrementId=t}setCurrentIncrementJog(t){this.incrementJogInProgress=t}setVelocityFromSlider(t){this.currentMotionType==="translate"?this.translationVelocityMmPerSec=t:this.rotationVelocityDegPerSec=t}setSelectedCartesianMotionType(t){this.selectedCartesianMotionType=t}lock(t){this.locks.add(t)}unlock(t){this.locks.delete(t)}block(){this.blocked=!0}unblock(){this.blocked=!1,this.jogger.mode==="jogging"&&this.jogger.initializeJoggingWebsocket()}async withMotionLock(t){const n=wC();this.lock(n);try{return await t()}finally{this.unlock(n)}}}const RC=ie.observer(({store:e})=>{const{t}=de.useTranslation();return g.jsxRuntimeExports.jsx(M.Backdrop,{open:!0,sx:{position:"absolute",zIndex:n=>n.zIndex.drawer+1,color:"#fff",background:"rgba(15, 15, 15, 0.88)",justifyContent:"flex-start",alignItems:"flex-start"},children:g.jsxRuntimeExports.jsxs(M.Stack,{sx:{m:2,width:"100%"},children:[g.jsxRuntimeExports.jsxs(M.Alert,{severity:"error",sx:{mb:2},children:[g.jsxRuntimeExports.jsx(M.AlertTitle,{children:t("Jogging.Blocked.ti")}),t("Jogging.Blocked.lb")]}),g.jsxRuntimeExports.jsx(M.Button,{variant:"contained",color:"secondary",onClick:()=>e.unblock(),children:t("Jogging.Blocked.Reenable.bt")})]})})});function AC(e,t){return Io(e,t)}const zh=({store:e})=>{const{t}=de.useTranslation(),[n,r]=D.useState(e.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached),i=D.useRef(n);g.useAnimationFrame(()=>{const s=e.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached;AC(i.current,s)||(i.current=s,r(s))});const o=[];for(const[s,a]of n.entries())a&&o.push(s);return g.jsxRuntimeExports.jsx(M.Typography,{color:"error",sx:{margin:"0.5rem 1rem",textAlign:"center",minHeight:"1.5rem",visibility:o.length?"visible":"hidden"},children:t("Jogging.JointLimitsReached.lb",{jointNumbers:o.map(s=>s+1).join(", ")})})},_C=M.styled(M.FormControl)(({theme:e})=>({"&.MuiFormControl-root":{".MuiSelect-select":{paddingTop:"20px",paddingLeft:"12px"},label:{pointerEvents:"none",fontSize:"16px"},".MuiInputLabel-root":{"&.Mui-focused":{color:e.palette.text.primary}}}}));function ri({labelValue:e,...t}){return g.jsxRuntimeExports.jsxs(_C,{fullWidth:!0,variant:"filled",children:[g.jsxRuntimeExports.jsx(M.InputLabel,{id:t.labelId,children:e}),g.jsxRuntimeExports.jsx(M.Select,{...t})]})}const IC=ie.observer(({store:e})=>{var o;const{t}=de.useTranslation(),n=D.useId(),r=[];function i(s){switch(s){case"coordsys":return t("Jogging.Orientation.coordsys");case"tool":return t("Jogging.Orientation.tool");default:return s}}return e.showCoordSystemSelect&&r.push(g.jsxRuntimeExports.jsx(ri,{labelId:`jogging-coord-select-${n}`,labelValue:t("Jogging.CoordinateSystem.hlb"),value:e.selectedCoordSystemId,size:"small",variant:"filled",displayEmpty:!0,onChange:s=>e.setSelectedCoordSystemId(s.target.value),disabled:e.isLocked,children:e.coordSystems.map(s=>g.jsxRuntimeExports.jsx(M.MenuItem,{value:s.coordinate_system,children:s.name&&e.coordSystemCountByName[s.name]>1?`${s.name} / ${s.coordinate_system}`:s.name||s.coordinate_system},s.coordinate_system))},"coord")),e.showTcpSelect&&r.push(g.jsxRuntimeExports.jsx(ri,{labelId:`jogging-tcp-select-${n}`,labelValue:"TCP",value:e.selectedTcpId,size:"small",variant:"filled",onChange:s=>e.setSelectedTcpId(s.target.value),disabled:e.isLocked,children:e.tcps.map(s=>g.jsxRuntimeExports.jsx(M.MenuItem,{value:s.id,children:s.id},s.id))},"tcp")),e.showOrientationSelect&&r.push(g.jsxRuntimeExports.jsx(ri,{labelValue:t("Jogging.Cartesian.Orientation.lb"),labelId:`orientation-select-${n}`,value:e.selectedOrientation,onChange:s=>e.setSelectedOrientation(s.target.value),disabled:e.isLocked,children:MC.map(s=>g.jsxRuntimeExports.jsx(M.MenuItem,{value:s,children:i(s)},s))},"orientation")),e.showIncrementSelect&&r.push(g.jsxRuntimeExports.jsxs(ri,{labelValue:t("Jogging.Increment.hlb"),labelId:`jogging-increment-select-${n}`,size:"small",variant:"filled",value:((o=e.activeDiscreteIncrement)==null?void 0:o.id)||"continuous",onChange:s=>e.setSelectedIncrementId(s.target.value),disabled:e.isLocked,children:[g.jsxRuntimeExports.jsx(M.MenuItem,{value:"continuous",children:t("Jogging.Increment.Continuous.dd")},"continuous"),e.selectedOrientation==="tool"?null:e.discreteIncrementOptions.map(s=>g.jsxRuntimeExports.jsx(M.MenuItem,{value:s.id,children:e.currentMotionType==="translate"?`${s.mm}mm`:`${s.degrees}°`},s.id))]},"increment")),g.jsxRuntimeExports.jsx(M.Box,{component:"div",sx:{display:"grid",gap:"16px",gridTemplateColumns:"1fr 1fr",gridAutoRows:"min-content","& label":{opacity:.7,fontSize:"12px",marginBottom:"4px"}},children:r.map((s,a)=>g.jsxRuntimeExports.jsx(M.Box,{sx:{gridColumn:r.length%2===1&&a===r.length-1?"span 2":"auto"},children:s},a))})}),jC=M.styled(M.ToggleButtonGroup)(({theme:e})=>{var t;return{"&.MuiToggleButtonGroup-root":{background:(t=e.palette.backgroundPaperElevation)==null?void 0:t[8],borderRadius:"8px",padding:"4px",gap:"4px",button:{border:"none",borderRadius:"4px",flex:"1 1 0px",minWidth:0,"&.MuiToggleButtonGroup-firstButton":{borderRadius:"8px 4px 4px 8px"},"&.MuiToggleButtonGroup-lastButton":{borderRadius:"4px 8px 8px 4px"}}}}});function ac(e,t){return process.env.NODE_ENV==="production"?()=>null:function(...r){return e(...r)||t(...r)}}function ur(e){return typeof e=="string"}function kC(e,t,n){return e===void 0||ur(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function di(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function lc(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function OC(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){const f=Ne(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),m={...n==null?void 0:n.style,...i==null?void 0:i.style,...r==null?void 0:r.style},p={...n,...i,...r};return f.length>0&&(p.className=f),Object.keys(m).length>0&&(p.style=m),{props:p,internalRef:void 0}}const s=di({...i,...r}),a=lc(r),l=lc(i),u=t(s),c=Ne(u==null?void 0:u.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),d={...u==null?void 0:u.style,...n==null?void 0:n.style,...i==null?void 0:i.style,...r==null?void 0:r.style},h={...u,...n,...l,...a};return c.length>0&&(h.className=c),Object.keys(d).length>0&&(h.style=d),{props:h,internalRef:u.ref}}function PC(e,t,n){return typeof e=="function"?e(t,n):e}function Pt(e){var d;const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...o}=e,s=i?{}:PC(n,r),{props:a,internalRef:l}=OC({...o,externalSlotProps:s}),u=Qi(l,s==null?void 0:s.ref,(d=e.additionalProps)==null?void 0:d.ref);return kC(t,{...a,ref:u},r)}function uc(e){try{return e.matches(":focus-visible")}catch{process.env.NODE_ENV!=="production"&&!window.navigator.userAgent.includes("jsdom")&&console.warn(["MUI: The `:focus-visible` pseudo class is not supported in this browser.","Some components rely on this feature to work properly."].join(`
|
|
112
|
-
`))}return!1}const DC={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function $C(e,t,n=(r,i)=>r===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}const NC=2;function _n(e,t,n,r,i){return n===1?Math.min(e+t,i):Math.max(e-t,r)}function Fh(e,t){return e-t}function cc(e,t){const{index:n}=e.reduce((r,i,o)=>{const s=Math.abs(t-i);return r===null||s<r.distance||s===r.distance?{distance:s,index:o}:r},null)??{};return n}function ii(e,t){if(t.current!==void 0&&e.changedTouches){const n=e;for(let r=0;r<n.changedTouches.length;r+=1){const i=n.changedTouches[r];if(i.identifier===t.current)return{x:i.clientX,y:i.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function $i(e,t,n){return(e-t)*100/(n-t)}function LC(e,t,n){return(n-t)*e+t}function zC(e){if(Math.abs(e)<1){const n=e.toExponential().split("e-"),r=n[0].split(".")[1];return(r?r.length:0)+parseInt(n[1],10)}const t=e.toString().split(".")[1];return t?t.length:0}function FC(e,t,n){const r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(zC(t)))}function dc({values:e,newValue:t,index:n}){const r=e.slice();return r[n]=t,r.sort(Fh)}function oi({sliderRef:e,activeIndex:t,setActive:n}){var i,o,s;const r=sr(e.current);(!((i=e.current)!=null&&i.contains(r.activeElement))||Number((o=r==null?void 0:r.activeElement)==null?void 0:o.getAttribute("data-index"))!==t)&&((s=e.current)==null||s.querySelector(`[type="range"][data-index="${t}"]`).focus()),n&&n(t)}function si(e,t){return typeof e=="number"&&typeof t=="number"?e===t:typeof e=="object"&&typeof t=="object"?$C(e,t):!1}const BC={horizontal:{offset:e=>({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},GC=e=>e;let ai;function hc(){return ai===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?ai=CSS.supports("touch-action","none"):ai=!0),ai}function UC(e){const{"aria-labelledby":t,defaultValue:n,disabled:r=!1,disableSwap:i=!1,isRtl:o=!1,marks:s=!1,max:a=100,min:l=0,name:u,onChange:c,onChangeCommitted:d,orientation:h="horizontal",rootRef:f,scale:m=GC,step:p=1,shiftStep:y=10,tabIndex:b,value:E}=e,T=O.useRef(void 0),[w,C]=O.useState(-1),[S,R]=O.useState(-1),[I,k]=O.useState(!1),z=O.useRef(0),P=O.useRef(null),[v,_]=OS({controlled:E,default:n??l,name:"Slider"}),A=c&&((N,U,H)=>{const ee=N.nativeEvent||N,ue=new ee.constructor(ee.type,ee);Object.defineProperty(ue,"target",{writable:!0,value:{value:U,name:u}}),P.current=U,c(ue,U,H)}),B=Array.isArray(v);let G=B?v.slice().sort(Fh):[v];G=G.map(N=>N==null?l:In(N,l,a));const Z=s===!0&&p!==null?[...Array(Math.floor((a-l)/p)+1)].map((N,U)=>({value:l+p*U})):s||[],Y=Z.map(N=>N.value),[te,we]=O.useState(-1),V=O.useRef(null),xe=Qi(f,V),Pe=N=>U=>{var ee;const H=Number(U.currentTarget.getAttribute("data-index"));uc(U.target)&&we(H),R(H),(ee=N==null?void 0:N.onFocus)==null||ee.call(N,U)},xt=N=>U=>{var H;uc(U.target)||we(-1),R(-1),(H=N==null?void 0:N.onBlur)==null||H.call(N,U)},ke=(N,U)=>{const H=Number(N.currentTarget.getAttribute("data-index")),ee=G[H],ue=Y.indexOf(ee);let K=U;if(Z&&p==null){const Me=Y[Y.length-1];K>=Me?K=Me:K<=Y[0]?K=Y[0]:K=K<ee?Y[ue-1]:Y[ue+1]}if(K=In(K,l,a),B){i&&(K=In(K,G[H-1]||-1/0,G[H+1]||1/0));const Me=K;K=dc({values:G,newValue:K,index:H});let De=H;i||(De=K.indexOf(Me)),oi({sliderRef:V,activeIndex:De})}_(K),we(H),A&&!si(K,v)&&A(N,K,H),d&&d(N,P.current??K)},bt=N=>U=>{var H;if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(U.key)){U.preventDefault();const ee=Number(U.currentTarget.getAttribute("data-index")),ue=G[ee];let K=null;if(p!=null){const Me=U.shiftKey?y:p;switch(U.key){case"ArrowUp":K=_n(ue,Me,1,l,a);break;case"ArrowRight":K=_n(ue,Me,o?-1:1,l,a);break;case"ArrowDown":K=_n(ue,Me,-1,l,a);break;case"ArrowLeft":K=_n(ue,Me,o?1:-1,l,a);break;case"PageUp":K=_n(ue,y,1,l,a);break;case"PageDown":K=_n(ue,y,-1,l,a);break;case"Home":K=l;break;case"End":K=a;break}}else if(Z){const Me=Y[Y.length-1],De=Y.indexOf(ue),ve=[o?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],He=[o?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];ve.includes(U.key)?De===0?K=Y[0]:K=Y[De-1]:He.includes(U.key)&&(De===Y.length-1?K=Me:K=Y[De+1])}K!=null&&ke(U,K)}(H=N==null?void 0:N.onKeyDown)==null||H.call(N,U)};ot(()=>{var N;r&&V.current.contains(document.activeElement)&&((N=document.activeElement)==null||N.blur())},[r]),r&&w!==-1&&C(-1),r&&te!==-1&&we(-1);const st=N=>U=>{var H;(H=N.onChange)==null||H.call(N,U),ke(U,U.target.valueAsNumber)},Ue=O.useRef(void 0);let F=h;o&&h==="horizontal"&&(F+="-reverse");const q=({finger:N,move:U=!1})=>{const{current:H}=V,{width:ee,height:ue,bottom:K,left:Me}=H.getBoundingClientRect();let De;F.startsWith("vertical")?De=(K-N.y)/ue:De=(N.x-Me)/ee,F.includes("-reverse")&&(De=1-De);let ve;if(ve=LC(De,l,a),p)ve=FC(ve,p,l);else{const qn=cc(Y,ve);ve=Y[qn]}ve=In(ve,l,a);let He=0;if(B){U?He=Ue.current:He=cc(G,ve),i&&(ve=In(ve,G[He-1]||-1/0,G[He+1]||1/0));const qn=ve;ve=dc({values:G,newValue:ve,index:He}),i&&U||(He=ve.indexOf(qn),Ue.current=He)}return{newValue:ve,activeIndex:He}},X=Ye(N=>{const U=ii(N,T);if(!U)return;if(z.current+=1,N.type==="mousemove"&&N.buttons===0){$(N);return}const{newValue:H,activeIndex:ee}=q({finger:U,move:!0});oi({sliderRef:V,activeIndex:ee,setActive:C}),_(H),!I&&z.current>NC&&k(!0),A&&!si(H,v)&&A(N,H,ee)}),$=Ye(N=>{const U=ii(N,T);if(k(!1),!U)return;const{newValue:H}=q({finger:U,move:!0});C(-1),N.type==="touchend"&&R(-1),d&&d(N,P.current??H),T.current=void 0,Q()}),re=Ye(N=>{if(r)return;hc()||N.preventDefault();const U=N.changedTouches[0];U!=null&&(T.current=U.identifier);const H=ii(N,T);if(H!==!1){const{newValue:ue,activeIndex:K}=q({finger:H});oi({sliderRef:V,activeIndex:K,setActive:C}),_(ue),A&&!si(ue,v)&&A(N,ue,K)}z.current=0;const ee=sr(V.current);ee.addEventListener("touchmove",X,{passive:!0}),ee.addEventListener("touchend",$,{passive:!0})}),Q=O.useCallback(()=>{const N=sr(V.current);N.removeEventListener("mousemove",X),N.removeEventListener("mouseup",$),N.removeEventListener("touchmove",X),N.removeEventListener("touchend",$)},[$,X]);O.useEffect(()=>{const{current:N}=V;return N.addEventListener("touchstart",re,{passive:hc()}),()=>{N.removeEventListener("touchstart",re),Q()}},[Q,re]),O.useEffect(()=>{r&&Q()},[r,Q]);const Ae=N=>U=>{var ue;if((ue=N.onMouseDown)==null||ue.call(N,U),r||U.defaultPrevented||U.button!==0)return;U.preventDefault();const H=ii(U,T);if(H!==!1){const{newValue:K,activeIndex:Me}=q({finger:H});oi({sliderRef:V,activeIndex:Me,setActive:C}),_(K),A&&!si(K,v)&&A(U,K,Me)}z.current=0;const ee=sr(V.current);ee.addEventListener("mousemove",X,{passive:!0}),ee.addEventListener("mouseup",$)},Ce=$i(B?G[0]:l,l,a),pe=$i(G[G.length-1],l,a)-Ce,kt=(N={})=>{const U=di(N),H={onMouseDown:Ae(U||{})},ee={...U,...H};return{...N,ref:xe,...ee}},jr=N=>U=>{var ee;(ee=N.onMouseOver)==null||ee.call(N,U);const H=Number(U.currentTarget.getAttribute("data-index"));R(H)},kr=N=>U=>{var H;(H=N.onMouseLeave)==null||H.call(N,U),R(-1)},Or=(N={})=>{const U=di(N),H={onMouseOver:jr(U||{}),onMouseLeave:kr(U||{})};return{...N,...U,...H}},Pr=N=>({pointerEvents:w!==-1&&w!==N?"none":void 0});let vn;return h==="vertical"&&(vn=o?"vertical-rl":"vertical-lr"),{active:w,axis:F,axisProps:BC,dragging:I,focusedThumbIndex:te,getHiddenInputProps:(N={})=>{const U=di(N),H={onChange:st(U||{}),onFocus:Pe(U||{}),onBlur:xt(U||{}),onKeyDown:bt(U||{})},ee={...U,...H};return{tabIndex:b,"aria-labelledby":t,"aria-orientation":h,"aria-valuemax":m(a),"aria-valuemin":m(l),name:u,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":e.step??void 0,disabled:r,...N,...ee,style:{...DC,direction:o?"rtl":"ltr",width:"100%",height:"100%",writingMode:vn}}},getRootProps:kt,getThumbProps:Or,marks:Z,open:S,range:B,rootRef:xe,trackLeap:pe,trackOffset:Ce,values:G,getThumbStyle:Pr}}const VC=e=>!e||!ur(e);function YC(e){return typeof e.main=="string"}function WC(e,t=[]){if(!YC(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function Wa(e=[]){return([,t])=>t&&WC(t,e)}function HC(e){return hn("MuiSlider",e)}const Xe=Ki("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),qC=e=>{const{open:t}=e;return{offset:Ne(t&&Xe.valueLabelOpen),circle:Xe.valueLabelCircle,label:Xe.valueLabelLabel}};function Bh(e){const{children:t,className:n,value:r}=e,i=qC(e);return t?O.cloneElement(t,{className:t.props.className},g.jsxRuntimeExports.jsxs(O.Fragment,{children:[t.props.children,g.jsxRuntimeExports.jsx("span",{className:Ne(i.offset,n),"aria-hidden":!0,children:g.jsxRuntimeExports.jsx("span",{className:i.circle,children:g.jsxRuntimeExports.jsx("span",{className:i.label,children:r})})})]})):null}process.env.NODE_ENV!=="production"&&(Bh.propTypes={children:x.element.isRequired,className:x.string,value:x.node});function fc(e){return e}const KC=We("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${$e(n.color)}`],n.size!=="medium"&&t[`size${$e(n.size)}`],n.marked&&t.marked,n.orientation==="vertical"&&t.vertical,n.track==="inverted"&&t.trackInverted,n.track===!1&&t.trackFalse]}})(gn(({theme:e})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${Xe.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${Xe.dragging}`]:{[`& .${Xe.thumb}, & .${Xe.track}`]:{transition:"none"}},variants:[...Object.entries(e.palette).filter(Wa()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}))),JC=We("span",{name:"MuiSlider",slot:"Rail"})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),XC=We("span",{name:"MuiSlider",slot:"Track"})(gn(({theme:e})=>({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:e.transitions.create(["left","width","bottom","height"],{duration:e.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.entries(e.palette).filter(Wa()).map(([t])=>({props:{color:t,track:"inverted"},style:{...e.vars?{backgroundColor:e.vars.palette.Slider[`${t}Track`],borderColor:e.vars.palette.Slider[`${t}Track`]}:{backgroundColor:e.lighten(e.palette[t].main,.62),borderColor:e.lighten(e.palette[t].main,.62),...e.applyStyles("dark",{backgroundColor:e.darken(e.palette[t].main,.5)}),...e.applyStyles("dark",{borderColor:e.darken(e.palette[t].main,.5)})}}}))]}))),ZC=We("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.thumb,t[`thumbColor${$e(n.color)}`],n.size!=="medium"&&t[`thumbSize${$e(n.size)}`]]}})(gn(({theme:e})=>({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow","left","bottom"],{duration:e.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(e.vars||e).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${Xe.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.entries(e.palette).filter(Wa()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${Xe.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.alpha((e.vars||e).palette[t].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${Xe.active}`]:{boxShadow:`0px 0px 0px 14px ${e.alpha((e.vars||e).palette[t].main,.16)}`}}}))]}))),Gh=We(Bh,{name:"MuiSlider",slot:"ValueLabel"})(gn(({theme:e})=>({zIndex:1,whiteSpace:"nowrap",...e.typography.body2,fontWeight:500,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),position:"absolute",backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${Xe.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${Xe.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:e.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]})));process.env.NODE_ENV!=="production"&&(Gh.propTypes={children:x.element.isRequired,index:x.number.isRequired,open:x.bool.isRequired,value:x.node});const QC=We("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>Us(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:n}=e;return[t.mark,n&&t.markActive]}})(gn(({theme:e})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8}}]}))),eM=We("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>Us(e)&&e!=="markLabelActive"})(gn(({theme:e})=>({...e.typography.body2,color:(e.vars||e).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(e.vars||e).palette.text.primary}}]}))),tM=e=>{const{disabled:t,dragging:n,marked:r,orientation:i,track:o,classes:s,color:a,size:l}=e,u={root:["root",t&&"disabled",n&&"dragging",r&&"marked",i==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",a&&`color${$e(a)}`,l&&`size${$e(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${$e(l)}`,a&&`thumbColor${$e(a)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Sr(u,HC,s)},nM=({children:e})=>e,Uh=O.forwardRef(function(t,n){const r=za({props:t,name:"MuiSlider"}),i=zp(),{"aria-label":o,"aria-valuetext":s,"aria-labelledby":a,component:l="span",components:u={},componentsProps:c={},color:d="primary",classes:h,className:f,disableSwap:m=!1,disabled:p=!1,getAriaLabel:y,getAriaValueText:b,marks:E=!1,max:T=100,min:w=0,name:C,onChange:S,onChangeCommitted:R,orientation:I="horizontal",shiftStep:k=10,size:z="medium",step:P=1,scale:v=fc,slotProps:_,slots:A,tabIndex:B,track:G="normal",value:Z,valueLabelDisplay:Y="off",valueLabelFormat:te=fc,...we}=r,V={...r,isRtl:i,max:T,min:w,classes:h,disabled:p,disableSwap:m,orientation:I,marks:E,color:d,size:z,step:P,shiftStep:k,scale:v,track:G,valueLabelDisplay:Y,valueLabelFormat:te},{axisProps:xe,getRootProps:Pe,getHiddenInputProps:xt,getThumbProps:ke,open:bt,active:st,axis:Ue,focusedThumbIndex:F,range:q,dragging:X,marks:$,values:re,trackOffset:Q,trackLeap:Ae,getThumbStyle:Ce}=UC({...V,rootRef:n});V.marked=$.length>0&&$.some(be=>be.label),V.dragging=X,V.focusedThumbIndex=F;const pe=tM(V),kt=(A==null?void 0:A.root)??u.Root??KC,jr=(A==null?void 0:A.rail)??u.Rail??JC,kr=(A==null?void 0:A.track)??u.Track??XC,Or=(A==null?void 0:A.thumb)??u.Thumb??ZC,Pr=(A==null?void 0:A.valueLabel)??u.ValueLabel??Gh,vn=(A==null?void 0:A.mark)??u.Mark??QC,Dr=(A==null?void 0:A.markLabel)??u.MarkLabel??eM,N=(A==null?void 0:A.input)??u.Input??"input",U=(_==null?void 0:_.root)??c.root,H=(_==null?void 0:_.rail)??c.rail,ee=(_==null?void 0:_.track)??c.track,ue=(_==null?void 0:_.thumb)??c.thumb,K=(_==null?void 0:_.valueLabel)??c.valueLabel,Me=(_==null?void 0:_.mark)??c.mark,De=(_==null?void 0:_.markLabel)??c.markLabel,ve=(_==null?void 0:_.input)??c.input,He=Pt({elementType:kt,getSlotProps:Pe,externalSlotProps:U,externalForwardedProps:we,additionalProps:{...VC(kt)&&{as:l}},ownerState:{...V,...U==null?void 0:U.ownerState},className:[pe.root,f]}),qn=Pt({elementType:jr,externalSlotProps:H,ownerState:V,className:pe.rail}),Xh=Pt({elementType:kr,externalSlotProps:ee,additionalProps:{style:{...xe[Ue].offset(Q),...xe[Ue].leap(Ae)}},ownerState:{...V,...ee==null?void 0:ee.ownerState},className:pe.track}),Oo=Pt({elementType:Or,getSlotProps:ke,externalSlotProps:ue,ownerState:{...V,...ue==null?void 0:ue.ownerState},className:pe.thumb}),Zh=Pt({elementType:Pr,externalSlotProps:K,ownerState:{...V,...K==null?void 0:K.ownerState},className:pe.valueLabel}),Po=Pt({elementType:vn,externalSlotProps:Me,ownerState:V,className:pe.mark}),Do=Pt({elementType:Dr,externalSlotProps:De,ownerState:V,className:pe.markLabel}),Qh=Pt({elementType:N,getSlotProps:xt,externalSlotProps:ve,ownerState:V});return g.jsxRuntimeExports.jsxs(kt,{...He,children:[g.jsxRuntimeExports.jsx(jr,{...qn}),g.jsxRuntimeExports.jsx(kr,{...Xh}),$.filter(be=>be.value>=w&&be.value<=T).map((be,_e)=>{const $o=$i(be.value,w,T),$r=xe[Ue].offset($o);let vt;return G===!1?vt=re.includes(be.value):vt=G==="normal"&&(q?be.value>=re[0]&&be.value<=re[re.length-1]:be.value<=re[0])||G==="inverted"&&(q?be.value<=re[0]||be.value>=re[re.length-1]:be.value>=re[0]),g.jsxRuntimeExports.jsxs(O.Fragment,{children:[g.jsxRuntimeExports.jsx(vn,{"data-index":_e,...Po,...!ur(vn)&&{markActive:vt},style:{...$r,...Po.style},className:Ne(Po.className,vt&&pe.markActive)}),be.label!=null?g.jsxRuntimeExports.jsx(Dr,{"aria-hidden":!0,"data-index":_e,...Do,...!ur(Dr)&&{markLabelActive:vt},style:{...$r,...Do.style},className:Ne(pe.markLabel,Do.className,vt&&pe.markLabelActive),children:be.label}):null]},_e)}),re.map((be,_e)=>{const $o=$i(be,w,T),$r=xe[Ue].offset($o),vt=Y==="off"?nM:Pr;return g.jsxRuntimeExports.jsx(vt,{...!ur(vt)&&{valueLabelFormat:te,valueLabelDisplay:Y,value:typeof te=="function"?te(v(be),_e):te,index:_e,open:bt===_e||st===_e||Y==="on",disabled:p},...Zh,children:g.jsxRuntimeExports.jsx(Or,{"data-index":_e,...Oo,className:Ne(pe.thumb,Oo.className,st===_e&&pe.active,F===_e&&pe.focusVisible),style:{...$r,...Ce(_e),...Oo.style},children:g.jsxRuntimeExports.jsx(N,{"data-index":_e,"aria-label":y?y(_e):o,"aria-valuenow":v(be),"aria-labelledby":a,"aria-valuetext":b?b(v(be),_e):s,value:re[_e],...Qh})})},_e)})]})});process.env.NODE_ENV!=="production"&&(Uh.propTypes={"aria-label":ac(x.string,e=>Array.isArray(e.value||e.defaultValue)&&e["aria-label"]!=null?new Error("MUI: You need to use the `getAriaLabel` prop instead of `aria-label` when using a range slider."):null),"aria-labelledby":x.string,"aria-valuetext":ac(x.string,e=>Array.isArray(e.value||e.defaultValue)&&e["aria-valuetext"]!=null?new Error("MUI: You need to use the `getAriaValueText` prop instead of `aria-valuetext` when using a range slider."):null),children:x.node,classes:x.object,className:x.string,color:x.oneOfType([x.oneOf(["primary","secondary","error","info","success","warning"]),x.string]),components:x.shape({Input:x.elementType,Mark:x.elementType,MarkLabel:x.elementType,Rail:x.elementType,Root:x.elementType,Thumb:x.elementType,Track:x.elementType,ValueLabel:x.elementType}),componentsProps:x.shape({input:x.oneOfType([x.func,x.object]),mark:x.oneOfType([x.func,x.object]),markLabel:x.oneOfType([x.func,x.object]),rail:x.oneOfType([x.func,x.object]),root:x.oneOfType([x.func,x.object]),thumb:x.oneOfType([x.func,x.object]),track:x.oneOfType([x.func,x.object]),valueLabel:x.oneOfType([x.func,x.shape({children:x.element,className:x.string,open:x.bool,style:x.object,value:x.node,valueLabelDisplay:x.oneOf(["auto","off","on"])})])}),defaultValue:x.oneOfType([x.arrayOf(x.number),x.number]),disabled:x.bool,disableSwap:x.bool,getAriaLabel:x.func,getAriaValueText:x.func,marks:x.oneOfType([x.arrayOf(x.shape({label:x.node,value:x.number.isRequired})),x.bool]),max:x.number,min:x.number,name:x.string,onChange:x.func,onChangeCommitted:x.func,orientation:x.oneOf(["horizontal","vertical"]),scale:x.func,shiftStep:x.number,size:x.oneOfType([x.oneOf(["small","medium"]),x.string]),slotProps:x.shape({input:x.oneOfType([x.func,x.object]),mark:x.oneOfType([x.func,x.object]),markLabel:x.oneOfType([x.func,x.object]),rail:x.oneOfType([x.func,x.object]),root:x.oneOfType([x.func,x.object]),thumb:x.oneOfType([x.func,x.object]),track:x.oneOfType([x.func,x.object]),valueLabel:x.oneOfType([x.func,x.shape({children:x.element,className:x.string,open:x.bool,style:x.object,value:x.node,valueLabelDisplay:x.oneOf(["auto","off","on"])})])}),slots:x.shape({input:x.elementType,mark:x.elementType,markLabel:x.elementType,rail:x.elementType,root:x.elementType,thumb:x.elementType,track:x.elementType,valueLabel:x.elementType}),step:x.number,sx:x.oneOfType([x.arrayOf(x.oneOfType([x.func,x.object,x.bool])),x.func,x.object]),tabIndex:x.number,track:x.oneOf(["inverted","normal",!1]),value:x.oneOfType([x.arrayOf(x.number),x.number]),valueLabelDisplay:x.oneOf(["auto","off","on"]),valueLabelFormat:x.oneOfType([x.func,x.string])});var rM="[object Number]";function iM(e){return typeof e=="number"||cn(e)&&yn(e)==rM}const Vh=ie.observer(e=>{var o,s,a;const t=M.useTheme(),{store:n}=e,{t:r}=de.useTranslation();function i(l,u){u===e.velocity||!iM(u)||e.onVelocityChange(u)}return g.jsxRuntimeExports.jsxs(M.Stack,{direction:"row",gap:2,alignItems:"center",children:[n.showVelocityLegend&&g.jsxRuntimeExports.jsx(M.Typography,{sx:{color:(a=(s=(o=t.componentsExt)==null?void 0:o.JoggingPanel)==null?void 0:s.VelocitySlider)==null?void 0:a.sliderLegendColor,fontSize:"14px"},children:r("Jogging.Velocity.bt")}),g.jsxRuntimeExports.jsx(Uh,{value:e.velocity,color:"secondary",onChange:i,min:e.min,max:e.max,"aria-labelledby":"input-slider",disabled:e.disabled,sx:{"& .MuiSlider-valueLabelOpen":{zIndex:100,backgroundColor:"transparent",top:"0px"}}}),n.showVelocitySliderLabel&&(e.renderValue?e.renderValue(e.velocity):g.jsxRuntimeExports.jsx(Ha,{value:e.velocity.toString()}))]})});function Ha({value:e,sx:t}){var r;const n=M.useTheme();return g.jsxRuntimeExports.jsx(M.Stack,{direction:"row",justifyContent:"center",alignItems:"center",gap:"5px",sx:{padding:"6px 12px",background:(r=n.palette.backgroundPaperElevation)==null?void 0:r[8],borderRadius:"10px",minWidth:"111px",...t},children:g.jsxRuntimeExports.jsx(M.Typography,{component:"span",sx:{textAlign:"right",fontSize:"14px",opacity:.8,color:n.palette.text.primary,whiteSpace:"nowrap"},children:e})})}const Yh=ie.observer(({store:e})=>{const{t}=de.useTranslation(),n=ie.useLocalObservable(()=>({get valueLabelFormat(){return e.currentMotionType==="translate"?r=>`v = ${t("Jogging.Cartesian.Translation.velocityMmPerSec.lb",{amount:r})}`:r=>`ω = ${t("Jogging.Cartesian.Rotation.velocityDegPerSec.lb",{amount:r})}`}}));return g.jsxRuntimeExports.jsx(Vh,{store:e,velocity:e.velocityInDisplayUnits,min:e.minVelocityInDisplayUnits,max:e.maxVelocityInDisplayUnits,onVelocityChange:e.setVelocityFromSlider,disabled:e.isLocked,renderValue:r=>g.jsxRuntimeExports.jsx(Ha,{value:n.valueLabelFormat(r),sx:{minWidth:"111px",span:{transform:"translateY(-1.5px)"}}})})}),oM=ie.observer(({store:e,children:t})=>{const{t:n}=de.useTranslation(),r=M.useTheme();function i(h,f){(f==="translate"||f==="rotate")&&e.setSelectedCartesianMotionType(f)}g.useReaction(()=>[e.selectedCoordSystemId,e.selectedTcpId],()=>{e.jogger.motionStream.motionStateSocket.changeUrl(e.jogger.nova.makeWebsocketURL(`/controllers/${e.jogger.motionStream.controllerId}/motion-groups/${e.jogger.motionGroupId}/state-stream?tcp=${e.selectedTcpId}`))},{fireImmediately:!0});async function o(h,f){const m=await e.activate(),p=m.motionStream.rapidlyChangingMotionState.tcp_pose,y=m.motionStream.rapidlyChangingMotionState.joint_position;p&&await e.withMotionLock(async()=>{try{e.setCurrentIncrementJog({axis:h.axis,direction:h.direction}),await e.jogger.runIncrementalCartesianMotion({currentTcpPose:p,currentJoints:y,coordSystemId:e.activeCoordSystemId,velocityInRelevantUnits:e.selectedCartesianMotionType==="translate"?e.translationVelocityMmPerSec:e.rotationVelocityRadsPerSec,axis:h.axis,direction:h.direction,motion:e.selectedCartesianMotionType==="translate"?{type:"translate",distanceMm:f.mm}:{type:"rotate",distanceRads:Ie.degreesToRadians(f.degrees)}})}finally{e.setCurrentIncrementJog(null),await e.deactivate()}})}async function s(h){if(!e.isLocked){if(await e.activate(),e.activeDiscreteIncrement)return o(h,e.activeDiscreteIncrement);h.motionType==="translate"?await e.jogger.translateTCP({axis:h.axis,direction:h.direction,velocityMmPerSec:e.translationVelocityMmPerSec}):await e.jogger.rotateTCP({axis:h.axis,direction:h.direction,velocityRadsPerSec:e.rotationVelocityRadsPerSec})}}async function a(){e.isLocked||e.activeDiscreteIncrement||await e.deactivate()}function l(h,f,m){var y,b,E;const p=(E=(b=(y=m.componentsExt)==null?void 0:y.JoggingPanel)==null?void 0:b.JoggingCartesian)==null?void 0:E.Axis;if(p)return f==="translate"?p[h]:p.CustomRotation??p[h]}const u=[{id:"x",icon:g.jsxRuntimeExports.jsx(je.ForwardRef$10,{}),colors:l("X",e.selectedCartesianMotionType,r)},{id:"y",icon:g.jsxRuntimeExports.jsx(je.ForwardRef$11,{}),colors:l("Y",e.selectedCartesianMotionType,r)},{id:"z",icon:g.jsxRuntimeExports.jsx(je.ForwardRef$12,{}),colors:l("Z",e.selectedCartesianMotionType,r)}];function c(h){return n("General.mm.variable",{amount:h.toFixed(1)})}function d(h){return n("General.degree.variable",{amount:Ie.radiansToDegrees(h).toFixed(1)})}return g.jsxRuntimeExports.jsxs(M.Stack,{flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[g.jsxRuntimeExports.jsxs(M.Stack,{gap:2,children:[g.jsxRuntimeExports.jsx(IC,{store:e}),g.jsxRuntimeExports.jsx(Yh,{store:e}),g.jsxRuntimeExports.jsx(M.Divider,{})]}),g.jsxRuntimeExports.jsx(M.Stack,{marginLeft:"auto",marginRight:"auto",gap:"24px",justifyContent:"center",sx:{flexGrow:"1"},children:g.jsxRuntimeExports.jsxs(M.Stack,{alignItems:"center",justifyContent:"center",gap:"24px",sx:{flexGrow:1},children:[g.jsxRuntimeExports.jsxs(jC,{value:e.selectedCartesianMotionType,onChange:i,exclusive:!0,"aria-label":n("Jogging.Cartesian.MotionType.lb"),sx:{justifyContent:"center"},children:[g.jsxRuntimeExports.jsx(M.ToggleButton,{value:"translate",children:n("Jogging.Cartesian.Translation.bt")}),g.jsxRuntimeExports.jsx(M.ToggleButton,{value:"rotate",children:n("Jogging.Cartesian.Rotation.bt")})]}),e.selectedCartesianMotionType==="translate"&&u.map(h=>{var f,m;return g.jsxRuntimeExports.jsx(_s,{colors:h.colors,disabled:e.isLocked,activeJoggingDirection:((f=e.incrementJogInProgress)==null?void 0:f.axis)===h.id?e.incrementJogInProgress.direction:void 0,label:g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[h.icon,g.jsxRuntimeExports.jsx(M.Typography,{sx:{fontSize:"24px",color:((m=h.colors)==null?void 0:m.labelColor)??r.palette.text.primary},children:h.id.toUpperCase()})]}),getDisplayedValue:()=>{var p,y;return c(((y=(p=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:p.position)==null?void 0:y[Ie.XYZ_TO_VECTOR[h.id]])||0)},startJogging:p=>s({axis:h.id,motionType:"translate",direction:p}),stopJogging:a},h.id)}),e.selectedCartesianMotionType==="rotate"&&u.map(h=>{var f,m;return g.jsxRuntimeExports.jsx(_s,{colors:h.colors,disabled:e.isLocked,activeJoggingDirection:((f=e.incrementJogInProgress)==null?void 0:f.axis)===h.id?e.incrementJogInProgress.direction:void 0,label:g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[g.jsxRuntimeExports.jsx(je.ForwardRef$16,{}),g.jsxRuntimeExports.jsx(M.Typography,{sx:{fontSize:"24px",color:((m=h.colors)==null?void 0:m.labelColor)??r.palette.text.primary},children:h.id.toUpperCase()})]}),getDisplayedValue:()=>{var p,y;return d(((y=(p=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:p.orientation)==null?void 0:y[Ie.XYZ_TO_VECTOR[h.id]])||0)},startJogging:p=>s({axis:h.id,motionType:"rotate",direction:p}),stopJogging:a},h.id)})]})}),g.jsxRuntimeExports.jsx(zh,{store:e}),t&&g.jsxRuntimeExports.jsx(M.Divider,{}),t]})}),sM=ie.observer(({store:e,children:t})=>{const n=M.useTheme();async function r(o){await e.activate(),await e.jogger.rotateJoints({joint:o.joint,direction:o.direction,velocityUnit:e.jointCategory===$s.PRISMATIC?"mm/s":"rad/s",velocityValue:e.jointCategory===$s.PRISMATIC?e.translationVelocityMmPerSec:e.rotationVelocityRadsPerSec})}async function i(){await e.jogger.stop(),await e.deactivate()}return g.jsxRuntimeExports.jsxs(M.Stack,{flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[g.jsxRuntimeExports.jsx(Yh,{store:e}),g.jsxRuntimeExports.jsx(M.Divider,{}),g.jsxRuntimeExports.jsx(M.Stack,{justifyContent:"center",alignItems:"stretch",sx:{flexGrow:"1"},children:g.jsxRuntimeExports.jsx(M.Stack,{alignItems:"center",gap:"24px",children:e.jogger.motionStream.joints.map(o=>{var a,l,u;const s=(u=(l=(a=e.motionGroupDescription.operation_limits.auto_limits)==null?void 0:a.joints)==null?void 0:l[o.index])==null?void 0:u.position;return g.jsxRuntimeExports.jsxs(M.Stack,{direction:"row",alignItems:"center",justifyContent:"center",spacing:1.5,width:"100%",children:[e.showJointsLegend&&g.jsxRuntimeExports.jsx(M.Typography,{color:e.isLocked?n.palette.text.disabled:n.palette.text.secondary,children:`G${o.index+1}`}),g.jsxRuntimeExports.jsx(xh,{disabled:e.isLocked,lowerLimit:s==null?void 0:s.lower_limit,upperLimit:s==null?void 0:s.upper_limit,useDegree:e.currentMotionType==="rotate",getValue:()=>{const c=e.jogger.motionStream.rapidlyChangingMotionState.joint_position[o.index];return c!==void 0?c:void 0},startJogging:c=>r({joint:o.index,direction:c}),stopJogging:i})]},`joint-${o.index}`)})})}),g.jsxRuntimeExports.jsx(zh,{store:e}),t&&g.jsxRuntimeExports.jsx(M.Divider,{}),t]})}),aM=g.externalizeComponent(ie.observer(e=>{const t=Ns.isString(e.nova)?new g.NovaClient({instanceUrl:e.nova}):e.nova,n=ie.useLocalObservable(()=>({joggingStore:null,loadingError:null}));async function r(){ce.runInAction(()=>{n.loadingError=null,n.joggingStore=null});try{let i=e.store;if(!i){const o=await Ro.open(t,e.motionGroupId);i=await ko.loadFor(o)}ce.runInAction(()=>{n.joggingStore=i}),e.onSetup&&e.onSetup(i)}catch(i){n.loadingError=i}}return D.useEffect(()=>(r(),e.store?()=>null:()=>{var i;(i=n.joggingStore)==null||i.dispose()}),[e.store,e.nova,e.motionGroupId]),D.useEffect(()=>{const i=n.joggingStore;i&&(e.locked?i.lock("external"):i.unlock("external"))},[n.joggingStore,e.locked]),g.jsxRuntimeExports.jsx(M.Stack,{sx:{maxWidth:"460px",minWidth:"320px",position:"relative",...e.sx},children:n.joggingStore?g.jsxRuntimeExports.jsx(lM,{store:n.joggingStore,children:e.children}):g.jsxRuntimeExports.jsx(Sh,{message:"Loading jogging",error:n.loadingError})})})),lM=ie.observer(({store:e,children:t})=>{const{t:n}=de.useTranslation();function r(){if(e.currentTab.id==="cartesian")return g.jsxRuntimeExports.jsx(g.jsxRuntimeExports.Fragment,{children:g.jsxRuntimeExports.jsx(oM,{store:e,children:t})});if(e.currentTab.id==="joint")return g.jsxRuntimeExports.jsx(g.jsxRuntimeExports.Fragment,{children:g.jsxRuntimeExports.jsx(sM,{store:e,children:t})})}return g.jsxRuntimeExports.jsxs(M.Stack,{flexGrow:1,sx:{overflow:"hidden"},children:[g.jsxRuntimeExports.jsx(M.Tabs,{value:e.tabIndex,onChange:e.onTabChange,variant:"fullWidth",children:e.tabs.map(i=>{const o=i.label==="Cartesian"?n("Jogging.Cartesian.bt"):n("Jogging.Joints.bt"),s=i.label==="cartesian"?g.jsxRuntimeExports.jsx(lE,{fontSize:"small",sx:{mr:1}}):g.jsxRuntimeExports.jsx(uE,{fontSize:"small",sx:{mr:1}});return g.jsxRuntimeExports.jsx(M.Tab,{label:e.showTabIcons?g.jsxRuntimeExports.jsxs(M.Stack,{direction:"row",alignItems:"center",children:[s,o]}):o,id:`jogging-tab-${i.id}`,"aria-controls":`jogging-tab-${i.id}`},i.id)})}),g.jsxRuntimeExports.jsx(M.Stack,{flexGrow:1,position:"relative",sx:{overflowY:"auto",overflowX:"hidden"},children:r()}),e.blocked&&g.jsxRuntimeExports.jsx(RC,{store:e})]})}),Wh=e=>{var a;const{value:t,ref:n}=e,r=M.useTheme(),[i,o]=D.useState(!1);async function s(){if(!n||!("current"in n))return console.warn("No copy target found"),!1;try{return await navigator.clipboard.writeText(t),console.log("Copied!"),o(!0),!0}catch(l){console.error(l);const u=window.getSelection();if(u&&n&&"current"in n&&n.current){const c=document.createRange();c.selectNodeContents(n.current),u.removeAllRanges(),u.addRange(c)}}return!1}return D.useEffect(()=>{if(!i)return;const l=setTimeout(()=>o(!1),3e3);return()=>{l&&clearTimeout(l)}},[i]),g.jsxRuntimeExports.jsx(M.Tooltip,{open:i,title:"Copied!",children:g.jsxRuntimeExports.jsx(M.Stack,{justifyContent:"center",sx:{height:"100%",boxSizing:"border-box",padding:"6px 12px",background:(a=r.palette.backgroundPaperElevation)==null?void 0:a[8],borderRadius:"10px",minWidth:"0",cursor:"pointer"},onClick:()=>s(),children:g.jsxRuntimeExports.jsx(M.Typography,{ref:n,align:"center",sx:{pointerEvents:"none",fontSize:"12px",color:r.palette.text.primary,whiteSpace:"nowrap",minWidth:0,textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:t})})})},uM=g.externalizeComponent(ie.observer(({tcpPose:e,showCopyButton:t=!1})=>{const[n,r]=D.useState(null),i=g.poseToWandelscriptString(e),o=async()=>{try{await navigator.clipboard.writeText(i),r("Copied!"),setTimeout(()=>r(null),2e3)}catch{r("Copy failed"),setTimeout(()=>r(null),2e3)}};return g.jsxRuntimeExports.jsxs(M.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},"data-testid":"pose-cartesian-values",children:[g.jsxRuntimeExports.jsx(Wh,{value:i}),t&&g.jsxRuntimeExports.jsx(M.Button,{variant:"contained",color:"secondary",size:"small",onClick:o,sx:{flexShrink:0},children:n||"Copy"})]})})),cM=g.externalizeComponent(ie.observer(({joints:e,showCopyButton:t=!1})=>{const[n,r]=D.useState(null),i=`[${e.map(s=>parseFloat(s.toFixed(4))).join(", ")}]`,o=async()=>{try{await navigator.clipboard.writeText(i),r("Copied!"),setTimeout(()=>r(null),2e3)}catch{r("Copy failed"),setTimeout(()=>r(null),2e3)}};return g.jsxRuntimeExports.jsxs(M.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},"data-testid":"pose-joint-values",children:[g.jsxRuntimeExports.jsx(Wh,{value:i}),t&&g.jsxRuntimeExports.jsx(M.Button,{variant:"contained",color:"secondary",size:"small",onClick:o,sx:{flexShrink:0},children:n||"Copy"})]})}));class Hh{constructor(){this.messages=[],this.addMessage=(t,n="info")=>{const r={id:Math.random().toString(36).substring(2,11),timestamp:new Date,message:t,level:n};this.messages.push(r)},this.clearMessages=()=>{this.messages=[]},this.addInfo=t=>{this.addMessage(t,"info")},this.addWarning=t=>{this.addMessage(t,"warning")},this.addError=t=>{this.addMessage(t,"error")},this.addDebug=t=>{this.addMessage(t,"debug")},ce.makeObservable(this,{messages:ce.observable,addMessage:ce.action,clearMessages:ce.action})}}const Ir=(e,t,n)=>({id:n||`${Date.now()}-${Math.random().toString(36).substring(2,11)}`,timestamp:new Date,message:e,level:t}),dM=(e,t)=>Ir(e,"debug",t),hM=(e,t)=>Ir(e,"info",t),fM=(e,t)=>Ir(e,"warning",t),pM=(e,t)=>Ir(e,"error",t),qh=g.externalizeComponent(ie.observer(e=>{var c;const{messages:t=[],onClear:n,height:r=400,sx:i}=e,o=M.useTheme(),s=D.useRef(null);D.useEffect(()=>{if(t.length===0)return;const d=s.current;if(!d)return;const h=setTimeout(()=>{d.scrollTop=d.scrollHeight},10);return()=>clearTimeout(h)},[t.length]);const a=d=>d.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),l=d=>{switch(d){case"error":return o.palette.error.main;case"warning":return o.palette.warning.main;case"info":return o.palette.info.main;case"debug":return o.palette.text.disabled;default:return o.palette.text.secondary}},u=({message:d})=>{const[h,f]=D.useState(!1),[m,p]=D.useState(!1),[y,b]=D.useState(!1),E=d.message.length>150,T=async()=>{try{await navigator.clipboard.writeText(d.message),p(!0),setTimeout(()=>p(!1),2e3)}catch(C){console.error("Failed to copy message:",C)}},w=E&&!h?d.message.substring(0,150)+"...":d.message;return g.jsxRuntimeExports.jsx(M.Box,{onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),sx:{display:"flex",gap:1,fontFamily:"monospace",flexDirection:"column","&:hover":{backgroundColor:o.palette.action.hover},borderRadius:"4px",padding:"2px 4px",margin:"-2px -4px"},children:g.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",gap:1},children:[g.jsxRuntimeExports.jsxs(M.Typography,{component:"span",sx:{fontWeight:400,fontSize:"12px",lineHeight:"18px",letterSpacing:"0.4px",color:o.palette.text.disabled,whiteSpace:"nowrap",flexShrink:0},children:["[",a(d.timestamp),"]"]}),g.jsxRuntimeExports.jsx(M.Typography,{component:"span",sx:{fontWeight:400,fontSize:"12px",lineHeight:"18px",letterSpacing:"0.4px",color:l(d.level),wordBreak:"break-word",overflowWrap:"anywhere",hyphens:"auto",flex:1,whiteSpace:"pre-wrap"},children:w}),g.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",alignItems:"flex-start",gap:.5,opacity:y?1:0,transition:"opacity 0.2s ease-in-out",visibility:y?"visible":"hidden"},children:[g.jsxRuntimeExports.jsx(M.IconButton,{size:"small",onClick:T,sx:{padding:"2px",color:o.palette.text.secondary,"&:hover":{backgroundColor:o.palette.action.hover}},title:m?"Copied!":"Copy message",children:g.jsxRuntimeExports.jsx(Nr.ContentCopy,{sx:{fontSize:12}})}),E&&g.jsxRuntimeExports.jsx(M.IconButton,{size:"small",onClick:()=>f(!h),sx:{padding:"2px",color:o.palette.text.secondary,"&:hover":{backgroundColor:o.palette.action.hover}},title:h?"Collapse":"Expand",children:h?g.jsxRuntimeExports.jsx(Nr.ExpandLess,{sx:{fontSize:12}}):g.jsxRuntimeExports.jsx(Nr.ExpandMore,{sx:{fontSize:12}})})]})]})},d.id)};return g.jsxRuntimeExports.jsxs(M.Paper,{sx:{backgroundColor:((c=o.palette.backgroundPaperElevation)==null?void 0:c[2])||"#171927",backgroundImage:"none",height:r,display:"flex",flexDirection:"column",overflow:"hidden",...i},children:[g.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px"},children:[g.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[g.jsxRuntimeExports.jsx(Nr.DescriptionOutlined,{sx:{fontSize:16,color:o.palette.action.active,opacity:.56}}),g.jsxRuntimeExports.jsx(M.Typography,{sx:{fontWeight:500,fontSize:"14px",lineHeight:"143%",letterSpacing:"0.17px",color:o.palette.text.primary},children:"Log"})]}),g.jsxRuntimeExports.jsx(M.Button,{onClick:n,variant:"text",sx:{fontWeight:500,fontSize:"13px",lineHeight:"22px",letterSpacing:"0.46px",color:o.palette.primary.main,textTransform:"none",minWidth:"auto",padding:"4px 8px","&:hover":{backgroundColor:o.palette.primary.main+"14"}},children:"Clear"})]}),g.jsxRuntimeExports.jsx(M.Box,{ref:s,sx:{flex:1,overflow:"auto",padding:"8px 16px",display:"flex",flexDirection:"column",gap:"2px",scrollbarWidth:"thin",scrollbarColor:`${o.palette.divider} transparent`,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:o.palette.divider,borderRadius:"3px","&:hover":{backgroundColor:o.palette.divider}}},children:t.length===0?g.jsxRuntimeExports.jsx(M.Typography,{sx:{color:o.palette.text.disabled,fontSize:"12px",fontStyle:"italic",textAlign:"center",marginTop:2},children:"No log messages"}):t.map(d=>g.jsxRuntimeExports.jsx(u,{message:d},d.id))})]})})),mM=g.externalizeComponent(ie.observer(e=>{const{store:t,onStoreReady:n,...r}=e,i=D.useRef(n);D.useEffect(()=>{i.current=n},[n]);const o=D.useMemo(()=>{var l;const a=t||new Hh;return(l=i.current)==null||l.call(i,a),a},[t]),s=()=>{o.clearMessages()};return g.jsxRuntimeExports.jsx(qh,{...r,messages:o.messages,onClear:s})}));function gM(){const e=window.location.href;return e.substring(0,e.indexOf("/",e.indexOf("//")+2))}function yM({baseUrl:e=gM(),...t}){return g.jsxRuntimeExports.jsxs(M.Dialog,{"aria-labelledby":"no-motion-group-modal-title",open:!0,fullWidth:!0,sx:{"& .MuiModal-backdrop":{backdropFilter:"blur(10px)"},"& .MuiDialog-paper":{"::before":{content:'""',height:"8px",width:"100%",background:"linear-gradient(90deg, #FF0E65 0%, #47D3FF 100%)"},background:"#101629"}},children:[g.jsxRuntimeExports.jsx(M.DialogTitle,{id:"no-motion-group-modal-title",children:"No motion group found"}),g.jsxRuntimeExports.jsxs(M.DialogContent,{sx:{marginTop:"3rem",marginBottom:"1.5rem",textAlign:"center"},children:[g.jsxRuntimeExports.jsx(M.Typography,{color:"#fff",children:"Found no devices to connect to."}),g.jsxRuntimeExports.jsx(M.Typography,{color:"#fff",children:"Please ensure a motion group has been created."})]}),g.jsxRuntimeExports.jsx(M.DialogActions,{children:g.jsxRuntimeExports.jsxs(M.Stack,{width:"100%",maxWidth:"300px",margin:"auto",marginBottom:"2rem",children:[g.jsxRuntimeExports.jsx(M.Button,{href:`${e}/settings`,variant:"contained",sx:{borderRadius:"8px",width:"100%"},children:"Go to settings app"}),g.jsxRuntimeExports.jsx(M.Button,{href:`${e}`,variant:"text",sx:{marginTop:"1rem",color:"#fff",textDecoration:"underline",fontSize:"0.75rem"},children:"Back to Homescreen"})]})})]})}const xM=Kt(g.jsxRuntimeExports.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error");var qa=(e=>(e.PRECONDITION_NOT_FULFILLED="PRECONDITION_NOT_FULFILLED",e.ROBOT_DISCONNECTED="ROBOT_DISCONNECTED",e.CELL_OPEN="CELL_OPEN",e.E_STOP="E_STOP",e.MANUAL_MODE="MANUAL_MODE",e.READY="READY",e))(qa||{});const Kh=g.externalizeComponent(ie.observer(({setupState:e,className:t})=>{const n=M.useTheme(),{t:r}=de.useTranslation(),i=()=>{var u,c,d,h,f,m,p;switch(e){case"READY":return{label:r("RobotSetupReadinessIndicator.Ready.lb"),indicatorColor:((u=n.palette.tertiary)==null?void 0:u.main)||n.palette.primary.main,backgroundColor:((c=n.palette.backgroundPaperElevation)==null?void 0:c[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"ROBOT_DISCONNECTED":return{label:r("RobotSetupReadinessIndicator.RobotDisconnected.lb"),indicatorColor:n.palette.error.main,backgroundColor:((d=n.palette.backgroundPaperElevation)==null?void 0:d[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"CELL_OPEN":return{label:r("RobotSetupReadinessIndicator.CellOpen.lb"),indicatorColor:n.palette.error.main,backgroundColor:((h=n.palette.backgroundPaperElevation)==null?void 0:h[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"E_STOP":return{label:r("RobotSetupReadinessIndicator.EStop.lb"),indicatorColor:n.palette.error.main,backgroundColor:((f=n.palette.backgroundPaperElevation)==null?void 0:f[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"MANUAL_MODE":return{label:r("RobotSetupReadinessIndicator.ManualMode.lb"),indicatorColor:n.palette.error.main,backgroundColor:((m=n.palette.backgroundPaperElevation)==null?void 0:m[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"PRECONDITION_NOT_FULFILLED":default:return{label:r("RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb"),indicatorColor:n.palette.error.main,backgroundColor:((p=n.palette.backgroundPaperElevation)==null?void 0:p[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText}}},{label:o,indicatorColor:s,backgroundColor:a,textColor:l}=i();return g.jsxRuntimeExports.jsx(M.Chip,{className:t,label:g.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[g.jsxRuntimeExports.jsx(M.Box,{sx:{width:8,height:8,borderRadius:"50%",backgroundColor:s,flexShrink:0}}),g.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{color:l,fontSize:"0.75rem",lineHeight:1.2},children:o})]}),variant:"filled",sx:{backgroundColor:a,color:n.palette.getContrastText(a),fontWeight:500,height:"auto","& .MuiChip-label":{paddingX:1.5,paddingY:.5}}})})),bM=g.externalizeComponent(ie.observer(({robotName:e,robotType:t,setupState:n,PreconditionComponent:r=Kh,className:i})=>{var l;const o=M.useTheme(),s=t||"Robot",a=n===qa.READY;return g.jsxRuntimeExports.jsxs(M.Box,{className:i,sx:{border:`1px solid ${o.palette.divider}`,background:((l=o.palette.backgroundPaperElevation)==null?void 0:l[8])||"#292B3F",borderRadius:"8px",padding:"20px",display:"flex",alignItems:"center",justifyContent:"space-between",opacity:1},children:[g.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",alignItems:"center",gap:2,flex:1},children:[a?g.jsxRuntimeExports.jsx(M.Box,{sx:{fontSize:24,display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,"& svg":{fill:`${o.palette.primary.main} !important`},"& svg path":{fill:`${o.palette.primary.main} !important`}},children:g.jsxRuntimeExports.jsx(je.ForwardRef$15,{})}):g.jsxRuntimeExports.jsx(xM,{sx:{color:o.palette.error.main,fontSize:24}}),g.jsxRuntimeExports.jsx(M.Typography,{variant:"body1",sx:{fontWeight:500,color:o.palette.text.primary},children:e}),g.jsxRuntimeExports.jsx(M.Divider,{orientation:"vertical",flexItem:!0,sx:{backgroundColor:o.palette.text.secondary,opacity:.3,width:"1px"}}),g.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{color:o.palette.text.secondary},children:s})]}),r&&g.jsxRuntimeExports.jsx(r,{setupState:n})]})})),ht=ie.observer(({id:e,icon:t,color:n,title:r,name:i,label:o,explanation:s,literalValue:a,anchorOrigin:l,transformOrigin:u})=>{const c=ie.useLocalObservable(()=>({anchorEl:null,get isPopoverOpen(){return!!c.anchorEl},openPopover(d){c.anchorEl=d.currentTarget},closePopover(){c.anchorEl=null}}));return g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[g.jsxRuntimeExports.jsxs(M.Stack,{"aria-owns":c.isPopoverOpen?e:void 0,"aria-haspopup":"true",onMouseEnter:c.openPopover,onMouseLeave:c.closePopover,direction:"row",spacing:1,sx:{cursor:"pointer"},children:[g.jsxRuntimeExports.jsx(M.SvgIcon,{component:t,sx:{color:n}}),o&&g.jsxRuntimeExports.jsx("div",{style:{color:n},children:o})]}),g.jsxRuntimeExports.jsx(M.Popover,{id:e,sx:{pointerEvents:"none"},open:c.isPopoverOpen,anchorEl:c.anchorEl,anchorOrigin:l??{vertical:"bottom",horizontal:"left"},transformOrigin:u??{vertical:"top",horizontal:"left"},onClose:c.closePopover,disableRestoreFocus:!0,children:g.jsxRuntimeExports.jsxs(M.Stack,{gap:"1rem",padding:2,maxWidth:"450px",sx:{wordWrap:"break-word"},children:[g.jsxRuntimeExports.jsxs("div",{children:[r&&g.jsxRuntimeExports.jsx(M.Typography,{component:"span",fontSize:"14px",children:`${r}: `}),g.jsxRuntimeExports.jsx(M.Typography,{component:"span",color:n,fontWeight:"bold",fontSize:"14px",children:i})]}),g.jsxRuntimeExports.jsx(M.Typography,{fontSize:"14px",children:s}),a&&g.jsxRuntimeExports.jsx(M.Typography,{fontSize:"12px",children:a})]})})]})}),vM=ie.observer(({isVirtual:e,motionGroupId:t,anchorOrigin:n,transformOrigin:r,compact:i})=>{const o=M.useTheme(),s=D.useId(),{t:a}=de.useTranslation();return e?g.jsxRuntimeExports.jsx(ht,{id:`motion-group-virtual-${s}`,icon:je.ForwardRef$1,color:o.palette.tertiary.main,name:a("SafetyBar.ControllerType.Virtual.lb"),label:i?null:a("SafetyBar.ControllerType.Virtual.lb"),explanation:g.jsxRuntimeExports.jsxs(de.Trans,{i18nKey:"SafetyBar.MotionGroup.Virtual.Explanation.lb",values:{motionGroupId:t},children:["Motion group ",g.jsxRuntimeExports.jsx("code",{children:t})," refers to a virtual robot with no physical counterpart. It can be freely manipulated without special safety precautions."]}),anchorOrigin:n,transformOrigin:r}):g.jsxRuntimeExports.jsx(ht,{id:`motion-group-physical-${s}`,icon:je.ForwardRef,color:o.palette.primary.main,name:a("SafetyBar.ControllerType.Physical.lb"),label:i?null:a("SafetyBar.ControllerType.Physical.lb"),explanation:g.jsxRuntimeExports.jsx(de.Trans,{i18nKey:"SafetyBar.MotionGroup.Physical.Explanation.lb",values:{motionGroupId:t},components:{code:g.jsxRuntimeExports.jsx("code",{}),strong:g.jsxRuntimeExports.jsx("strong",{})}}),anchorOrigin:n,transformOrigin:r})}),SM=ie.observer(({operationMode:e,anchorOrigin:t,transformOrigin:n,compact:r})=>{const{t:i}=de.useTranslation(),o=M.useTheme(),s=D.useId();switch(e){case"OPERATION_MODE_AUTO":return g.jsxRuntimeExports.jsx(ht,{id:`operation-mode-auto-${s}`,icon:je.ForwardRef$2,title:i("SafetyBar.OperationMode.ti"),name:i("SafetyBar.OperationMode.Automatic.ti"),label:r?null:i("SafetyBar.OperationMode.Automatic.ti"),color:o.palette.text.secondary,explanation:g.jsxRuntimeExports.jsx(de.Trans,{i18nKey:"SafetyBar.OperationMode.Auto.Explanation.lb",children:"The robot controller is in automatic operation mode. Automated movement without manual confirmation is possible in this mode."}),anchorOrigin:t,transformOrigin:n});case"OPERATION_MODE_MANUAL":case"OPERATION_MODE_MANUAL_T1":case"OPERATION_MODE_MANUAL_T2":return g.jsxRuntimeExports.jsx(ht,{id:`operation-mode-manual-${s}`,icon:je.ForwardRef$4,color:o.palette.warning.main,title:i("SafetyBar.OperationMode.ti"),name:i("SafetyBar.OperationMode.Manual.lb"),label:r?null:i("SafetyBar.OperationMode.Manual.lb"),explanation:g.jsxRuntimeExports.jsx(de.Trans,{i18nKey:"SafetyBar.OperationMode.Manual.Explanation.lb",children:"The robot controller is in manual operation mode. On a physical robot, this generally indicates that an enabling switch must be held for the robot to move successfully."}),literalValue:e,anchorOrigin:t,transformOrigin:n});default:return g.jsxRuntimeExports.jsx(ht,{id:`operation-mode-error-${s}`,icon:je.ForwardRef$3,color:o.palette.warning.main,title:i("SafetyBar.OperationMode.ti"),name:i("SafetyBar.OperationMode.Error.lb"),label:r?null:i("SafetyBar.OperationMode.Error.lb"),explanation:g.jsxRuntimeExports.jsx(de.Trans,{i18nKey:"SafetyBar.OperationMode.Error.Explanation.lb",children:"The robot controller has entered an unexpected operation mode. Motion group movement may not be possible."}),literalValue:e,anchorOrigin:t,transformOrigin:n})}}),EM=ie.observer(({safetyState:e,anchorOrigin:t,transformOrigin:n,compact:r})=>{const{t:i}=de.useTranslation(),o=M.useTheme(),s=D.useId();switch(e){case"SAFETY_STATE_NORMAL":return g.jsxRuntimeExports.jsx(ht,{id:`safety-state-normal-${s}`,title:i("SafetyBar.SafetyState.ti"),name:i("SafetyBar.SafetyState.Normal.lb"),label:r?null:i("SafetyBar.SafetyState.Normal.lb"),icon:je.ForwardRef$8,color:o.palette.text.secondary,explanation:g.jsxRuntimeExports.jsx(de.Trans,{i18nKey:"SafetyBar.SafetyState.Normal.Explanation.lb",children:"The robot controller is in a normal safety state. Movement is not prevented by this state."}),anchorOrigin:t,transformOrigin:n});case"SAFETY_STATE_DEVICE_EMERGENCY_STOP":case"SAFETY_STATE_ROBOT_EMERGENCY_STOP":return g.jsxRuntimeExports.jsx(ht,{id:`safety-state-estop-${s}`,title:i("SafetyBar.SafetyState.ti"),name:i("SafetyBar.SafetyState.Estop.lb"),label:r?null:i("SafetyBar.SafetyState.Estop.lb"),icon:je.ForwardRef$6,color:o.palette.error.main,explanation:g.jsxRuntimeExports.jsx(de.Trans,{i18nKey:"SafetyBar.StopState.Estop.Explanation.lb",children:"An emergency stop of the robot controller has been triggered. Movement of the robot is no longer possible until the estop is released."}),literalValue:e,anchorOrigin:t,transformOrigin:n});case"SAFETY_STATE_STOP_0":case"SAFETY_STATE_STOP_1":case"SAFETY_STATE_STOP_2":case"SAFETY_STATE_PROTECTIVE_STOP":case"SAFETY_STATE_STOP":return g.jsxRuntimeExports.jsx(ht,{id:`safety-state-stop-${s}`,icon:je.ForwardRef$9,title:i("SafetyBar.SafetyState.ti"),name:i("SafetyBar.SafetyState.Stop.lb"),label:r?null:i("SafetyBar.SafetyState.Stop.lb"),color:o.palette.warning.main,explanation:g.jsxRuntimeExports.jsx(de.Trans,{i18nKey:"SafetyBar.SafetyState.Stop.Explanation.lb",children:"The robot controller has entered a stop state. Movement is no longer possible until the stop state is resolved."}),literalValue:e,anchorOrigin:t,transformOrigin:n});case"SAFETY_STATE_REDUCED":case"SAFETY_STATE_MASTERING":case"SAFETY_STATE_CONFIRM_SAFETY":case"SAFETY_STATE_OPERATOR_SAFETY":case"SAFETY_STATE_RECOVERY":case"SAFETY_STATE_VIOLATION":return g.jsxRuntimeExports.jsx(ht,{id:`safety-state-manual-action-required-${s}`,icon:je.ForwardRef$7,color:o.palette.warning.main,title:i("SafetyBar.SafetyState.ti"),name:i("SafetyBar.SafetyState.ManualActionRequired.lb"),label:r?null:i("SafetyBar.SafetyState.ManualActionRequired.lb"),explanation:g.jsxRuntimeExports.jsx(de.Trans,{i18nKey:"SafetyBar.SafetyState.ManualActionRequired.Explanation.lb",children:"The robot controller has entered a safety state requiring manual action to resolve."}),literalValue:e,anchorOrigin:t,transformOrigin:n});case"SAFETY_STATE_UNKNOWN":case"SAFETY_STATE_FAULT":return g.jsxRuntimeExports.jsx(ht,{id:`safety-state-error-${s}`,icon:je.ForwardRef$5,color:o.palette.error.main,title:i("SafetyBar.SafetyState.ti"),name:i("SafetyBar.SafetyState.Error.lb"),label:r?null:i("SafetyBar.SafetyState.Error.lb"),explanation:g.jsxRuntimeExports.jsx(de.Trans,{i18nKey:"SafetyBar.SafetyState.Error.Explanation.lb",children:"The robot controller has entered an unexpected safety state."}),literalValue:e,anchorOrigin:t,transformOrigin:n});default:hE(e,`Unknown safety state ${e}`)}}),TM=g.externalizeComponent(ie.observer(({isVirtual:e,motionGroupId:t,operationMode:n,safetyState:r,anchorOrigin:i,transformOrigin:o,compact:s=!0})=>{const a=s?1:2;return g.jsxRuntimeExports.jsxs(M.Stack,{direction:"row",gap:a,alignItems:"center",sx:{height:"24px"},children:[g.jsxRuntimeExports.jsx(EM,{safetyState:r,anchorOrigin:i,transformOrigin:o,compact:s}),g.jsxRuntimeExports.jsx(M.Divider,{orientation:"vertical",flexItem:!0}),g.jsxRuntimeExports.jsx(SM,{operationMode:n,anchorOrigin:i,transformOrigin:o,compact:s}),g.jsxRuntimeExports.jsx(M.Divider,{orientation:"vertical",flexItem:!0}),g.jsxRuntimeExports.jsx(vM,{isVirtual:e,motionGroupId:t,anchorOrigin:i,transformOrigin:o,compact:s})]})})),wM=M.styled(M.Fab,{shouldForwardProp:e=>e!=="selected"})(({theme:e})=>{var t,n,r;return{borderRadius:"20px","&:hover":{background:(t=e.palette.backgroundPaperElevation)==null?void 0:t[7]},variants:[{props:({selected:i})=>!i,style:{background:(n=e.palette.backgroundPaperElevation)==null?void 0:n[0],color:e.palette.action.disabled,"> img":{opacity:.4}}},{props:({selected:i})=>i,style:{background:(r=e.palette.backgroundPaperElevation)==null?void 0:r[11],border:`1px solid ${e.palette.divider}`,color:e.palette.primary.contrastText}}]}}),CM=e=>{const{ref:t,...n}=e;return g.jsxRuntimeExports.jsx(wM,{ref:t,selected:e.selected,...n,color:"secondary",variant:"circular"})};function MM(e){const{children:t,value:n,index:r,...i}=e;return g.jsxRuntimeExports.jsx("div",{role:"tabpanel",hidden:n!==r,id:`tabpanel-${r}`,"aria-labelledby":`tab-${r}`,...i,children:n===r&&g.jsxRuntimeExports.jsx(M.Box,{children:t})})}function RM({children:e,...t}){const{fullWidth:n,indicator:r,onChange:i,orientation:o,scrollButtons:s,selectionFollowsFocus:a,textColor:l,value:u,variant:c,...d}=t;return g.jsxRuntimeExports.jsx(M.Box,{...d,children:e})}const AM=g.externalizeComponent(ie.observer(e=>{const{items:t,activeTab:n,defaultActiveTab:r=0,onTabChange:i,sx:o,ref:s}=e,a=n!==void 0,[l,u]=D.useState(r),c=a?n:l;D.useEffect(()=>{a||t.length!==0&&(l<0||l>t.length-1)&&u(0)},[t.length,a,l]);const d=(h,f)=>{a||u(f),i==null||i(f)};return g.jsxRuntimeExports.jsxs(M.Box,{ref:s,sx:{height:"100%",display:"flex",flexDirection:"column",...o},children:[g.jsxRuntimeExports.jsx(M.Box,{sx:{px:0,py:0,overflow:"visible",position:"relative",paddingTop:h=>h.spacing(2),paddingRight:h=>h.spacing(2.5)},children:g.jsxRuntimeExports.jsx(M.Tabs,{value:c,onChange:d,sx:{minHeight:"32px",backgroundColor:"transparent",overflow:"visible","& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:2,overflow:"visible",paddingTop:0,paddingBottom:0},"& .MuiTabs-scroller":{overflow:"visible !important"},"& .MuiTab-root":{overflow:"visible"}},children:t.map((h,f)=>{var w,C,S;const m=()=>{if(!h.badge)return;const R=h.badge.content,I=h.badge.max;return typeof R=="number"&&I&&R>I?`${I}+`:R},p=()=>{if(!h.badge)return!1;const R=h.badge.content,I=h.badge.showZero;return!(R===0&&!I)},y=m(),b=p(),E=()=>{a||u(f),i==null||i(f)},T=g.jsxRuntimeExports.jsx(M.Tab,{label:h.label,icon:h.icon,iconPosition:"start",disableRipple:!0,onClick:E,sx:{minHeight:"32px",height:"32px",padding:"0px 10px",borderRadius:"12px",backgroundColor:R=>{var I;return((I=R.palette.backgroundPaperElevation)==null?void 0:I[11])||"#32344B"},color:"text.primary",opacity:c===f?1:.38,fontSize:"13px",transition:"all 0.2s ease-in-out",position:"relative",overflow:"visible","&:hover":{opacity:c===f?1:.6},"&.Mui-selected":{opacity:1,backgroundColor:R=>{var I;return((I=R.palette.backgroundPaperElevation)==null?void 0:I[11])||"#32344B"},color:"text.primary"},"&:focus":{outline:"none"},"&:active":{transform:"none"}}},h.id);return b?g.jsxRuntimeExports.jsx(RM,{component:"span",sx:{display:"inline-flex"},children:g.jsxRuntimeExports.jsx(M.Badge,{badgeContent:y,color:((w=h.badge)==null?void 0:w.color)||"error",max:(C=h.badge)==null?void 0:C.max,showZero:(S=h.badge)==null?void 0:S.showZero,anchorOrigin:{vertical:"top",horizontal:"right"},overlap:"rectangular",sx:{"& .MuiBadge-badge":{opacity:"1 !important"}},children:T})},h.id):T})})}),g.jsxRuntimeExports.jsx(M.Box,{sx:{mt:h=>h.spacing(2),borderBottom:1,borderColor:"divider"}}),g.jsxRuntimeExports.jsx(M.Box,{sx:{flex:1,overflow:"auto"},children:t.map((h,f)=>g.jsxRuntimeExports.jsx(MM,{value:c,index:f,children:h.content},h.id))})]})})),_M=e=>{const t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60),i=e%60,o=[];return t>0?(o.push(t.toString()),o.push(n.toString().padStart(2,"0")),o.push(r.toString().padStart(2,"0")),o.push(i.toString().padStart(2,"0"))):n>0?(o.push(n.toString()),o.push(r.toString().padStart(2,"0")),o.push(i.toString().padStart(2,"0"))):(o.push(r.toString()),o.push(i.toString().padStart(2,"0"))),o.join(":")},pc=(e,t)=>{const n=Math.floor(e/86400),r=Math.floor(e%86400/3600),i=Math.floor(e%3600/60),o=e%60;if(typeof Intl<"u"&&"DurationFormat"in Intl)try{const a={};return n>0&&(a.days=n),r>0&&(a.hours=r),i>0&&(a.minutes=i),(o>0||Object.keys(a).length===0)&&(a.seconds=o),new Intl.DurationFormat(t,{style:"narrow"}).format(a)}catch{}const s=[];return n>0&&s.push(`${n}d`),r>0&&s.push(`${r}h`),i>0&&s.push(`${i}m`),(o>0||s.length===0)&&s.push(`${o}s`),s.join(" ")},IM=({timerState:e,animationState:t,hasError:n,className:r})=>{const{t:i}=de.useTranslation(),o=zc(),{elapsedTime:s,currentProgress:a}=e,{showErrorAnimation:l,showPauseAnimation:u,showMainText:c}=t;return g.jsxRuntimeExports.jsxs(M.Box,{className:r,sx:{position:"relative",width:264,height:264,display:"flex",alignItems:"center",justifyContent:"center"},children:[g.jsxRuntimeExports.jsx(of.Gauge,{width:264,height:264,value:a,valueMin:0,valueMax:100,innerRadius:"85%",outerRadius:"100%",margin:0,skipAnimation:!0,text:()=>"",sx:{opacity:u||l?.6:1,transition:"opacity 0.5s ease-out","& .MuiGauge-valueArc":{fill:n?o.palette.error.light:o.palette.success.main,transition:"fill 0.5s ease-out"},"& .MuiGauge-referenceArc":{fill:"#171927",stroke:"transparent",strokeWidth:0,transition:"fill 0.5s ease-out, stroke 0.5s ease-out, stroke-width 0.5s ease-out"},"& .MuiGauge-valueText":{display:"none"},"& .MuiGauge-text":{display:"none"}}}),g.jsxRuntimeExports.jsx(M.Box,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:225,height:225,borderRadius:"50%",backgroundColor:"#292B3F",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",gap:1,transition:"background-color 0.5s ease-out"},children:g.jsxRuntimeExports.jsxs(M.Box,{sx:{position:"relative",height:"48px",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:.5},children:[g.jsxRuntimeExports.jsx(M.Fade,{in:c&&n,timeout:200,children:g.jsxRuntimeExports.jsx(M.Typography,{variant:"h6",sx:{position:"absolute",fontSize:"16px",fontWeight:500,color:o.palette.error.light},children:i("timer.error")})}),g.jsxRuntimeExports.jsx(M.Fade,{in:c&&!n,timeout:300,children:g.jsxRuntimeExports.jsx(M.Typography,{variant:"h1",sx:{position:"absolute",fontSize:"48px",fontWeight:500,color:o.palette.text.primary,lineHeight:1,letterSpacing:"-0.5px"},children:_M(s)})})]})})]})},jM=({timerState:e,animationState:t,hasError:n,compact:r,className:i})=>{const{t:o,i18n:s}=de.useTranslation(),a=zc(),{elapsedTime:l,currentProgress:u}=e,{showErrorAnimation:c,showPauseAnimation:d}=t;return r?g.jsxRuntimeExports.jsx(M.Box,{className:i,sx:{display:"flex",alignItems:"center",m:0},children:g.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{color:n?a.palette.error.light:a.palette.text.primary,fontSize:"14px",transition:"color 0.5s ease-out"},children:n?o("timer.error"):pc(l,s.language)})}):g.jsxRuntimeExports.jsxs(M.Box,{className:i,sx:{display:"flex",alignItems:"center",m:0,gap:1},children:[g.jsxRuntimeExports.jsx(M.Box,{sx:{width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",opacity:d||c?.6:1,transition:"opacity 0.5s ease-out"},children:g.jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",style:{transform:"rotate(-90deg)"},role:"img","aria-label":"Timer progress",children:[g.jsxRuntimeExports.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?a.palette.error.light:a.palette.success.main,strokeWidth:"2",opacity:.3,style:{transition:"stroke 0.8s ease-in-out, opacity 2s ease-in-out"}}),g.jsxRuntimeExports.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?a.palette.error.light:a.palette.success.main,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:`${2*Math.PI*8}`,strokeDashoffset:`${2*Math.PI*8*(1-u/100)}`,style:{transition:"stroke-dashoffset 0.1s ease-out, stroke 0.8s ease-in-out, opacity 2s ease-in-out"}})]})}),g.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{color:n?a.palette.error.light:a.palette.text.primary,fontSize:"14px",lineHeight:"normal",letterSpacing:"normal",transition:"color 0.8s ease-in-out, font-size 0.3s ease-out, opacity 2s ease-in-out"},children:n?o("timer.error"):pc(l,s.language)})]})},kM=()=>{const[e,t]=D.useState({showPauseAnimation:!1,showErrorAnimation:!1,showMainText:!0}),n=D.useRef(null),r=D.useRef(null),i=D.useRef(null),o=D.useCallback(()=>{t(d=>({...d,showPauseAnimation:!0})),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{t(d=>({...d,showPauseAnimation:!1}))},800)},[]),s=D.useCallback(()=>{t(d=>({...d,showErrorAnimation:!0})),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{t(d=>({...d,showErrorAnimation:!1}))},600)},[]),a=D.useCallback(()=>{t(d=>({...d,showErrorAnimation:!1})),r.current&&clearTimeout(r.current)},[]),l=D.useCallback(()=>{t(d=>({...d,showMainText:!1})),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{t(d=>({...d,showMainText:!0}))},200)},[]),u=D.useCallback(()=>{t(d=>({...d,showMainText:!0}))},[]),c=D.useCallback(()=>{n.current&&clearTimeout(n.current),r.current&&clearTimeout(r.current),i.current&&clearTimeout(i.current)},[]);return{animationState:e,triggerPauseAnimation:o,triggerErrorAnimation:s,clearErrorAnimation:a,triggerFadeTransition:l,setInitialAnimationState:u,cleanup:c}},OM=({autoStart:e,hasError:t,onPauseAnimation:n,onErrorAnimation:r,onClearErrorAnimation:i})=>{const[o,s]=D.useState({elapsedTime:0,isRunning:!1,isPausedState:!1,currentProgress:0,wasRunningBeforeError:!1}),a=D.useRef(null),l=D.useRef(null),u=D.useRef(0),c=D.useRef(0),[d]=g.useInterpolation([0],{tension:80,friction:18,onChange:([b])=>{s(E=>({...E,currentProgress:b}))}}),h=D.useCallback((b=0)=>{const E=b/60%1*100;s(T=>({...T,elapsedTime:b,isPausedState:!1,currentProgress:E})),u.current=0,c.current=E,d.setImmediate([E]),e?(l.current=Date.now()-b*1e3,s(T=>({...T,isRunning:!0}))):l.current=null},[e,d]),f=D.useCallback(()=>{if(l.current&&o.isRunning){const E=(Date.now()-l.current)/1e3+u.current,T=E/60%1*100;d.setTarget([T]),s(w=>({...w,elapsedTime:Math.floor(E)}))}s(b=>({...b,isRunning:!1,isPausedState:!0})),n()},[o.isRunning,d,n]),m=D.useCallback(()=>{o.isPausedState&&(u.current=o.elapsedTime,l.current=Date.now(),s(b=>({...b,isRunning:!0,isPausedState:!1})))},[o.isPausedState,o.elapsedTime]),p=D.useCallback(()=>{s(b=>({...b,elapsedTime:0,isRunning:!1,isPausedState:!1,currentProgress:0})),u.current=0,l.current=null,c.current=0,d.setImmediate([0])},[d]),y=D.useCallback(()=>o.isPausedState,[o.isPausedState]);return D.useEffect(()=>{t?(o.isRunning&&(s(b=>({...b,wasRunningBeforeError:!0})),f()),r()):(o.wasRunningBeforeError&&!o.isRunning&&(s(b=>({...b,wasRunningBeforeError:!1})),m()),i())},[t,o.isRunning,o.wasRunningBeforeError,f,m,r,i]),D.useEffect(()=>{if(o.isRunning){const b=()=>{if(l.current){const T=(Date.now()-l.current)/1e3+u.current,w=T/60%1*100;s(S=>({...S,elapsedTime:Math.floor(T)})),Math.abs(w-c.current)>.1&&(d.setTarget([w]),c.current=w)}a.current=requestAnimationFrame(b)};a.current=requestAnimationFrame(b)}else a.current&&(cancelAnimationFrame(a.current),a.current=null);return()=>{a.current&&(cancelAnimationFrame(a.current),a.current=null)}},[o.isRunning,d]),D.useEffect(()=>{let b=null;const E=()=>{d.update(),b=requestAnimationFrame(E)};return b=requestAnimationFrame(E),()=>{b&&cancelAnimationFrame(b)}},[d]),{timerState:o,controls:{start:h,pause:f,resume:m,reset:p,isPaused:y}}},PM=g.externalizeComponent(ie.observer(({onTimerReady:e,autoStart:t=!0,variant:n="default",compact:r=!1,className:i,hasError:o=!1})=>{const{animationState:s,triggerPauseAnimation:a,triggerErrorAnimation:l,clearErrorAnimation:u,setInitialAnimationState:c,cleanup:d}=kM(),{timerState:h,controls:f}=OM({autoStart:t,hasError:o,onPauseAnimation:a,onErrorAnimation:l,onClearErrorAnimation:u});return D.useEffect(()=>{c()},[c]),D.useEffect(()=>{let m=!0;const p=setTimeout(()=>{m&&e(f)},0);return()=>{m=!1,clearTimeout(p)}},[e,f]),D.useEffect(()=>d,[d]),n==="small"?g.jsxRuntimeExports.jsx(jM,{timerState:h,animationState:s,hasError:o,compact:r,className:i}):g.jsxRuntimeExports.jsx(IM,{timerState:h,animationState:s,hasError:o,className:i})})),mc=1e-4,DM={a:0,d:0,alpha:0,theta:0,reverse_rotation_direction:!1};class Ni{constructor(t,n,r,i,o,s,a,l,u,c){this.nova=t,this.controller=n,this.motionGroup=r,this.initialMotionState=i,this.motionStateSocket=o,this.isVirtual=s,this.tcps=a,this.description=l,this.initialControllerState=u,this.controllerStateSocket=c,this.connectedJoggingSocket=null,this.joggingVelocity=10,this.activationState="inactive",this.rapidlyChangingMotionState=i,this.controllerState=u,c.addEventListener("message",d=>{var f;const h=(f=Ie.tryParseJson(d.data))==null?void 0:f.result;h&&ce.runInAction(()=>{this.controllerState=h})}),o.addEventListener("message",d=>{var f;const h=(f=Ie.tryParseJson(d.data))==null?void 0:f.result;if(!h)throw new Error(`Failed to get motion state for ${this.motionGroupId}: ${d.data}`);Fa(this.rapidlyChangingMotionState.joint_position,h.joint_position,mc)||ce.runInAction(()=>{this.rapidlyChangingMotionState.joint_position=h.joint_position}),Ba(this.rapidlyChangingMotionState,h,mc)||ce.runInAction(()=>{this.rapidlyChangingMotionState.tcp_pose=h.tcp_pose}),this.rapidlyChangingMotionState.standstill!==h.standstill&&ce.runInAction(()=>{this.rapidlyChangingMotionState.standstill=h.standstill})}),ce.makeAutoObservable(this)}static async connectMultiple(t,n){return Promise.all(n.map(r=>Ni.connect(t,r)))}static async connect(t,n){var b,E;const[r,i]=n.split("@"),o=await t.api.controller.getCurrentRobotControllerState(i),s=o==null?void 0:o.motion_groups.find(T=>T.motion_group===n);if(!o||!s)throw new Error(`Controller ${i} or motion group ${n} not found`);const a=t.openReconnectingWebsocket(`/controllers/${i}/motion-groups/${n}/state-stream`),l=await a.firstMessage(),u=(b=Ie.tryParseJson(l.data))==null?void 0:b.result;if(!u)throw new Error(`Unable to parse initial motion state message ${l.data}`);console.log(`Connected motion state websocket to motion group ${s.motion_group}. Initial state:
|
|
113
|
-
`,
|
|
114
|
-
`,y),new Ni(t,o,s,u,a,d,f,h,y,m)}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get modelFromController(){return this.description.motion_group_model}get joggingVelocityRads(){return this.joggingVelocity*Math.PI/180}get joints(){return this.initialMotionState.joint_position.map((t,n)=>({index:n}))}get dhParameters(){if(this.description.dh_parameters!==void 0)return this.description.dh_parameters.map(t=>({...DM,...t}))}get safetyZones(){return this.description.safety_zones}get mountingPosition(){var t,n,r;return this.description.mounting?[(((t=this.description.mounting.position)==null?void 0:t[0])||0)/1e3,(((n=this.description.mounting.position)==null?void 0:n[1])||0)/1e3,(((r=this.description.mounting.position)==null?void 0:r[2])||0)/1e3]:[0,0,0]}get mountingQuaternion(){var i,o,s,a,l,u;const t=new Ja.Vector3(((o=(i=this.description.mounting)==null?void 0:i.orientation)==null?void 0:o[0])||0,((a=(s=this.description.mounting)==null?void 0:s.orientation)==null?void 0:a[1])||0,((u=(l=this.description.mounting)==null?void 0:l.orientation)==null?void 0:u[2])||0),n=t.length(),r=t.normalize();return new Ja.Quaternion().setFromAxisAngle(r,n)}get isEstopActive(){return["SAFETY_STATE_ROBOT_EMERGENCY_STOP","SAFETY_STATE_DEVICE_EMERGENCY_STOP"].includes(this.controllerState.safety_state)}get isMoveableSafetyState(){return["SAFETY_STATE_NORMAL","SAFETY_STATE_REDUCED"].includes(this.controllerState.safety_state)}get isMoveableOperationMode(){return["OPERATION_MODE_AUTO","OPERATION_MODE_MANUAL","OPERATION_MODE_MANUAL_T1","OPERATION_MODE_MANUAL_T2"].includes(this.controllerState.operation_mode)}get canBeMoved(){return this.isMoveableSafetyState&&this.isMoveableOperationMode&&this.activationState==="active"}async deactivate(){if(this.activationState!=="active"){console.error("Tried to deactivate while already deactivating");return}ce.runInAction(()=>{this.activationState="deactivating"});try{await this.nova.api.controller.setDefaultMode(this.controllerId,"ROBOT_SYSTEM_MODE_MONITOR"),ce.runInAction(()=>{this.activationState="inactive"})}catch(t){throw ce.runInAction(()=>{this.activationState="active"}),t}}async activate(){if(this.activationState!=="inactive"){console.error("Tried to activate while already activating");return}ce.runInAction(()=>{this.activationState="activating"});try{await this.nova.api.controller.setDefaultMode(this.controllerId,"ROBOT_SYSTEM_MODE_CONTROL"),ce.runInAction(()=>{this.activationState="active"})}catch(t){throw ce.runInAction(()=>{this.activationState="inactive"}),t}}toggleActivation(){this.activationState==="inactive"?this.activate():this.activationState==="active"&&this.deactivate()}dispose(){this.motionStateSocket.close(),this.connectedJoggingSocket&&this.connectedJoggingSocket.close()}setJoggingVelocity(t){this.joggingVelocity=t}}function Jh(){var t,n,r,i,o,s;const e=M.createTheme({palette:{mode:"dark",text:{primary:"rgba(255, 255, 255, 1)",secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.38)"},primary:{main:"rgba(142, 86, 252, 1)",dark:"rgba(136, 58, 255, 1)",light:"rgba(157, 131, 246, 1)",contrastText:"rgba(255, 255, 255, 0.87)"},secondary:{main:"rgba(255, 255, 255, 1)",dark:"rgba(255, 255, 255, 0.06)",contrastText:"rgba(255, 255, 255, 0.87)"},tertiary:{main:"rgba(100, 255, 218, 1)",dark:"rgba(38, 166, 154, 1)",light:"rgba(167, 255, 235, 1)",contrastText:"rgba(0, 0, 0, 1)"},error:{main:"rgba(239, 83, 80, 1)",dark:"rgba(229, 57, 53, 1)",light:"rgba(239, 154, 154, 1)",contrastText:"rgba(255, 255, 255, 1)"},warning:{main:"rgba(255, 171, 64, 1)",dark:"rgba(255, 145, 0, 1)",light:"rgba(255, 209, 128, 1)",contrastText:"rgba(0, 0, 0, 0.87)"},success:{main:"rgba(38, 166, 154, 1)",dark:"rgba(0, 121, 107, 1)",light:"rgba(128, 203, 196, 1)",contrastText:"rgba(255, 255, 255, 0.87)"},background:{default:"rgba(2, 6, 23, 1)",paper:"rgba(17, 19, 31, 1)"},action:{active:"rgba(255, 255, 255, 0.56)",hover:"rgba(255, 255, 255, 0.08)",selected:"rgba(255, 255, 255, 0.16)",disabledBackground:"rgba(255, 255, 255, 0.12)",focus:"rgba(255, 255, 255, 0.12)",disabled:"rgba(255, 255, 255, 0.38)"},common:{white:"rgba(255, 255, 255, 1)",black:"rgba(0, 0, 0, 1)"},divider:"rgba(255, 255, 255, 0.12)",backgroundPaperElevation:{0:"rgba(17,19,31,1.0)",1:"rgba(20,22,35,1.0)",2:"rgba(23,25,39,1.0)",3:"rgba(26,28,43,1.0)",4:"rgba(29,31,47,1.0)",5:"rgba(32,34,51,1.0)",6:"rgba(35,37,55,1.0)",7:"rgba(38,40,59,1.0)",8:"rgba(41,43,63,1.0)",9:"rgba(44,46,67,1.0)",10:"rgba(47,49,71,1.0)",11:"rgba(50,52,75,1.0)",12:"rgba(53,55,79,1.0)",13:"rgba(56,58,83,1.0)",14:"rgba(59,61,87,1.0)",15:"rgba(62,64,91,1.0)",16:"rgba(57,63,87,1.0)"}},paletteExt:{primary:{hover:"rgba(142, 86, 252, 0.08)",selected:"rgba(142, 86, 252, 0.16)",focus:"rgba(142, 86, 252, 0.12)",focusVisible:"rgba(142, 86, 252, 0.3)",outlineBorder:"rgba(142, 86, 252, 0.5)"},secondary:{tonal:"rgba(255,255,255,0.1)"}}});return{...e,components:{MuiCssBaseline:{styleOverrides:{"html, body, *":{scrollbarWidth:"none",msOverflowStyle:"none"},"html:hover, body:hover, *:hover":{scrollbarWidth:"thin",scrollbarColor:`${e.palette.divider} transparent`},".MuiDataGrid-panelContent":{borderRadius:"16px !important","& .MuiPaper-root":{borderRadius:"16px !important"}},".MuiDataGrid-filterForm":{borderRadius:"16px !important","& .MuiInputBase-root":{borderRadius:"16px !important","& fieldset":{borderRadius:"16px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"16px !important"}},"& .MuiTextField-root":{"& .MuiInputBase-root":{borderRadius:"16px !important","& fieldset":{borderRadius:"16px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"16px !important"}}}},".MuiDataGrid-filterFormValueInput":{"& .MuiInputBase-root":{borderRadius:"16px !important","& fieldset":{borderRadius:"16px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"16px !important"}}}}},MuiDataGrid:{styleOverrides:{root:{},panelContent:{borderRadius:"16px !important"},filterForm:{"& .MuiInputBase-root":{borderRadius:"10px !important","& fieldset":{borderRadius:"10px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"10px !important"}}},filterFormValueInput:{"& .MuiInputBase-root":{borderRadius:"10px !important","& fieldset":{borderRadius:"10px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"10px !important"}}}}},MuiButton:{styleOverrides:{root:{textTransform:"none",borderRadius:"10px"}},variants:[{props:{color:"secondary",variant:"contained"},style:{border:`1px solid ${e.palette.divider}`,background:(r=(n=(t=e.paletteExt)==null?void 0:t.secondary)==null?void 0:n.tonal)==null?void 0:r.toString()}},{props:{color:"secondary",variant:"outlined"},style:{border:`1px solid ${e.palette.divider}`}}]},MuiTab:{styleOverrides:{root:{textTransform:"none",color:e.palette.text.secondary,"&.Mui-selected":{color:e.palette.text.primary}}}},MuiTabs:{styleOverrides:{root:{background:(i=e.palette.backgroundPaperElevation)==null?void 0:i[1]}}},MuiToggleButtonGroup:{styleOverrides:{root:{".MuiToggleButtonGroup-firstButton":{borderRadius:"10px 0 0 10px"},".MuiToggleButtonGroup-lastButton":{borderRadius:"0 10px 10px 0"}}}},MuiToggleButton:{styleOverrides:{root:{textTransform:"none",padding:"6px 16px"}}},MuiSelect:{variants:[{props:{variant:"filled"},style:{borderRadius:"10px","::before, ::after":{visibility:"collapse"},".MuiInputBase-input":{padding:"6px 16px",borderRadius:"10px"}}}]},MuiDrawer:{styleOverrides:{paper:{border:"none",boxShadow:"4px 0 8px -4px rgba(0, 0, 0, 0.3)"}}},MuiFab:{styleOverrides:{root:{background:(s=(o=e.paletteExt)==null?void 0:o.secondary)==null?void 0:s.tonal}},variants:[{props:{color:"primary"},style:{background:e.palette.primary.main}}]}},componentsExt:{JoggingPanel:{JoggingCartesian:{Axis:{X:{backgroundColor:"rgba(215, 66, 56, 1)",borderColor:"rgba(215, 66, 56, 1)",buttonBackgroundColor:{default:"rgba(241, 77, 66, 1)",pressed:"rgba(138, 41, 35, 1)",hovered:"rgba(241, 77, 66, 1)",disabled:"rgba(241, 77, 66, 1)"},color:"rgba(255, 198, 198, 1)",labelColor:e.palette.text.primary},Y:{backgroundColor:"rgba(20, 151, 108, 1)",borderColor:"rgba(20, 151, 108, 1)",buttonBackgroundColor:{default:"rgba(28, 188, 135, 1)",pressed:"rgba(11, 89, 63, 1)",disabled:"rgba(28, 188, 135, 1)",hovered:"rgba(28, 188, 135, 1)"},color:"rgba(215, 255, 242, 1)",labelColor:e.palette.text.primary},Z:{backgroundColor:"rgba(1, 87, 155, 1)",borderColor:"rgba(1, 87, 155, 1)",buttonBackgroundColor:{default:"rgba(2, 136, 209, 1)",pressed:"rgba(2, 64, 114, 1)",disabled:"rgba(2, 136, 209, 1)",hovered:"rgba(2, 136, 209, 1)"},color:"rgba(210, 239, 255, 1)",labelColor:e.palette.text.primary}}},JoggingJoint:{Joint:{arrowColor:e.palette.text.primary}},VelocitySlider:{sliderLegendColor:e.palette.text.primary}}}}}function $M(){const e=Jh();return e.palette.mode="light",e}function NM(e){var r,i,o,s;let t=!0;((r=e.palette)==null?void 0:r.mode)==="light"?t=!1:((i=e.palette)==null?void 0:i.mode)!=="dark"&&(t=!(typeof window<"u"&&((s=(o=window.matchMedia)==null?void 0:o.call(window,"(prefers-color-scheme: light)"))==null?void 0:s.matches)));const n=t?Jh():$M();return Lc(n,e)}exports.AppHeader=lf;exports.ConnectedMotionGroup=Ni;exports.CycleTimer=_S;exports.JoggerConnection=Ro;exports.JoggingCartesianAxisControl=_s;exports.JoggingJointValueControl=xh;exports.JoggingPanel=aM;exports.JoggingStore=ko;exports.LoadingCover=Sh;exports.LoadingErrorMessage=Eh;exports.LogPanel=mM;exports.LogStore=Hh;exports.LogViewer=qh;exports.MotionStreamConnection=Mo;exports.NoMotionGroupModal=yM;exports.PoseCartesianValues=uM;exports.PoseJointValues=cM;exports.RobotListItem=bM;exports.RobotSetupReadinessIndicator=Kh;exports.RobotSetupReadinessState=qa;exports.SafetyBar=TM;exports.SelectableFab=CM;exports.TabBar=AM;exports.Timer=PM;exports.VelocitySlider=Vh;exports.VelocitySliderLabel=Ha;exports.WandelbotsDataGrid=mh;exports.createDebugMessage=dM;exports.createErrorMessage=pM;exports.createInfoMessage=hM;exports.createLogMessage=Ir;exports.createNovaMuiTheme=NM;exports.createWarningMessage=fM;exports.jointValuesEqual=Fa;exports.poseEqual=bh;exports.tcpMotionEqual=Ba;exports.unwrapRotationVector=vh;
|
|
115
|
-
//# sourceMappingURL=theming-
|
|
106
|
+
`));return e.svgRef}function E1(){const e=oh();return O.useCallback(t=>`${e}-gradient-${t}`,[e])}function T1(){const e=oh();return O.useCallback(t=>`${e}-gradient-${t}-object-bound`,[e])}var is,_c;function w1(){if(_c)return is;_c=1;var e=4,t=.001,n=1e-7,r=10,i=11,o=1/(i-1),s=typeof Float32Array=="function";function a(p,y){return 1-3*y+3*p}function l(p,y){return 3*y-6*p}function c(p){return 3*p}function u(p,y,b){return((a(y,b)*p+l(y,b))*p+c(y))*p}function d(p,y,b){return 3*a(y,b)*p*p+2*l(y,b)*p+c(y)}function h(p,y,b,E,T){var w,C,S=0;do C=y+(b-y)/2,w=u(C,E,T)-p,w>0?b=C:y=C;while(Math.abs(w)>n&&++S<r);return C}function f(p,y,b,E){for(var T=0;T<e;++T){var w=d(y,b,E);if(w===0)return y;var C=u(y,b,E)-p;y-=C/w}return y}function m(p){return p}return is=function(y,b,E,T){if(!(0<=y&&y<=1&&0<=E&&E<=1))throw new Error("bezier x values must be in [0, 1] range");if(y===b&&E===T)return m;for(var w=s?new Float32Array(i):new Array(i),C=0;C<i;++C)w[C]=u(C*o,y,E);function S(R){for(var I=0,k=1,z=i-1;k!==z&&w[k]<=R;++k)I+=o;--k;var P=(R-w[k])/(w[k+1]-w[k]),v=I+P*o,_=d(v,y,E);return _>=t?f(R,v,y,E):_===0?v:h(R,I,I+o,y,E)}return function(I){return I===0?0:I===1?1:u(S(I),b,T)}},is}var C1=w1();const M1=sf(C1),R1=300,A1=M1(.66,0,.34,1);var Vn=0,rr=0,Qn=0,sh=1e3,ki,ir,Oi=0,ln=0,Co=0,br=typeof performance=="object"&&performance.now?performance:Date,ah=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ka(){return ln||(ah(_1),ln=br.now()+Co)}function _1(){ln=0}function Pi(){this._call=this._time=this._next=null}Pi.prototype=lh.prototype={constructor:Pi,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ka():+n)+(t==null?0:+t),!this._next&&ir!==this&&(ir?ir._next=this:ki=this,ir=this),this._call=e,this._time=n,_s()},stop:function(){this._call&&(this._call=null,this._time=1/0,_s())}};function lh(e,t,n){var r=new Pi;return r.restart(e,t,n),r}function I1(){ka(),++Vn;for(var e=ki,t;e;)(t=ln-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Vn}function Ic(){ln=(Oi=br.now())+Co,Vn=rr=0;try{I1()}finally{Vn=0,k1(),ln=0}}function j1(){var e=br.now(),t=e-Oi;t>sh&&(Co-=t,Oi=e)}function k1(){for(var e,t=ki,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ki=n);ir=e,_s(r)}function _s(e){if(!Vn){rr&&(rr=clearTimeout(rr));var t=e-ln;t>24?(e<1/0&&(rr=setTimeout(Ic,e-br.now()-Co)),Qn&&(Qn=clearInterval(Qn))):(Qn||(Oi=br.now(),Qn=setInterval(j1,sh)),Vn=1,ah(Ic))}}function O1(e,t,n){var r=new Pi;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}class P1{constructor(t,n,r){W(this,"elapsed",0);W(this,"timer",null);this.duration=t,this.easingFn=n,this.onTickCallback=r,this.resume()}get running(){return this.timer!==null}timerCallback(t){this.elapsed=Math.min(t,this.duration);const n=this.duration===0?1:this.elapsed/this.duration,r=this.easingFn(n);this.onTickCallback(r),this.elapsed>=this.duration&&this.stop()}resume(){if(this.running||this.elapsed>=this.duration)return this;const t=ka()-this.elapsed;return this.timer=lh(n=>this.timerCallback(n),0,t),this}stop(){return this.running?(this.timer&&(this.timer.stop(),this.timer=null),this):this}finish(){return this.stop(),O1(()=>this.timerCallback(this.duration)),this}}function D1(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i+=1){const o=n[i];if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1}return!0}function $1(e,{createInterpolator:t,applyProps:n,skip:r,initialProps:i=e}){const o=O.useRef(i),s=O.useRef(null),a=O.useRef(null),l=O.useRef(e);ot(()=>{l.current=e},[e]),ot(()=>{var d;r&&((d=s.current)==null||d.finish(),s.current=null,a.current=null,o.current=e)},[e,r]);const c=O.useCallback(d=>{const h=o.current,f=t(h,e);s.current=new P1(R1,A1,m=>{const p=f(m);o.current=p,n(d,p)})},[n,t,e]);return[O.useCallback(d=>{var f,m,p,y;if(d===null){(f=s.current)==null||f.stop();return}const h=a.current;if(h===d){if(D1(l.current,e)){(m=s.current)==null||m.resume();return}(p=s.current)==null||p.stop()}h&&((y=s.current)==null||y.stop()),a.current=d,(s.current||!r)&&c(d)},[c,e,r]),o.current]}function N1(e,{createInterpolator:t,transformProps:n,applyProps:r,skip:i,initialProps:o=e,ref:s}){const a=n??(d=>d),[l,c]=$1(e,{initialProps:o,createInterpolator:t,applyProps:(d,h)=>r(d,a(h)),skip:i}),u=n(i?e:c);return L({},u,{ref:eo(l,s)})}function jc(e){const{isReversed:t,gradientId:n,size:r,direction:i,scale:o,colorMap:s}=e;return r<=0?null:g.jsxRuntimeExports.jsx("linearGradient",{id:n,x1:"0",x2:"0",y1:"0",y2:"0",[`${i}${t?1:2}`]:`${r}px`,gradientUnits:"userSpaceOnUse",children:s.thresholds.map((a,l)=>{const c=o(a);if(c===void 0)return null;const u=t?1-c/r:c/r;return Number.isNaN(u)?null:g.jsxRuntimeExports.jsxs(O.Fragment,{children:[g.jsxRuntimeExports.jsx("stop",{offset:u,stopColor:s.colors[l],stopOpacity:1}),g.jsxRuntimeExports.jsx("stop",{offset:u,stopColor:s.colors[l+1],stopOpacity:1})]},a.toString()+l)})})}const L1=10;function kc(e){const{gradientUnits:t,isReversed:n,gradientId:r,size:i,direction:o,scale:s,colorScale:a,colorMap:l}=e,c=[l.min??0,l.max??100],u=c.map(s).filter(m=>m!==void 0);if(u.length!==2)return null;const d=typeof c[0]=="number"?nt(c[0],c[1]):aa(c[0],c[1]),h=Math.round((Math.max(...u)-Math.min(...u))/L1),f=`${c[0]}-${c[1]}-`;return g.jsxRuntimeExports.jsx("linearGradient",{id:r,x1:"0",x2:"0",y1:"0",y2:"0",[`${o}${n?1:2}`]:t==="objectBoundingBox"?1:`${i}px`,gradientUnits:t??"userSpaceOnUse",children:Array.from({length:h+1},(m,p)=>{const y=d(p/h);if(y===void 0)return null;const b=s(y);if(b===void 0)return null;const E=n?1-b/i:b/i,T=a(y);return T===null?null:g.jsxRuntimeExports.jsx("stop",{offset:E,stopColor:T,stopOpacity:1},f+p)})})}const z1=10,F1=e=>e?{x1:"1",x2:"0",y1:"0",y2:"0"}:{x1:"0",x2:"1",y1:"0",y2:"0"};function os(e){const{isReversed:t,gradientId:n,colorScale:r,colorMap:i}=e,o=[i.min??0,i.max??100],s=typeof o[0]=="number"?nt(o[0],o[1]):aa(o[0],o[1]),a=z1,l=`${o[0]}-${o[1]}-`;return g.jsxRuntimeExports.jsx("linearGradient",L({id:n},F1(t),{gradientUnits:"objectBoundingBox",children:Array.from({length:a+1},(c,u)=>{const d=u/a,h=s(d);if(h===void 0)return null;const f=r(h);return f===null?null:g.jsxRuntimeExports.jsx("stop",{offset:d,stopColor:f,stopOpacity:1},l+u)})}))}function B1(){const{top:e,height:t,bottom:n,left:r,width:i,right:o}=ih(),s=e+t+n,a=r+i+o,l=E1(),c=T1(),{xAxis:u,xAxisIds:d}=x1(),{yAxis:h,yAxisIds:f}=b1(),{zAxis:m,zAxisIds:p}=v1(),y=f.filter(T=>h[T].colorMap!==void 0),b=d.filter(T=>u[T].colorMap!==void 0),E=p.filter(T=>m[T].colorMap!==void 0);return y.length===0&&b.length===0&&E.length===0?null:g.jsxRuntimeExports.jsxs("defs",{children:[y.map(T=>{const w=l(T),C=c(T),{colorMap:S,scale:R,colorScale:I,reverse:k}=h[T];return(S==null?void 0:S.type)==="piecewise"?g.jsxRuntimeExports.jsx(jc,{isReversed:!k,scale:R,colorMap:S,size:s,gradientId:w,direction:"y"},w):(S==null?void 0:S.type)==="continuous"?g.jsxRuntimeExports.jsxs(O.Fragment,{children:[g.jsxRuntimeExports.jsx(kc,{isReversed:!k,scale:R,colorScale:I,colorMap:S,size:s,gradientId:w,direction:"y"}),g.jsxRuntimeExports.jsx(os,{isReversed:k,colorScale:I,colorMap:S,gradientId:C})]},w):null}),b.map(T=>{const w=l(T),C=c(T),{colorMap:S,scale:R,reverse:I,colorScale:k}=u[T];return(S==null?void 0:S.type)==="piecewise"?g.jsxRuntimeExports.jsx(jc,{isReversed:I,scale:R,colorMap:S,size:a,gradientId:w,direction:"x"},w):(S==null?void 0:S.type)==="continuous"?g.jsxRuntimeExports.jsxs(O.Fragment,{children:[g.jsxRuntimeExports.jsx(kc,{isReversed:I,scale:R,colorScale:k,colorMap:S,size:a,gradientId:w,direction:"x"}),g.jsxRuntimeExports.jsx(os,{isReversed:I,colorScale:k,colorMap:S,gradientId:C})]},w):null}),E.map(T=>{const w=c(T),{colorMap:C,colorScale:S}=m[T];return(C==null?void 0:C.type)==="continuous"?g.jsxRuntimeExports.jsx(os,{colorScale:S,colorMap:C,gradientId:w},w):null})]})}function G1(e){return hn("MuiChartsSurface",e)}const U1=()=>Er({root:["root"]},G1);Ji("MuiChartsSurface",["root"]);const V1=["children","className","title","desc"],Y1=We("svg",{name:"MuiChartsSurface",slot:"Root"})(({ownerState:e})=>({width:e.width??"100%",height:e.height??"100%",display:"flex",position:"relative",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden",touchAction:"pan-y",userSelect:"none",gridArea:"chart","&:focus":{outline:"none"}})),Oa=O.forwardRef(function(t,n){const{store:r,instance:i}=ja(),o=r.use(zg),s=r.use(Fg),a=r.use(Bg),l=r.use(Gg),c=r.use(Ub),u=r.use(Gb),d=S1(),h=eo(d,n),f=zm({props:t,name:"MuiChartsSurface"}),{children:m,className:p,title:y,desc:b}=f,E=pt(f,V1),T=U1(),w=s>0&&o>0;return g.jsxRuntimeExports.jsxs(Y1,L({ownerState:{width:a,height:l},viewBox:`0 0 ${o} ${s}`,className:Ne(T.root,p),tabIndex:c?0:void 0,"data-has-focused-item":u||void 0},E,{onPointerEnter:C=>{var S,R;(S=E.onPointerEnter)==null||S.call(E,C),(R=i.handlePointerEnter)==null||R.call(i,C)},onPointerLeave:C=>{var S,R;(S=E.onPointerLeave)==null||S.call(E,C),(R=i.handlePointerLeave)==null||R.call(i,C)},onClick:C=>{var S,R;(S=E.onClick)==null||S.call(E,C),(R=i.handleClick)==null||R.call(i,C)},ref:h,children:[y&&g.jsxRuntimeExports.jsx("title",{children:y}),b&&g.jsxRuntimeExports.jsx("desc",{children:b}),g.jsxRuntimeExports.jsx(B1,{}),w&&m]}))});process.env.NODE_ENV!=="production"&&(Oa.displayName="ChartsSurface");process.env.NODE_ENV!=="production"&&(Oa.propTypes={children:x.node,className:x.string,desc:x.string,sx:x.oneOfType([x.arrayOf(x.oneOfType([x.func,x.object,x.bool])),x.func,x.object]),title:x.string});function ss(e){const t=nn(e);return[Math.sin(t),-Math.cos(t)]}function W1(e,t){const n=[[0,0],ss(e),ss(t)],r=Math.min(e,t),i=Math.max(e,t),o=Math.floor(r/90)*90;for(let u=1;u<=4;u+=1){const d=o+u*90;d<i&&n.push(ss(d))}const s=Math.min(...n.map(([u])=>u)),a=Math.max(...n.map(([u])=>u)),l=Math.min(...n.map(([,u])=>u)),c=Math.max(...n.map(([,u])=>u));return{cx:-s/(a-s),cy:-l/(c-l),minX:s,maxX:a,minY:l,maxY:c}}function H1(e,t,n,r,{minX:i,maxX:o,minY:s,maxY:a}){return Math.min(...[{ratio:Math.abs(i),space:e},{ratio:Math.abs(o),space:n-e},{ratio:Math.abs(s),space:t},{ratio:Math.abs(a),space:r-t}].map(({ratio:l,space:c})=>l<1e-5?1/0:c/l))}const Pa=O.createContext({value:null,valueMin:0,valueMax:0,startAngle:0,endAngle:0,innerRadius:0,outerRadius:0,cornerRadius:0,cx:0,cy:0,maxRadius:0,valueAngle:null});process.env.NODE_ENV!=="production"&&(Pa.displayName="GaugeContext");function q1(e){const{value:t=null,valueMin:n=0,valueMax:r=100,startAngle:i=0,endAngle:o=360,outerRadius:s,innerRadius:a,cornerRadius:l,cx:c,cy:u,children:d}=e,{left:h,top:f,width:m,height:p}=ih(),y=W1(i,o),b=c?dt(c,m):y.cx*m,E=u?dt(u,p):y.cy*p;let T=h+b,w=f+E;const C=H1(b,E,m,p,y);if(c===void 0){const z=C*(y.maxX-y.minX);T=h+(m-z)/2+y.cx*z}if(u===void 0){const z=C*(y.maxY-y.minY);w=f+(p-z)/2+y.cy*z}const S=dt(s??C,C),R=dt(a??"80%",C),I=dt(l??0,S-R),k=O.useMemo(()=>{const z=nn(i),P=nn(o);return{value:t,valueMin:n,valueMax:r,startAngle:z,endAngle:P,outerRadius:S,innerRadius:R,cornerRadius:I,cx:T,cy:w,maxRadius:C,valueAngle:t===null?null:z+(P-z)*(t-n)/(r-n)}},[t,n,r,i,o,S,R,I,T,w,C]);return g.jsxRuntimeExports.jsx(Pa.Provider,{value:k,children:d})}function Da(){return O.useContext(Pa)}const K1=["width","height","margin","title","desc","value","valueMin","valueMax","startAngle","endAngle","outerRadius","innerRadius","cornerRadius","cx","cy","children"],J1=We("g",{slot:"internal",shouldForwardProp:void 0})(({theme:e})=>({"& text":{fill:(e.vars||e).palette.text.primary}})),$a=O.forwardRef(function(t,n){const{width:r,height:i,margin:o,title:s,desc:a,value:l,valueMin:c=0,valueMax:u=100,startAngle:d,endAngle:h,outerRadius:f,innerRadius:m,cornerRadius:p,cx:y,cy:b,children:E}=t,T=pt(t,K1);return g.jsxRuntimeExports.jsx(y1,{pluginParams:{width:r,height:i,margin:Vu(o,{left:10,right:10,top:10,bottom:10})},plugins:[],children:g.jsxRuntimeExports.jsx(q1,{value:l,valueMin:c,valueMax:u,startAngle:d,endAngle:h,outerRadius:f,innerRadius:m,cornerRadius:p,cx:y,cy:b,children:g.jsxRuntimeExports.jsx(Oa,L({title:s,desc:a,role:"meter","aria-valuenow":l===null?void 0:l,"aria-valuemin":c,"aria-valuemax":u},T,{ref:n,children:g.jsxRuntimeExports.jsx(J1,{"aria-hidden":"true",children:E})}))})})});process.env.NODE_ENV!=="production"&&($a.displayName="GaugeContainer");process.env.NODE_ENV!=="production"&&($a.propTypes={children:x.node,className:x.string,cornerRadius:x.oneOfType([x.number,x.string]),cx:x.oneOfType([x.number,x.string]),cy:x.oneOfType([x.number,x.string]),desc:x.string,endAngle:x.number,height:x.number,id:x.string,innerRadius:x.oneOfType([x.number,x.string]),margin:x.oneOfType([x.number,x.shape({bottom:x.number,left:x.number,right:x.number,top:x.number})]),outerRadius:x.oneOfType([x.number,x.string]),skipAnimation:x.bool,startAngle:x.number,sx:x.oneOfType([x.arrayOf(x.oneOfType([x.func,x.object,x.bool])),x.func,x.object]),title:x.string,value:x.number,valueMax:x.number,valueMin:x.number,width:x.number});function X1(e){const n=Hn().use(Mg);return e||n}function Z1(e,t){const n=nt(e.startAngle,t.startAngle),r=nt(e.endAngle,t.endAngle),i=nt(e.innerRadius,t.innerRadius),o=nt(e.outerRadius,t.outerRadius),s=nt(e.cornerRadius,t.cornerRadius);return a=>({startAngle:n(a),endAngle:r(a),innerRadius:i(a),outerRadius:o(a),cornerRadius:s(a)})}function Q1(e){return N1({startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,cornerRadius:e.cornerRadius},{createInterpolator:Z1,transformProps:t=>({d:Hd().cornerRadius(t.cornerRadius)({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle})}),applyProps(t,n){t.setAttribute("d",n.d)},initialProps:{startAngle:e.startAngle,endAngle:e.startAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,cornerRadius:e.cornerRadius},skip:e.skipAnimation,ref:e.ref})}function eS(e){return hn("MuiGauge",e)}const Na=Ji("MuiGauge",["root","valueArc","referenceArc","valueText"]),tS=["className"],nS=["cx","cy","startAngle","endAngle","cornerRadius","innerRadius","outerRadius","skipAnimation"],rS=We("path",{name:"MuiGauge",slot:"ValueArc"})(({theme:e})=>({fill:(e.vars||e).palette.primary.main}));function ch(e){let{className:t}=e,n=pt(e,tS);const{value:r,valueMin:i,valueMax:o,startAngle:s,endAngle:a,outerRadius:l,innerRadius:c,cornerRadius:u,cx:d,cy:h}=Da();if(r===null)return null;const f=s+(r-i)/(o-i)*(a-s);return g.jsxRuntimeExports.jsx(uh,L({},n,{className:Ne(Na.valueArc,t),cx:d,cy:h,startAngle:s,endAngle:f,cornerRadius:u,innerRadius:c,outerRadius:l}))}process.env.NODE_ENV!=="production"&&(ch.propTypes={skipAnimation:x.bool});function uh(e){let{cx:t,cy:n,startAngle:r,endAngle:i,cornerRadius:o,innerRadius:s,outerRadius:a,skipAnimation:l}=e,c=pt(e,nS);const u=X1(l),d=Q1({startAngle:r,endAngle:i,cornerRadius:o,innerRadius:s,outerRadius:a,skipAnimation:u});return g.jsxRuntimeExports.jsx(rS,L({},d,{transform:`translate(${t}, ${n})`},c))}process.env.NODE_ENV!=="production"&&(uh.propTypes={cornerRadius:x.number.isRequired,cx:x.number.isRequired,cy:x.number.isRequired,endAngle:x.number.isRequired,innerRadius:x.number.isRequired,outerRadius:x.number.isRequired,skipAnimation:x.bool,startAngle:x.number.isRequired});const iS=["className"],oS=We("path",{name:"MuiGauge",slot:"ReferenceArc"})(({theme:e})=>({fill:(e.vars||e).palette.divider}));function sS(e){let{className:t}=e,n=pt(e,iS);const{startAngle:r,endAngle:i,outerRadius:o,innerRadius:s,cornerRadius:a,cx:l,cy:c}=Da();return g.jsxRuntimeExports.jsx(oS,L({className:Ne(Na.referenceArc,t),transform:`translate(${l}, ${c})`,d:Hd().cornerRadius(a)({startAngle:r,endAngle:i,innerRadius:s,outerRadius:o})},n))}function aS(){return typeof window>"u"}const ti=new Map,lS=2e3,cS=new Set(["minWidth","maxWidth","width","minHeight","maxHeight","height","top","left","fontSize","padding","margin","paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom"]);function dh(e,t){return cS.has(e)&&t===+t?`${t}px`:t}const uS=/([A-Z])/g;function hh(e){return String(e).replace(uS,t=>`-${t.toLowerCase()}`)}function dS(e){let t="";for(const n in e)if(Object.hasOwn(e,n)){const r=n,i=e[r];if(i===void 0)continue;t+=`${hh(r)}:${dh(r,i)};`}return t}const hS=(e,t={})=>{if(e==null||aS())return{width:0,height:0};const n=String(e),r=dS(t),i=`${n}-${r}`,o=ti.get(i);if(o)return o;try{const s=pS(),a=document.createElementNS("http://www.w3.org/2000/svg","text");Object.keys(t).map(c=>(a.style[hh(c)]=dh(c,t[c]),c)),a.textContent=n,s.replaceChildren(a);const l=fS(a);return ti.set(i,l),ti.size+1>lS&&ti.clear(),process.env.NODE_ENV==="test"&&s.replaceChildren(),l}catch{return{width:0,height:0}}};function fS(e){try{const t=e.getBBox();return{width:t.width,height:t.height}}catch{const t=e.getBoundingClientRect();return{width:t.width,height:t.height}}}let Fe=null;function pS(){return Fe===null&&(Fe=document.createElementNS("http://www.w3.org/2000/svg","svg"),Fe.setAttribute("aria-hidden","true"),Fe.style.position="absolute",Fe.style.top="-20000px",Fe.style.left="0",Fe.style.padding="0",Fe.style.margin="0",Fe.style.border="none",Fe.style.pointerEvents="none",Fe.style.visibility="hidden",Fe.style.contain="strict",document.body.appendChild(Fe)),Fe}function mS({style:e,needsComputation:t,text:n}){return n.split(`
|
|
107
|
+
`).map(r=>L({text:r},t?hS(r,e):{width:0,height:0}))}function gS(){const[e,t]=O.useState(!1);return O.useEffect(()=>{t(!0)},[]),e}const yS=["x","y","style","text","ownerState"],xS=["angle","textAnchor","dominantBaseline"];function fh(e){const{x:t,y:n,style:r,text:i}=e,o=pt(e,yS),s=r??{},{angle:a,textAnchor:l,dominantBaseline:c}=s,u=pt(s,xS),d=gS(),h=O.useMemo(()=>mS({style:u,needsComputation:d&&i.includes(`
|
|
108
|
+
`),text:i}),[u,i,d]);let f;switch(c){case"hanging":case"text-before-edge":f=0;break;case"central":f=(h.length-1)/2*-h[0].height;break;default:f=(h.length-1)*-h[0].height;break}return g.jsxRuntimeExports.jsx("text",L({},o,{transform:a?`rotate(${a}, ${t}, ${n})`:void 0,x:t,y:n,textAnchor:l,dominantBaseline:c,style:u,children:h.map((m,p)=>g.jsxRuntimeExports.jsx("tspan",{x:t,dy:`${p===0?f:h[0].height}px`,dominantBaseline:c,children:m.text},p))}))}process.env.NODE_ENV!=="production"&&(fh.propTypes={lineHeight:x.number,needsComputation:x.bool,ownerState:x.any,style:x.object,text:x.string.isRequired});const bS=["text","className"];function vS({value:e}){return e===null?null:e.toLocaleString()}function ph(e){const{text:t=vS,className:n}=e,r=pt(e,bS),{value:i,valueMin:o,valueMax:s,cx:a,cy:l}=Da(),c=typeof t=="function"?t({value:i,valueMin:o,valueMax:s}):t;return c===null?null:g.jsxRuntimeExports.jsx("g",{className:Ne(Na.valueText,n),children:g.jsxRuntimeExports.jsx(fh,L({x:a,y:l,text:c,style:{textAnchor:"middle",dominantBaseline:"central"}},r))})}process.env.NODE_ENV!=="production"&&(ph.propTypes={lineHeight:x.number,needsComputation:x.bool,ownerState:x.any,style:x.object,text:x.oneOfType([x.func,x.string])});const SS=["text","children","classes","className","skipAnimation"],ES=e=>{const{classes:t}=e;return Er({root:["root"]},eS,t)},La=O.forwardRef(function(t,n){const{text:r,children:i,className:o,skipAnimation:s}=t,a=pt(t,SS),l=ES(t);return g.jsxRuntimeExports.jsxs($a,L({},a,{className:Ne(l.root,o),ref:n,children:[g.jsxRuntimeExports.jsx(sS,{}),g.jsxRuntimeExports.jsx(ch,{skipAnimation:s}),g.jsxRuntimeExports.jsx(ph,{text:r}),i]}))});process.env.NODE_ENV!=="production"&&(La.displayName="Gauge");process.env.NODE_ENV!=="production"&&(La.propTypes={children:x.node,classes:x.object,className:x.string,cornerRadius:x.oneOfType([x.number,x.string]),cx:x.oneOfType([x.number,x.string]),cy:x.oneOfType([x.number,x.string]),desc:x.string,endAngle:x.number,height:x.number,id:x.string,innerRadius:x.oneOfType([x.number,x.string]),margin:x.oneOfType([x.number,x.shape({bottom:x.number,left:x.number,right:x.number,top:x.number})]),outerRadius:x.oneOfType([x.number,x.string]),skipAnimation:x.bool,startAngle:x.number,sx:x.oneOfType([x.arrayOf(x.oneOfType([x.func,x.object,x.bool])),x.func,x.object]),text:x.oneOfType([x.func,x.string]),title:x.string,value:x.number,valueMax:x.number,valueMin:x.number,width:x.number});const TS=e=>{const t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60),i=e%60,o=[];return t>0?(o.push(t.toString()),o.push(n.toString().padStart(2,"0")),o.push(r.toString().padStart(2,"0")),o.push(i.toString().padStart(2,"0"))):n>0?(o.push(n.toString()),o.push(r.toString().padStart(2,"0")),o.push(i.toString().padStart(2,"0"))):(o.push(r.toString()),o.push(i.toString().padStart(2,"0"))),o.join(":")},ct=(e,t)=>{const n=Math.floor(e/86400),r=Math.floor(e%86400/3600),i=Math.floor(e%3600/60),o=e%60;if(typeof Intl<"u"&&"DurationFormat"in Intl)try{const a={};return n>0&&(a.days=n),r>0&&(a.hours=r),i>0&&(a.minutes=i),(o>0||Object.keys(a).length===0)&&(a.seconds=o),new Intl.DurationFormat(t,{style:"narrow"}).format(a)}catch{}const s=[];return n>0&&s.push(`${n}d`),r>0&&s.push(`${r}h`),i>0&&s.push(`${i}m`),(o>0||s.length===0)&&s.push(`${o}s`),s.join(" ")},wS=(e,t,n)=>e==="countdown"&&n!==null?Math.min(100,t/n*100):e==="measuring"?t/60%1*100:0,CS=({timerState:e,animationState:t,hasError:n,className:r})=>{const{t:i,i18n:o}=de.useTranslation(),s=M.useTheme(),{currentState:a,remainingTime:l,maxTime:c,currentProgress:u}=e,{showErrorAnimation:d,showPauseAnimation:h,showPulsatingText:f,pulsatingFinished:m,showLabels:p,showMainText:y,showIdlePulsating:b,idleDotsCount:E}=t;return g.jsxRuntimeExports.jsxs(M.Box,{className:r,sx:{position:"relative",width:264,height:264,display:"flex",alignItems:"center",justifyContent:"center"},children:[g.jsxRuntimeExports.jsx(La,{width:264,height:264,value:a==="idle"?0:u,valueMin:0,valueMax:100,innerRadius:"85%",outerRadius:"100%",margin:0,skipAnimation:!0,text:()=>"",sx:{opacity:h||d?.6:1,transition:"opacity 0.5s ease-out","& .MuiGauge-valueArc":{fill:n?s.palette.error.light:s.palette.success.main,transition:"fill 0.5s ease-out"},"& .MuiGauge-referenceArc":{fill:"#171927",stroke:"transparent",strokeWidth:0,transition:"fill 0.5s ease-out, stroke 0.5s ease-out, stroke-width 0.5s ease-out"},"& .MuiGauge-valueText":{display:"none"},"& .MuiGauge-text":{display:"none"}}}),g.jsxRuntimeExports.jsxs(M.Box,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:225,height:225,borderRadius:"50%",backgroundColor:"#292B3F",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",gap:1,transition:"background-color 0.5s ease-out"},children:[g.jsxRuntimeExports.jsx(M.Box,{sx:{height:"16px",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:1},children:g.jsxRuntimeExports.jsx(M.Fade,{in:p&&!n&&a!=="idle"&&a!=="success",timeout:300,children:g.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{fontSize:"12px",color:a==="measured"&&(f||m)?s.palette.success.main:s.palette.text.secondary,transition:"color 0.8s ease-in-out"},children:g.jsxRuntimeExports.jsx("span",{style:{opacity:a==="measured"&&m?f?1:.6:1,transition:"opacity 2s ease-in-out"},children:a==="measuring"||a==="measured"?i("CycleTimer.CycleTime.lb","Cycle Time"):a==="countdown"?i("CycleTimer.RemainingTime.lb","Remaining Time"):""})})})}),g.jsxRuntimeExports.jsxs(M.Box,{sx:{position:"relative",height:"48px",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:.5},children:[g.jsxRuntimeExports.jsx(M.Fade,{in:y&&a==="idle"&&!n,timeout:200,children:g.jsxRuntimeExports.jsxs(M.Typography,{variant:"body2",sx:{position:"absolute",fontSize:"12px",fontWeight:400,color:"rgba(255, 255, 255, 0.7)",lineHeight:"166%",letterSpacing:"0.17px",textAlign:"center",width:"200px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center"},children:[g.jsxRuntimeExports.jsx("span",{style:{opacity:b?1:.6,transition:"opacity 2s ease-in-out"},children:i("CycleTimer.WaitingForCycle.lb","Waiting for program cycle")}),g.jsxRuntimeExports.jsx("span",{style:{display:"inline-block",width:"18px",textAlign:"left",opacity:b?1:.6,transition:"opacity 2s ease-in-out"},children:".".repeat(E)})]})}),g.jsxRuntimeExports.jsx(M.Fade,{in:y&&n,timeout:200,children:g.jsxRuntimeExports.jsx(M.Typography,{variant:"h3",sx:{position:"absolute",fontSize:"40px",fontWeight:400,color:"#FFFFFF",lineHeight:"116.7%"},children:i("CycleTimer.Error.lb","Error")})}),g.jsxRuntimeExports.jsx(M.Fade,{in:y&&!n&&a!=="idle"&&a!=="success",timeout:300,children:g.jsxRuntimeExports.jsx(M.Typography,{variant:"h1",sx:{position:"absolute",fontSize:"48px",fontWeight:500,color:s.palette.text.primary,lineHeight:1,transition:"color 0.8s ease-in-out"},children:g.jsxRuntimeExports.jsx("span",{style:{opacity:1,transition:"opacity 2s ease-in-out"},children:TS(l)})})})]}),g.jsxRuntimeExports.jsx(M.Box,{sx:{height:"16px",display:"flex",marginTop:.5,alignItems:"center",justifyContent:"center"},children:g.jsxRuntimeExports.jsx(M.Fade,{in:p&&!n&&a!=="idle"&&a!=="success",timeout:300,children:g.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{fontSize:"12px",color:a==="measured"&&(f||m)?s.palette.success.main:s.palette.text.secondary,transition:"color 0.8s ease-in-out"},children:g.jsxRuntimeExports.jsx("span",{style:{opacity:a==="measured"&&m?f?1:.6:1,transition:"opacity 2s ease-in-out"},children:a==="measuring"?i("CycleTimer.Measuring.lb","measuring..."):a==="measured"?i("CycleTimer.Determined.lb","determined"):a==="countdown"&&c!==null?i("CycleTimer.OfTime.lb",{time:ct(c,o.language)}):""})})})})]})]})},MS=({timerState:e,animationState:t,hasError:n,compact:r,className:i})=>{const{t:o,i18n:s}=de.useTranslation(),a=M.useTheme(),{currentState:l,remainingTime:c,maxTime:u}=e,{showErrorAnimation:d,showPauseAnimation:h,showPulsatingText:f,pulsatingFinished:m,showIdlePulsating:p,idleDotsCount:y}=t;return r&&l==="idle"?g.jsxRuntimeExports.jsx(M.Box,{className:i,sx:{display:"flex",alignItems:"center",m:0},children:g.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{color:n?a.palette.error.light:a.palette.text.primary,fontSize:"14px",transition:"color 0.5s ease-out"},children:n?o("CycleTimer.Error.lb","Error"):l==="idle"?"0s":ct(c,s.language)})}):g.jsxRuntimeExports.jsxs(M.Box,{className:i,sx:{display:"flex",alignItems:"center",m:0,gap:1},children:[!(l==="idle"&&r)&&g.jsxRuntimeExports.jsx(M.Box,{sx:{width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",opacity:h||d?.6:1,transition:"opacity 0.5s ease-out"},children:g.jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",style:{transform:"rotate(-90deg)"},role:"img","aria-label":"Timer progress",children:[g.jsxRuntimeExports.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?a.palette.error.light:l==="measured"?f||m?a.palette.success.main:a.palette.text.secondary:a.palette.success.main,strokeWidth:"2",opacity:l==="measured"&&m?f?1:.6:.3,style:{transition:"stroke 0.8s ease-in-out, opacity 2s ease-in-out"}}),g.jsxRuntimeExports.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?a.palette.error.light:l==="measured"?f||m?a.palette.success.main:a.palette.text.secondary:a.palette.success.main,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:`${2*Math.PI*8}`,strokeDashoffset:`${2*Math.PI*8*(1-(l==="idle"?0:e.currentProgress)/100)}`,style:{opacity:l==="measured"&&m?f?1:.6:1,transition:"stroke-dashoffset 0.1s ease-out, stroke 0.8s ease-in-out, opacity 2s ease-in-out"}})]})}),g.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{color:n?a.palette.error.light:l==="idle"?"rgba(255, 255, 255, 0.7)":l==="measured"?f||m?a.palette.success.main:a.palette.text.secondary:a.palette.text.primary,fontSize:"14px",lineHeight:"normal",letterSpacing:"normal",opacity:l==="idle"?p?1:.6:l==="measured"&&m?f?1:.6:1,transition:"color 0.8s ease-in-out, font-size 0.3s ease-out, opacity 2s ease-in-out"},children:n?o("CycleTimer.Error.lb","Error"):l==="idle"?g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[g.jsxRuntimeExports.jsx("span",{children:o("CycleTimer.WaitingForCycle.lb","Waiting for program cycle")}),g.jsxRuntimeExports.jsx("span",{style:{display:"inline-block",width:"18px",textAlign:"left"},children:".".repeat(y)})]}):l==="measuring"?r?ct(c,s.language):`${ct(c,s.language)} / ${o("CycleTimer.Measuring.lb","measuring...")}`:l==="measured"?r?ct(c,s.language):`${ct(c,s.language)} / ${o("CycleTimer.Determined.lb","determined")}`:l==="countdown"&&u!==null?r?ct(c,s.language):`${ct(c,s.language)} / ${o("CycleTimer.Time.lb",{time:ct(u,s.language)})}`:ct(c,s.language)})]})},RS=()=>{const[e,t]=D.useState({showPauseAnimation:!1,showErrorAnimation:!1,showPulsatingText:!1,pulsatingFinished:!1,showLabels:!0,showMainText:!0,showIdlePulsating:!1,idleDotsCount:0}),n=D.useRef(null),r=D.useRef(null),i=D.useRef(null),o=D.useRef(null),s=D.useRef(0),a=D.useRef(null),l=D.useRef(null),c=D.useCallback(()=>{t(T=>({...T,showPauseAnimation:!0})),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{t(T=>({...T,showPauseAnimation:!1}))},800)},[]),u=D.useCallback(()=>{t(T=>({...T,showErrorAnimation:!0})),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{t(T=>({...T,showErrorAnimation:!1}))},600)},[]),d=D.useCallback(()=>{t(T=>({...T,showErrorAnimation:!1})),r.current&&clearTimeout(r.current)},[]),h=D.useCallback(T=>{s.current=0,t(w=>({...w,showPulsatingText:!0,pulsatingFinished:!1})),setTimeout(()=>{t(w=>({...w,pulsatingFinished:!0})),i.current=setInterval(()=>{t(w=>({...w,showPulsatingText:!w.showPulsatingText}))},2e3),T&&T()},800)},[]),f=D.useCallback(()=>{i.current&&(clearInterval(i.current),i.current=null),t(T=>({...T,showPulsatingText:!1,pulsatingFinished:!1})),s.current=0},[]),m=D.useCallback(()=>{t(T=>({...T,showIdlePulsating:!0})),a.current=setInterval(()=>{t(T=>({...T,showIdlePulsating:!T.showIdlePulsating}))},2e3),l.current=setInterval(()=>{t(T=>({...T,idleDotsCount:(T.idleDotsCount+1)%4}))},800)},[]),p=D.useCallback(()=>{a.current&&(clearInterval(a.current),a.current=null),l.current&&(clearInterval(l.current),l.current=null),t(T=>({...T,showIdlePulsating:!1,idleDotsCount:0}))},[]),y=D.useCallback(()=>{t(T=>({...T,showLabels:!1,showMainText:!1})),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{t(T=>({...T,showLabels:!0,showMainText:!0}))},200)},[]),b=D.useCallback(()=>{t(T=>({...T,showLabels:!0,showMainText:!0}))},[]),E=D.useCallback(()=>{n.current&&clearTimeout(n.current),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current),i.current&&clearInterval(i.current),a.current&&clearInterval(a.current),l.current&&clearInterval(l.current)},[]);return{animationState:e,triggerPauseAnimation:c,triggerErrorAnimation:u,clearErrorAnimation:d,startPulsatingAnimation:h,stopPulsatingAnimation:f,startIdleAnimations:m,stopIdleAnimations:p,triggerFadeTransition:y,setInitialAnimationState:b,cleanup:E}},AS=({autoStart:e,onCycleEnd:t,onMeasuringComplete:n,hasError:r,onPauseAnimation:i,onErrorAnimation:o,onClearErrorAnimation:s,onStartPulsating:a})=>{const[l,c]=D.useState({currentState:"idle",remainingTime:0,maxTime:null,isRunning:!1,isPausedState:!1,currentProgress:0,wasRunningBeforeError:!1}),u=D.useRef(null),d=D.useRef(null),h=D.useRef(0),[f]=g.useInterpolation([0],{tension:80,friction:18,onChange:([C])=>{c(S=>({...S,currentProgress:C}))}}),m=D.useCallback(()=>{c(C=>({...C,currentState:"idle",maxTime:null,isRunning:!1,isPausedState:!1,currentProgress:0})),h.current=0,d.current=null,f.setImmediate([0])},[f]),p=D.useCallback((C=0)=>{const S=C/60%1*100;c(R=>({...R,currentState:"measuring",maxTime:null,remainingTime:C,isPausedState:!1,currentProgress:S})),h.current=0,f.setImmediate([S]),e?(d.current=Date.now()-C*1e3,c(R=>({...R,isRunning:!0}))):d.current=null},[e,f]),y=D.useCallback((C,S=0)=>{c(k=>({...k,isRunning:!1})),d.current=null,c(k=>({...k,currentState:"countdown",maxTime:C,isPausedState:!1})),h.current=0;const R=Math.max(0,C-S),I=S>0?S/C*100:0;c(k=>({...k,remainingTime:R,currentProgress:I})),f.setImmediate([I]),R===0?(c(k=>({...k,isRunning:!1})),d.current=null,t&&queueMicrotask(()=>t())):e?setTimeout(()=>{d.current=Date.now()-S*1e3,c(k=>({...k,isRunning:!0}))},0):d.current=null},[e,t,f]),b=D.useCallback(()=>{c(C=>({...C,isRunning:!1,currentState:"measured"})),d.current=null,a(()=>{n&&n()})},[a,n]),E=D.useCallback(()=>{if(d.current&&l.isRunning){const S=Date.now()-d.current;h.current+=S;const R=h.current/1e3,I=wS(l.currentState,R,l.maxTime);f.setTarget([I])}c(C=>({...C,isRunning:!1,isPausedState:!0})),i()},[l.isRunning,l.currentState,l.maxTime,f,i]),T=D.useCallback(()=>{l.isPausedState&&(l.remainingTime>0||l.currentState!=="countdown")&&(d.current=Date.now(),c(C=>({...C,isRunning:!0,isPausedState:!1})))},[l.isPausedState,l.remainingTime,l.currentState]),w=D.useCallback(()=>l.isPausedState,[l.isPausedState]);return D.useEffect(()=>{r?(l.isRunning&&!l.isPausedState&&(c(C=>({...C,wasRunningBeforeError:!0})),E()),o()):(l.wasRunningBeforeError&&l.isPausedState&&(c(C=>({...C,wasRunningBeforeError:!1})),T()),s())},[r,l.isRunning,l.isPausedState,l.wasRunningBeforeError,E,T,o,s]),D.useEffect(()=>{if(l.isRunning){const C=()=>{if(d.current){const R=(Date.now()-d.current+h.current)/1e3;if(l.currentState==="countdown"&&l.maxTime!==null){const I=Math.max(0,l.maxTime-R);c(z=>({...z,remainingTime:Math.ceil(I)}));const k=Math.min(100,R/l.maxTime*100);if(f.setTarget([k]),I<=0){c(z=>({...z,isRunning:!1,remainingTime:0})),d.current=null,f.setTarget([100]),t&&queueMicrotask(()=>t());return}}else if(l.currentState==="measuring"){c(k=>({...k,remainingTime:Math.floor(R)}));const I=R/60%1*100;f.setTarget([I])}l.isRunning&&(u.current=requestAnimationFrame(C))}};u.current=requestAnimationFrame(C)}else u.current&&(cancelAnimationFrame(u.current),u.current=null);return()=>{u.current&&cancelAnimationFrame(u.current)}},[l.isRunning,t,l.currentState,l.maxTime,f]),D.useEffect(()=>{let C=null;const S=()=>{f.update(1/60),C=requestAnimationFrame(S)};return C=requestAnimationFrame(S),()=>{C&&cancelAnimationFrame(C)}},[f]),{timerState:l,controls:{startNewCycle:y,startMeasuring:p,setIdle:m,completeMeasuring:b,pause:E,resume:T,isPaused:w}}},_S=g.externalizeComponent(se.observer(({onCycleComplete:e,onCycleEnd:t,onMeasuringComplete:n,autoStart:r=!0,variant:i="default",compact:o=!1,className:s,hasError:a=!1})=>{const l=D.useRef(void 0),{animationState:c,triggerPauseAnimation:u,triggerErrorAnimation:d,clearErrorAnimation:h,startPulsatingAnimation:f,stopPulsatingAnimation:m,startIdleAnimations:p,stopIdleAnimations:y,triggerFadeTransition:b,setInitialAnimationState:E,cleanup:T}=RS(),{timerState:w,controls:C}=AS({autoStart:r,onCycleEnd:t,onMeasuringComplete:n,hasError:a,onPauseAnimation:u,onErrorAnimation:d,onClearErrorAnimation:h,onStartPulsating:f});return D.useEffect(()=>{const S=l.current;l.current!==void 0&&S!==w.currentState?(S==="measured"&&m(),S==="idle"&&y(),b()):E(),w.currentState==="idle"&&p(),l.current=w.currentState},[w.currentState,m,y,p,b,E]),D.useEffect(()=>{let S=!0;const R=setTimeout(()=>{S&&e(C)},0);return()=>{S=!1,clearTimeout(R)}},[e,C]),D.useEffect(()=>T,[T]),i==="small"?g.jsxRuntimeExports.jsx(MS,{timerState:w,animationState:c,hasError:a,compact:o,className:s}):g.jsxRuntimeExports.jsx(CS,{timerState:w,animationState:c,hasError:a,className:s})})),gn=Wp;process.env.NODE_ENV!=="production"&&(x.node,x.object.isRequired);function za(e){return Gp(e)}function IS(e){return hn("MuiSvgIcon",e)}Ji("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const jS=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${$e(t)}`,`fontSize${$e(n)}`]};return Er(i,IS,r)},kS=We("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${$e(n.color)}`],t[`fontSize${$e(n.fontSize)}`]]}})(gn(({theme:e})=>{var t,n,r,i,o,s,a,l,c,u,d,h,f,m;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(i=(t=e.transitions)==null?void 0:t.create)==null?void 0:i.call(t,"fill",{duration:(r=(n=(e.vars??e).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:p=>!p.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(o=e.typography)==null?void 0:o.pxToRem)==null?void 0:s.call(o,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((l=(a=e.typography)==null?void 0:a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((u=(c=e.typography)==null?void 0:c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,p])=>p&&p.main).map(([p])=>{var y,b;return{props:{color:p},style:{color:(b=(y=(e.vars??e).palette)==null?void 0:y[p])==null?void 0:b.main}}}),{props:{color:"action"},style:{color:(h=(d=(e.vars??e).palette)==null?void 0:d.action)==null?void 0:h.active}},{props:{color:"disabled"},style:{color:(m=(f=(e.vars??e).palette)==null?void 0:f.action)==null?void 0:m.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),Di=O.forwardRef(function(t,n){const r=za({props:t,name:"MuiSvgIcon"}),{children:i,className:o,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:d,viewBox:h="0 0 24 24",...f}=r,m=O.isValidElement(i)&&i.type==="svg",p={...r,color:s,component:a,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:h,hasSvgAsChild:m},y={};u||(y.viewBox=h);const b=jS(p);return g.jsxRuntimeExports.jsxs(kS,{as:a,className:Ne(b.root,o),focusable:"false",color:c,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:n,...y,...f,...m&&i.props,ownerState:p,children:[m?i.props.children:i,d?g.jsxRuntimeExports.jsx("title",{children:d}):null]})});process.env.NODE_ENV!=="production"&&(Di.propTypes={children:x.node,classes:x.object,className:x.string,color:x.oneOfType([x.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),x.string]),component:x.elementType,fontSize:x.oneOfType([x.oneOf(["inherit","large","medium","small"]),x.string]),htmlColor:x.string,inheritViewBox:x.bool,shapeRendering:x.string,sx:x.oneOfType([x.arrayOf(x.oneOfType([x.func,x.object,x.bool])),x.func,x.object]),titleAccess:x.string,viewBox:x.string});Di.muiName="SvgIcon";function Kt(e,t){function n(r,i){return g.jsxRuntimeExports.jsx(Di,{"data-testid":process.env.NODE_ENV!=="production"?`${t}Icon`:void 0,ref:i,...r,children:e})}return process.env.NODE_ENV!=="production"&&(n.displayName=`${t}Icon`),n.muiName=Di.muiName,O.memo(O.forwardRef(n))}function OS(e){const{controlled:t,default:n,name:r,state:i="value"}=e,{current:o}=O.useRef(t!==void 0),[s,a]=O.useState(n),l=o?t:s;if(process.env.NODE_ENV!=="production"){O.useEffect(()=>{o!==(t!==void 0)&&console.error([`MUI: A component is changing the ${o?"":"un"}controlled ${i} state of ${r} to be ${o?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${r} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
|
|
109
|
+
`))},[i,r,t]);const{current:u}=O.useRef(n);O.useEffect(()=>{!o&&JSON.stringify(n)!==JSON.stringify(u)&&console.error([`MUI: A component is changing the default ${i} state of an uncontrolled ${r} after being initialized. To suppress this warning opt to use a controlled ${r}.`].join(`
|
|
110
|
+
`))},[JSON.stringify(n)])}const c=O.useCallback(u=>{o||a(u)},[]);return[l,c]}const PS=Kt(g.jsxRuntimeExports.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"}),"Clear"),DS=Kt(g.jsxRuntimeExports.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList"),Oc=Kt(g.jsxRuntimeExports.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"),mh=g.externalizeComponent(se.observer(({data:e,columns:t,getRowData:n,onRowClick:r,selectedItem:i,getItemId:o,title:s,showCount:a=!0,searchPlaceholder:l="Search programs",dataGridProps:c,CustomToolbar:u,selectFirstByDefault:d=!1,sx:h})=>{var I;const f=M.useTheme(),m=et.useGridApiRef(),p=D.useRef(null),[y,b]=D.useState(null),E=D.useMemo(()=>e.map(n),[e,n]);D.useEffect(()=>{m.current&&E.length>0&&m.current.autosizeColumns({includeOutliers:!0,includeHeaders:!0,expand:!0,columns:t.map(k=>k.field)})},[E,t,m]),D.useEffect(()=>{if(!p.current||!m.current)return;const k=new ResizeObserver(()=>{setTimeout(()=>{m.current&&E.length>0&&m.current.autosizeColumns({includeOutliers:!0,includeHeaders:!0,expand:!0,columns:t.map(z=>z.field)})},100)});return k.observe(p.current),()=>{k.disconnect()}},[m,E.length,t]);const T=D.useMemo(()=>{if(i!==void 0)return i;if(y!==null)return y;if(d&&e.length>0){const k=e[0];return b(k),k}return null},[d,e,i,y]),w=k=>{const z=e.find(P=>n(P).id===k.id);z&&(i===void 0&&b(z),r&&r(z,k))},C=D.useMemo(()=>!T||!o?null:o(T),[T,o]);function S(){return g.jsxRuntimeExports.jsx(et.Toolbar,{children:g.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",width:"100%",gap:1,p:.5,alignItems:"center"},children:[s&&g.jsxRuntimeExports.jsxs(M.Typography,{variant:"h6",sx:{fontWeight:500,color:"white"},children:[s,a&&` (${e.length})`]}),g.jsxRuntimeExports.jsxs(M.Box,{sx:{ml:"auto",display:"flex",gap:.5,alignItems:"center",pr:1},children:[g.jsxRuntimeExports.jsx(et.FilterPanelTrigger,{render:g.jsxRuntimeExports.jsx(et.ToolbarButton,{"aria-label":"Show filters",children:g.jsxRuntimeExports.jsx(DS,{fontSize:"small"})})}),g.jsxRuntimeExports.jsx(M.Divider,{orientation:"vertical",flexItem:!0,sx:{height:"24px",alignSelf:"center"}}),g.jsxRuntimeExports.jsx(et.QuickFilter,{render:(k,z)=>g.jsxRuntimeExports.jsxs(M.Box,{...k,sx:{display:"flex",overflow:"hidden"},children:[!z.expanded&&g.jsxRuntimeExports.jsx(et.QuickFilterTrigger,{render:g.jsxRuntimeExports.jsx(et.ToolbarButton,{"aria-label":"Search",children:g.jsxRuntimeExports.jsx(Oc,{fontSize:"small"})})}),g.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",overflow:"hidden",transition:"all 0.3s ease-in-out",width:z.expanded?"200px":"0px",position:"relative"},children:[g.jsxRuntimeExports.jsxs(M.Box,{sx:{flex:1,position:"relative","& .MuiInputBase-root":{height:"32px",borderRadius:"16px",backgroundColor:"#171927",paddingLeft:"40px",paddingRight:z.expanded&&z.value!==""?"40px":"12px",color:"white",fontSize:"14px",border:"none !important",outline:"none !important",boxShadow:"none !important","&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"},"&:hover":{"&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"}},"&:focus-within":{outline:"none !important",boxShadow:"none !important","&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"}},"&.Mui-focused":{outline:"none !important",boxShadow:"none !important","&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"}},"& .MuiInputBase-input":{padding:"8px 0",border:"none !important",outline:"none !important",boxShadow:"none !important","&:focus":{outline:"none !important",boxShadow:"none !important",border:"none !important"},"&::placeholder":{color:"rgba(255, 255, 255, 0.3)",opacity:1}},"& fieldset":{border:"none !important",display:"none !important"},"& .MuiOutlinedInput-notchedOutline":{border:"none !important",display:"none !important"}}},children:[z.expanded&&g.jsxRuntimeExports.jsx(Oc,{fontSize:"small",sx:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:"rgba(255, 255, 255, 0.6)",zIndex:1,pointerEvents:"none"}}),g.jsxRuntimeExports.jsx(et.QuickFilterControl,{placeholder:l})]}),z.expanded&&z.value!==""&&g.jsxRuntimeExports.jsx(et.QuickFilterClear,{render:g.jsxRuntimeExports.jsx(M.Box,{sx:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)",zIndex:1},children:g.jsxRuntimeExports.jsx(M.Box,{sx:{minWidth:"24px",width:"24px",height:"24px",padding:0,color:"rgba(255, 255, 255, 0.6)","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.1)"}},children:g.jsxRuntimeExports.jsx(et.ToolbarButton,{"aria-label":"Clear",children:g.jsxRuntimeExports.jsx(PS,{fontSize:"small"})})})})})]})]})})]})]})})}const R=u||S;return g.jsxRuntimeExports.jsx(M.Box,{ref:p,sx:{height:"100%",display:"flex",flexDirection:"column","& *":{scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none"}},"&:hover *":{scrollbarWidth:"thin",scrollbarColor:`${f.palette.divider} transparent`,"&::-webkit-scrollbar":{display:"block",width:"8px",height:"8px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:f.palette.divider,borderRadius:"4px"},"&::-webkit-scrollbar-thumb:hover":{background:f.palette.action.hover}},...h},children:g.jsxRuntimeExports.jsx(et.DataGrid,{apiRef:m,rows:E,columns:t,onRowClick:w,disableColumnMenu:!1,disableRowSelectionOnClick:!0,disableMultipleRowSelection:!0,hideFooterSelectedRowCount:!0,filterMode:"client",sortingOrder:["desc","asc"],hideFooter:!1,showToolbar:!0,slots:{toolbar:R},initialState:{sorting:{sortModel:[]},filter:{filterModel:{items:[]}},...c==null?void 0:c.initialState},...c,autosizeOnMount:!0,autosizeOptions:{...(c==null?void 0:c.autosizeOptions)||{},includeOutliers:!0,includeHeaders:!0,expand:!0,columns:((I=c==null?void 0:c.autosizeOptions)==null?void 0:I.columns)||t.map(k=>k.field)},sx:{border:"none",width:"100%","& .MuiPaper-root":{boxShadow:"none !important"},"& .MuiDataGrid-overlay":{},"& .MuiDataGrid-main":{border:"none","& .MuiPaper-root":{}},"& .MuiDataGrid-container--top [role=row]":{},"& .MuiDataGrid-topContainer":{borderBottom:"none !important"},"& .MuiDataGrid-columnHeaders":{border:"none",borderBottom:"none !important"},"& .MuiDataGrid-row":{cursor:r?"pointer":"default",border:"none",margin:"1px 0",position:"relative",backgroundColor:"transparent !important","&:hover":{backgroundColor:"transparent !important","&::before":{content:'""',position:"absolute",top:0,left:"16px",right:"16px",bottom:0,backgroundColor:"action.hover",borderRadius:"16px",zIndex:0}},"&.Mui-selected":{backgroundColor:"transparent !important","&:hover":{backgroundColor:"transparent !important"}},...C!==null&&{[`&[data-id="${C}"]`]:{backgroundColor:"transparent !important","&::before":{content:'""',position:"absolute",top:0,left:"16px",right:"16px",bottom:0,backgroundColor:"rgba(255, 255, 255, 0.08) !important",borderRadius:"16px",zIndex:0},"&:hover":{backgroundColor:"transparent !important"},"&:hover::before":{backgroundColor:"rgba(255, 255, 255, 0.12) !important"}}}},"& .MuiDataGrid-cell--textLeft":{paddingLeft:"40px"},"& .MuiDataGrid-cell":{border:"none",position:"relative",zIndex:1,"&:focus":{outline:"none"},"&:focus-within":{outline:"none"},"&:hover":{backgroundColor:"transparent !important"}},"& .MuiDataGrid-columnHeader":{border:"none",paddingLeft:"40px",paddingRight:"40px","& .MuiDataGrid-columnHeaderTitle":{color:"rgba(255, 255, 255, 0.6)"}},"& .MuiDataGrid-toolbarContainer":{padding:"8px",border:"none !important",borderBottom:"none !important","& .MuiBox-root":{},"& .MuiFormControl-root":{},"& .MuiInputBase-root":{},"& .MuiPaper-root":{boxShadow:"none !important"},"& *":{borderBottom:"none !important"}},"& .MuiDataGrid-toolbar":{borderBottom:"none !important"},"& .MuiDataGrid-toolbarFilterList":{border:"none"},"& .MuiDataGrid-withBorderColor":{borderColor:"transparent !important"},"& .MuiDataGrid-columnSeparator":{display:"none"},"& .MuiDataGrid-footerContainer":{display:"none"},"& .MuiDataGrid-filler":{border:"none !important",borderTop:"none !important",borderBottom:"none !important",borderLeft:"none !important",borderRight:"none !important","--rowBorderColor":"none !important"},"& .MuiBackdrop-root":{},"& .MuiModal-backdrop":{},...c==null?void 0:c.sx}})})}));mh.displayName="WandelbotsDataGrid";const Pn=im({createStyledComponent:We("div",{name:"MuiStack",slot:"Root"}),useThemeProps:e=>za({props:e,name:"MuiStack"})});process.env.NODE_ENV!=="production"&&(Pn.propTypes={children:x.node,component:x.elementType,direction:x.oneOfType([x.oneOf(["column-reverse","column","row-reverse","row"]),x.arrayOf(x.oneOf(["column-reverse","column","row-reverse","row"])),x.object]),divider:x.node,spacing:x.oneOfType([x.arrayOf(x.oneOfType([x.number,x.string])),x.number,x.object,x.string]),sx:x.oneOfType([x.arrayOf(x.oneOfType([x.func,x.object,x.bool])),x.func,x.object]),useFlexGap:x.bool});const Is=g.externalizeComponent(se.observer(({colors:e,label:t,getDisplayedValue:n,startJogging:r,stopJogging:i,disabled:o,activeJoggingDirection:s,...a})=>{var T,w,C,S,R,I,k;g.useAnimationFrame(()=>{const z=n(),P=h.current;P&&(P.textContent=z)});const l=M.useTheme(),[c,u]=D.useState(null);D.useEffect(()=>{o&&E()},[o]);const d=s||c,h=D.useRef(null);e||(e={color:"#fff",backgroundColor:"#000",borderColor:"#000",buttonBackgroundColor:{disabled:"#000",default:"#000",hovered:"#000",pressed:"#000"},labelColor:"#000"});const f=d?(T=e.buttonBackgroundColor)==null?void 0:T.pressed:e.borderColor,m={width:"55px",color:e.color,path:{fill:e.color},alignContent:"center",fontSize:"37px",svg:{pointerEvents:"none"}},p={...m,backgroundColor:(w=e.buttonBackgroundColor)==null?void 0:w.default,":hover":{backgroundColor:(C=e.buttonBackgroundColor)==null?void 0:C.hovered},":active":{backgroundColor:(S=e.buttonBackgroundColor)==null?void 0:S.pressed,color:e.backgroundColor,path:{fill:e.backgroundColor}},":disabled":{backgroundColor:(R=e.buttonBackgroundColor)==null?void 0:R.disabled,"svg path":{fill:l.palette.action.disabled}}},y={...m,backgroundColor:(I=e.buttonBackgroundColor)==null?void 0:I.pressed,color:e.backgroundColor,path:{fill:e.backgroundColor},":disabled":{backgroundColor:(k=e.buttonBackgroundColor)==null?void 0:k.pressed,"svg path":{fill:l.palette.action.disabled}}};function b(z,P){o||z.button===0&&(u(P),r(P))}function E(){u(null),i()}return g.jsxRuntimeExports.jsxs(Pn,{height:"64px",direction:"row",justifyContent:"center",...a,children:[g.jsxRuntimeExports.jsx(M.IconButton,{disabled:o,disableRipple:!0,onPointerDown:z=>b(z,"-"),onPointerUp:E,onPointerOut:E,size:"large",sx:{...d==="-"?y:p,borderRadius:"16px 0px 0px 16px",borderLeft:`2px solid ${f??"#fff"}`,borderBottom:`2px solid ${f??"#fff"}`,borderTop:`2px solid ${f??"#fff"}`},children:g.jsxRuntimeExports.jsx(je.ForwardRef$13,{})}),g.jsxRuntimeExports.jsxs(Pn,{spacing:"6px",sx:{width:"150px",backgroundColor:e.backgroundColor,alignItems:"center",justifyContent:"center",opacity:"0.9",borderBottom:`2px solid ${f??"#fff"}`,borderTop:`2px solid ${f??"#fff"}`},children:[g.jsxRuntimeExports.jsx(Pn,{height:"22px",direction:"row",alignItems:"center",justifyItems:"center",spacing:1,sx:{userSelect:"none",color:e.color,".MuiTypography-root":{fontWeight:700,...o?{color:l.palette.action.disabled}:{}},...o?{"svg path":{fill:l.palette.action.disabled}}:{}},children:t}),g.jsxRuntimeExports.jsx(M.Typography,{height:"22px",sx:{fontSize:"15px",color:o?l.palette.action.disabled:e.color,fontWeight:700},ref:h,children:n()})]}),g.jsxRuntimeExports.jsx(M.IconButton,{disableRipple:!0,disabled:o,onPointerDown:z=>b(z,"+"),onPointerUp:E,onPointerOut:E,size:"large",sx:{...d==="+"?y:p,borderRadius:"0px 16px 16px 0px",borderRight:`2px solid ${f??"#fff"}`,borderBottom:`2px solid ${f??"#fff"}`,borderTop:`2px solid ${f??"#fff"}`},children:g.jsxRuntimeExports.jsx(je.ForwardRef$14,{})})]})})),$S=Kt(g.jsxRuntimeExports.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),NS=Kt(g.jsxRuntimeExports.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");function cn(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var gh=typeof global=="object"&&global&&global.Object===Object&&global,LS=typeof self=="object"&&self&&self.Object===Object&&self,yt=gh||LS||Function("return this")(),as=function(){return yt.Date.now()},zS=/\s/;function FS(e){for(var t=e.length;t--&&zS.test(e.charAt(t)););return t}var BS=/^\s+/;function GS(e){return e&&e.slice(0,FS(e)+1).replace(BS,"")}var Ft=yt.Symbol,yh=Object.prototype,US=yh.hasOwnProperty,VS=yh.toString,er=Ft?Ft.toStringTag:void 0;function YS(e){var t=US.call(e,er),n=e[er];try{e[er]=void 0;var r=!0}catch{}var i=VS.call(e);return r&&(t?e[er]=n:delete e[er]),i}var WS=Object.prototype,HS=WS.toString;function qS(e){return HS.call(e)}var KS="[object Null]",JS="[object Undefined]",Pc=Ft?Ft.toStringTag:void 0;function yn(e){return e==null?e===void 0?JS:KS:Pc&&Pc in Object(e)?YS(e):qS(e)}function un(e){return e!=null&&typeof e=="object"}var XS="[object Symbol]";function Mo(e){return typeof e=="symbol"||un(e)&&yn(e)==XS}var Dc=NaN,ZS=/^[-+]0x[0-9a-f]+$/i,QS=/^0b[01]+$/i,eE=/^0o[0-7]+$/i,tE=parseInt;function $c(e){if(typeof e=="number")return e;if(Mo(e))return Dc;if(cn(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=cn(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=GS(e);var n=QS.test(e);return n||eE.test(e)?tE(e.slice(2),n?2:8):ZS.test(e)?Dc:+e}var nE="Expected a function",rE=Math.max,iE=Math.min;function oE(e,t,n){var r,i,o,s,a,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(nE);t=$c(t)||0,cn(n)&&(u=!!n.leading,d="maxWait"in n,o=d?rE($c(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h);function f(S){var R=r,I=i;return r=i=void 0,c=S,s=e.apply(I,R),s}function m(S){return c=S,a=setTimeout(b,t),u?f(S):s}function p(S){var R=S-l,I=S-c,k=t-R;return d?iE(k,o-I):k}function y(S){var R=S-l,I=S-c;return l===void 0||R>=t||R<0||d&&I>=o}function b(){var S=as();if(y(S))return E(S);a=setTimeout(b,p(S))}function E(S){return a=void 0,h&&r?f(S):(r=i=void 0,s)}function T(){a!==void 0&&clearTimeout(a),c=0,r=l=i=a=void 0}function w(){return a===void 0?s:E(as())}function C(){var S=as(),R=y(S);if(r=arguments,i=this,l=S,R){if(a===void 0)return m(l);if(d)return clearTimeout(a),a=setTimeout(b,t),f(l)}return a===void 0&&(a=setTimeout(b,t)),s}return C.cancel=T,C.flush=w,C}var sE="Expected a function";function aE(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(sE);return cn(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),oE(e,t,{leading:r,maxWait:t,trailing:i})}const xh=g.externalizeComponent(se.observer(({startJogging:e,stopJogging:t,lowerLimit:n,upperLimit:r,useDegree:i,getValue:o,disabled:s,...a})=>{var S,R,I,k,z,P,v,_,A,B,G,Z,Y,te,we;const{t:l}=de.useTranslation(),[c,u]=D.useState(),d=M.useTheme(),h={background:(S=d.palette.backgroundPaperElevation)==null?void 0:S[4],color:(R=d.palette.backgroundPaperElevation)==null?void 0:R[11]},f=se.useLocalObservable(()=>({activeJoggingDir:null,startJogging(V){this.activeJoggingDir=V,e(V)},stopJogging(){this.activeJoggingDir=null,t()}})),m=aE(()=>{u(i?p(o()):o())},50);g.useAnimationFrame(m);function p(V){if(V!=null)return Ie.radiansToDegrees(V)}function y(V){V.button===0&&f.startJogging("-")}function b(V){V.button===0&&f.startJogging("+")}function E(V){f.stopJogging()}function T(V){f.stopJogging()}function w(V,xe=1){if(V===void 0||isNaN(V))return"";const Pe=l("General.degree.variable",{amount:V.toFixed(xe)});return V>0&&xe===0?`+${Pe}`:Pe}function C(V,xe=1){if(V===void 0||isNaN(V))return"";const Pe=l("General.mm.variable",{amount:V.toFixed(xe)});return V>0&&xe===0?`+${Pe}`:Pe}return g.jsxRuntimeExports.jsxs(Pn,{height:"64px",width:"100%",maxWidth:"260px",direction:"row",...a,sx:{"& .MuiIconButton-root":{width:"52px",color:d.palette.text.primary,alignContent:"center",backgroundColor:(I=d.palette.backgroundPaperElevation)==null?void 0:I[11],"& svg":{width:"42px",height:"42px"},"&.Mui-disabled":{backgroundColor:(k=d.palette.backgroundPaperElevation)==null?void 0:k[11],color:d.palette.action.disabled,opacity:1},"&:hover":{backgroundColor:(z=d.palette.backgroundPaperElevation)==null?void 0:z[9]},"&:active":{...h}}},children:[g.jsxRuntimeExports.jsx(M.IconButton,{onPointerDown:y,onPointerUp:E,onPointerOut:T,disabled:s,disableRipple:!0,sx:{borderRadius:"16px 0px 0px 16px",...f.activeJoggingDir==="-"?h:{}},children:g.jsxRuntimeExports.jsx($S,{sx:{pointerEvents:"none",color:(A=(_=(v=(P=d.componentsExt)==null?void 0:P.JoggingPanel)==null?void 0:v.JoggingJoint)==null?void 0:_.Joint)==null?void 0:A.arrowColor}})}),g.jsxRuntimeExports.jsxs(Pn,{flexGrow:1,alignItems:"center",justifyContent:"center",sx:{borderStyle:"solid",borderLeftWidth:0,borderRightWidth:0,border:"none",backgroundColor:(B=d.palette.backgroundPaperElevation)==null?void 0:B[11],paddingLeft:"20px",paddingRight:"20px",zIndex:1},children:[g.jsxRuntimeExports.jsx(M.Typography,{sx:{fontSize:"15px",fontWeight:700,position:"relative",top:"5px",color:s?d.palette.action.disabled:d.palette.text.primary},children:i?w(c):C(c)}),g.jsxRuntimeExports.jsx(M.Slider,{disabled:!0,"aria-label":"Joint position",min:i?p(n):n,max:i?p(r):r,value:c||0,track:!1,sx:{"& .MuiSlider-mark":{display:"none"},"& .MuiSlider-thumb":{width:"5px",height:"12px",borderRadius:"2px",color:s?d.palette.action.disabled:d.palette.text.primary},"& .MuiSlider-markLabel":{top:"20px",fontSize:"12px",color:s?d.palette.action.disabled:d.palette.text.secondary},"& .MuiSlider-rail":{backgroundColor:(G=d.palette.backgroundPaperElevation)==null?void 0:G[5],opacity:1}},marks:n!==void 0&&r!==void 0&&[{value:i?p(n):n,label:i?w(p(n),0):C(n)},{value:i?p(r):r,label:i?w(p(r),0):C(r)}]})]}),g.jsxRuntimeExports.jsx(M.IconButton,{onPointerDown:b,onPointerUp:E,onPointerOut:T,disabled:s,disableRipple:!0,sx:{borderRadius:"0px 16px 16px 0px",...f.activeJoggingDir==="+"?h:{}},children:g.jsxRuntimeExports.jsx(NS,{sx:{pointerEvents:"none",color:(we=(te=(Y=(Z=d.componentsExt)==null?void 0:Z.JoggingPanel)==null?void 0:Y.JoggingJoint)==null?void 0:te.Joint)==null?void 0:we.arrowColor}})})]})})),lE=Kt(g.jsxRuntimeExports.jsx("path",{d:"M10 9h4V6h3l-5-5-5 5h3zm-1 1H6V7l-5 5 5 5v-3h3zm14 2-5-5v3h-3v4h3v3zm-9 3h-4v3H7l5 5 5-5h-3z"}),"OpenWith"),cE=Kt(g.jsxRuntimeExports.jsx("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92"}),"Share");function uE(...e){const t="THREE."+e.shift();console.warn(t,...e)}function Et(e,t,n){return Math.max(t,Math.min(n,e))}class dE{constructor(t=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=t,this._y=n,this._z=r,this._w=i}static slerpFlat(t,n,r,i,o,s,a){let l=r[i+0],c=r[i+1],u=r[i+2],d=r[i+3],h=o[s+0],f=o[s+1],m=o[s+2],p=o[s+3];if(a<=0){t[n+0]=l,t[n+1]=c,t[n+2]=u,t[n+3]=d;return}if(a>=1){t[n+0]=h,t[n+1]=f,t[n+2]=m,t[n+3]=p;return}if(d!==p||l!==h||c!==f||u!==m){let y=l*h+c*f+u*m+d*p;y<0&&(h=-h,f=-f,m=-m,p=-p,y=-y);let b=1-a;if(y<.9995){const E=Math.acos(y),T=Math.sin(E);b=Math.sin(b*E)/T,a=Math.sin(a*E)/T,l=l*b+h*a,c=c*b+f*a,u=u*b+m*a,d=d*b+p*a}else{l=l*b+h*a,c=c*b+f*a,u=u*b+m*a,d=d*b+p*a;const E=1/Math.sqrt(l*l+c*c+u*u+d*d);l*=E,c*=E,u*=E,d*=E}}t[n]=l,t[n+1]=c,t[n+2]=u,t[n+3]=d}static multiplyQuaternionsFlat(t,n,r,i,o,s){const a=r[i],l=r[i+1],c=r[i+2],u=r[i+3],d=o[s],h=o[s+1],f=o[s+2],m=o[s+3];return t[n]=a*m+u*d+l*f-c*h,t[n+1]=l*m+u*h+c*d-a*f,t[n+2]=c*m+u*f+a*h-l*d,t[n+3]=u*m-a*d-l*h-c*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,n,r,i){return this._x=t,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,n=!0){const r=t._x,i=t._y,o=t._z,s=t._order,a=Math.cos,l=Math.sin,c=a(r/2),u=a(i/2),d=a(o/2),h=l(r/2),f=l(i/2),m=l(o/2);switch(s){case"XYZ":this._x=h*u*d+c*f*m,this._y=c*f*d-h*u*m,this._z=c*u*m+h*f*d,this._w=c*u*d-h*f*m;break;case"YXZ":this._x=h*u*d+c*f*m,this._y=c*f*d-h*u*m,this._z=c*u*m-h*f*d,this._w=c*u*d+h*f*m;break;case"ZXY":this._x=h*u*d-c*f*m,this._y=c*f*d+h*u*m,this._z=c*u*m+h*f*d,this._w=c*u*d-h*f*m;break;case"ZYX":this._x=h*u*d-c*f*m,this._y=c*f*d+h*u*m,this._z=c*u*m-h*f*d,this._w=c*u*d+h*f*m;break;case"YZX":this._x=h*u*d+c*f*m,this._y=c*f*d+h*u*m,this._z=c*u*m-h*f*d,this._w=c*u*d-h*f*m;break;case"XZY":this._x=h*u*d-c*f*m,this._y=c*f*d-h*u*m,this._z=c*u*m+h*f*d,this._w=c*u*d+h*f*m;break;default:uE("Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,n){const r=n/2,i=Math.sin(r);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(t){const n=t.elements,r=n[0],i=n[4],o=n[8],s=n[1],a=n[5],l=n[9],c=n[2],u=n[6],d=n[10],h=r+a+d;if(h>0){const f=.5/Math.sqrt(h+1);this._w=.25/f,this._x=(u-l)*f,this._y=(o-c)*f,this._z=(s-i)*f}else if(r>a&&r>d){const f=2*Math.sqrt(1+r-a-d);this._w=(u-l)/f,this._x=.25*f,this._y=(i+s)/f,this._z=(o+c)/f}else if(a>d){const f=2*Math.sqrt(1+a-r-d);this._w=(o-c)/f,this._x=(i+s)/f,this._y=.25*f,this._z=(l+u)/f}else{const f=2*Math.sqrt(1+d-r-a);this._w=(s-i)/f,this._x=(o+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,n){let r=t.dot(n)+1;return r<1e-8?(r=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=r):(this._x=0,this._y=-t.z,this._z=t.y,this._w=r)):(this._x=t.y*n.z-t.z*n.y,this._y=t.z*n.x-t.x*n.z,this._z=t.x*n.y-t.y*n.x,this._w=r),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Et(this.dot(t),-1,1)))}rotateTowards(t,n){const r=this.angleTo(t);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,n){const r=t._x,i=t._y,o=t._z,s=t._w,a=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+s*a+i*c-o*l,this._y=i*u+s*l+o*a-r*c,this._z=o*u+s*c+r*l-i*a,this._w=s*u-r*a-i*l-o*c,this._onChangeCallback(),this}slerp(t,n){if(n<=0)return this;if(n>=1)return this.copy(t);let r=t._x,i=t._y,o=t._z,s=t._w,a=this.dot(t);a<0&&(r=-r,i=-i,o=-o,s=-s,a=-a);let l=1-n;if(a<.9995){const c=Math.acos(a),u=Math.sin(c);l=Math.sin(l*c)/u,n=Math.sin(n*c)/u,this._x=this._x*l+r*n,this._y=this._y*l+i*n,this._z=this._z*l+o*n,this._w=this._w*l+s*n,this._onChangeCallback()}else this._x=this._x*l+r*n,this._y=this._y*l+i*n,this._z=this._z*l+o*n,this._w=this._w*l+s*n,this.normalize();return this}slerpQuaternions(t,n,r){return this.copy(t).slerp(n,r)}random(){const t=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),o=Math.sqrt(r);return this.set(i*Math.sin(t),i*Math.cos(t),o*Math.sin(n),o*Math.cos(n))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,n=0){return this._x=t[n],this._y=t[n+1],this._z=t[n+2],this._w=t[n+3],this._onChangeCallback(),this}toArray(t=[],n=0){return t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+3]=this._w,t}fromBufferAttribute(t,n){return this._x=t.getX(n),this._y=t.getY(n),this._z=t.getZ(n),this._w=t.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Dn{constructor(t=0,n=0,r=0){Dn.prototype.isVector3=!0,this.x=t,this.y=n,this.z=r}set(t,n,r){return r===void 0&&(r=this.z),this.x=t,this.y=n,this.z=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,n){return this.x=t.x*n.x,this.y=t.y*n.y,this.z=t.z*n.z,this}applyEuler(t){return this.applyQuaternion(Nc.setFromEuler(t))}applyAxisAngle(t,n){return this.applyQuaternion(Nc.setFromAxisAngle(t,n))}applyMatrix3(t){const n=this.x,r=this.y,i=this.z,o=t.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const n=this.x,r=this.y,i=this.z,o=t.elements,s=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*s,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*s,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*s,this}applyQuaternion(t){const n=this.x,r=this.y,i=this.z,o=t.x,s=t.y,a=t.z,l=t.w,c=2*(s*i-a*r),u=2*(a*n-o*i),d=2*(o*r-s*n);return this.x=n+l*c+s*d-a*u,this.y=r+l*u+a*c-o*d,this.z=i+l*d+o*u-s*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const n=this.x,r=this.y,i=this.z,o=t.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,n){return this.x=Et(this.x,t.x,n.x),this.y=Et(this.y,t.y,n.y),this.z=Et(this.z,t.z,n.z),this}clampScalar(t,n){return this.x=Et(this.x,t,n),this.y=Et(this.y,t,n),this.z=Et(this.z,t,n),this}clampLength(t,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Et(r,t,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this}lerpVectors(t,n,r){return this.x=t.x+(n.x-t.x)*r,this.y=t.y+(n.y-t.y)*r,this.z=t.z+(n.z-t.z)*r,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,n){const r=t.x,i=t.y,o=t.z,s=n.x,a=n.y,l=n.z;return this.x=i*l-o*a,this.y=o*s-r*l,this.z=r*a-i*s,this}projectOnVector(t){const n=t.lengthSq();if(n===0)return this.set(0,0,0);const r=t.dot(this)/n;return this.copy(t).multiplyScalar(r)}projectOnPlane(t){return ls.copy(this).projectOnVector(t),this.sub(ls)}reflect(t){return this.sub(ls.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const n=Math.sqrt(this.lengthSq()*t.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(t)/n;return Math.acos(Et(r,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const n=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return n*n+r*r+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,n,r){const i=Math.sin(n)*t;return this.x=i*Math.sin(r),this.y=Math.cos(n)*t,this.z=i*Math.cos(r),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,n,r){return this.x=t*Math.sin(n),this.y=r,this.z=t*Math.cos(n),this}setFromMatrixPosition(t){const n=t.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(t){const n=this.setFromMatrixColumn(t,0).length(),r=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(t,n){return this.fromArray(t.elements,n*4)}setFromMatrix3Column(t,n){return this.fromArray(t.elements,n*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this.z=t[n+2],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t}fromBufferAttribute(t,n){return this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,n=Math.random()*2-1,r=Math.sqrt(1-n*n);return this.x=r*Math.cos(t),this.y=n,this.z=r*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const ls=new Dn,Nc=new dE;function Fa(e,t,n){if(t.length!==e.length)return!0;for(let r=0;r<t.length;r++)if(Math.abs(t[r]-e[r])>n)return!1;return!0}function bh(e,t,n){if(e===void 0&&t||e&&t===void 0||(e==null?void 0:e.orientation)===void 0||(t==null?void 0:t.orientation)===void 0||(e==null?void 0:e.position)===void 0||(t==null?void 0:t.position)===void 0)return!1;if(e===void 0||t===void 0)return!0;let r=0;return r+=Math.abs(e.orientation[0]-t.orientation[0]),r+=Math.abs(e.orientation[1]-t.orientation[1]),r+=Math.abs(e.orientation[2]-t.orientation[2]),r+=Math.abs(e.position[0]-t.position[0]),r+=Math.abs(e.position[1]-t.position[1]),r+=Math.abs(e.position[2]-t.position[2]),r<=n}function Ba(e,t,n){return e.coordinate_system===t.coordinate_system&&e.tcp===t.tcp&&bh(e.tcp_pose,t.tcp_pose,n)}function vh(e,t){const n=new hs.Vector3(t[0],t[1],t[2]),r=new hs.Vector3(e[0],e[1],e[2]),i=n.length(),o=n.normalize();let s=r.length(),a=r.normalize();a.dot(o)<0&&(s=-s,a=a.multiplyScalar(-1));let l=s-i;return l-=2*Math.PI*Math.floor((l+Math.PI)/(2*Math.PI)),s=i+l,[...a.multiplyScalar(s)]}const Lc=1e-4;class Ro{constructor(t,n,r,i,o,s){this.nova=t,this.controller=n,this.motionGroup=r,this.description=i,this.initialMotionState=o,this.motionStateSocket=s,this.rapidlyChangingMotionState=o,s.addEventListener("message",a=>{var c;const l=(c=Ie.tryParseJson(a.data))==null?void 0:c.result;if(!l)throw new Error(`Failed to get motion state for ${this.motionGroupId}: ${a.data}`);Fa(this.rapidlyChangingMotionState.joint_position,l.joint_position,Lc)||ue.runInAction(()=>{this.rapidlyChangingMotionState.joint_position=l.joint_position}),Ba(this.rapidlyChangingMotionState,l,Lc)||ue.runInAction(()=>{var u,d,h;this.rapidlyChangingMotionState.tcp_pose==null?this.rapidlyChangingMotionState.tcp_pose=l.tcp_pose:(u=l.tcp_pose)!=null&&u.orientation&&((d=l.tcp_pose)!=null&&d.position)&&((h=this.rapidlyChangingMotionState.tcp_pose)!=null&&h.orientation)?this.rapidlyChangingMotionState.tcp_pose={position:l.tcp_pose.position,orientation:vh(l.tcp_pose.orientation,this.rapidlyChangingMotionState.tcp_pose.orientation)}:console.warn("Received incomplete tcp_pose, ignoring",l.tcp_pose)}),this.rapidlyChangingMotionState.standstill!==l.standstill&&ue.runInAction(()=>{this.rapidlyChangingMotionState.standstill=l.standstill})}),ue.makeAutoObservable(this)}static async open(t,n){var d;const[r,i]=n.split("@"),o=await t.api.controller.getCurrentRobotControllerState(i),s=o==null?void 0:o.motion_groups.find(h=>h.motion_group===n);if(!o||!s)throw new Error(`Controller ${i} or motion group ${n} not found`);const a=t.openReconnectingWebsocket(`/controllers/${i}/motion-groups/${n}/state-stream`),l=await a.firstMessage(),c=(d=Ie.tryParseJson(l.data))==null?void 0:d.result;if(!c)throw new Error(`Unable to parse initial motion state message ${l.data}`);console.log(`Connected motion state websocket to motion group ${s.motion_group}. Initial state:
|
|
111
|
+
`,c);const u=await t.api.motionGroup.getMotionGroupDescription(i,s.motion_group);return new Ro(t,o,s,u,c,a)}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get joints(){return this.initialMotionState.joint_position.map((t,n)=>({index:n}))}dispose(){this.motionStateSocket.close()}}const zc="Movement request rejected. Another client is currently executing a 'Jogging' motion!";class Ao{constructor(t,n={}){this.motionStream=t,this.options=n,this.ENDPOINT_JOGGING="/execution/jogging",this.ENDPOINT_TRAJECTORY="/execution/trajectory",this.DEFAULT_MODE="off",this.DEFAULT_TCP="Flange",this.DEFAULT_INIT_TIMEOUT=5e3,this.DEFAULT_ORIENTATION="coordsys",this.mode="off",this.joggingSocket=null,this.trajectorySocket=null,this.timeout=this.DEFAULT_INIT_TIMEOUT,this.tcp=(n==null?void 0:n.tcp)||t.motionGroup.tcp||this.DEFAULT_TCP,this.orientation=(n==null?void 0:n.orientation)||this.DEFAULT_ORIENTATION,this.timeout=(n==null?void 0:n.timeout)||this.DEFAULT_INIT_TIMEOUT,this.mode=(n==null?void 0:n.mode)||this.DEFAULT_MODE,this.onError=n==null?void 0:n.onError}static async open(t,n,r={}){const i=await Ro.open(t,n),o=new Ao(i,r);return await o.setJoggingMode(o.mode),o}async setOptions(t){t.tcp&&(this.tcp=t.tcp),t.orientation&&(this.orientation=t.orientation),t.timeout&&(this.timeout=t.timeout),t.mode&&(this.mode=t.mode),t.onError&&(this.onError=t.onError),this.setJoggingMode(this.mode,!1)}get motionGroupId(){return this.motionStream.motionGroupId}get nova(){return this.motionStream.nova}get numJoints(){return this.motionStream.joints.length}async stop(){if(this.joggingSocket){const t=new Array(this.numJoints).fill(0);this.joggingSocket.sendJson({message_type:"JointVelocityRequest",velocity:t})}this.trajectorySocket&&this.trajectorySocket.sendJson({message_type:"PauseMovementRequest"})}async dispose(){const t=[this.joggingSocket,this.trajectorySocket].filter(n=>n!==null);return t.forEach(n=>{n.dispose()}),this.joggingSocket=null,this.trajectorySocket=null,Promise.all(t.map(n=>n.closed()))}async setJoggingMode(t,n=!0){if(!(this.mode===t&&n)&&(this.dispose(),this.mode=t,this.mode==="jogging"))return this.initializeJoggingWebsocket()}async initializeJoggingWebsocket(){return new Promise((t,n)=>{const r=setTimeout(()=>{n(new Error(`Jogging initialization timeout after ${this.timeout} seconds`))},this.timeout);this.joggingSocket=this.nova.openReconnectingWebsocket(this.ENDPOINT_JOGGING),this.joggingSocket.addEventListener("message",i=>{var s,a,l,c;const o=Ie.tryParseJson(i.data);if(((s=o==null?void 0:o.result)==null?void 0:s.kind)==="INITIALIZE_RECEIVED"){clearTimeout(r),t();return}if(((a=o==null?void 0:o.result)==null?void 0:a.kind)==="MOTION_ERROR")if(clearTimeout(r),this.onBlocked&&((l=o==null?void 0:o.result)!=null&&l.message.includes(zc))){(c=this.joggingSocket)==null||c.dispose(),this.onBlocked();return}else this.onError?this.onError(i.data):n(new Error(i.data))}),this.joggingSocket.sendJson({message_type:"InitializeJoggingRequest",motion_group:this.motionGroupId,tcp:this.tcp})})}async rotateJoints({joint:t,direction:n,velocityValue:r,velocityUnit:i}){if(!this.joggingSocket||this.mode!=="jogging")throw new Error("Joint jogging websocket not connected; create one by setting jogging mode to 'jogging'");const o=new Array(this.numJoints).fill(0);o[t]=n==="-"?-r:r,this.joggingSocket.sendJson({message_type:"JointVelocityRequest",velocity:o})}async translateTCP({axis:t,direction:n,velocityMmPerSec:r}){if(!this.joggingSocket||this.mode!=="jogging")throw new Error("Continuous jogging websocket not connected; create one by setting jogging mode to 'jogging'");const i=[0,0,0],o=[0,0,0];o[Ie.XYZ_TO_VECTOR[t]]=n==="-"?-r:r,this.joggingSocket.sendJson({message_type:"TcpVelocityRequest",translation:o,rotation:i,use_tool_coordinate_system:this.orientation==="tool"})}async rotateTCP({axis:t,direction:n,velocityRadsPerSec:r}){if(!this.joggingSocket||this.mode!=="jogging")throw new Error("Continuous jogging websocket not connected; create one by setting jogging mode to 'jogging'");const i=[0,0,0],o=[0,0,0];i[Ie.XYZ_TO_VECTOR[t]]=n==="-"?-r:r,this.joggingSocket.sendJson({message_type:"TcpVelocityRequest",translation:o,rotation:i})}async runIncrementalCartesianMotion({currentTcpPose:t,currentJoints:n,velocityInRelevantUnits:r,axis:i,direction:o,motion:s}){const a=[];if(this.mode!=="trajectory")throw new Error("Set jogging mode to 'trajectory' to run incremental cartesian motions");if(s.type==="translate"){if(!t.position)throw new Error("Current pose has no position, cannot perform translation");const y=[...t.position];y[Ie.XYZ_TO_VECTOR[i]]+=s.distanceMm*(o==="-"?-1:1),a.push({limits_override:{tcp_velocity_limit:r},path:{path_definition_name:"PathLine",target_pose:{position:y,orientation:t.orientation}}})}else if(s.type==="rotate"){if(!t.orientation)throw new Error("Current pose has no orientation, cannot perform rotation");const y=new Dn(t.orientation[0],t.orientation[1],t.orientation[2]),b=y.length(),E=y.clone().normalize(),T=s.distanceRads*(o==="-"?-1:1),w=new Dn(0,0,0);w[i]=1;const C=Math.cos(.5*T)*Math.cos(.5*b),S=Math.sin(.5*T)*Math.sin(.5*b),R=Math.sin(.5*T)*Math.cos(.5*b),I=Math.cos(.5*T)*Math.sin(.5*b),k=w.dot(E),z=w.clone().cross(E),P=2*Math.acos(C-S*k),v=P/Math.sin(.5*P),_=new Dn().addScaledVector(z,S).addScaledVector(w,R).addScaledVector(E,I).multiplyScalar(v);a.push({limits_override:{tcp_orientation_velocity_limit:r},path:{path_definition_name:"PathLine",target_pose:{position:t.position,orientation:[..._]}}})}const l=this.motionStream.description;if(l.cycle_time===void 0){console.warn("Current motion group has no cycle time, cannot plan jogging motion");return}const c={motion_group_model:l.motion_group_model,cycle_time:l.cycle_time,mounting:l.mounting,global:l.operation_limits.auto_limits},u=await this.nova.api.trajectoryPlanning.planTrajectory({motion_group_setup:c,start_joint_position:n,motion_commands:a}),d=u.response;if(!d)throw new Error(`Failed to plan jogging increment motion ${JSON.stringify(u)}`);this.trajectorySocket&&(console.warn("Trajectory jogging websocket already open; will close"),this.trajectorySocket.dispose()),this.trajectorySocket=this.nova.openReconnectingWebsocket(this.ENDPOINT_TRAJECTORY);const h=y=>{var b;if(!y||y.add_trajectory_error||y.message)if(this.onError)this.onError(y);else throw new Error(((b=y==null?void 0:y.add_trajectory_error)==null?void 0:b.message)||(y==null?void 0:y.message)||"Failed to execute trajectory, unknown error");if(!this.trajectorySocket)throw new Error("Failed to execute trajectory, websocket not available anymore");this.trajectorySocket.sendJson({message_type:"StartMovementRequest",direction:"DIRECTION_FORWARD"})},f=async()=>{var y;await ue.when(()=>!this.motionStream.rapidlyChangingMotionState.standstill),await ue.when(()=>this.motionStream.rapidlyChangingMotionState.standstill),(y=this.trajectorySocket)==null||y.dispose(),this.trajectorySocket=null},m=async()=>{var y;await ue.when(()=>this.motionStream.rapidlyChangingMotionState.standstill),(y=this.trajectorySocket)==null||y.dispose(),this.trajectorySocket=null},p=async y=>{if(y!=null&&y.message)if(this.onError){this.onError(y);return}else throw new Error(y.message||"Failed to execute trajectory, unknown error");this.motionStream.rapidlyChangingMotionState.standstill?await f():await m()};this.trajectorySocket.addEventListener("message",y=>{var E,T;const b=Ie.tryParseJson(y.data);if(!((E=b==null?void 0:b.result)!=null&&E.kind))throw new Error(`Failed to execute trajectory: Received invalid message ${y.data}`);if(this.onBlocked&&((T=b.result.message)!=null&&T.includes(zc))){this.onBlocked();return}if(b.result.kind==="INITIALIZE_RECEIVED")h(b.result);else if(b.result.kind==="START_RECEIVED")p(b);else if(b.result.kind!=="PAUSE_RECEIVED")if(b.result.kind==="MOTION_ERROR"&&b.result.message)if(this.onError){this.onError(b);return}else throw new Error(b.result.message);else throw new Error(`Failed to execute trajectory, cannot handle message type "${b.result.kind}"`)}),this.trajectorySocket.sendJson({message_type:"InitializeMovementRequest",trajectory:{message_type:"TrajectoryData",motion_group:this.motionGroupId,data:d,tcp:this.tcp}})}}function hE(e,t){throw new Error(t+` ${JSON.stringify(e)}`)}function fE(e){var t,n,r,i;return e instanceof Ka.AxiosError&&e.code==="ERR_NETWORK"?"Failed to connect to the server. Please check your internet connection.":e instanceof Ka.AxiosError&&e.response?`${(t=e.response)==null?void 0:t.status} ${(n=e.response)==null?void 0:n.statusText} from ${(r=e.response)==null?void 0:r.config.url}: ${JSON.stringify((i=e.response)==null?void 0:i.data)}`:e instanceof Error?e.message:`Unexpected error: ${g.tryStringifyJson(e)||e}`}const Sh=e=>{const t=e.softTimeout||3e3,[n,r]=D.useState(!1),i=M.useTheme();return D.useEffect(()=>{const o=setTimeout(()=>{r(!0)},t);return()=>clearTimeout(o)}),g.jsxRuntimeExports.jsx(M.Stack,{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",sx:{color:i.palette.text.primary},children:e.error?g.jsxRuntimeExports.jsx(Eh,{loadingMessage:e.message,error:e.error}):g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[g.jsxRuntimeExports.jsx(M.CircularProgress,{sx:{marginBottom:"24px"}}),!!e.message&&g.jsxRuntimeExports.jsx("div",{children:e.message}),g.jsxRuntimeExports.jsx(M.Stack,{sx:{visibility:n?"visible":"hidden",marginTop:"1rem",color:i.palette.text.secondary},children:"This is taking longer than expected..."})]})})},Eh=e=>{const t=fE(e.error),n=e.error instanceof Error?e.error.stack:null,r=M.useTheme();return g.jsxRuntimeExports.jsxs(M.Stack,{sx:{maxHeight:"100%",maxWidth:"min(100%, 800px)",padding:2,overflow:"auto",color:r.palette.error.main,"& pre":{whiteSpace:"pre-wrap",wordBreak:"break-word",paddingBottom:"3rem"}},children:[(e.loadingMessage?`Error while ${Ns.lowerFirst(M.capitalize(e.loadingMessage))} - `:"")+t,g.jsxRuntimeExports.jsx("br",{}),n&&g.jsxRuntimeExports.jsx("pre",{children:n})]})};var pE="[object AsyncFunction]",mE="[object Function]",gE="[object GeneratorFunction]",yE="[object Proxy]";function Th(e){if(!cn(e))return!1;var t=yn(e);return t==mE||t==gE||t==pE||t==yE}var cs=yt["__core-js_shared__"],Fc=(function(){var e=/[^.]+$/.exec(cs&&cs.keys&&cs.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function xE(e){return!!Fc&&Fc in e}var bE=Function.prototype,vE=bE.toString;function xn(e){if(e!=null){try{return vE.call(e)}catch{}try{return e+""}catch{}}return""}var SE=/[\\^$.*+?()[\]{}|]/g,EE=/^\[object .+?Constructor\]$/,TE=Function.prototype,wE=Object.prototype,CE=TE.toString,ME=wE.hasOwnProperty,RE=RegExp("^"+CE.call(ME).replace(SE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function AE(e){if(!cn(e)||xE(e))return!1;var t=Th(e)?RE:EE;return t.test(xn(e))}function _E(e,t){return e==null?void 0:e[t]}function bn(e,t){var n=_E(e,t);return AE(n)?n:void 0}var Bc=(function(){try{var e=bn(Object,"defineProperty");return e({},"",{}),e}catch{}})();function IE(e,t,n){t=="__proto__"&&Bc?Bc(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function jE(e,t,n,r){for(var i=-1,o=e==null?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function kE(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var l=s[++i];if(n(o[l],l,o)===!1)break}return t}}var OE=kE();function PE(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var DE="[object Arguments]";function Gc(e){return un(e)&&yn(e)==DE}var wh=Object.prototype,$E=wh.hasOwnProperty,NE=wh.propertyIsEnumerable,Ch=Gc((function(){return arguments})())?Gc:function(e){return un(e)&&$E.call(e,"callee")&&!NE.call(e,"callee")},mt=Array.isArray;function LE(){return!1}var Mh=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Uc=Mh&&typeof module=="object"&&module&&!module.nodeType&&module,zE=Uc&&Uc.exports===Mh,Vc=zE?yt.Buffer:void 0,FE=Vc?Vc.isBuffer:void 0,js=FE||LE,BE=9007199254740991,GE=/^(?:0|[1-9]\d*)$/;function Rh(e,t){var n=typeof e;return t=t??BE,!!t&&(n=="number"||n!="symbol"&&GE.test(e))&&e>-1&&e%1==0&&e<t}var UE=9007199254740991;function Ga(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=UE}var VE="[object Arguments]",YE="[object Array]",WE="[object Boolean]",HE="[object Date]",qE="[object Error]",KE="[object Function]",JE="[object Map]",XE="[object Number]",ZE="[object Object]",QE="[object RegExp]",eT="[object Set]",tT="[object String]",nT="[object WeakMap]",rT="[object ArrayBuffer]",iT="[object DataView]",oT="[object Float32Array]",sT="[object Float64Array]",aT="[object Int8Array]",lT="[object Int16Array]",cT="[object Int32Array]",uT="[object Uint8Array]",dT="[object Uint8ClampedArray]",hT="[object Uint16Array]",fT="[object Uint32Array]",he={};he[oT]=he[sT]=he[aT]=he[lT]=he[cT]=he[uT]=he[dT]=he[hT]=he[fT]=!0;he[VE]=he[YE]=he[rT]=he[WE]=he[iT]=he[HE]=he[qE]=he[KE]=he[JE]=he[XE]=he[ZE]=he[QE]=he[eT]=he[tT]=he[nT]=!1;function pT(e){return un(e)&&Ga(e.length)&&!!he[yn(e)]}function mT(e){return function(t){return e(t)}}var Ah=typeof exports=="object"&&exports&&!exports.nodeType&&exports,cr=Ah&&typeof module=="object"&&module&&!module.nodeType&&module,gT=cr&&cr.exports===Ah,us=gT&&gh.process,Yc=(function(){try{var e=cr&&cr.require&&cr.require("util").types;return e||us&&us.binding&&us.binding("util")}catch{}})(),Wc=Yc&&Yc.isTypedArray,_h=Wc?mT(Wc):pT,yT=Object.prototype,xT=yT.hasOwnProperty;function bT(e,t){var n=mt(e),r=!n&&Ch(e),i=!n&&!r&&js(e),o=!n&&!r&&!i&&_h(e),s=n||r||i||o,a=s?PE(e.length,String):[],l=a.length;for(var c in e)xT.call(e,c)&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Rh(c,l)))&&a.push(c);return a}var vT=Object.prototype;function ST(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||vT;return e===n}function ET(e,t){return function(n){return e(t(n))}}var TT=ET(Object.keys,Object),wT=Object.prototype,CT=wT.hasOwnProperty;function MT(e){if(!ST(e))return TT(e);var t=[];for(var n in Object(e))CT.call(e,n)&&n!="constructor"&&t.push(n);return t}function Ih(e){return e!=null&&Ga(e.length)&&!Th(e)}function Ua(e){return Ih(e)?bT(e):MT(e)}function RT(e,t){return e&&OE(e,t,Ua)}function AT(e,t){return function(n,r){if(n==null)return n;if(!Ih(n))return e(n,r);for(var i=n.length,o=-1,s=Object(n);++o<i&&r(s[o],o,s)!==!1;);return n}}var _T=AT(RT);function IT(e,t,n,r){return _T(e,function(i,o,s){t(r,i,n(i),s)}),r}function jT(){this.__data__=[],this.size=0}function jh(e,t){return e===t||e!==e&&t!==t}function _o(e,t){for(var n=e.length;n--;)if(jh(e[n][0],t))return n;return-1}var kT=Array.prototype,OT=kT.splice;function PT(e){var t=this.__data__,n=_o(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():OT.call(t,n,1),--this.size,!0}function DT(e){var t=this.__data__,n=_o(t,e);return n<0?void 0:t[n][1]}function $T(e){return _o(this.__data__,e)>-1}function NT(e,t){var n=this.__data__,r=_o(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function It(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}It.prototype.clear=jT;It.prototype.delete=PT;It.prototype.get=DT;It.prototype.has=$T;It.prototype.set=NT;function LT(){this.__data__=new It,this.size=0}function zT(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function FT(e){return this.__data__.get(e)}function BT(e){return this.__data__.has(e)}var vr=bn(yt,"Map"),Sr=bn(Object,"create");function GT(){this.__data__=Sr?Sr(null):{},this.size=0}function UT(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var VT="__lodash_hash_undefined__",YT=Object.prototype,WT=YT.hasOwnProperty;function HT(e){var t=this.__data__;if(Sr){var n=t[e];return n===VT?void 0:n}return WT.call(t,e)?t[e]:void 0}var qT=Object.prototype,KT=qT.hasOwnProperty;function JT(e){var t=this.__data__;return Sr?t[e]!==void 0:KT.call(t,e)}var XT="__lodash_hash_undefined__";function ZT(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Sr&&t===void 0?XT:t,this}function dn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dn.prototype.clear=GT;dn.prototype.delete=UT;dn.prototype.get=HT;dn.prototype.has=JT;dn.prototype.set=ZT;function QT(){this.size=0,this.__data__={hash:new dn,map:new(vr||It),string:new dn}}function ew(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Io(e,t){var n=e.__data__;return ew(t)?n[typeof t=="string"?"string":"hash"]:n.map}function tw(e){var t=Io(this,e).delete(e);return this.size-=t?1:0,t}function nw(e){return Io(this,e).get(e)}function rw(e){return Io(this,e).has(e)}function iw(e,t){var n=Io(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function jt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}jt.prototype.clear=QT;jt.prototype.delete=tw;jt.prototype.get=nw;jt.prototype.has=rw;jt.prototype.set=iw;var ow=200;function sw(e,t){var n=this.__data__;if(n instanceof It){var r=n.__data__;if(!vr||r.length<ow-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new jt(r)}return n.set(e,t),this.size=n.size,this}function Ct(e){var t=this.__data__=new It(e);this.size=t.size}Ct.prototype.clear=LT;Ct.prototype.delete=zT;Ct.prototype.get=FT;Ct.prototype.has=BT;Ct.prototype.set=sw;var aw="__lodash_hash_undefined__";function lw(e){return this.__data__.set(e,aw),this}function cw(e){return this.__data__.has(e)}function $i(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new jt;++t<n;)this.add(e[t])}$i.prototype.add=$i.prototype.push=lw;$i.prototype.has=cw;function uw(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function dw(e,t){return e.has(t)}var hw=1,fw=2;function kh(e,t,n,r,i,o){var s=n&hw,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(e),u=o.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,f=n&fw?new $i:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var m=e[d],p=t[d];if(r)var y=s?r(p,m,d,t,e,o):r(m,p,d,e,t,o);if(y!==void 0){if(y)continue;h=!1;break}if(f){if(!uw(t,function(b,E){if(!dw(f,E)&&(m===b||i(m,b,n,r,o)))return f.push(E)})){h=!1;break}}else if(!(m===p||i(m,p,n,r,o))){h=!1;break}}return o.delete(e),o.delete(t),h}var Hc=yt.Uint8Array;function pw(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function mw(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var gw=1,yw=2,xw="[object Boolean]",bw="[object Date]",vw="[object Error]",Sw="[object Map]",Ew="[object Number]",Tw="[object RegExp]",ww="[object Set]",Cw="[object String]",Mw="[object Symbol]",Rw="[object ArrayBuffer]",Aw="[object DataView]",qc=Ft?Ft.prototype:void 0,ds=qc?qc.valueOf:void 0;function _w(e,t,n,r,i,o,s){switch(n){case Aw:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Rw:return!(e.byteLength!=t.byteLength||!o(new Hc(e),new Hc(t)));case xw:case bw:case Ew:return jh(+e,+t);case vw:return e.name==t.name&&e.message==t.message;case Tw:case Cw:return e==t+"";case Sw:var a=pw;case ww:var l=r&gw;if(a||(a=mw),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=yw,s.set(e,t);var u=kh(a(e),a(t),r,i,o,s);return s.delete(e),u;case Mw:if(ds)return ds.call(e)==ds.call(t)}return!1}function Iw(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function jw(e,t,n){var r=t(e);return mt(e)?r:Iw(r,n(e))}function kw(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function Ow(){return[]}var Pw=Object.prototype,Dw=Pw.propertyIsEnumerable,Kc=Object.getOwnPropertySymbols,$w=Kc?function(e){return e==null?[]:(e=Object(e),kw(Kc(e),function(t){return Dw.call(e,t)}))}:Ow;function Jc(e){return jw(e,Ua,$w)}var Nw=1,Lw=Object.prototype,zw=Lw.hasOwnProperty;function Fw(e,t,n,r,i,o){var s=n&Nw,a=Jc(e),l=a.length,c=Jc(t),u=c.length;if(l!=u&&!s)return!1;for(var d=l;d--;){var h=a[d];if(!(s?h in t:zw.call(t,h)))return!1}var f=o.get(e),m=o.get(t);if(f&&m)return f==t&&m==e;var p=!0;o.set(e,t),o.set(t,e);for(var y=s;++d<l;){h=a[d];var b=e[h],E=t[h];if(r)var T=s?r(E,b,h,t,e,o):r(b,E,h,e,t,o);if(!(T===void 0?b===E||i(b,E,n,r,o):T)){p=!1;break}y||(y=h=="constructor")}if(p&&!y){var w=e.constructor,C=t.constructor;w!=C&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof C=="function"&&C instanceof C)&&(p=!1)}return o.delete(e),o.delete(t),p}var ks=bn(yt,"DataView"),Os=bn(yt,"Promise"),Ps=bn(yt,"Set"),Ds=bn(yt,"WeakMap"),Xc="[object Map]",Bw="[object Object]",Zc="[object Promise]",Qc="[object Set]",eu="[object WeakMap]",tu="[object DataView]",Gw=xn(ks),Uw=xn(vr),Vw=xn(Os),Yw=xn(Ps),Ww=xn(Ds),$t=yn;(ks&&$t(new ks(new ArrayBuffer(1)))!=tu||vr&&$t(new vr)!=Xc||Os&&$t(Os.resolve())!=Zc||Ps&&$t(new Ps)!=Qc||Ds&&$t(new Ds)!=eu)&&($t=function(e){var t=yn(e),n=t==Bw?e.constructor:void 0,r=n?xn(n):"";if(r)switch(r){case Gw:return tu;case Uw:return Xc;case Vw:return Zc;case Yw:return Qc;case Ww:return eu}return t});var Hw=1,nu="[object Arguments]",ru="[object Array]",ni="[object Object]",qw=Object.prototype,iu=qw.hasOwnProperty;function Kw(e,t,n,r,i,o){var s=mt(e),a=mt(t),l=s?ru:$t(e),c=a?ru:$t(t);l=l==nu?ni:l,c=c==nu?ni:c;var u=l==ni,d=c==ni,h=l==c;if(h&&js(e)){if(!js(t))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new Ct),s||_h(e)?kh(e,t,n,r,i,o):_w(e,t,l,n,r,i,o);if(!(n&Hw)){var f=u&&iu.call(e,"__wrapped__"),m=d&&iu.call(t,"__wrapped__");if(f||m){var p=f?e.value():e,y=m?t.value():t;return o||(o=new Ct),i(p,y,n,r,o)}}return h?(o||(o=new Ct),Fw(e,t,n,r,i,o)):!1}function jo(e,t,n,r,i){return e===t?!0:e==null||t==null||!un(e)&&!un(t)?e!==e&&t!==t:Kw(e,t,n,r,jo,i)}var Jw=1,Xw=2;function Zw(e,t,n,r){var i=n.length,o=i;if(e==null)return!o;for(e=Object(e);i--;){var s=n[i];if(s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){s=n[i];var a=s[0],l=e[a],c=s[1];if(s[2]){if(l===void 0&&!(a in e))return!1}else{var u=new Ct,d;if(!(d===void 0?jo(c,l,Jw|Xw,r,u):d))return!1}}return!0}function Oh(e){return e===e&&!cn(e)}function Qw(e){for(var t=Ua(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Oh(i)]}return t}function Ph(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function eC(e){var t=Qw(e);return t.length==1&&t[0][2]?Ph(t[0][0],t[0][1]):function(n){return n===e||Zw(n,e,t)}}var tC=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nC=/^\w*$/;function Va(e,t){if(mt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Mo(e)?!0:nC.test(e)||!tC.test(e)||t!=null&&e in Object(t)}var rC="Expected a function";function Ya(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(rC);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Ya.Cache||jt),n}Ya.Cache=jt;var iC=500;function oC(e){var t=Ya(e,function(r){return n.size===iC&&n.clear(),r}),n=t.cache;return t}var sC=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,aC=/\\(\\)?/g,lC=oC(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(sC,function(n,r,i,o){t.push(i?o.replace(aC,"$1"):r||n)}),t});function cC(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var ou=Ft?Ft.prototype:void 0,su=ou?ou.toString:void 0;function Dh(e){if(typeof e=="string")return e;if(mt(e))return cC(e,Dh)+"";if(Mo(e))return su?su.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function $h(e){return e==null?"":Dh(e)}function Nh(e,t){return mt(e)?e:Va(e,t)?[e]:lC($h(e))}function ko(e){if(typeof e=="string"||Mo(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Lh(e,t){t=Nh(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[ko(t[n++])];return n&&n==r?e:void 0}function uC(e,t,n){var r=e==null?void 0:Lh(e,t);return r===void 0?n:r}function dC(e,t){return e!=null&&t in Object(e)}function hC(e,t,n){t=Nh(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=ko(t[r]);if(!(o=e!=null&&n(e,s)))break;e=e[s]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&Ga(i)&&Rh(s,i)&&(mt(e)||Ch(e)))}function fC(e,t){return e!=null&&hC(e,t,dC)}var pC=1,mC=2;function gC(e,t){return Va(e)&&Oh(t)?Ph(ko(e),t):function(n){var r=uC(n,e);return r===void 0&&r===t?fC(n,e):jo(t,r,pC|mC)}}function yC(e){return e}function xC(e){return function(t){return t==null?void 0:t[e]}}function bC(e){return function(t){return Lh(t,e)}}function vC(e){return Va(e)?xC(ko(e)):bC(e)}function SC(e){return typeof e=="function"?e:e==null?yC:typeof e=="object"?mt(e)?gC(e[0],e[1]):eC(e):vC(e)}function EC(e,t){return function(n,r){var i=mt(n)?jE:IT,o={};return i(n,e,SC(r),o)}}var ri=EC(function(e,t,n){IE(e,n,t)}),TC=0;function wC(e){var t=++TC;return $h(e)+t}const $s=[{id:"0.1",mm:.1,degrees:.05},{id:"1",mm:1,degrees:.5},{id:"5",mm:5,degrees:2.5},{id:"10",mm:10,degrees:5}],CC=[{id:"continuous"},...$s],MC=["coordsys","tool"];var or=(e=>(e.REVOLUTE="REVOLUTE",e.PRISMATIC="PRISMATIC",e))(or||{});class Oo{constructor(t,n,r,i){var o,s;this.jogger=t,this.coordSystems=n,this.motionGroupDescription=r,this.tcps=i,this.selectedTabId="cartesian",this.activationState="inactive",this.activationError=null,this.activationCounter=0,this.locks=new Set,this.blocked=!1,this.selectedCoordSystemId="world",this.selectedTcpId="",this.selectedOrientation="coordsys",this.selectedIncrementId="continuous",this.selectedCartesianMotionType="translate",this.incrementJogInProgress=null,this.translationVelocityMmPerSec=10,this.rotationVelocityDegPerSec=1,this.minTranslationVelocityMmPerSec=5,this.maxTranslationVelocityMmPerSec=250,this.minRotationVelocityDegPerSec=1,this.maxRotationVelocityDegPerSec=60,this.showCoordSystemSelect=!1,this.showTcpSelect=!0,this.showOrientationSelect=!0,this.showIncrementSelect=!0,this.showTabIcons=!1,this.showVelocitySliderLabel=!0,this.showVelocityLegend=!1,this.showJointsLegend=!1,this.disposers=[];for(const a of n)if(a.coordinate_system===""){a.coordinate_system="world";break}this.selectedCoordSystemId=((o=n[0])==null?void 0:o.coordinate_system)||"world",this.selectedTcpId=((s=i[0])==null?void 0:s.id)||"",ue.makeAutoObservable(this,{},{autoBind:!0}),this.jogger.onBlocked=()=>{this.block()},this.loadFromLocalStorage(),this.disposers.push(ue.autorun(()=>this.saveToLocalStorage())),window.joggingStore=this}static async loadFor(t){const{nova:n}=t,[r,i]=await Promise.all([n.api.controller.listCoordinateSystems(t.motionStream.controllerId,"ROTATION_VECTOR"),n.api.motionGroup.getMotionGroupDescription(t.motionStream.controllerId,t.motionGroupId)]),o=Object.entries(i.tcps||{}).map(([s,a])=>({id:s,readable_name:a.name,position:a.pose.position,orientation:a.pose.orientation}));return new Oo(t,r||[],i,o)}dispose(){for(const t of this.disposers)t();this.jogger.dispose()}get coordSystemCountByName(){return Ns.countBy(this.coordSystems,t=>t.name)}async deactivate(){if(this.jogger.mode==="jogging")return this.jogger.stop()}async activate(){return this.currentTab.id==="cartesian"?((this.jogger.tcp!==this.selectedTcpId||this.jogger.orientation!==this.selectedOrientation)&&this.jogger.setOptions({tcp:this.selectedTcpId,orientation:this.selectedOrientation}),this.activeDiscreteIncrement?this.jogger.setJoggingMode("trajectory"):this.jogger.setJoggingMode("jogging")):this.jogger.setJoggingMode("jogging"),this.jogger}loadFromLocalStorage(){const t=Ie.tryParseJson(localStorage.getItem("joggingToolStore"));t&&(this.tabsById[t.selectedTabId]&&(this.selectedTabId=t.selectedTabId),this.coordSystemsById[t.selectedCoordSystemId]&&(this.selectedCoordSystemId=t.selectedCoordSystemId),this.tcpsById[t.selectedTcpId]&&(this.selectedTcpId=t.selectedTcpId),this.incrementOptionsById[t.selectedIncrementId]&&(this.selectedIncrementId=t.selectedIncrementId),["translate","rotate"].includes(t.selectedCartesianMotionType)&&(this.selectedCartesianMotionType=t.selectedCartesianMotionType),["coordsys","tool"].includes(t.selectedOrientation)&&(this.selectedOrientation=t.selectedOrientation))}saveToLocalStorage(){localStorage.setItem("joggingToolStore",JSON.stringify(this.localStorageSave))}get isLocked(){return this.locks.size>0}get localStorageSave(){return{selectedTabId:this.selectedTabId,selectedCoordSystemId:this.selectedCoordSystemId,selectedTcpId:this.selectedTcpId,selectedOrientation:this.selectedOrientation,selectedIncrementId:this.selectedIncrementId,selectedCartesianMotionType:this.selectedCartesianMotionType}}get tabs(){const t=[{id:"joint",label:"Joints"}];return this.isTcpCartesianMoveable&&t.unshift({id:"cartesian",label:"Cartesian"}),t}get incrementOptions(){return CC}get discreteIncrementOptions(){return $s}get incrementOptionsById(){return ri(this.incrementOptions,t=>t.id)}get tabsById(){return ri(this.tabs,t=>t.id)}get currentTab(){return this.tabsById[this.selectedTabId]||this.tabs[0]}get tabIndex(){return this.tabs.indexOf(this.currentTab)}get coordSystemsById(){return ri(this.coordSystems,t=>t.coordinate_system)}get selectedCoordSystem(){return this.coordSystemsById[this.selectedCoordSystemId]}get activeCoordSystemId(){return this.selectedOrientation==="tool"?"tool":this.selectedCoordSystemId}get tcpsById(){return ri(this.tcps,t=>t.id)}get activeDiscreteIncrement(){return this.selectedOrientation==="tool"?void 0:$s.find(t=>t.id===this.selectedIncrementId)}get rotationVelocityRadsPerSec(){return this.rotationVelocityDegPerSec*Math.PI/180}velocityInDisplayUnits(t){return t?this.rotationVelocityDegPerSec:this.translationVelocityMmPerSec}minVelocityInDisplayUnits(t){return t?this.minRotationVelocityDegPerSec:this.minTranslationVelocityMmPerSec}maxVelocityInDisplayUnits(t){return t?this.maxRotationVelocityDegPerSec:this.maxTranslationVelocityMmPerSec}get jointCategory(){return this.motionGroupDescription.motion_group_model==="ABB_IRT710"?"PRISMATIC":"REVOLUTE"}get isTcpCartesianMoveable(){return this.motionGroupDescription.motion_group_model!=="ABB_IRT710"}onTabChange(t,n){const r=this.tabs[n]||this.tabs[0];this.selectedTabId=r.id}setSelectedCoordSystemId(t){this.selectedCoordSystemId=t}setSelectedTcpId(t){this.selectedTcpId=t}setSelectedOrientation(t){this.selectedOrientation=t}setSelectedIncrementId(t){this.selectedIncrementId=t}setCurrentIncrementJog(t){this.incrementJogInProgress=t}setVelocityFromSlider(t,n){n?this.rotationVelocityDegPerSec=t:this.translationVelocityMmPerSec=t}setSelectedCartesianMotionType(t){this.selectedCartesianMotionType=t}lock(t){this.locks.add(t)}unlock(t){this.locks.delete(t)}block(){this.blocked=!0}unblock(){this.blocked=!1,this.jogger.mode==="jogging"&&this.jogger.initializeJoggingWebsocket()}async withMotionLock(t){const n=wC();this.lock(n);try{return await t()}finally{this.unlock(n)}}}const RC=se.observer(({store:e})=>{const{t}=de.useTranslation();return g.jsxRuntimeExports.jsx(M.Backdrop,{open:!0,sx:{position:"absolute",zIndex:n=>n.zIndex.drawer+1,color:"#fff",background:"rgba(15, 15, 15, 0.88)",justifyContent:"flex-start",alignItems:"flex-start"},children:g.jsxRuntimeExports.jsxs(M.Stack,{sx:{m:2,width:"100%"},children:[g.jsxRuntimeExports.jsxs(M.Alert,{severity:"error",sx:{mb:2},children:[g.jsxRuntimeExports.jsx(M.AlertTitle,{children:t("Jogging.Blocked.ti")}),t("Jogging.Blocked.lb")]}),g.jsxRuntimeExports.jsx(M.Button,{variant:"contained",color:"secondary",onClick:()=>e.unblock(),children:t("Jogging.Blocked.Reenable.bt")})]})})});function AC(e,t){return jo(e,t)}const zh=({store:e})=>{const{t}=de.useTranslation(),[n,r]=D.useState(e.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached),i=D.useRef(n);g.useAnimationFrame(()=>{const s=e.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached;AC(i.current,s)||(i.current=s,r(s))});const o=[];for(const[s,a]of n.entries())a&&o.push(s);return g.jsxRuntimeExports.jsx(M.Typography,{color:"error",sx:{margin:"0.5rem 1rem",textAlign:"center",minHeight:"1.5rem",visibility:o.length?"visible":"hidden"},children:t("Jogging.JointLimitsReached.lb",{jointNumbers:o.map(s=>s+1).join(", ")})})},_C=M.styled(M.FormControl)(({theme:e})=>({"&.MuiFormControl-root":{".MuiSelect-select":{paddingTop:"20px",paddingLeft:"12px"},label:{pointerEvents:"none",fontSize:"16px"},".MuiInputLabel-root":{"&.Mui-focused":{color:e.palette.text.primary}}}}));function ii({labelValue:e,...t}){return g.jsxRuntimeExports.jsxs(_C,{fullWidth:!0,variant:"filled",children:[g.jsxRuntimeExports.jsx(M.InputLabel,{id:t.labelId,children:e}),g.jsxRuntimeExports.jsx(M.Select,{...t})]})}const IC=se.observer(({store:e,useDegree:t})=>{var s;const{t:n}=de.useTranslation(),r=D.useId(),i=[];function o(a){switch(a){case"coordsys":return n("Jogging.Orientation.coordsys");case"tool":return n("Jogging.Orientation.tool");default:return a}}return e.showCoordSystemSelect&&i.push(g.jsxRuntimeExports.jsx(ii,{labelId:`jogging-coord-select-${r}`,labelValue:n("Jogging.CoordinateSystem.hlb"),value:e.selectedCoordSystemId,size:"small",variant:"filled",displayEmpty:!0,onChange:a=>e.setSelectedCoordSystemId(a.target.value),disabled:e.isLocked,children:e.coordSystems.map(a=>g.jsxRuntimeExports.jsx(M.MenuItem,{value:a.coordinate_system,children:a.name&&e.coordSystemCountByName[a.name]>1?`${a.name} / ${a.coordinate_system}`:a.name||a.coordinate_system},a.coordinate_system))},"coord")),e.showTcpSelect&&i.push(g.jsxRuntimeExports.jsx(ii,{labelId:`jogging-tcp-select-${r}`,labelValue:"TCP",value:e.selectedTcpId,size:"small",variant:"filled",onChange:a=>e.setSelectedTcpId(a.target.value),disabled:e.isLocked,children:e.tcps.map(a=>g.jsxRuntimeExports.jsx(M.MenuItem,{value:a.id,children:a.id},a.id))},"tcp")),e.showOrientationSelect&&i.push(g.jsxRuntimeExports.jsx(ii,{labelValue:n("Jogging.Cartesian.Orientation.lb"),labelId:`orientation-select-${r}`,value:e.selectedOrientation,onChange:a=>e.setSelectedOrientation(a.target.value),disabled:e.isLocked,children:MC.map(a=>g.jsxRuntimeExports.jsx(M.MenuItem,{value:a,children:o(a)},a))},"orientation")),e.showIncrementSelect&&i.push(g.jsxRuntimeExports.jsxs(ii,{labelValue:n("Jogging.Increment.hlb"),labelId:`jogging-increment-select-${r}`,size:"small",variant:"filled",value:((s=e.activeDiscreteIncrement)==null?void 0:s.id)||"continuous",onChange:a=>e.setSelectedIncrementId(a.target.value),disabled:e.isLocked,children:[g.jsxRuntimeExports.jsx(M.MenuItem,{value:"continuous",children:n("Jogging.Increment.Continuous.dd")},"continuous"),e.selectedOrientation==="tool"?null:e.discreteIncrementOptions.map(a=>g.jsxRuntimeExports.jsx(M.MenuItem,{value:a.id,children:t?`${a.degrees}°`:`${a.mm}mm`},a.id))]},"increment")),g.jsxRuntimeExports.jsx(M.Box,{component:"div",sx:{display:"grid",gap:"16px",gridTemplateColumns:"1fr 1fr",gridAutoRows:"min-content","& label":{opacity:.7,fontSize:"12px",marginBottom:"4px"}},children:i.map((a,l)=>g.jsxRuntimeExports.jsx(M.Box,{sx:{gridColumn:i.length%2===1&&l===i.length-1?"span 2":"auto"},children:a},l))})}),jC=M.styled(M.ToggleButtonGroup)(({theme:e})=>{var t;return{"&.MuiToggleButtonGroup-root":{background:(t=e.palette.backgroundPaperElevation)==null?void 0:t[8],borderRadius:"8px",padding:"4px",gap:"4px",button:{border:"none",borderRadius:"4px",flex:"1 1 0px",minWidth:0,"&.MuiToggleButtonGroup-firstButton":{borderRadius:"8px 4px 4px 8px"},"&.MuiToggleButtonGroup-lastButton":{borderRadius:"4px 8px 8px 4px"}}}}});function au(e,t){return process.env.NODE_ENV==="production"?()=>null:function(...r){return e(...r)||t(...r)}}function ur(e){return typeof e=="string"}function kC(e,t,n){return e===void 0||ur(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function hi(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function lu(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function OC(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){const f=Ne(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),m={...n==null?void 0:n.style,...i==null?void 0:i.style,...r==null?void 0:r.style},p={...n,...i,...r};return f.length>0&&(p.className=f),Object.keys(m).length>0&&(p.style=m),{props:p,internalRef:void 0}}const s=hi({...i,...r}),a=lu(r),l=lu(i),c=t(s),u=Ne(c==null?void 0:c.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),d={...c==null?void 0:c.style,...n==null?void 0:n.style,...i==null?void 0:i.style,...r==null?void 0:r.style},h={...c,...n,...l,...a};return u.length>0&&(h.className=u),Object.keys(d).length>0&&(h.style=d),{props:h,internalRef:c.ref}}function PC(e,t,n){return typeof e=="function"?e(t,n):e}function Pt(e){var d;const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...o}=e,s=i?{}:PC(n,r),{props:a,internalRef:l}=OC({...o,externalSlotProps:s}),c=eo(l,s==null?void 0:s.ref,(d=e.additionalProps)==null?void 0:d.ref);return kC(t,{...a,ref:c},r)}function cu(e){try{return e.matches(":focus-visible")}catch{process.env.NODE_ENV!=="production"&&!window.navigator.userAgent.includes("jsdom")&&console.warn(["MUI: The `:focus-visible` pseudo class is not supported in this browser.","Some components rely on this feature to work properly."].join(`
|
|
112
|
+
`))}return!1}const DC={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function $C(e,t,n=(r,i)=>r===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}const NC=2;function _n(e,t,n,r,i){return n===1?Math.min(e+t,i):Math.max(e-t,r)}function Fh(e,t){return e-t}function uu(e,t){const{index:n}=e.reduce((r,i,o)=>{const s=Math.abs(t-i);return r===null||s<r.distance||s===r.distance?{distance:s,index:o}:r},null)??{};return n}function oi(e,t){if(t.current!==void 0&&e.changedTouches){const n=e;for(let r=0;r<n.changedTouches.length;r+=1){const i=n.changedTouches[r];if(i.identifier===t.current)return{x:i.clientX,y:i.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function Ni(e,t,n){return(e-t)*100/(n-t)}function LC(e,t,n){return(n-t)*e+t}function zC(e){if(Math.abs(e)<1){const n=e.toExponential().split("e-"),r=n[0].split(".")[1];return(r?r.length:0)+parseInt(n[1],10)}const t=e.toString().split(".")[1];return t?t.length:0}function FC(e,t,n){const r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(zC(t)))}function du({values:e,newValue:t,index:n}){const r=e.slice();return r[n]=t,r.sort(Fh)}function si({sliderRef:e,activeIndex:t,setActive:n}){var i,o,s;const r=ar(e.current);(!((i=e.current)!=null&&i.contains(r.activeElement))||Number((o=r==null?void 0:r.activeElement)==null?void 0:o.getAttribute("data-index"))!==t)&&((s=e.current)==null||s.querySelector(`[type="range"][data-index="${t}"]`).focus()),n&&n(t)}function ai(e,t){return typeof e=="number"&&typeof t=="number"?e===t:typeof e=="object"&&typeof t=="object"?$C(e,t):!1}const BC={horizontal:{offset:e=>({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},GC=e=>e;let li;function hu(){return li===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?li=CSS.supports("touch-action","none"):li=!0),li}function UC(e){const{"aria-labelledby":t,defaultValue:n,disabled:r=!1,disableSwap:i=!1,isRtl:o=!1,marks:s=!1,max:a=100,min:l=0,name:c,onChange:u,onChangeCommitted:d,orientation:h="horizontal",rootRef:f,scale:m=GC,step:p=1,shiftStep:y=10,tabIndex:b,value:E}=e,T=O.useRef(void 0),[w,C]=O.useState(-1),[S,R]=O.useState(-1),[I,k]=O.useState(!1),z=O.useRef(0),P=O.useRef(null),[v,_]=OS({controlled:E,default:n??l,name:"Slider"}),A=u&&((N,U,H)=>{const ee=N.nativeEvent||N,ce=new ee.constructor(ee.type,ee);Object.defineProperty(ce,"target",{writable:!0,value:{value:U,name:c}}),P.current=U,u(ce,U,H)}),B=Array.isArray(v);let G=B?v.slice().sort(Fh):[v];G=G.map(N=>N==null?l:In(N,l,a));const Z=s===!0&&p!==null?[...Array(Math.floor((a-l)/p)+1)].map((N,U)=>({value:l+p*U})):s||[],Y=Z.map(N=>N.value),[te,we]=O.useState(-1),V=O.useRef(null),xe=eo(f,V),Pe=N=>U=>{var ee;const H=Number(U.currentTarget.getAttribute("data-index"));cu(U.target)&&we(H),R(H),(ee=N==null?void 0:N.onFocus)==null||ee.call(N,U)},xt=N=>U=>{var H;cu(U.target)||we(-1),R(-1),(H=N==null?void 0:N.onBlur)==null||H.call(N,U)},ke=(N,U)=>{const H=Number(N.currentTarget.getAttribute("data-index")),ee=G[H],ce=Y.indexOf(ee);let K=U;if(Z&&p==null){const Me=Y[Y.length-1];K>=Me?K=Me:K<=Y[0]?K=Y[0]:K=K<ee?Y[ce-1]:Y[ce+1]}if(K=In(K,l,a),B){i&&(K=In(K,G[H-1]||-1/0,G[H+1]||1/0));const Me=K;K=du({values:G,newValue:K,index:H});let De=H;i||(De=K.indexOf(Me)),si({sliderRef:V,activeIndex:De})}_(K),we(H),A&&!ai(K,v)&&A(N,K,H),d&&d(N,P.current??K)},bt=N=>U=>{var H;if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(U.key)){U.preventDefault();const ee=Number(U.currentTarget.getAttribute("data-index")),ce=G[ee];let K=null;if(p!=null){const Me=U.shiftKey?y:p;switch(U.key){case"ArrowUp":K=_n(ce,Me,1,l,a);break;case"ArrowRight":K=_n(ce,Me,o?-1:1,l,a);break;case"ArrowDown":K=_n(ce,Me,-1,l,a);break;case"ArrowLeft":K=_n(ce,Me,o?1:-1,l,a);break;case"PageUp":K=_n(ce,y,1,l,a);break;case"PageDown":K=_n(ce,y,-1,l,a);break;case"Home":K=l;break;case"End":K=a;break}}else if(Z){const Me=Y[Y.length-1],De=Y.indexOf(ce),ve=[o?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],He=[o?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];ve.includes(U.key)?De===0?K=Y[0]:K=Y[De-1]:He.includes(U.key)&&(De===Y.length-1?K=Me:K=Y[De+1])}K!=null&&ke(U,K)}(H=N==null?void 0:N.onKeyDown)==null||H.call(N,U)};ot(()=>{var N;r&&V.current.contains(document.activeElement)&&((N=document.activeElement)==null||N.blur())},[r]),r&&w!==-1&&C(-1),r&&te!==-1&&we(-1);const st=N=>U=>{var H;(H=N.onChange)==null||H.call(N,U),ke(U,U.target.valueAsNumber)},Ue=O.useRef(void 0);let F=h;o&&h==="horizontal"&&(F+="-reverse");const q=({finger:N,move:U=!1})=>{const{current:H}=V,{width:ee,height:ce,bottom:K,left:Me}=H.getBoundingClientRect();let De;F.startsWith("vertical")?De=(K-N.y)/ce:De=(N.x-Me)/ee,F.includes("-reverse")&&(De=1-De);let ve;if(ve=LC(De,l,a),p)ve=FC(ve,p,l);else{const qn=uu(Y,ve);ve=Y[qn]}ve=In(ve,l,a);let He=0;if(B){U?He=Ue.current:He=uu(G,ve),i&&(ve=In(ve,G[He-1]||-1/0,G[He+1]||1/0));const qn=ve;ve=du({values:G,newValue:ve,index:He}),i&&U||(He=ve.indexOf(qn),Ue.current=He)}return{newValue:ve,activeIndex:He}},X=Ye(N=>{const U=oi(N,T);if(!U)return;if(z.current+=1,N.type==="mousemove"&&N.buttons===0){$(N);return}const{newValue:H,activeIndex:ee}=q({finger:U,move:!0});si({sliderRef:V,activeIndex:ee,setActive:C}),_(H),!I&&z.current>NC&&k(!0),A&&!ai(H,v)&&A(N,H,ee)}),$=Ye(N=>{const U=oi(N,T);if(k(!1),!U)return;const{newValue:H}=q({finger:U,move:!0});C(-1),N.type==="touchend"&&R(-1),d&&d(N,P.current??H),T.current=void 0,Q()}),re=Ye(N=>{if(r)return;hu()||N.preventDefault();const U=N.changedTouches[0];U!=null&&(T.current=U.identifier);const H=oi(N,T);if(H!==!1){const{newValue:ce,activeIndex:K}=q({finger:H});si({sliderRef:V,activeIndex:K,setActive:C}),_(ce),A&&!ai(ce,v)&&A(N,ce,K)}z.current=0;const ee=ar(V.current);ee.addEventListener("touchmove",X,{passive:!0}),ee.addEventListener("touchend",$,{passive:!0})}),Q=O.useCallback(()=>{const N=ar(V.current);N.removeEventListener("mousemove",X),N.removeEventListener("mouseup",$),N.removeEventListener("touchmove",X),N.removeEventListener("touchend",$)},[$,X]);O.useEffect(()=>{const{current:N}=V;return N.addEventListener("touchstart",re,{passive:hu()}),()=>{N.removeEventListener("touchstart",re),Q()}},[Q,re]),O.useEffect(()=>{r&&Q()},[r,Q]);const Ae=N=>U=>{var ce;if((ce=N.onMouseDown)==null||ce.call(N,U),r||U.defaultPrevented||U.button!==0)return;U.preventDefault();const H=oi(U,T);if(H!==!1){const{newValue:K,activeIndex:Me}=q({finger:H});si({sliderRef:V,activeIndex:Me,setActive:C}),_(K),A&&!ai(K,v)&&A(U,K,Me)}z.current=0;const ee=ar(V.current);ee.addEventListener("mousemove",X,{passive:!0}),ee.addEventListener("mouseup",$)},Ce=Ni(B?G[0]:l,l,a),pe=Ni(G[G.length-1],l,a)-Ce,kt=(N={})=>{const U=hi(N),H={onMouseDown:Ae(U||{})},ee={...U,...H};return{...N,ref:xe,...ee}},kr=N=>U=>{var ee;(ee=N.onMouseOver)==null||ee.call(N,U);const H=Number(U.currentTarget.getAttribute("data-index"));R(H)},Or=N=>U=>{var H;(H=N.onMouseLeave)==null||H.call(N,U),R(-1)},Pr=(N={})=>{const U=hi(N),H={onMouseOver:kr(U||{}),onMouseLeave:Or(U||{})};return{...N,...U,...H}},Dr=N=>({pointerEvents:w!==-1&&w!==N?"none":void 0});let vn;return h==="vertical"&&(vn=o?"vertical-rl":"vertical-lr"),{active:w,axis:F,axisProps:BC,dragging:I,focusedThumbIndex:te,getHiddenInputProps:(N={})=>{const U=hi(N),H={onChange:st(U||{}),onFocus:Pe(U||{}),onBlur:xt(U||{}),onKeyDown:bt(U||{})},ee={...U,...H};return{tabIndex:b,"aria-labelledby":t,"aria-orientation":h,"aria-valuemax":m(a),"aria-valuemin":m(l),name:c,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":e.step??void 0,disabled:r,...N,...ee,style:{...DC,direction:o?"rtl":"ltr",width:"100%",height:"100%",writingMode:vn}}},getRootProps:kt,getThumbProps:Pr,marks:Z,open:S,range:B,rootRef:xe,trackLeap:pe,trackOffset:Ce,values:G,getThumbStyle:Dr}}const VC=e=>!e||!ur(e);function YC(e){return typeof e.main=="string"}function WC(e,t=[]){if(!YC(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function Wa(e=[]){return([,t])=>t&&WC(t,e)}function HC(e){return hn("MuiSlider",e)}const Xe=Ji("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),qC=e=>{const{open:t}=e;return{offset:Ne(t&&Xe.valueLabelOpen),circle:Xe.valueLabelCircle,label:Xe.valueLabelLabel}};function Bh(e){const{children:t,className:n,value:r}=e,i=qC(e);return t?O.cloneElement(t,{className:t.props.className},g.jsxRuntimeExports.jsxs(O.Fragment,{children:[t.props.children,g.jsxRuntimeExports.jsx("span",{className:Ne(i.offset,n),"aria-hidden":!0,children:g.jsxRuntimeExports.jsx("span",{className:i.circle,children:g.jsxRuntimeExports.jsx("span",{className:i.label,children:r})})})]})):null}process.env.NODE_ENV!=="production"&&(Bh.propTypes={children:x.element.isRequired,className:x.string,value:x.node});function fu(e){return e}const KC=We("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${$e(n.color)}`],n.size!=="medium"&&t[`size${$e(n.size)}`],n.marked&&t.marked,n.orientation==="vertical"&&t.vertical,n.track==="inverted"&&t.trackInverted,n.track===!1&&t.trackFalse]}})(gn(({theme:e})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${Xe.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${Xe.dragging}`]:{[`& .${Xe.thumb}, & .${Xe.track}`]:{transition:"none"}},variants:[...Object.entries(e.palette).filter(Wa()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}))),JC=We("span",{name:"MuiSlider",slot:"Rail"})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),XC=We("span",{name:"MuiSlider",slot:"Track"})(gn(({theme:e})=>({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:e.transitions.create(["left","width","bottom","height"],{duration:e.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.entries(e.palette).filter(Wa()).map(([t])=>({props:{color:t,track:"inverted"},style:{...e.vars?{backgroundColor:e.vars.palette.Slider[`${t}Track`],borderColor:e.vars.palette.Slider[`${t}Track`]}:{backgroundColor:e.lighten(e.palette[t].main,.62),borderColor:e.lighten(e.palette[t].main,.62),...e.applyStyles("dark",{backgroundColor:e.darken(e.palette[t].main,.5)}),...e.applyStyles("dark",{borderColor:e.darken(e.palette[t].main,.5)})}}}))]}))),ZC=We("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.thumb,t[`thumbColor${$e(n.color)}`],n.size!=="medium"&&t[`thumbSize${$e(n.size)}`]]}})(gn(({theme:e})=>({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow","left","bottom"],{duration:e.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(e.vars||e).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${Xe.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.entries(e.palette).filter(Wa()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${Xe.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.alpha((e.vars||e).palette[t].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${Xe.active}`]:{boxShadow:`0px 0px 0px 14px ${e.alpha((e.vars||e).palette[t].main,.16)}`}}}))]}))),Gh=We(Bh,{name:"MuiSlider",slot:"ValueLabel"})(gn(({theme:e})=>({zIndex:1,whiteSpace:"nowrap",...e.typography.body2,fontWeight:500,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),position:"absolute",backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${Xe.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${Xe.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:e.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]})));process.env.NODE_ENV!=="production"&&(Gh.propTypes={children:x.element.isRequired,index:x.number.isRequired,open:x.bool.isRequired,value:x.node});const QC=We("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>Us(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:n}=e;return[t.mark,n&&t.markActive]}})(gn(({theme:e})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8}}]}))),eM=We("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>Us(e)&&e!=="markLabelActive"})(gn(({theme:e})=>({...e.typography.body2,color:(e.vars||e).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(e.vars||e).palette.text.primary}}]}))),tM=e=>{const{disabled:t,dragging:n,marked:r,orientation:i,track:o,classes:s,color:a,size:l}=e,c={root:["root",t&&"disabled",n&&"dragging",r&&"marked",i==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",a&&`color${$e(a)}`,l&&`size${$e(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${$e(l)}`,a&&`thumbColor${$e(a)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Er(c,HC,s)},nM=({children:e})=>e,Uh=O.forwardRef(function(t,n){const r=za({props:t,name:"MuiSlider"}),i=zp(),{"aria-label":o,"aria-valuetext":s,"aria-labelledby":a,component:l="span",components:c={},componentsProps:u={},color:d="primary",classes:h,className:f,disableSwap:m=!1,disabled:p=!1,getAriaLabel:y,getAriaValueText:b,marks:E=!1,max:T=100,min:w=0,name:C,onChange:S,onChangeCommitted:R,orientation:I="horizontal",shiftStep:k=10,size:z="medium",step:P=1,scale:v=fu,slotProps:_,slots:A,tabIndex:B,track:G="normal",value:Z,valueLabelDisplay:Y="off",valueLabelFormat:te=fu,...we}=r,V={...r,isRtl:i,max:T,min:w,classes:h,disabled:p,disableSwap:m,orientation:I,marks:E,color:d,size:z,step:P,shiftStep:k,scale:v,track:G,valueLabelDisplay:Y,valueLabelFormat:te},{axisProps:xe,getRootProps:Pe,getHiddenInputProps:xt,getThumbProps:ke,open:bt,active:st,axis:Ue,focusedThumbIndex:F,range:q,dragging:X,marks:$,values:re,trackOffset:Q,trackLeap:Ae,getThumbStyle:Ce}=UC({...V,rootRef:n});V.marked=$.length>0&&$.some(be=>be.label),V.dragging=X,V.focusedThumbIndex=F;const pe=tM(V),kt=(A==null?void 0:A.root)??c.Root??KC,kr=(A==null?void 0:A.rail)??c.Rail??JC,Or=(A==null?void 0:A.track)??c.Track??XC,Pr=(A==null?void 0:A.thumb)??c.Thumb??ZC,Dr=(A==null?void 0:A.valueLabel)??c.ValueLabel??Gh,vn=(A==null?void 0:A.mark)??c.Mark??QC,$r=(A==null?void 0:A.markLabel)??c.MarkLabel??eM,N=(A==null?void 0:A.input)??c.Input??"input",U=(_==null?void 0:_.root)??u.root,H=(_==null?void 0:_.rail)??u.rail,ee=(_==null?void 0:_.track)??u.track,ce=(_==null?void 0:_.thumb)??u.thumb,K=(_==null?void 0:_.valueLabel)??u.valueLabel,Me=(_==null?void 0:_.mark)??u.mark,De=(_==null?void 0:_.markLabel)??u.markLabel,ve=(_==null?void 0:_.input)??u.input,He=Pt({elementType:kt,getSlotProps:Pe,externalSlotProps:U,externalForwardedProps:we,additionalProps:{...VC(kt)&&{as:l}},ownerState:{...V,...U==null?void 0:U.ownerState},className:[pe.root,f]}),qn=Pt({elementType:kr,externalSlotProps:H,ownerState:V,className:pe.rail}),Xh=Pt({elementType:Or,externalSlotProps:ee,additionalProps:{style:{...xe[Ue].offset(Q),...xe[Ue].leap(Ae)}},ownerState:{...V,...ee==null?void 0:ee.ownerState},className:pe.track}),Po=Pt({elementType:Pr,getSlotProps:ke,externalSlotProps:ce,ownerState:{...V,...ce==null?void 0:ce.ownerState},className:pe.thumb}),Zh=Pt({elementType:Dr,externalSlotProps:K,ownerState:{...V,...K==null?void 0:K.ownerState},className:pe.valueLabel}),Do=Pt({elementType:vn,externalSlotProps:Me,ownerState:V,className:pe.mark}),$o=Pt({elementType:$r,externalSlotProps:De,ownerState:V,className:pe.markLabel}),Qh=Pt({elementType:N,getSlotProps:xt,externalSlotProps:ve,ownerState:V});return g.jsxRuntimeExports.jsxs(kt,{...He,children:[g.jsxRuntimeExports.jsx(kr,{...qn}),g.jsxRuntimeExports.jsx(Or,{...Xh}),$.filter(be=>be.value>=w&&be.value<=T).map((be,_e)=>{const No=Ni(be.value,w,T),Nr=xe[Ue].offset(No);let vt;return G===!1?vt=re.includes(be.value):vt=G==="normal"&&(q?be.value>=re[0]&&be.value<=re[re.length-1]:be.value<=re[0])||G==="inverted"&&(q?be.value<=re[0]||be.value>=re[re.length-1]:be.value>=re[0]),g.jsxRuntimeExports.jsxs(O.Fragment,{children:[g.jsxRuntimeExports.jsx(vn,{"data-index":_e,...Do,...!ur(vn)&&{markActive:vt},style:{...Nr,...Do.style},className:Ne(Do.className,vt&&pe.markActive)}),be.label!=null?g.jsxRuntimeExports.jsx($r,{"aria-hidden":!0,"data-index":_e,...$o,...!ur($r)&&{markLabelActive:vt},style:{...Nr,...$o.style},className:Ne(pe.markLabel,$o.className,vt&&pe.markLabelActive),children:be.label}):null]},_e)}),re.map((be,_e)=>{const No=Ni(be,w,T),Nr=xe[Ue].offset(No),vt=Y==="off"?nM:Dr;return g.jsxRuntimeExports.jsx(vt,{...!ur(vt)&&{valueLabelFormat:te,valueLabelDisplay:Y,value:typeof te=="function"?te(v(be),_e):te,index:_e,open:bt===_e||st===_e||Y==="on",disabled:p},...Zh,children:g.jsxRuntimeExports.jsx(Pr,{"data-index":_e,...Po,className:Ne(pe.thumb,Po.className,st===_e&&pe.active,F===_e&&pe.focusVisible),style:{...Nr,...Ce(_e),...Po.style},children:g.jsxRuntimeExports.jsx(N,{"data-index":_e,"aria-label":y?y(_e):o,"aria-valuenow":v(be),"aria-labelledby":a,"aria-valuetext":b?b(v(be),_e):s,value:re[_e],...Qh})})},_e)})]})});process.env.NODE_ENV!=="production"&&(Uh.propTypes={"aria-label":au(x.string,e=>Array.isArray(e.value||e.defaultValue)&&e["aria-label"]!=null?new Error("MUI: You need to use the `getAriaLabel` prop instead of `aria-label` when using a range slider."):null),"aria-labelledby":x.string,"aria-valuetext":au(x.string,e=>Array.isArray(e.value||e.defaultValue)&&e["aria-valuetext"]!=null?new Error("MUI: You need to use the `getAriaValueText` prop instead of `aria-valuetext` when using a range slider."):null),children:x.node,classes:x.object,className:x.string,color:x.oneOfType([x.oneOf(["primary","secondary","error","info","success","warning"]),x.string]),components:x.shape({Input:x.elementType,Mark:x.elementType,MarkLabel:x.elementType,Rail:x.elementType,Root:x.elementType,Thumb:x.elementType,Track:x.elementType,ValueLabel:x.elementType}),componentsProps:x.shape({input:x.oneOfType([x.func,x.object]),mark:x.oneOfType([x.func,x.object]),markLabel:x.oneOfType([x.func,x.object]),rail:x.oneOfType([x.func,x.object]),root:x.oneOfType([x.func,x.object]),thumb:x.oneOfType([x.func,x.object]),track:x.oneOfType([x.func,x.object]),valueLabel:x.oneOfType([x.func,x.shape({children:x.element,className:x.string,open:x.bool,style:x.object,value:x.node,valueLabelDisplay:x.oneOf(["auto","off","on"])})])}),defaultValue:x.oneOfType([x.arrayOf(x.number),x.number]),disabled:x.bool,disableSwap:x.bool,getAriaLabel:x.func,getAriaValueText:x.func,marks:x.oneOfType([x.arrayOf(x.shape({label:x.node,value:x.number.isRequired})),x.bool]),max:x.number,min:x.number,name:x.string,onChange:x.func,onChangeCommitted:x.func,orientation:x.oneOf(["horizontal","vertical"]),scale:x.func,shiftStep:x.number,size:x.oneOfType([x.oneOf(["small","medium"]),x.string]),slotProps:x.shape({input:x.oneOfType([x.func,x.object]),mark:x.oneOfType([x.func,x.object]),markLabel:x.oneOfType([x.func,x.object]),rail:x.oneOfType([x.func,x.object]),root:x.oneOfType([x.func,x.object]),thumb:x.oneOfType([x.func,x.object]),track:x.oneOfType([x.func,x.object]),valueLabel:x.oneOfType([x.func,x.shape({children:x.element,className:x.string,open:x.bool,style:x.object,value:x.node,valueLabelDisplay:x.oneOf(["auto","off","on"])})])}),slots:x.shape({input:x.elementType,mark:x.elementType,markLabel:x.elementType,rail:x.elementType,root:x.elementType,thumb:x.elementType,track:x.elementType,valueLabel:x.elementType}),step:x.number,sx:x.oneOfType([x.arrayOf(x.oneOfType([x.func,x.object,x.bool])),x.func,x.object]),tabIndex:x.number,track:x.oneOf(["inverted","normal",!1]),value:x.oneOfType([x.arrayOf(x.number),x.number]),valueLabelDisplay:x.oneOf(["auto","off","on"]),valueLabelFormat:x.oneOfType([x.func,x.string])});var rM="[object Number]";function iM(e){return typeof e=="number"||un(e)&&yn(e)==rM}const Vh=se.observer(e=>{var o,s,a;const t=M.useTheme(),{store:n}=e,{t:r}=de.useTranslation();function i(l,c){c===e.velocity||!iM(c)||e.onVelocityChange(c,e.useDegree)}return g.jsxRuntimeExports.jsxs(M.Stack,{direction:"row",gap:2,alignItems:"center",children:[n.showVelocityLegend&&g.jsxRuntimeExports.jsx(M.Typography,{sx:{color:(a=(s=(o=t.componentsExt)==null?void 0:o.JoggingPanel)==null?void 0:s.VelocitySlider)==null?void 0:a.sliderLegendColor,fontSize:"14px"},children:r("Jogging.Velocity.bt")}),g.jsxRuntimeExports.jsx(Uh,{value:e.velocity,color:"secondary",onChange:i,min:e.min,max:e.max,"aria-labelledby":"input-slider",disabled:e.disabled,sx:{"& .MuiSlider-valueLabelOpen":{zIndex:100,backgroundColor:"transparent",top:"0px"}}}),n.showVelocitySliderLabel&&(e.renderValue?e.renderValue(e.velocity):g.jsxRuntimeExports.jsx(Ha,{value:e.velocity.toString()}))]})});function Ha({value:e,sx:t}){var r;const n=M.useTheme();return g.jsxRuntimeExports.jsx(M.Stack,{direction:"row",justifyContent:"center",alignItems:"center",gap:"5px",sx:{padding:"6px 12px",background:(r=n.palette.backgroundPaperElevation)==null?void 0:r[8],borderRadius:"10px",minWidth:"111px",...t},children:g.jsxRuntimeExports.jsx(M.Typography,{component:"span",sx:{textAlign:"right",fontSize:"14px",opacity:.8,color:n.palette.text.primary,whiteSpace:"nowrap"},children:e})})}const Yh=se.observer(({store:e,useDegree:t})=>{const{t:n}=de.useTranslation();function r(i,o){return o?`ω = ${n("Jogging.Cartesian.Rotation.velocityDegPerSec.lb",{amount:i})}`:`v = ${n("Jogging.Cartesian.Translation.velocityMmPerSec.lb",{amount:i})}`}return g.jsxRuntimeExports.jsx(Vh,{store:e,velocity:e.velocityInDisplayUnits(t),min:e.minVelocityInDisplayUnits(t),max:e.maxVelocityInDisplayUnits(t),onVelocityChange:e.setVelocityFromSlider,useDegree:t,disabled:e.isLocked,renderValue:i=>g.jsxRuntimeExports.jsx(Ha,{value:r(i,t),sx:{minWidth:"111px",span:{transform:"translateY(-1.5px)"}}})})}),oM=se.observer(({store:e,children:t})=>{const{t:n}=de.useTranslation(),r=M.useTheme();function i(h,f){(f==="translate"||f==="rotate")&&e.setSelectedCartesianMotionType(f)}g.useReaction(()=>[e.selectedCoordSystemId,e.selectedTcpId],()=>{e.jogger.motionStream.motionStateSocket.changeUrl(e.jogger.nova.makeWebsocketURL(`/controllers/${e.jogger.motionStream.controllerId}/motion-groups/${e.jogger.motionGroupId}/state-stream?tcp=${e.selectedTcpId}`))},{fireImmediately:!0});async function o(h,f){const m=await e.activate(),p=m.motionStream.rapidlyChangingMotionState.tcp_pose,y=m.motionStream.rapidlyChangingMotionState.joint_position;p&&await e.withMotionLock(async()=>{try{e.setCurrentIncrementJog({axis:h.axis,direction:h.direction}),await e.jogger.runIncrementalCartesianMotion({currentTcpPose:p,currentJoints:y,coordSystemId:e.activeCoordSystemId,velocityInRelevantUnits:e.selectedCartesianMotionType==="translate"?e.translationVelocityMmPerSec:e.rotationVelocityRadsPerSec,axis:h.axis,direction:h.direction,motion:e.selectedCartesianMotionType==="translate"?{type:"translate",distanceMm:f.mm}:{type:"rotate",distanceRads:Ie.degreesToRadians(f.degrees)}})}finally{e.setCurrentIncrementJog(null),await e.deactivate()}})}async function s(h){if(!e.isLocked){if(await e.activate(),e.activeDiscreteIncrement)return o(h,e.activeDiscreteIncrement);h.motionType==="translate"?await e.jogger.translateTCP({axis:h.axis,direction:h.direction,velocityMmPerSec:e.translationVelocityMmPerSec}):await e.jogger.rotateTCP({axis:h.axis,direction:h.direction,velocityRadsPerSec:e.rotationVelocityRadsPerSec})}}async function a(){e.isLocked||e.activeDiscreteIncrement||await e.deactivate()}function l(h,f,m){var y,b,E;const p=(E=(b=(y=m.componentsExt)==null?void 0:y.JoggingPanel)==null?void 0:b.JoggingCartesian)==null?void 0:E.Axis;if(p)return f==="translate"?p[h]:p.CustomRotation??p[h]}const c=[{id:"x",icon:g.jsxRuntimeExports.jsx(je.ForwardRef$10,{}),colors:l("X",e.selectedCartesianMotionType,r)},{id:"y",icon:g.jsxRuntimeExports.jsx(je.ForwardRef$11,{}),colors:l("Y",e.selectedCartesianMotionType,r)},{id:"z",icon:g.jsxRuntimeExports.jsx(je.ForwardRef$12,{}),colors:l("Z",e.selectedCartesianMotionType,r)}];function u(h){return n("General.mm.variable",{amount:h.toFixed(1)})}function d(h){return n("General.degree.variable",{amount:Ie.radiansToDegrees(h).toFixed(1)})}return g.jsxRuntimeExports.jsxs(M.Stack,{flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[g.jsxRuntimeExports.jsxs(M.Stack,{gap:2,children:[g.jsxRuntimeExports.jsx(IC,{store:e,useDegree:e.selectedCartesianMotionType==="rotate"}),g.jsxRuntimeExports.jsx(Yh,{store:e,useDegree:e.selectedCartesianMotionType==="rotate"}),g.jsxRuntimeExports.jsx(M.Divider,{})]}),g.jsxRuntimeExports.jsx(M.Stack,{marginLeft:"auto",marginRight:"auto",gap:"24px",justifyContent:"center",sx:{flexGrow:"1"},children:g.jsxRuntimeExports.jsxs(M.Stack,{alignItems:"center",justifyContent:"center",gap:"24px",sx:{flexGrow:1},children:[g.jsxRuntimeExports.jsxs(jC,{value:e.selectedCartesianMotionType,onChange:i,exclusive:!0,"aria-label":n("Jogging.Cartesian.MotionType.lb"),sx:{justifyContent:"center"},children:[g.jsxRuntimeExports.jsx(M.ToggleButton,{value:"translate",children:n("Jogging.Cartesian.Translation.bt")}),g.jsxRuntimeExports.jsx(M.ToggleButton,{value:"rotate",children:n("Jogging.Cartesian.Rotation.bt")})]}),e.selectedCartesianMotionType==="translate"&&c.map(h=>{var f,m;return g.jsxRuntimeExports.jsx(Is,{colors:h.colors,disabled:e.isLocked,activeJoggingDirection:((f=e.incrementJogInProgress)==null?void 0:f.axis)===h.id?e.incrementJogInProgress.direction:void 0,label:g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[h.icon,g.jsxRuntimeExports.jsx(M.Typography,{sx:{fontSize:"24px",color:((m=h.colors)==null?void 0:m.labelColor)??r.palette.text.primary},children:h.id.toUpperCase()})]}),getDisplayedValue:()=>{var p,y;return u(((y=(p=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:p.position)==null?void 0:y[Ie.XYZ_TO_VECTOR[h.id]])||0)},startJogging:p=>s({axis:h.id,motionType:"translate",direction:p}),stopJogging:a},h.id)}),e.selectedCartesianMotionType==="rotate"&&c.map(h=>{var f,m;return g.jsxRuntimeExports.jsx(Is,{colors:h.colors,disabled:e.isLocked,activeJoggingDirection:((f=e.incrementJogInProgress)==null?void 0:f.axis)===h.id?e.incrementJogInProgress.direction:void 0,label:g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[g.jsxRuntimeExports.jsx(je.ForwardRef$16,{}),g.jsxRuntimeExports.jsx(M.Typography,{sx:{fontSize:"24px",color:((m=h.colors)==null?void 0:m.labelColor)??r.palette.text.primary},children:h.id.toUpperCase()})]}),getDisplayedValue:()=>{var p,y;return d(((y=(p=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:p.orientation)==null?void 0:y[Ie.XYZ_TO_VECTOR[h.id]])||0)},startJogging:p=>s({axis:h.id,motionType:"rotate",direction:p}),stopJogging:a},h.id)})]})}),g.jsxRuntimeExports.jsx(zh,{store:e}),t&&g.jsxRuntimeExports.jsx(M.Divider,{}),t]})}),sM=se.observer(({store:e,children:t})=>{const n=M.useTheme();async function r(o){await e.activate(),await e.jogger.rotateJoints({joint:o.joint,direction:o.direction,velocityUnit:e.jointCategory===or.PRISMATIC?"mm/s":"rad/s",velocityValue:e.jointCategory===or.PRISMATIC?e.translationVelocityMmPerSec:e.rotationVelocityRadsPerSec})}async function i(){await e.jogger.stop(),await e.deactivate()}return g.jsxRuntimeExports.jsxs(M.Stack,{flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[g.jsxRuntimeExports.jsx(Yh,{store:e,useDegree:e.jointCategory===or.REVOLUTE}),g.jsxRuntimeExports.jsx(M.Divider,{}),g.jsxRuntimeExports.jsx(M.Stack,{justifyContent:"center",alignItems:"stretch",sx:{flexGrow:"1"},children:g.jsxRuntimeExports.jsx(M.Stack,{alignItems:"center",gap:"24px",children:e.jogger.motionStream.joints.map(o=>{var a,l,c;const s=(c=(l=(a=e.motionGroupDescription.operation_limits.auto_limits)==null?void 0:a.joints)==null?void 0:l[o.index])==null?void 0:c.position;return g.jsxRuntimeExports.jsxs(M.Stack,{direction:"row",alignItems:"center",justifyContent:"center",spacing:1.5,width:"100%",children:[e.showJointsLegend&&g.jsxRuntimeExports.jsx(M.Typography,{color:e.isLocked?n.palette.text.disabled:n.palette.text.secondary,children:`G${o.index+1}`}),g.jsxRuntimeExports.jsx(xh,{disabled:e.isLocked,lowerLimit:s==null?void 0:s.lower_limit,upperLimit:s==null?void 0:s.upper_limit,useDegree:e.jointCategory===or.REVOLUTE,getValue:()=>{const u=e.jogger.motionStream.rapidlyChangingMotionState.joint_position[o.index];return u!==void 0?u:void 0},startJogging:u=>r({joint:o.index,direction:u}),stopJogging:i})]},`joint-${o.index}`)})})}),g.jsxRuntimeExports.jsx(zh,{store:e}),t&&g.jsxRuntimeExports.jsx(M.Divider,{}),t]})}),aM=g.externalizeComponent(se.observer(e=>{const t=Ns.isString(e.nova)?new g.NovaClient({instanceUrl:e.nova}):e.nova,n=se.useLocalObservable(()=>({joggingStore:null,loadingError:null}));async function r(){ue.runInAction(()=>{n.loadingError=null,n.joggingStore=null});try{let i=e.store;if(!i){const o=await Ao.open(t,e.motionGroupId);i=await Oo.loadFor(o)}ue.runInAction(()=>{n.joggingStore=i}),e.onSetup&&e.onSetup(i)}catch(i){n.loadingError=i}}return D.useEffect(()=>(r(),e.store?()=>null:()=>{var i;(i=n.joggingStore)==null||i.dispose()}),[e.store,e.nova,e.motionGroupId]),D.useEffect(()=>{const i=n.joggingStore;i&&(e.locked?i.lock("external"):i.unlock("external"))},[n.joggingStore,e.locked]),g.jsxRuntimeExports.jsx(M.Stack,{sx:{maxWidth:"460px",minWidth:"320px",position:"relative",...e.sx},children:n.joggingStore?g.jsxRuntimeExports.jsx(lM,{store:n.joggingStore,children:e.children}):g.jsxRuntimeExports.jsx(Sh,{message:"Loading jogging",error:n.loadingError})})})),lM=se.observer(({store:e,children:t})=>{const{t:n}=de.useTranslation();function r(){if(e.currentTab.id==="cartesian")return g.jsxRuntimeExports.jsx(g.jsxRuntimeExports.Fragment,{children:g.jsxRuntimeExports.jsx(oM,{store:e,children:t})});if(e.currentTab.id==="joint")return g.jsxRuntimeExports.jsx(g.jsxRuntimeExports.Fragment,{children:g.jsxRuntimeExports.jsx(sM,{store:e,children:t})})}return g.jsxRuntimeExports.jsxs(M.Stack,{flexGrow:1,sx:{overflow:"hidden"},children:[g.jsxRuntimeExports.jsx(M.Tabs,{value:e.tabIndex,onChange:e.onTabChange,variant:"fullWidth",children:e.tabs.map(i=>{const o=i.label==="Cartesian"?n("Jogging.Cartesian.bt"):n("Jogging.Joints.bt"),s=i.label==="cartesian"?g.jsxRuntimeExports.jsx(lE,{fontSize:"small",sx:{mr:1}}):g.jsxRuntimeExports.jsx(cE,{fontSize:"small",sx:{mr:1}});return g.jsxRuntimeExports.jsx(M.Tab,{label:e.showTabIcons?g.jsxRuntimeExports.jsxs(M.Stack,{direction:"row",alignItems:"center",children:[s,o]}):o,id:`jogging-tab-${i.id}`,"aria-controls":`jogging-tab-${i.id}`},i.id)})}),g.jsxRuntimeExports.jsx(M.Stack,{flexGrow:1,position:"relative",sx:{overflowY:"auto",overflowX:"hidden"},children:r()}),e.blocked&&g.jsxRuntimeExports.jsx(RC,{store:e})]})}),Wh=e=>{var a;const{value:t,ref:n}=e,r=M.useTheme(),[i,o]=D.useState(!1);async function s(){if(!n||!("current"in n))return console.warn("No copy target found"),!1;try{return await navigator.clipboard.writeText(t),console.log("Copied!"),o(!0),!0}catch(l){console.error(l);const c=window.getSelection();if(c&&n&&"current"in n&&n.current){const u=document.createRange();u.selectNodeContents(n.current),c.removeAllRanges(),c.addRange(u)}}return!1}return D.useEffect(()=>{if(!i)return;const l=setTimeout(()=>o(!1),3e3);return()=>{l&&clearTimeout(l)}},[i]),g.jsxRuntimeExports.jsx(M.Tooltip,{open:i,title:"Copied!",children:g.jsxRuntimeExports.jsx(M.Stack,{justifyContent:"center",sx:{height:"100%",boxSizing:"border-box",padding:"6px 12px",background:(a=r.palette.backgroundPaperElevation)==null?void 0:a[8],borderRadius:"10px",minWidth:"0",cursor:"pointer"},onClick:()=>s(),children:g.jsxRuntimeExports.jsx(M.Typography,{ref:n,align:"center",sx:{pointerEvents:"none",fontSize:"12px",color:r.palette.text.primary,whiteSpace:"nowrap",minWidth:0,textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:t})})})},cM=g.externalizeComponent(se.observer(({tcpPose:e,showCopyButton:t=!1})=>{const[n,r]=D.useState(null),i=g.poseToWandelscriptString(e),o=async()=>{try{await navigator.clipboard.writeText(i),r("Copied!"),setTimeout(()=>r(null),2e3)}catch{r("Copy failed"),setTimeout(()=>r(null),2e3)}};return g.jsxRuntimeExports.jsxs(M.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},"data-testid":"pose-cartesian-values",children:[g.jsxRuntimeExports.jsx(Wh,{value:i}),t&&g.jsxRuntimeExports.jsx(M.Button,{variant:"contained",color:"secondary",size:"small",onClick:o,sx:{flexShrink:0},children:n||"Copy"})]})})),uM=g.externalizeComponent(se.observer(({joints:e,showCopyButton:t=!1})=>{const[n,r]=D.useState(null),i=`[${e.map(s=>parseFloat(s.toFixed(4))).join(", ")}]`,o=async()=>{try{await navigator.clipboard.writeText(i),r("Copied!"),setTimeout(()=>r(null),2e3)}catch{r("Copy failed"),setTimeout(()=>r(null),2e3)}};return g.jsxRuntimeExports.jsxs(M.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},"data-testid":"pose-joint-values",children:[g.jsxRuntimeExports.jsx(Wh,{value:i}),t&&g.jsxRuntimeExports.jsx(M.Button,{variant:"contained",color:"secondary",size:"small",onClick:o,sx:{flexShrink:0},children:n||"Copy"})]})}));class Hh{constructor(){this.messages=[],this.addMessage=(t,n="info")=>{const r={id:Math.random().toString(36).substring(2,11),timestamp:new Date,message:t,level:n};this.messages.push(r)},this.clearMessages=()=>{this.messages=[]},this.addInfo=t=>{this.addMessage(t,"info")},this.addWarning=t=>{this.addMessage(t,"warning")},this.addError=t=>{this.addMessage(t,"error")},this.addDebug=t=>{this.addMessage(t,"debug")},ue.makeObservable(this,{messages:ue.observable,addMessage:ue.action,clearMessages:ue.action})}}const jr=(e,t,n)=>({id:n||`${Date.now()}-${Math.random().toString(36).substring(2,11)}`,timestamp:new Date,message:e,level:t}),dM=(e,t)=>jr(e,"debug",t),hM=(e,t)=>jr(e,"info",t),fM=(e,t)=>jr(e,"warning",t),pM=(e,t)=>jr(e,"error",t),qh=g.externalizeComponent(se.observer(e=>{var u;const{messages:t=[],onClear:n,height:r=400,sx:i}=e,o=M.useTheme(),s=D.useRef(null);D.useEffect(()=>{if(t.length===0)return;const d=s.current;if(!d)return;const h=setTimeout(()=>{d.scrollTop=d.scrollHeight},10);return()=>clearTimeout(h)},[t.length]);const a=d=>d.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),l=d=>{switch(d){case"error":return o.palette.error.main;case"warning":return o.palette.warning.main;case"info":return o.palette.info.main;case"debug":return o.palette.text.disabled;default:return o.palette.text.secondary}},c=({message:d})=>{const[h,f]=D.useState(!1),[m,p]=D.useState(!1),[y,b]=D.useState(!1),E=d.message.length>150,T=async()=>{try{await navigator.clipboard.writeText(d.message),p(!0),setTimeout(()=>p(!1),2e3)}catch(C){console.error("Failed to copy message:",C)}},w=E&&!h?d.message.substring(0,150)+"...":d.message;return g.jsxRuntimeExports.jsx(M.Box,{onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),sx:{display:"flex",gap:1,fontFamily:"monospace",flexDirection:"column","&:hover":{backgroundColor:o.palette.action.hover},borderRadius:"4px",padding:"2px 4px",margin:"-2px -4px"},children:g.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",gap:1},children:[g.jsxRuntimeExports.jsxs(M.Typography,{component:"span",sx:{fontWeight:400,fontSize:"12px",lineHeight:"18px",letterSpacing:"0.4px",color:o.palette.text.disabled,whiteSpace:"nowrap",flexShrink:0},children:["[",a(d.timestamp),"]"]}),g.jsxRuntimeExports.jsx(M.Typography,{component:"span",sx:{fontWeight:400,fontSize:"12px",lineHeight:"18px",letterSpacing:"0.4px",color:l(d.level),wordBreak:"break-word",overflowWrap:"anywhere",hyphens:"auto",flex:1,whiteSpace:"pre-wrap"},children:w}),g.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",alignItems:"flex-start",gap:.5,opacity:y?1:0,transition:"opacity 0.2s ease-in-out",visibility:y?"visible":"hidden"},children:[g.jsxRuntimeExports.jsx(M.IconButton,{size:"small",onClick:T,sx:{padding:"2px",color:o.palette.text.secondary,"&:hover":{backgroundColor:o.palette.action.hover}},title:m?"Copied!":"Copy message",children:g.jsxRuntimeExports.jsx(Lr.ContentCopy,{sx:{fontSize:12}})}),E&&g.jsxRuntimeExports.jsx(M.IconButton,{size:"small",onClick:()=>f(!h),sx:{padding:"2px",color:o.palette.text.secondary,"&:hover":{backgroundColor:o.palette.action.hover}},title:h?"Collapse":"Expand",children:h?g.jsxRuntimeExports.jsx(Lr.ExpandLess,{sx:{fontSize:12}}):g.jsxRuntimeExports.jsx(Lr.ExpandMore,{sx:{fontSize:12}})})]})]})},d.id)};return g.jsxRuntimeExports.jsxs(M.Paper,{sx:{backgroundColor:((u=o.palette.backgroundPaperElevation)==null?void 0:u[2])||"#171927",backgroundImage:"none",height:r,display:"flex",flexDirection:"column",overflow:"hidden",...i},children:[g.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px"},children:[g.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[g.jsxRuntimeExports.jsx(Lr.DescriptionOutlined,{sx:{fontSize:16,color:o.palette.action.active,opacity:.56}}),g.jsxRuntimeExports.jsx(M.Typography,{sx:{fontWeight:500,fontSize:"14px",lineHeight:"143%",letterSpacing:"0.17px",color:o.palette.text.primary},children:"Log"})]}),g.jsxRuntimeExports.jsx(M.Button,{onClick:n,variant:"text",sx:{fontWeight:500,fontSize:"13px",lineHeight:"22px",letterSpacing:"0.46px",color:o.palette.primary.main,textTransform:"none",minWidth:"auto",padding:"4px 8px","&:hover":{backgroundColor:o.palette.primary.main+"14"}},children:"Clear"})]}),g.jsxRuntimeExports.jsx(M.Box,{ref:s,sx:{flex:1,overflow:"auto",padding:"8px 16px",display:"flex",flexDirection:"column",gap:"2px",scrollbarWidth:"thin",scrollbarColor:`${o.palette.divider} transparent`,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:o.palette.divider,borderRadius:"3px","&:hover":{backgroundColor:o.palette.divider}}},children:t.length===0?g.jsxRuntimeExports.jsx(M.Typography,{sx:{color:o.palette.text.disabled,fontSize:"12px",fontStyle:"italic",textAlign:"center",marginTop:2},children:"No log messages"}):t.map(d=>g.jsxRuntimeExports.jsx(c,{message:d},d.id))})]})})),mM=g.externalizeComponent(se.observer(e=>{const{store:t,onStoreReady:n,...r}=e,i=D.useRef(n);D.useEffect(()=>{i.current=n},[n]);const o=D.useMemo(()=>{var l;const a=t||new Hh;return(l=i.current)==null||l.call(i,a),a},[t]),s=()=>{o.clearMessages()};return g.jsxRuntimeExports.jsx(qh,{...r,messages:o.messages,onClear:s})}));function gM(){const e=window.location.href;return e.substring(0,e.indexOf("/",e.indexOf("//")+2))}function yM({baseUrl:e=gM(),...t}){return g.jsxRuntimeExports.jsxs(M.Dialog,{"aria-labelledby":"no-motion-group-modal-title",open:!0,fullWidth:!0,sx:{"& .MuiModal-backdrop":{backdropFilter:"blur(10px)"},"& .MuiDialog-paper":{"::before":{content:'""',height:"8px",width:"100%",background:"linear-gradient(90deg, #FF0E65 0%, #47D3FF 100%)"},background:"#101629"}},children:[g.jsxRuntimeExports.jsx(M.DialogTitle,{id:"no-motion-group-modal-title",children:"No motion group found"}),g.jsxRuntimeExports.jsxs(M.DialogContent,{sx:{marginTop:"3rem",marginBottom:"1.5rem",textAlign:"center"},children:[g.jsxRuntimeExports.jsx(M.Typography,{color:"#fff",children:"Found no devices to connect to."}),g.jsxRuntimeExports.jsx(M.Typography,{color:"#fff",children:"Please ensure a motion group has been created."})]}),g.jsxRuntimeExports.jsx(M.DialogActions,{children:g.jsxRuntimeExports.jsxs(M.Stack,{width:"100%",maxWidth:"300px",margin:"auto",marginBottom:"2rem",children:[g.jsxRuntimeExports.jsx(M.Button,{href:`${e}/settings`,variant:"contained",sx:{borderRadius:"8px",width:"100%"},children:"Go to settings app"}),g.jsxRuntimeExports.jsx(M.Button,{href:`${e}`,variant:"text",sx:{marginTop:"1rem",color:"#fff",textDecoration:"underline",fontSize:"0.75rem"},children:"Back to Homescreen"})]})})]})}const xM=Kt(g.jsxRuntimeExports.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error");var qa=(e=>(e.PRECONDITION_NOT_FULFILLED="PRECONDITION_NOT_FULFILLED",e.ROBOT_DISCONNECTED="ROBOT_DISCONNECTED",e.CELL_OPEN="CELL_OPEN",e.E_STOP="E_STOP",e.MANUAL_MODE="MANUAL_MODE",e.READY="READY",e))(qa||{});const Kh=g.externalizeComponent(se.observer(({setupState:e,className:t})=>{const n=M.useTheme(),{t:r}=de.useTranslation(),i=()=>{var c,u,d,h,f,m,p;switch(e){case"READY":return{label:r("RobotSetupReadinessIndicator.Ready.lb"),indicatorColor:((c=n.palette.tertiary)==null?void 0:c.main)||n.palette.primary.main,backgroundColor:((u=n.palette.backgroundPaperElevation)==null?void 0:u[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"ROBOT_DISCONNECTED":return{label:r("RobotSetupReadinessIndicator.RobotDisconnected.lb"),indicatorColor:n.palette.error.main,backgroundColor:((d=n.palette.backgroundPaperElevation)==null?void 0:d[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"CELL_OPEN":return{label:r("RobotSetupReadinessIndicator.CellOpen.lb"),indicatorColor:n.palette.error.main,backgroundColor:((h=n.palette.backgroundPaperElevation)==null?void 0:h[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"E_STOP":return{label:r("RobotSetupReadinessIndicator.EStop.lb"),indicatorColor:n.palette.error.main,backgroundColor:((f=n.palette.backgroundPaperElevation)==null?void 0:f[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"MANUAL_MODE":return{label:r("RobotSetupReadinessIndicator.ManualMode.lb"),indicatorColor:n.palette.error.main,backgroundColor:((m=n.palette.backgroundPaperElevation)==null?void 0:m[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"PRECONDITION_NOT_FULFILLED":default:return{label:r("RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb"),indicatorColor:n.palette.error.main,backgroundColor:((p=n.palette.backgroundPaperElevation)==null?void 0:p[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText}}},{label:o,indicatorColor:s,backgroundColor:a,textColor:l}=i();return g.jsxRuntimeExports.jsx(M.Chip,{className:t,label:g.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[g.jsxRuntimeExports.jsx(M.Box,{sx:{width:8,height:8,borderRadius:"50%",backgroundColor:s,flexShrink:0}}),g.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{color:l,fontSize:"0.75rem",lineHeight:1.2},children:o})]}),variant:"filled",sx:{backgroundColor:a,color:n.palette.getContrastText(a),fontWeight:500,height:"auto","& .MuiChip-label":{paddingX:1.5,paddingY:.5}}})})),bM=g.externalizeComponent(se.observer(({robotName:e,robotType:t,setupState:n,PreconditionComponent:r=Kh,className:i})=>{var l;const o=M.useTheme(),s=t||"Robot",a=n===qa.READY;return g.jsxRuntimeExports.jsxs(M.Box,{className:i,sx:{border:`1px solid ${o.palette.divider}`,background:((l=o.palette.backgroundPaperElevation)==null?void 0:l[8])||"#292B3F",borderRadius:"8px",padding:"20px",display:"flex",alignItems:"center",justifyContent:"space-between",opacity:1},children:[g.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",alignItems:"center",gap:2,flex:1},children:[a?g.jsxRuntimeExports.jsx(M.Box,{sx:{fontSize:24,display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,"& svg":{fill:`${o.palette.primary.main} !important`},"& svg path":{fill:`${o.palette.primary.main} !important`}},children:g.jsxRuntimeExports.jsx(je.ForwardRef$15,{})}):g.jsxRuntimeExports.jsx(xM,{sx:{color:o.palette.error.main,fontSize:24}}),g.jsxRuntimeExports.jsx(M.Typography,{variant:"body1",sx:{fontWeight:500,color:o.palette.text.primary},children:e}),g.jsxRuntimeExports.jsx(M.Divider,{orientation:"vertical",flexItem:!0,sx:{backgroundColor:o.palette.text.secondary,opacity:.3,width:"1px"}}),g.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{color:o.palette.text.secondary},children:s})]}),r&&g.jsxRuntimeExports.jsx(r,{setupState:n})]})})),ht=se.observer(({id:e,icon:t,color:n,title:r,name:i,label:o,explanation:s,literalValue:a,anchorOrigin:l,transformOrigin:c})=>{const u=se.useLocalObservable(()=>({anchorEl:null,get isPopoverOpen(){return!!u.anchorEl},openPopover(d){u.anchorEl=d.currentTarget},closePopover(){u.anchorEl=null}}));return g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[g.jsxRuntimeExports.jsxs(M.Stack,{"aria-owns":u.isPopoverOpen?e:void 0,"aria-haspopup":"true",onMouseEnter:u.openPopover,onMouseLeave:u.closePopover,direction:"row",spacing:1,sx:{cursor:"pointer"},children:[g.jsxRuntimeExports.jsx(M.SvgIcon,{component:t,sx:{color:n}}),o&&g.jsxRuntimeExports.jsx("div",{style:{color:n},children:o})]}),g.jsxRuntimeExports.jsx(M.Popover,{id:e,sx:{pointerEvents:"none"},open:u.isPopoverOpen,anchorEl:u.anchorEl,anchorOrigin:l??{vertical:"bottom",horizontal:"left"},transformOrigin:c??{vertical:"top",horizontal:"left"},onClose:u.closePopover,disableRestoreFocus:!0,children:g.jsxRuntimeExports.jsxs(M.Stack,{gap:"1rem",padding:2,maxWidth:"450px",sx:{wordWrap:"break-word"},children:[g.jsxRuntimeExports.jsxs("div",{children:[r&&g.jsxRuntimeExports.jsx(M.Typography,{component:"span",fontSize:"14px",children:`${r}: `}),g.jsxRuntimeExports.jsx(M.Typography,{component:"span",color:n,fontWeight:"bold",fontSize:"14px",children:i})]}),g.jsxRuntimeExports.jsx(M.Typography,{fontSize:"14px",children:s}),a&&g.jsxRuntimeExports.jsx(M.Typography,{fontSize:"12px",children:a})]})})]})}),vM=se.observer(({isVirtual:e,motionGroupId:t,anchorOrigin:n,transformOrigin:r,compact:i})=>{const o=M.useTheme(),s=D.useId(),{t:a}=de.useTranslation();return e?g.jsxRuntimeExports.jsx(ht,{id:`motion-group-virtual-${s}`,icon:je.ForwardRef$1,color:o.palette.tertiary.main,name:a("SafetyBar.ControllerType.Virtual.lb"),label:i?null:a("SafetyBar.ControllerType.Virtual.lb"),explanation:g.jsxRuntimeExports.jsxs(de.Trans,{i18nKey:"SafetyBar.MotionGroup.Virtual.Explanation.lb",values:{motionGroupId:t},children:["Motion group ",g.jsxRuntimeExports.jsx("code",{children:t})," refers to a virtual robot with no physical counterpart. It can be freely manipulated without special safety precautions."]}),anchorOrigin:n,transformOrigin:r}):g.jsxRuntimeExports.jsx(ht,{id:`motion-group-physical-${s}`,icon:je.ForwardRef,color:o.palette.primary.main,name:a("SafetyBar.ControllerType.Physical.lb"),label:i?null:a("SafetyBar.ControllerType.Physical.lb"),explanation:g.jsxRuntimeExports.jsx(de.Trans,{i18nKey:"SafetyBar.MotionGroup.Physical.Explanation.lb",values:{motionGroupId:t},components:{code:g.jsxRuntimeExports.jsx("code",{}),strong:g.jsxRuntimeExports.jsx("strong",{})}}),anchorOrigin:n,transformOrigin:r})}),SM=se.observer(({operationMode:e,anchorOrigin:t,transformOrigin:n,compact:r})=>{const{t:i}=de.useTranslation(),o=M.useTheme(),s=D.useId();switch(e){case"OPERATION_MODE_AUTO":return g.jsxRuntimeExports.jsx(ht,{id:`operation-mode-auto-${s}`,icon:je.ForwardRef$2,title:i("SafetyBar.OperationMode.ti"),name:i("SafetyBar.OperationMode.Automatic.ti"),label:r?null:i("SafetyBar.OperationMode.Automatic.ti"),color:o.palette.text.secondary,explanation:g.jsxRuntimeExports.jsx(de.Trans,{i18nKey:"SafetyBar.OperationMode.Auto.Explanation.lb",children:"The robot controller is in automatic operation mode. Automated movement without manual confirmation is possible in this mode."}),anchorOrigin:t,transformOrigin:n});case"OPERATION_MODE_MANUAL":case"OPERATION_MODE_MANUAL_T1":case"OPERATION_MODE_MANUAL_T2":return g.jsxRuntimeExports.jsx(ht,{id:`operation-mode-manual-${s}`,icon:je.ForwardRef$4,color:o.palette.warning.main,title:i("SafetyBar.OperationMode.ti"),name:i("SafetyBar.OperationMode.Manual.lb"),label:r?null:i("SafetyBar.OperationMode.Manual.lb"),explanation:g.jsxRuntimeExports.jsx(de.Trans,{i18nKey:"SafetyBar.OperationMode.Manual.Explanation.lb",children:"The robot controller is in manual operation mode. On a physical robot, this generally indicates that an enabling switch must be held for the robot to move successfully."}),literalValue:e,anchorOrigin:t,transformOrigin:n});default:return g.jsxRuntimeExports.jsx(ht,{id:`operation-mode-error-${s}`,icon:je.ForwardRef$3,color:o.palette.warning.main,title:i("SafetyBar.OperationMode.ti"),name:i("SafetyBar.OperationMode.Error.lb"),label:r?null:i("SafetyBar.OperationMode.Error.lb"),explanation:g.jsxRuntimeExports.jsx(de.Trans,{i18nKey:"SafetyBar.OperationMode.Error.Explanation.lb",children:"The robot controller has entered an unexpected operation mode. Motion group movement may not be possible."}),literalValue:e,anchorOrigin:t,transformOrigin:n})}}),EM=se.observer(({safetyState:e,anchorOrigin:t,transformOrigin:n,compact:r})=>{const{t:i}=de.useTranslation(),o=M.useTheme(),s=D.useId();switch(e){case"SAFETY_STATE_NORMAL":return g.jsxRuntimeExports.jsx(ht,{id:`safety-state-normal-${s}`,title:i("SafetyBar.SafetyState.ti"),name:i("SafetyBar.SafetyState.Normal.lb"),label:r?null:i("SafetyBar.SafetyState.Normal.lb"),icon:je.ForwardRef$8,color:o.palette.text.secondary,explanation:g.jsxRuntimeExports.jsx(de.Trans,{i18nKey:"SafetyBar.SafetyState.Normal.Explanation.lb",children:"The robot controller is in a normal safety state. Movement is not prevented by this state."}),anchorOrigin:t,transformOrigin:n});case"SAFETY_STATE_DEVICE_EMERGENCY_STOP":case"SAFETY_STATE_ROBOT_EMERGENCY_STOP":return g.jsxRuntimeExports.jsx(ht,{id:`safety-state-estop-${s}`,title:i("SafetyBar.SafetyState.ti"),name:i("SafetyBar.SafetyState.Estop.lb"),label:r?null:i("SafetyBar.SafetyState.Estop.lb"),icon:je.ForwardRef$6,color:o.palette.error.main,explanation:g.jsxRuntimeExports.jsx(de.Trans,{i18nKey:"SafetyBar.StopState.Estop.Explanation.lb",children:"An emergency stop of the robot controller has been triggered. Movement of the robot is no longer possible until the estop is released."}),literalValue:e,anchorOrigin:t,transformOrigin:n});case"SAFETY_STATE_STOP_0":case"SAFETY_STATE_STOP_1":case"SAFETY_STATE_STOP_2":case"SAFETY_STATE_PROTECTIVE_STOP":case"SAFETY_STATE_STOP":return g.jsxRuntimeExports.jsx(ht,{id:`safety-state-stop-${s}`,icon:je.ForwardRef$9,title:i("SafetyBar.SafetyState.ti"),name:i("SafetyBar.SafetyState.Stop.lb"),label:r?null:i("SafetyBar.SafetyState.Stop.lb"),color:o.palette.warning.main,explanation:g.jsxRuntimeExports.jsx(de.Trans,{i18nKey:"SafetyBar.SafetyState.Stop.Explanation.lb",children:"The robot controller has entered a stop state. Movement is no longer possible until the stop state is resolved."}),literalValue:e,anchorOrigin:t,transformOrigin:n});case"SAFETY_STATE_REDUCED":case"SAFETY_STATE_MASTERING":case"SAFETY_STATE_CONFIRM_SAFETY":case"SAFETY_STATE_OPERATOR_SAFETY":case"SAFETY_STATE_RECOVERY":case"SAFETY_STATE_VIOLATION":return g.jsxRuntimeExports.jsx(ht,{id:`safety-state-manual-action-required-${s}`,icon:je.ForwardRef$7,color:o.palette.warning.main,title:i("SafetyBar.SafetyState.ti"),name:i("SafetyBar.SafetyState.ManualActionRequired.lb"),label:r?null:i("SafetyBar.SafetyState.ManualActionRequired.lb"),explanation:g.jsxRuntimeExports.jsx(de.Trans,{i18nKey:"SafetyBar.SafetyState.ManualActionRequired.Explanation.lb",children:"The robot controller has entered a safety state requiring manual action to resolve."}),literalValue:e,anchorOrigin:t,transformOrigin:n});case"SAFETY_STATE_UNKNOWN":case"SAFETY_STATE_FAULT":return g.jsxRuntimeExports.jsx(ht,{id:`safety-state-error-${s}`,icon:je.ForwardRef$5,color:o.palette.error.main,title:i("SafetyBar.SafetyState.ti"),name:i("SafetyBar.SafetyState.Error.lb"),label:r?null:i("SafetyBar.SafetyState.Error.lb"),explanation:g.jsxRuntimeExports.jsx(de.Trans,{i18nKey:"SafetyBar.SafetyState.Error.Explanation.lb",children:"The robot controller has entered an unexpected safety state."}),literalValue:e,anchorOrigin:t,transformOrigin:n});default:hE(e,`Unknown safety state ${e}`)}}),TM=g.externalizeComponent(se.observer(({isVirtual:e,motionGroupId:t,operationMode:n,safetyState:r,anchorOrigin:i,transformOrigin:o,compact:s=!0})=>{const a=s?1:2;return g.jsxRuntimeExports.jsxs(M.Stack,{direction:"row",gap:a,alignItems:"center",sx:{height:"24px"},children:[g.jsxRuntimeExports.jsx(EM,{safetyState:r,anchorOrigin:i,transformOrigin:o,compact:s}),g.jsxRuntimeExports.jsx(M.Divider,{orientation:"vertical",flexItem:!0}),g.jsxRuntimeExports.jsx(SM,{operationMode:n,anchorOrigin:i,transformOrigin:o,compact:s}),g.jsxRuntimeExports.jsx(M.Divider,{orientation:"vertical",flexItem:!0}),g.jsxRuntimeExports.jsx(vM,{isVirtual:e,motionGroupId:t,anchorOrigin:i,transformOrigin:o,compact:s})]})})),wM=M.styled(M.Fab,{shouldForwardProp:e=>e!=="selected"})(({theme:e})=>{var t,n,r;return{borderRadius:"20px","&:hover":{background:(t=e.palette.backgroundPaperElevation)==null?void 0:t[7]},variants:[{props:({selected:i})=>!i,style:{background:(n=e.palette.backgroundPaperElevation)==null?void 0:n[0],color:e.palette.action.disabled,"> img":{opacity:.4}}},{props:({selected:i})=>i,style:{background:(r=e.palette.backgroundPaperElevation)==null?void 0:r[11],border:`1px solid ${e.palette.divider}`,color:e.palette.primary.contrastText}}]}}),CM=e=>{const{ref:t,...n}=e;return g.jsxRuntimeExports.jsx(wM,{ref:t,selected:e.selected,...n,color:"secondary",variant:"circular"})};function MM(e){const{children:t,value:n,index:r,...i}=e;return g.jsxRuntimeExports.jsx("div",{role:"tabpanel",hidden:n!==r,id:`tabpanel-${r}`,"aria-labelledby":`tab-${r}`,...i,children:n===r&&g.jsxRuntimeExports.jsx(M.Box,{children:t})})}function RM({children:e,...t}){const{fullWidth:n,indicator:r,onChange:i,orientation:o,scrollButtons:s,selectionFollowsFocus:a,textColor:l,value:c,variant:u,...d}=t;return g.jsxRuntimeExports.jsx(M.Box,{...d,children:e})}const AM=g.externalizeComponent(se.observer(e=>{const{items:t,activeTab:n,defaultActiveTab:r=0,onTabChange:i,sx:o,ref:s}=e,a=n!==void 0,[l,c]=D.useState(r),u=a?n:l;D.useEffect(()=>{a||t.length!==0&&(l<0||l>t.length-1)&&c(0)},[t.length,a,l]);const d=(h,f)=>{a||c(f),i==null||i(f)};return g.jsxRuntimeExports.jsxs(M.Box,{ref:s,sx:{height:"100%",display:"flex",flexDirection:"column",...o},children:[g.jsxRuntimeExports.jsx(M.Box,{sx:{px:0,py:0,overflow:"visible",position:"relative",paddingTop:h=>h.spacing(2),paddingRight:h=>h.spacing(2.5)},children:g.jsxRuntimeExports.jsx(M.Tabs,{value:u,onChange:d,sx:{minHeight:"32px",backgroundColor:"transparent",overflow:"visible","& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:2,overflow:"visible",paddingTop:0,paddingBottom:0},"& .MuiTabs-scroller":{overflow:"visible !important"},"& .MuiTab-root":{overflow:"visible"}},children:t.map((h,f)=>{var w,C,S;const m=()=>{if(!h.badge)return;const R=h.badge.content,I=h.badge.max;return typeof R=="number"&&I&&R>I?`${I}+`:R},p=()=>{if(!h.badge)return!1;const R=h.badge.content,I=h.badge.showZero;return!(R===0&&!I)},y=m(),b=p(),E=()=>{a||c(f),i==null||i(f)},T=g.jsxRuntimeExports.jsx(M.Tab,{label:h.label,icon:h.icon,iconPosition:"start",disableRipple:!0,onClick:E,sx:{minHeight:"32px",height:"32px",padding:"0px 10px",borderRadius:"12px",backgroundColor:R=>{var I;return((I=R.palette.backgroundPaperElevation)==null?void 0:I[11])||"#32344B"},color:"text.primary",opacity:u===f?1:.38,fontSize:"13px",transition:"all 0.2s ease-in-out",position:"relative",overflow:"visible","&:hover":{opacity:u===f?1:.6},"&.Mui-selected":{opacity:1,backgroundColor:R=>{var I;return((I=R.palette.backgroundPaperElevation)==null?void 0:I[11])||"#32344B"},color:"text.primary"},"&:focus":{outline:"none"},"&:active":{transform:"none"}}},h.id);return b?g.jsxRuntimeExports.jsx(RM,{component:"span",sx:{display:"inline-flex"},children:g.jsxRuntimeExports.jsx(M.Badge,{badgeContent:y,color:((w=h.badge)==null?void 0:w.color)||"error",max:(C=h.badge)==null?void 0:C.max,showZero:(S=h.badge)==null?void 0:S.showZero,anchorOrigin:{vertical:"top",horizontal:"right"},overlap:"rectangular",sx:{"& .MuiBadge-badge":{opacity:"1 !important"}},children:T})},h.id):T})})}),g.jsxRuntimeExports.jsx(M.Box,{sx:{mt:h=>h.spacing(2),borderBottom:1,borderColor:"divider"}}),g.jsxRuntimeExports.jsx(M.Box,{sx:{flex:1,overflow:"auto"},children:t.map((h,f)=>g.jsxRuntimeExports.jsx(MM,{value:u,index:f,children:h.content},h.id))})]})})),_M=e=>{const t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60),i=e%60,o=[];return t>0?(o.push(t.toString()),o.push(n.toString().padStart(2,"0")),o.push(r.toString().padStart(2,"0")),o.push(i.toString().padStart(2,"0"))):n>0?(o.push(n.toString()),o.push(r.toString().padStart(2,"0")),o.push(i.toString().padStart(2,"0"))):(o.push(r.toString()),o.push(i.toString().padStart(2,"0"))),o.join(":")},pu=(e,t)=>{const n=Math.floor(e/86400),r=Math.floor(e%86400/3600),i=Math.floor(e%3600/60),o=e%60;if(typeof Intl<"u"&&"DurationFormat"in Intl)try{const a={};return n>0&&(a.days=n),r>0&&(a.hours=r),i>0&&(a.minutes=i),(o>0||Object.keys(a).length===0)&&(a.seconds=o),new Intl.DurationFormat(t,{style:"narrow"}).format(a)}catch{}const s=[];return n>0&&s.push(`${n}d`),r>0&&s.push(`${r}h`),i>0&&s.push(`${i}m`),(o>0||s.length===0)&&s.push(`${o}s`),s.join(" ")},IM=({timerState:e,animationState:t,hasError:n,className:r})=>{const{t:i}=de.useTranslation(),o=zu(),{elapsedTime:s,currentProgress:a}=e,{showErrorAnimation:l,showPauseAnimation:c,showMainText:u}=t;return g.jsxRuntimeExports.jsxs(M.Box,{className:r,sx:{position:"relative",width:264,height:264,display:"flex",alignItems:"center",justifyContent:"center"},children:[g.jsxRuntimeExports.jsx(of.Gauge,{width:264,height:264,value:a,valueMin:0,valueMax:100,innerRadius:"85%",outerRadius:"100%",margin:0,skipAnimation:!0,text:()=>"",sx:{opacity:c||l?.6:1,transition:"opacity 0.5s ease-out","& .MuiGauge-valueArc":{fill:n?o.palette.error.light:o.palette.success.main,transition:"fill 0.5s ease-out"},"& .MuiGauge-referenceArc":{fill:"#171927",stroke:"transparent",strokeWidth:0,transition:"fill 0.5s ease-out, stroke 0.5s ease-out, stroke-width 0.5s ease-out"},"& .MuiGauge-valueText":{display:"none"},"& .MuiGauge-text":{display:"none"}}}),g.jsxRuntimeExports.jsx(M.Box,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:225,height:225,borderRadius:"50%",backgroundColor:"#292B3F",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",gap:1,transition:"background-color 0.5s ease-out"},children:g.jsxRuntimeExports.jsxs(M.Box,{sx:{position:"relative",height:"48px",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:.5},children:[g.jsxRuntimeExports.jsx(M.Fade,{in:u&&n,timeout:200,children:g.jsxRuntimeExports.jsx(M.Typography,{variant:"h6",sx:{position:"absolute",fontSize:"16px",fontWeight:500,color:o.palette.error.light},children:i("timer.error")})}),g.jsxRuntimeExports.jsx(M.Fade,{in:u&&!n,timeout:300,children:g.jsxRuntimeExports.jsx(M.Typography,{variant:"h1",sx:{position:"absolute",fontSize:"48px",fontWeight:500,color:o.palette.text.primary,lineHeight:1,letterSpacing:"-0.5px"},children:_M(s)})})]})})]})},jM=({timerState:e,animationState:t,hasError:n,compact:r,className:i})=>{const{t:o,i18n:s}=de.useTranslation(),a=zu(),{elapsedTime:l,currentProgress:c}=e,{showErrorAnimation:u,showPauseAnimation:d}=t;return r?g.jsxRuntimeExports.jsx(M.Box,{className:i,sx:{display:"flex",alignItems:"center",m:0},children:g.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{color:n?a.palette.error.light:a.palette.text.primary,fontSize:"14px",transition:"color 0.5s ease-out"},children:n?o("timer.error"):pu(l,s.language)})}):g.jsxRuntimeExports.jsxs(M.Box,{className:i,sx:{display:"flex",alignItems:"center",m:0,gap:1},children:[g.jsxRuntimeExports.jsx(M.Box,{sx:{width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",opacity:d||u?.6:1,transition:"opacity 0.5s ease-out"},children:g.jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",style:{transform:"rotate(-90deg)"},role:"img","aria-label":"Timer progress",children:[g.jsxRuntimeExports.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?a.palette.error.light:a.palette.success.main,strokeWidth:"2",opacity:.3,style:{transition:"stroke 0.8s ease-in-out, opacity 2s ease-in-out"}}),g.jsxRuntimeExports.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?a.palette.error.light:a.palette.success.main,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:`${2*Math.PI*8}`,strokeDashoffset:`${2*Math.PI*8*(1-c/100)}`,style:{transition:"stroke-dashoffset 0.1s ease-out, stroke 0.8s ease-in-out, opacity 2s ease-in-out"}})]})}),g.jsxRuntimeExports.jsx(M.Typography,{variant:"body2",sx:{color:n?a.palette.error.light:a.palette.text.primary,fontSize:"14px",lineHeight:"normal",letterSpacing:"normal",transition:"color 0.8s ease-in-out, font-size 0.3s ease-out, opacity 2s ease-in-out"},children:n?o("timer.error"):pu(l,s.language)})]})},kM=()=>{const[e,t]=D.useState({showPauseAnimation:!1,showErrorAnimation:!1,showMainText:!0}),n=D.useRef(null),r=D.useRef(null),i=D.useRef(null),o=D.useCallback(()=>{t(d=>({...d,showPauseAnimation:!0})),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{t(d=>({...d,showPauseAnimation:!1}))},800)},[]),s=D.useCallback(()=>{t(d=>({...d,showErrorAnimation:!0})),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{t(d=>({...d,showErrorAnimation:!1}))},600)},[]),a=D.useCallback(()=>{t(d=>({...d,showErrorAnimation:!1})),r.current&&clearTimeout(r.current)},[]),l=D.useCallback(()=>{t(d=>({...d,showMainText:!1})),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{t(d=>({...d,showMainText:!0}))},200)},[]),c=D.useCallback(()=>{t(d=>({...d,showMainText:!0}))},[]),u=D.useCallback(()=>{n.current&&clearTimeout(n.current),r.current&&clearTimeout(r.current),i.current&&clearTimeout(i.current)},[]);return{animationState:e,triggerPauseAnimation:o,triggerErrorAnimation:s,clearErrorAnimation:a,triggerFadeTransition:l,setInitialAnimationState:c,cleanup:u}},OM=({autoStart:e,hasError:t,onPauseAnimation:n,onErrorAnimation:r,onClearErrorAnimation:i})=>{const[o,s]=D.useState({elapsedTime:0,isRunning:!1,isPausedState:!1,currentProgress:0,wasRunningBeforeError:!1}),a=D.useRef(null),l=D.useRef(null),c=D.useRef(0),u=D.useRef(0),[d]=g.useInterpolation([0],{tension:80,friction:18,onChange:([b])=>{s(E=>({...E,currentProgress:b}))}}),h=D.useCallback((b=0)=>{const E=b/60%1*100;s(T=>({...T,elapsedTime:b,isPausedState:!1,currentProgress:E})),c.current=0,u.current=E,d.setImmediate([E]),e?(l.current=Date.now()-b*1e3,s(T=>({...T,isRunning:!0}))):l.current=null},[e,d]),f=D.useCallback(()=>{if(l.current&&o.isRunning){const E=(Date.now()-l.current)/1e3+c.current,T=E/60%1*100;d.setTarget([T]),s(w=>({...w,elapsedTime:Math.floor(E)}))}s(b=>({...b,isRunning:!1,isPausedState:!0})),n()},[o.isRunning,d,n]),m=D.useCallback(()=>{o.isPausedState&&(c.current=o.elapsedTime,l.current=Date.now(),s(b=>({...b,isRunning:!0,isPausedState:!1})))},[o.isPausedState,o.elapsedTime]),p=D.useCallback(()=>{s(b=>({...b,elapsedTime:0,isRunning:!1,isPausedState:!1,currentProgress:0})),c.current=0,l.current=null,u.current=0,d.setImmediate([0])},[d]),y=D.useCallback(()=>o.isPausedState,[o.isPausedState]);return D.useEffect(()=>{t?(o.isRunning&&(s(b=>({...b,wasRunningBeforeError:!0})),f()),r()):(o.wasRunningBeforeError&&!o.isRunning&&(s(b=>({...b,wasRunningBeforeError:!1})),m()),i())},[t,o.isRunning,o.wasRunningBeforeError,f,m,r,i]),D.useEffect(()=>{if(o.isRunning){const b=()=>{if(l.current){const T=(Date.now()-l.current)/1e3+c.current,w=T/60%1*100;s(S=>({...S,elapsedTime:Math.floor(T)})),Math.abs(w-u.current)>.1&&(d.setTarget([w]),u.current=w)}a.current=requestAnimationFrame(b)};a.current=requestAnimationFrame(b)}else a.current&&(cancelAnimationFrame(a.current),a.current=null);return()=>{a.current&&(cancelAnimationFrame(a.current),a.current=null)}},[o.isRunning,d]),D.useEffect(()=>{let b=null;const E=()=>{d.update(),b=requestAnimationFrame(E)};return b=requestAnimationFrame(E),()=>{b&&cancelAnimationFrame(b)}},[d]),{timerState:o,controls:{start:h,pause:f,resume:m,reset:p,isPaused:y}}},PM=g.externalizeComponent(se.observer(({onTimerReady:e,autoStart:t=!0,variant:n="default",compact:r=!1,className:i,hasError:o=!1})=>{const{animationState:s,triggerPauseAnimation:a,triggerErrorAnimation:l,clearErrorAnimation:c,setInitialAnimationState:u,cleanup:d}=kM(),{timerState:h,controls:f}=OM({autoStart:t,hasError:o,onPauseAnimation:a,onErrorAnimation:l,onClearErrorAnimation:c});return D.useEffect(()=>{u()},[u]),D.useEffect(()=>{let m=!0;const p=setTimeout(()=>{m&&e(f)},0);return()=>{m=!1,clearTimeout(p)}},[e,f]),D.useEffect(()=>d,[d]),n==="small"?g.jsxRuntimeExports.jsx(jM,{timerState:h,animationState:s,hasError:o,compact:r,className:i}):g.jsxRuntimeExports.jsx(IM,{timerState:h,animationState:s,hasError:o,className:i})})),mu=1e-4,DM={a:0,d:0,alpha:0,theta:0,reverse_rotation_direction:!1};class Li{constructor(t,n,r,i,o,s,a,l,c,u){this.nova=t,this.controller=n,this.motionGroup=r,this.initialMotionState=i,this.motionStateSocket=o,this.isVirtual=s,this.tcps=a,this.description=l,this.initialControllerState=c,this.controllerStateSocket=u,this.connectedJoggingSocket=null,this.joggingVelocity=10,this.activationState="inactive",this.rapidlyChangingMotionState=i,this.controllerState=c,u.addEventListener("message",d=>{var f;const h=(f=Ie.tryParseJson(d.data))==null?void 0:f.result;h&&ue.runInAction(()=>{this.controllerState=h})}),o.addEventListener("message",d=>{var f;const h=(f=Ie.tryParseJson(d.data))==null?void 0:f.result;if(!h)throw new Error(`Failed to get motion state for ${this.motionGroupId}: ${d.data}`);Fa(this.rapidlyChangingMotionState.joint_position,h.joint_position,mu)||ue.runInAction(()=>{this.rapidlyChangingMotionState.joint_position=h.joint_position}),Ba(this.rapidlyChangingMotionState,h,mu)||ue.runInAction(()=>{this.rapidlyChangingMotionState.tcp_pose=h.tcp_pose}),this.rapidlyChangingMotionState.standstill!==h.standstill&&ue.runInAction(()=>{this.rapidlyChangingMotionState.standstill=h.standstill})}),ue.makeAutoObservable(this)}static async connectMultiple(t,n){return Promise.all(n.map(r=>Li.connect(t,r)))}static async connect(t,n){var b,E;const[r,i]=n.split("@"),o=await t.api.controller.getCurrentRobotControllerState(i),s=o==null?void 0:o.motion_groups.find(T=>T.motion_group===n);if(!o||!s)throw new Error(`Controller ${i} or motion group ${n} not found`);const a=t.openReconnectingWebsocket(`/controllers/${i}/motion-groups/${n}/state-stream`),l=await a.firstMessage(),c=(b=Ie.tryParseJson(l.data))==null?void 0:b.result;if(!c)throw new Error(`Unable to parse initial motion state message ${l.data}`);console.log(`Connected motion state websocket to motion group ${s.motion_group}. Initial state:
|
|
113
|
+
`,c);const d=(await t.api.controller.getRobotController(o.controller)).configuration.kind==="VirtualController",h=await t.api.motionGroup.getMotionGroupDescription(i,s.motion_group),f=Object.entries(h.tcps||{}).map(([T,w])=>({id:T,readable_name:w.name,position:w.pose.position,orientation:w.pose.orientation})),m=t.openReconnectingWebsocket(`/controllers/${o.controller}/state-stream?response_rate=1000`),p=await m.firstMessage(),y=(E=Ie.tryParseJson(p.data))==null?void 0:E.result;if(!y)throw new Error(`Unable to parse initial controller state message ${p.data}`);return console.log(`Connected controller state websocket to controller ${o.controller}. Initial state:
|
|
114
|
+
`,y),new Li(t,o,s,c,a,d,f,h,y,m)}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get modelFromController(){return this.description.motion_group_model}get joggingVelocityRads(){return this.joggingVelocity*Math.PI/180}get joints(){return this.initialMotionState.joint_position.map((t,n)=>({index:n}))}get dhParameters(){if(this.description.dh_parameters!==void 0)return this.description.dh_parameters.map(t=>({...DM,...t}))}get safetyZones(){return this.description.safety_zones}get mountingPosition(){var t,n,r;return this.description.mounting?[(((t=this.description.mounting.position)==null?void 0:t[0])||0)/1e3,(((n=this.description.mounting.position)==null?void 0:n[1])||0)/1e3,(((r=this.description.mounting.position)==null?void 0:r[2])||0)/1e3]:[0,0,0]}get mountingQuaternion(){var i,o,s,a,l,c;const t=new Ja.Vector3(((o=(i=this.description.mounting)==null?void 0:i.orientation)==null?void 0:o[0])||0,((a=(s=this.description.mounting)==null?void 0:s.orientation)==null?void 0:a[1])||0,((c=(l=this.description.mounting)==null?void 0:l.orientation)==null?void 0:c[2])||0),n=t.length(),r=t.normalize();return new Ja.Quaternion().setFromAxisAngle(r,n)}get isEstopActive(){return["SAFETY_STATE_ROBOT_EMERGENCY_STOP","SAFETY_STATE_DEVICE_EMERGENCY_STOP"].includes(this.controllerState.safety_state)}get isMoveableSafetyState(){return["SAFETY_STATE_NORMAL","SAFETY_STATE_REDUCED"].includes(this.controllerState.safety_state)}get isMoveableOperationMode(){return["OPERATION_MODE_AUTO","OPERATION_MODE_MANUAL","OPERATION_MODE_MANUAL_T1","OPERATION_MODE_MANUAL_T2"].includes(this.controllerState.operation_mode)}get canBeMoved(){return this.isMoveableSafetyState&&this.isMoveableOperationMode&&this.activationState==="active"}async deactivate(){if(this.activationState!=="active"){console.error("Tried to deactivate while already deactivating");return}ue.runInAction(()=>{this.activationState="deactivating"});try{await this.nova.api.controller.setDefaultMode(this.controllerId,"ROBOT_SYSTEM_MODE_MONITOR"),ue.runInAction(()=>{this.activationState="inactive"})}catch(t){throw ue.runInAction(()=>{this.activationState="active"}),t}}async activate(){if(this.activationState!=="inactive"){console.error("Tried to activate while already activating");return}ue.runInAction(()=>{this.activationState="activating"});try{await this.nova.api.controller.setDefaultMode(this.controllerId,"ROBOT_SYSTEM_MODE_CONTROL"),ue.runInAction(()=>{this.activationState="active"})}catch(t){throw ue.runInAction(()=>{this.activationState="inactive"}),t}}toggleActivation(){this.activationState==="inactive"?this.activate():this.activationState==="active"&&this.deactivate()}dispose(){this.motionStateSocket.close(),this.connectedJoggingSocket&&this.connectedJoggingSocket.close()}setJoggingVelocity(t){this.joggingVelocity=t}}function Jh(){var t,n,r,i,o,s;const e=M.createTheme({palette:{mode:"dark",text:{primary:"rgba(255, 255, 255, 1)",secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.38)"},primary:{main:"rgba(142, 86, 252, 1)",dark:"rgba(136, 58, 255, 1)",light:"rgba(157, 131, 246, 1)",contrastText:"rgba(255, 255, 255, 0.87)"},secondary:{main:"rgba(255, 255, 255, 1)",dark:"rgba(255, 255, 255, 0.06)",contrastText:"rgba(255, 255, 255, 0.87)"},tertiary:{main:"rgba(100, 255, 218, 1)",dark:"rgba(38, 166, 154, 1)",light:"rgba(167, 255, 235, 1)",contrastText:"rgba(0, 0, 0, 1)"},error:{main:"rgba(239, 83, 80, 1)",dark:"rgba(229, 57, 53, 1)",light:"rgba(239, 154, 154, 1)",contrastText:"rgba(255, 255, 255, 1)"},warning:{main:"rgba(255, 171, 64, 1)",dark:"rgba(255, 145, 0, 1)",light:"rgba(255, 209, 128, 1)",contrastText:"rgba(0, 0, 0, 0.87)"},success:{main:"rgba(38, 166, 154, 1)",dark:"rgba(0, 121, 107, 1)",light:"rgba(128, 203, 196, 1)",contrastText:"rgba(255, 255, 255, 0.87)"},background:{default:"rgba(2, 6, 23, 1)",paper:"rgba(17, 19, 31, 1)"},action:{active:"rgba(255, 255, 255, 0.56)",hover:"rgba(255, 255, 255, 0.08)",selected:"rgba(255, 255, 255, 0.16)",disabledBackground:"rgba(255, 255, 255, 0.12)",focus:"rgba(255, 255, 255, 0.12)",disabled:"rgba(255, 255, 255, 0.38)"},common:{white:"rgba(255, 255, 255, 1)",black:"rgba(0, 0, 0, 1)"},divider:"rgba(255, 255, 255, 0.12)",backgroundPaperElevation:{0:"rgba(17,19,31,1.0)",1:"rgba(20,22,35,1.0)",2:"rgba(23,25,39,1.0)",3:"rgba(26,28,43,1.0)",4:"rgba(29,31,47,1.0)",5:"rgba(32,34,51,1.0)",6:"rgba(35,37,55,1.0)",7:"rgba(38,40,59,1.0)",8:"rgba(41,43,63,1.0)",9:"rgba(44,46,67,1.0)",10:"rgba(47,49,71,1.0)",11:"rgba(50,52,75,1.0)",12:"rgba(53,55,79,1.0)",13:"rgba(56,58,83,1.0)",14:"rgba(59,61,87,1.0)",15:"rgba(62,64,91,1.0)",16:"rgba(57,63,87,1.0)"}},paletteExt:{primary:{hover:"rgba(142, 86, 252, 0.08)",selected:"rgba(142, 86, 252, 0.16)",focus:"rgba(142, 86, 252, 0.12)",focusVisible:"rgba(142, 86, 252, 0.3)",outlineBorder:"rgba(142, 86, 252, 0.5)"},secondary:{tonal:"rgba(255,255,255,0.1)"}}});return{...e,components:{MuiCssBaseline:{styleOverrides:{"html, body, *":{scrollbarWidth:"none",msOverflowStyle:"none"},"html:hover, body:hover, *:hover":{scrollbarWidth:"thin",scrollbarColor:`${e.palette.divider} transparent`},".MuiDataGrid-panelContent":{borderRadius:"16px !important","& .MuiPaper-root":{borderRadius:"16px !important"}},".MuiDataGrid-filterForm":{borderRadius:"16px !important","& .MuiInputBase-root":{borderRadius:"16px !important","& fieldset":{borderRadius:"16px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"16px !important"}},"& .MuiTextField-root":{"& .MuiInputBase-root":{borderRadius:"16px !important","& fieldset":{borderRadius:"16px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"16px !important"}}}},".MuiDataGrid-filterFormValueInput":{"& .MuiInputBase-root":{borderRadius:"16px !important","& fieldset":{borderRadius:"16px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"16px !important"}}}}},MuiDataGrid:{styleOverrides:{root:{},panelContent:{borderRadius:"16px !important"},filterForm:{"& .MuiInputBase-root":{borderRadius:"10px !important","& fieldset":{borderRadius:"10px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"10px !important"}}},filterFormValueInput:{"& .MuiInputBase-root":{borderRadius:"10px !important","& fieldset":{borderRadius:"10px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"10px !important"}}}}},MuiButton:{styleOverrides:{root:{textTransform:"none",borderRadius:"10px"}},variants:[{props:{color:"secondary",variant:"contained"},style:{border:`1px solid ${e.palette.divider}`,background:(r=(n=(t=e.paletteExt)==null?void 0:t.secondary)==null?void 0:n.tonal)==null?void 0:r.toString()}},{props:{color:"secondary",variant:"outlined"},style:{border:`1px solid ${e.palette.divider}`}}]},MuiTab:{styleOverrides:{root:{textTransform:"none",color:e.palette.text.secondary,"&.Mui-selected":{color:e.palette.text.primary}}}},MuiTabs:{styleOverrides:{root:{background:(i=e.palette.backgroundPaperElevation)==null?void 0:i[1]}}},MuiToggleButtonGroup:{styleOverrides:{root:{".MuiToggleButtonGroup-firstButton":{borderRadius:"10px 0 0 10px"},".MuiToggleButtonGroup-lastButton":{borderRadius:"0 10px 10px 0"}}}},MuiToggleButton:{styleOverrides:{root:{textTransform:"none",padding:"6px 16px"}}},MuiSelect:{variants:[{props:{variant:"filled"},style:{borderRadius:"10px","::before, ::after":{visibility:"collapse"},".MuiInputBase-input":{padding:"6px 16px",borderRadius:"10px"}}}]},MuiDrawer:{styleOverrides:{paper:{border:"none",boxShadow:"4px 0 8px -4px rgba(0, 0, 0, 0.3)"}}},MuiFab:{styleOverrides:{root:{background:(s=(o=e.paletteExt)==null?void 0:o.secondary)==null?void 0:s.tonal}},variants:[{props:{color:"primary"},style:{background:e.palette.primary.main}}]}},componentsExt:{JoggingPanel:{JoggingCartesian:{Axis:{X:{backgroundColor:"rgba(215, 66, 56, 1)",borderColor:"rgba(215, 66, 56, 1)",buttonBackgroundColor:{default:"rgba(241, 77, 66, 1)",pressed:"rgba(138, 41, 35, 1)",hovered:"rgba(241, 77, 66, 1)",disabled:"rgba(241, 77, 66, 1)"},color:"rgba(255, 198, 198, 1)",labelColor:e.palette.text.primary},Y:{backgroundColor:"rgba(20, 151, 108, 1)",borderColor:"rgba(20, 151, 108, 1)",buttonBackgroundColor:{default:"rgba(28, 188, 135, 1)",pressed:"rgba(11, 89, 63, 1)",disabled:"rgba(28, 188, 135, 1)",hovered:"rgba(28, 188, 135, 1)"},color:"rgba(215, 255, 242, 1)",labelColor:e.palette.text.primary},Z:{backgroundColor:"rgba(1, 87, 155, 1)",borderColor:"rgba(1, 87, 155, 1)",buttonBackgroundColor:{default:"rgba(2, 136, 209, 1)",pressed:"rgba(2, 64, 114, 1)",disabled:"rgba(2, 136, 209, 1)",hovered:"rgba(2, 136, 209, 1)"},color:"rgba(210, 239, 255, 1)",labelColor:e.palette.text.primary}}},JoggingJoint:{Joint:{arrowColor:e.palette.text.primary}},VelocitySlider:{sliderLegendColor:e.palette.text.primary}}}}}function $M(){const e=Jh();return e.palette.mode="light",e}function NM(e){var r,i,o,s;let t=!0;((r=e.palette)==null?void 0:r.mode)==="light"?t=!1:((i=e.palette)==null?void 0:i.mode)!=="dark"&&(t=!(typeof window<"u"&&((s=(o=window.matchMedia)==null?void 0:o.call(window,"(prefers-color-scheme: light)"))==null?void 0:s.matches)));const n=t?Jh():$M();return Lu(n,e)}exports.AppHeader=lf;exports.ConnectedMotionGroup=Li;exports.CycleTimer=_S;exports.JoggerConnection=Ao;exports.JoggingCartesianAxisControl=Is;exports.JoggingJointValueControl=xh;exports.JoggingPanel=aM;exports.JoggingStore=Oo;exports.LoadingCover=Sh;exports.LoadingErrorMessage=Eh;exports.LogPanel=mM;exports.LogStore=Hh;exports.LogViewer=qh;exports.MotionStreamConnection=Ro;exports.NoMotionGroupModal=yM;exports.PoseCartesianValues=cM;exports.PoseJointValues=uM;exports.RobotListItem=bM;exports.RobotSetupReadinessIndicator=Kh;exports.RobotSetupReadinessState=qa;exports.SafetyBar=TM;exports.SelectableFab=CM;exports.TabBar=AM;exports.Timer=PM;exports.VelocitySlider=Vh;exports.VelocitySliderLabel=Ha;exports.WandelbotsDataGrid=mh;exports.createDebugMessage=dM;exports.createErrorMessage=pM;exports.createInfoMessage=hM;exports.createLogMessage=jr;exports.createNovaMuiTheme=NM;exports.createWarningMessage=fM;exports.jointValuesEqual=Fa;exports.poseEqual=bh;exports.tcpMotionEqual=Ba;exports.unwrapRotationVector=vh;
|
|
115
|
+
//# sourceMappingURL=theming-BgAu1ds7.cjs.map
|