@wandelbots/wandelbots-js-react-components 4.2.0-pr.feat-JoggingPanelSupportForLinearAxis.514.cd022e8 → 4.2.0-pr.feat-JoggingPanelSupportForLinearAxis.514.4eb7fa6
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/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-DEFDMJUe.cjs → theming-Cqo-msxF.cjs} +2 -2
- package/dist/{theming-DEFDMJUe.cjs.map → theming-Cqo-msxF.cjs.map} +1 -1
- package/dist/{theming-BNnzOcHd.js → theming-gUgI75AD.js} +2 -2
- package/dist/{theming-BNnzOcHd.js.map → theming-gUgI75AD.js.map} +1 -1
- package/package.json +1 -1
- package/src/components/jogging/JoggingPanel.tsx +1 -1
|
@@ -109,7 +109,7 @@ Avoid returning a new reference inside your input selector, e.g.
|
|
|
109
109
|
`))},[i,r,t]);const{current:u}=_.useRef(n);_.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
110
|
`))},[JSON.stringify(n)])}const c=_.useCallback(u=>{o||a(u)},[]);return[l,c]}const kS=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"),OS=Kt(g.jsxRuntimeExports.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList"),kc=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(re.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 j;const f=M.useTheme(),m=Qe.useGridApiRef(),p=O.useRef(null),[y,v]=O.useState(null),E=O.useMemo(()=>e.map(n),[e,n]);O.useEffect(()=>{m.current&&E.length>0&&m.current.autosizeColumns({includeOutliers:!0,includeHeaders:!0,expand:!0,columns:t.map(P=>P.field)})},[E,t,m]),O.useEffect(()=>{if(!p.current||!m.current)return;const P=new ResizeObserver(()=>{setTimeout(()=>{m.current&&E.length>0&&m.current.autosizeColumns({includeOutliers:!0,includeHeaders:!0,expand:!0,columns:t.map(N=>N.field)})},100)});return P.observe(p.current),()=>{P.disconnect()}},[m,E.length,t]);const w=O.useMemo(()=>{if(i!==void 0)return i;if(y!==null)return y;if(d&&e.length>0){const P=e[0];return v(P),P}return null},[d,e,i,y]),T=P=>{const N=e.find(B=>n(B).id===P.id);N&&(i===void 0&&v(N),r&&r(N,P))},C=O.useMemo(()=>!w||!o?null:o(w),[w,o]);function S(){return g.jsxRuntimeExports.jsx(Qe.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(Qe.FilterPanelTrigger,{render:g.jsxRuntimeExports.jsx(Qe.ToolbarButton,{"aria-label":"Show filters",children:g.jsxRuntimeExports.jsx(OS,{fontSize:"small"})})}),g.jsxRuntimeExports.jsx(M.Divider,{orientation:"vertical",flexItem:!0,sx:{height:"24px",alignSelf:"center"}}),g.jsxRuntimeExports.jsx(Qe.QuickFilter,{render:(P,N)=>g.jsxRuntimeExports.jsxs(M.Box,{...P,sx:{display:"flex",overflow:"hidden"},children:[!N.expanded&&g.jsxRuntimeExports.jsx(Qe.QuickFilterTrigger,{render:g.jsxRuntimeExports.jsx(Qe.ToolbarButton,{"aria-label":"Search",children:g.jsxRuntimeExports.jsx(kc,{fontSize:"small"})})}),g.jsxRuntimeExports.jsxs(M.Box,{sx:{display:"flex",overflow:"hidden",transition:"all 0.3s ease-in-out",width:N.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:N.expanded&&N.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:[N.expanded&&g.jsxRuntimeExports.jsx(kc,{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(Qe.QuickFilterControl,{placeholder:l})]}),N.expanded&&N.value!==""&&g.jsxRuntimeExports.jsx(Qe.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(Qe.ToolbarButton,{"aria-label":"Clear",children:g.jsxRuntimeExports.jsx(kS,{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(Qe.DataGrid,{apiRef:m,rows:E,columns:t,onRowClick:T,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:((j=c==null?void 0:c.autosizeOptions)==null?void 0:j.columns)||t.map(P=>P.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=nm({createStyledComponent:He("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 PS=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:21,height:21,viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("g",{id:"JogMinus"},_.createElement("path",{id:"Minus",d:"M0 13V8H21V13H0Z",fill:"white"}))),DS=O.forwardRef(PS),$S=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:21,height:21,viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("g",{id:"JogPlus"},_.createElement("g",{id:"Plus"},_.createElement("path",{d:"M0 13V8H8V13H0Z",fill:"white"}),_.createElement("path",{d:"M8 0L13 2.18557e-07L13 21H8L8 0Z",fill:"white"}),_.createElement("path",{d:"M13 13V8H21V13H13Z",fill:"white"})))),LS=O.forwardRef($S),Is=g.externalizeComponent(re.observer(({colors:e,label:t,getDisplayedValue:n,startJogging:r,stopJogging:i,disabled:o,activeJoggingDirection:s,...a})=>{var w,T,C,S,R,j,P;Ft.useAnimationFrame(()=>{const N=n(),B=h.current;B&&(B.textContent=N)});const l=M.useTheme(),[c,u]=O.useState(null);O.useEffect(()=>{o&&E()},[o]);const d=s||c,h=O.useRef(null);e||(e={color:"#fff",backgroundColor:"#000",borderColor:"#000",buttonBackgroundColor:{disabled:"#000",default:"#000",hovered:"#000",pressed:"#000"},labelColor:"#000"});const f=d?(w=e.buttonBackgroundColor)==null?void 0:w.pressed:e.borderColor,m={width:"55px",color:e.color,path:{fill:e.color},alignContent:"center",fontSize:"37px",svg:{pointerEvents:"none"}},p={...m,backgroundColor:(T=e.buttonBackgroundColor)==null?void 0:T.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:(j=e.buttonBackgroundColor)==null?void 0:j.pressed,color:e.backgroundColor,path:{fill:e.backgroundColor},":disabled":{backgroundColor:(P=e.buttonBackgroundColor)==null?void 0:P.pressed,"svg path":{fill:l.palette.action.disabled}}};function v(N,B){o||N.button===0&&(u(B),r(B))}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:N=>v(N,"-"),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(DS,{})}),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:N=>v(N,"+"),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(LS,{})})]})})),NS=Kt(g.jsxRuntimeExports.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),zS=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,FS=typeof self=="object"&&self&&self.Object===Object&&self,gt=gh||FS||Function("return this")(),as=function(){return gt.Date.now()},BS=/\s/;function GS(e){for(var t=e.length;t--&&BS.test(e.charAt(t)););return t}var VS=/^\s+/;function US(e){return e&&e.slice(0,GS(e)+1).replace(VS,"")}var zt=gt.Symbol,yh=Object.prototype,HS=yh.hasOwnProperty,YS=yh.toString,er=zt?zt.toStringTag:void 0;function WS(e){var t=HS.call(e,er),n=e[er];try{e[er]=void 0;var r=!0}catch{}var i=YS.call(e);return r&&(t?e[er]=n:delete e[er]),i}var qS=Object.prototype,KS=qS.toString;function JS(e){return KS.call(e)}var XS="[object Null]",ZS="[object Undefined]",Oc=zt?zt.toStringTag:void 0;function yn(e){return e==null?e===void 0?ZS:XS:Oc&&Oc in Object(e)?WS(e):JS(e)}function un(e){return e!=null&&typeof e=="object"}var QS="[object Symbol]";function Mo(e){return typeof e=="symbol"||un(e)&&yn(e)==QS}var Pc=NaN,eE=/^[-+]0x[0-9a-f]+$/i,tE=/^0b[01]+$/i,nE=/^0o[0-7]+$/i,rE=parseInt;function Dc(e){if(typeof e=="number")return e;if(Mo(e))return Pc;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=US(e);var n=tE.test(e);return n||nE.test(e)?rE(e.slice(2),n?2:8):eE.test(e)?Pc:+e}var iE="Expected a function",oE=Math.max,sE=Math.min;function aE(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(iE);t=Dc(t)||0,cn(n)&&(u=!!n.leading,d="maxWait"in n,o=d?oE(Dc(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h);function f(S){var R=r,j=i;return r=i=void 0,c=S,s=e.apply(j,R),s}function m(S){return c=S,a=setTimeout(v,t),u?f(S):s}function p(S){var R=S-l,j=S-c,P=t-R;return d?sE(P,o-j):P}function y(S){var R=S-l,j=S-c;return l===void 0||R>=t||R<0||d&&j>=o}function v(){var S=as();if(y(S))return E(S);a=setTimeout(v,p(S))}function E(S){return a=void 0,h&&r?f(S):(r=i=void 0,s)}function w(){a!==void 0&&clearTimeout(a),c=0,r=l=i=a=void 0}function T(){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(v,t),f(l)}return a===void 0&&(a=setTimeout(v,t)),s}return C.cancel=w,C.flush=T,C}var lE="Expected a function";function cE(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(lE);return cn(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),aE(e,t,{leading:r,maxWait:t,trailing:i})}const xh=g.externalizeComponent(re.observer(({startJogging:e,stopJogging:t,lowerLimit:n,upperLimit:r,useDegree:i,getValue:o,disabled:s,...a})=>{var S,R,j,P,N,B,b,I,A,z,V,Z,H,se,ae;const{t:l}=he.useTranslation(),[c,u]=O.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=re.useLocalObservable(()=>({activeJoggingDir:null,startJogging(U){this.activeJoggingDir=U,e(U)},stopJogging(){this.activeJoggingDir=null,t()}})),m=cE(()=>{u(i?p(o()):o())},50);Ft.useAnimationFrame(m);function p(U){if(U!=null)return Ie.radiansToDegrees(U)}function y(U){U.button===0&&f.startJogging("-")}function v(U){U.button===0&&f.startJogging("+")}function E(U){f.stopJogging()}function w(U){f.stopJogging()}function T(U,be=1){if(U===void 0||isNaN(U))return"";const Oe=l("General.degree.variable",{amount:U.toFixed(be)});return U>0&&be===0?`+${Oe}`:Oe}function C(U,be=1){if(U===void 0||isNaN(U))return"";const Oe=l("General.mm.variable",{amount:U.toFixed(be)});return U>0&&be===0?`+${Oe}`:Oe}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:(j=d.palette.backgroundPaperElevation)==null?void 0:j[11],"& svg":{width:"42px",height:"42px"},"&.Mui-disabled":{backgroundColor:(P=d.palette.backgroundPaperElevation)==null?void 0:P[11],color:d.palette.action.disabled,opacity:1},"&:hover":{backgroundColor:(N=d.palette.backgroundPaperElevation)==null?void 0:N[9]},"&:active":{...h}}},children:[g.jsxRuntimeExports.jsx(M.IconButton,{onPointerDown:y,onPointerUp:E,onPointerOut:w,disabled:s,disableRipple:!0,sx:{borderRadius:"16px 0px 0px 16px",...f.activeJoggingDir==="-"?h:{}},children:g.jsxRuntimeExports.jsx(NS,{sx:{pointerEvents:"none",color:(A=(I=(b=(B=d.componentsExt)==null?void 0:B.JoggingPanel)==null?void 0:b.JoggingJoint)==null?void 0:I.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:(z=d.palette.backgroundPaperElevation)==null?void 0:z[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?T(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:(V=d.palette.backgroundPaperElevation)==null?void 0:V[5],opacity:1}},marks:n!==void 0&&r!==void 0&&[{value:i?p(n):n,label:i?T(p(n),0):C(n)},{value:i?p(r):r,label:i?T(p(r),0):C(r)}]})]}),g.jsxRuntimeExports.jsx(M.IconButton,{onPointerDown:v,onPointerUp:E,onPointerOut:w,disabled:s,disableRipple:!0,sx:{borderRadius:"0px 16px 16px 0px",...f.activeJoggingDir==="+"?h:{}},children:g.jsxRuntimeExports.jsx(zS,{sx:{pointerEvents:"none",color:(ae=(se=(H=(Z=d.componentsExt)==null?void 0:Z.JoggingPanel)==null?void 0:H.JoggingJoint)==null?void 0:se.Joint)==null?void 0:ae.arrowColor}})})]})})),uE=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"),dE=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 hE(...e){const t="THREE."+e.shift();console.warn(t,...e)}function St(e,t,n){return Math.max(t,Math.min(n,e))}class fE{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 v=1-a;if(y<.9995){const E=Math.acos(y),w=Math.sin(E);v=Math.sin(v*E)/w,a=Math.sin(a*E)/w,l=l*v+h*a,c=c*v+f*a,u=u*v+m*a,d=d*v+p*a}else{l=l*v+h*a,c=c*v+f*a,u=u*v+m*a,d=d*v+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:hE("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(St(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($c.setFromEuler(t))}applyAxisAngle(t,n){return this.applyQuaternion($c.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=St(this.x,t.x,n.x),this.y=St(this.y,t.y,n.y),this.z=St(this.z,t.z,n.z),this}clampScalar(t,n){return this.x=St(this.x,t,n),this.y=St(this.y,t,n),this.z=St(this.z,t,n),this}clampLength(t,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(St(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(St(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,$c=new fE;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)||de.runInAction(()=>{this.rapidlyChangingMotionState.joint_position=l.joint_position}),Ba(this.rapidlyChangingMotionState,l,Lc)||de.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&&de.runInAction(()=>{this.rapidlyChangingMotionState.standstill=l.standstill})}),de.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
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 wandelscriptIdentifier(){const t=this.motionGroupId.split("@")[0];return`${this.controllerId.replace(/-/g,"_")}_${t}`}get joints(){return this.initialMotionState.joint_position.map((t,n)=>({index:n}))}dispose(){this.motionStateSocket.close()}}const Nc="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(Nc))){(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]),v=y.length(),E=y.clone().normalize(),w=s.distanceRads*(o==="-"?-1:1),T=new Dn(0,0,0);T[i]=1;const C=Math.cos(.5*w)*Math.cos(.5*v),S=Math.sin(.5*w)*Math.sin(.5*v),R=Math.sin(.5*w)*Math.cos(.5*v),j=Math.cos(.5*w)*Math.sin(.5*v),P=T.dot(E),N=T.clone().cross(E),B=2*Math.acos(C-S*P),b=B/Math.sin(.5*B),I=new Dn().addScaledVector(N,S).addScaledVector(T,R).addScaledVector(E,j).multiplyScalar(b);a.push({limits_override:{tcp_orientation_velocity_limit:r},path:{path_definition_name:"PathLine",target_pose:{position:t.position,orientation:[...I]}}})}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 v;if(!y||y.add_trajectory_error||y.message)if(this.onError)this.onError(y);else throw new Error(((v=y==null?void 0:y.add_trajectory_error)==null?void 0:v.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 de.when(()=>!this.motionStream.rapidlyChangingMotionState.standstill),await de.when(()=>this.motionStream.rapidlyChangingMotionState.standstill),(y=this.trajectorySocket)==null||y.dispose(),this.trajectorySocket=null},m=async()=>{var y;await de.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,w;const v=Ie.tryParseJson(y.data);if(!((E=v==null?void 0:v.result)!=null&&E.kind))throw new Error(`Failed to execute trajectory: Received invalid message ${y.data}`);if(this.onBlocked&&((w=v.result.message)!=null&&w.includes(Nc))){this.onBlocked();return}if(v.result.kind==="INITIALIZE_RECEIVED")h(v.result);else if(v.result.kind==="START_RECEIVED")p(v);else if(v.result.kind!=="PAUSE_RECEIVED")if(v.result.kind==="MOTION_ERROR"&&v.result.message)if(this.onError){this.onError(v);return}else throw new Error(v.result.message);else throw new Error(`Failed to execute trajectory, cannot handle message type "${v.result.kind}"`)}),this.trajectorySocket.sendJson({message_type:"InitializeMovementRequest",trajectory:{message_type:"TrajectoryData",motion_group:this.motionGroupId,data:d,tcp:this.tcp}})}}var pE="[object AsyncFunction]",mE="[object Function]",gE="[object GeneratorFunction]",yE="[object Proxy]";function Sh(e){if(!cn(e))return!1;var t=yn(e);return t==mE||t==gE||t==pE||t==yE}var cs=gt["__core-js_shared__"],zc=(function(){var e=/[^.]+$/.exec(cs&&cs.keys&&cs.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function xE(e){return!!zc&&zc 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\]$/,wE=Function.prototype,TE=Object.prototype,CE=wE.toString,ME=TE.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=Sh(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 Fc=(function(){try{var e=bn(Object,"defineProperty");return e({},"",{}),e}catch{}})();function IE(e,t,n){t=="__proto__"&&Fc?Fc(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 Bc(e){return un(e)&&yn(e)==DE}var Eh=Object.prototype,$E=Eh.hasOwnProperty,LE=Eh.propertyIsEnumerable,wh=Bc((function(){return arguments})())?Bc:function(e){return un(e)&&$E.call(e,"callee")&&!LE.call(e,"callee")},pt=Array.isArray;function NE(){return!1}var Th=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Gc=Th&&typeof module=="object"&&module&&!module.nodeType&&module,zE=Gc&&Gc.exports===Th,Vc=zE?gt.Buffer:void 0,FE=Vc?Vc.isBuffer:void 0,js=FE||NE,BE=9007199254740991,GE=/^(?:0|[1-9]\d*)$/;function Ch(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 VE=9007199254740991;function Ga(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=VE}var UE="[object Arguments]",HE="[object Array]",YE="[object Boolean]",WE="[object Date]",qE="[object Error]",KE="[object Function]",JE="[object Map]",XE="[object Number]",ZE="[object Object]",QE="[object RegExp]",e2="[object Set]",t2="[object String]",n2="[object WeakMap]",r2="[object ArrayBuffer]",i2="[object DataView]",o2="[object Float32Array]",s2="[object Float64Array]",a2="[object Int8Array]",l2="[object Int16Array]",c2="[object Int32Array]",u2="[object Uint8Array]",d2="[object Uint8ClampedArray]",h2="[object Uint16Array]",f2="[object Uint32Array]",fe={};fe[o2]=fe[s2]=fe[a2]=fe[l2]=fe[c2]=fe[u2]=fe[d2]=fe[h2]=fe[f2]=!0;fe[UE]=fe[HE]=fe[r2]=fe[YE]=fe[i2]=fe[WE]=fe[qE]=fe[KE]=fe[JE]=fe[XE]=fe[ZE]=fe[QE]=fe[e2]=fe[t2]=fe[n2]=!1;function p2(e){return un(e)&&Ga(e.length)&&!!fe[yn(e)]}function m2(e){return function(t){return e(t)}}var Mh=typeof exports=="object"&&exports&&!exports.nodeType&&exports,lr=Mh&&typeof module=="object"&&module&&!module.nodeType&&module,g2=lr&&lr.exports===Mh,us=g2&&gh.process,Uc=(function(){try{var e=lr&&lr.require&&lr.require("util").types;return e||us&&us.binding&&us.binding("util")}catch{}})(),Hc=Uc&&Uc.isTypedArray,Rh=Hc?m2(Hc):p2,y2=Object.prototype,x2=y2.hasOwnProperty;function b2(e,t){var n=pt(e),r=!n&&wh(e),i=!n&&!r&&js(e),o=!n&&!r&&!i&&Rh(e),s=n||r||i||o,a=s?PE(e.length,String):[],l=a.length;for(var c in e)x2.call(e,c)&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ch(c,l)))&&a.push(c);return a}var v2=Object.prototype;function S2(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||v2;return e===n}function E2(e,t){return function(n){return e(t(n))}}var w2=E2(Object.keys,Object),T2=Object.prototype,C2=T2.hasOwnProperty;function M2(e){if(!S2(e))return w2(e);var t=[];for(var n in Object(e))C2.call(e,n)&&n!="constructor"&&t.push(n);return t}function Ah(e){return e!=null&&Ga(e.length)&&!Sh(e)}function Va(e){return Ah(e)?b2(e):M2(e)}function R2(e,t){return e&&OE(e,t,Va)}function A2(e,t){return function(n,r){if(n==null)return n;if(!Ah(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 _2=A2(R2);function I2(e,t,n,r){return _2(e,function(i,o,s){t(r,i,n(i),s)}),r}function j2(){this.__data__=[],this.size=0}function _h(e,t){return e===t||e!==e&&t!==t}function _o(e,t){for(var n=e.length;n--;)if(_h(e[n][0],t))return n;return-1}var k2=Array.prototype,O2=k2.splice;function P2(e){var t=this.__data__,n=_o(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():O2.call(t,n,1),--this.size,!0}function D2(e){var t=this.__data__,n=_o(t,e);return n<0?void 0:t[n][1]}function $2(e){return _o(this.__data__,e)>-1}function L2(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 _t(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])}}_t.prototype.clear=j2;_t.prototype.delete=P2;_t.prototype.get=D2;_t.prototype.has=$2;_t.prototype.set=L2;function N2(){this.__data__=new _t,this.size=0}function z2(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function F2(e){return this.__data__.get(e)}function B2(e){return this.__data__.has(e)}var br=bn(gt,"Map"),vr=bn(Object,"create");function G2(){this.__data__=vr?vr(null):{},this.size=0}function V2(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var U2="__lodash_hash_undefined__",H2=Object.prototype,Y2=H2.hasOwnProperty;function W2(e){var t=this.__data__;if(vr){var n=t[e];return n===U2?void 0:n}return Y2.call(t,e)?t[e]:void 0}var q2=Object.prototype,K2=q2.hasOwnProperty;function J2(e){var t=this.__data__;return vr?t[e]!==void 0:K2.call(t,e)}var X2="__lodash_hash_undefined__";function Z2(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=vr&&t===void 0?X2: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=G2;dn.prototype.delete=V2;dn.prototype.get=W2;dn.prototype.has=J2;dn.prototype.set=Z2;function Q2(){this.size=0,this.__data__={hash:new dn,map:new(br||_t),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 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=Q2;It.prototype.delete=tw;It.prototype.get=nw;It.prototype.has=rw;It.prototype.set=iw;var ow=200;function sw(e,t){var n=this.__data__;if(n instanceof _t){var r=n.__data__;if(!br||r.length<ow-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new It(r)}return n.set(e,t),this.size=n.size,this}function Tt(e){var t=this.__data__=new _t(e);this.size=t.size}Tt.prototype.clear=N2;Tt.prototype.delete=z2;Tt.prototype.get=F2;Tt.prototype.has=B2;Tt.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 It;++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 Ih(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(v,E){if(!dw(f,E)&&(m===v||i(m,v,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 Yc=gt.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]",ww="[object RegExp]",Tw="[object Set]",Cw="[object String]",Mw="[object Symbol]",Rw="[object ArrayBuffer]",Aw="[object DataView]",Wc=zt?zt.prototype:void 0,ds=Wc?Wc.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 Yc(e),new Yc(t)));case xw:case bw:case Ew:return _h(+e,+t);case vw:return e.name==t.name&&e.message==t.message;case ww:case Cw:return e==t+"";case Sw:var a=pw;case Tw: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=Ih(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 pt(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,qc=Object.getOwnPropertySymbols,$w=qc?function(e){return e==null?[]:(e=Object(e),kw(qc(e),function(t){return Dw.call(e,t)}))}:Ow;function Kc(e){return jw(e,Va,$w)}var Lw=1,Nw=Object.prototype,zw=Nw.hasOwnProperty;function Fw(e,t,n,r,i,o){var s=n&Lw,a=Kc(e),l=a.length,c=Kc(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 v=e[h],E=t[h];if(r)var w=s?r(E,v,h,t,e,o):r(v,E,h,e,t,o);if(!(w===void 0?v===E||i(v,E,n,r,o):w)){p=!1;break}y||(y=h=="constructor")}if(p&&!y){var T=e.constructor,C=t.constructor;T!=C&&"constructor"in e&&"constructor"in t&&!(typeof T=="function"&&T instanceof T&&typeof C=="function"&&C instanceof C)&&(p=!1)}return o.delete(e),o.delete(t),p}var ks=bn(gt,"DataView"),Os=bn(gt,"Promise"),Ps=bn(gt,"Set"),Ds=bn(gt,"WeakMap"),Jc="[object Map]",Bw="[object Object]",Xc="[object Promise]",Zc="[object Set]",Qc="[object WeakMap]",eu="[object DataView]",Gw=xn(ks),Vw=xn(br),Uw=xn(Os),Hw=xn(Ps),Yw=xn(Ds),Dt=yn;(ks&&Dt(new ks(new ArrayBuffer(1)))!=eu||br&&Dt(new br)!=Jc||Os&&Dt(Os.resolve())!=Xc||Ps&&Dt(new Ps)!=Zc||Ds&&Dt(new Ds)!=Qc)&&(Dt=function(e){var t=yn(e),n=t==Bw?e.constructor:void 0,r=n?xn(n):"";if(r)switch(r){case Gw:return eu;case Vw:return Jc;case Uw:return Xc;case Hw:return Zc;case Yw:return Qc}return t});var Ww=1,tu="[object Arguments]",nu="[object Array]",ti="[object Object]",qw=Object.prototype,ru=qw.hasOwnProperty;function Kw(e,t,n,r,i,o){var s=pt(e),a=pt(t),l=s?nu:Dt(e),c=a?nu:Dt(t);l=l==tu?ti:l,c=c==tu?ti:c;var u=l==ti,d=c==ti,h=l==c;if(h&&js(e)){if(!js(t))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new Tt),s||Rh(e)?Ih(e,t,n,r,i,o):_w(e,t,l,n,r,i,o);if(!(n&Ww)){var f=u&&ru.call(e,"__wrapped__"),m=d&&ru.call(t,"__wrapped__");if(f||m){var p=f?e.value():e,y=m?t.value():t;return o||(o=new Tt),i(p,y,n,r,o)}}return h?(o||(o=new Tt),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 Tt,d;if(!(d===void 0?jo(c,l,Jw|Xw,r,u):d))return!1}}return!0}function jh(e){return e===e&&!cn(e)}function Qw(e){for(var t=Va(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,jh(i)]}return t}function kh(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function eT(e){var t=Qw(e);return t.length==1&&t[0][2]?kh(t[0][0],t[0][1]):function(n){return n===e||Zw(n,e,t)}}var tT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nT=/^\w*$/;function Ua(e,t){if(pt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Mo(e)?!0:nT.test(e)||!tT.test(e)||t!=null&&e in Object(t)}var rT="Expected a function";function Ha(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(rT);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(Ha.Cache||It),n}Ha.Cache=It;var iT=500;function oT(e){var t=Ha(e,function(r){return n.size===iT&&n.clear(),r}),n=t.cache;return t}var sT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,aT=/\\(\\)?/g,lT=oT(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(sT,function(n,r,i,o){t.push(i?o.replace(aT,"$1"):r||n)}),t});function cT(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 iu=zt?zt.prototype:void 0,ou=iu?iu.toString:void 0;function Oh(e){if(typeof e=="string")return e;if(pt(e))return cT(e,Oh)+"";if(Mo(e))return ou?ou.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ph(e){return e==null?"":Oh(e)}function Dh(e,t){return pt(e)?e:Ua(e,t)?[e]:lT(Ph(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 $h(e,t){t=Dh(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 uT(e,t,n){var r=e==null?void 0:$h(e,t);return r===void 0?n:r}function dT(e,t){return e!=null&&t in Object(e)}function hT(e,t,n){t=Dh(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)&&Ch(s,i)&&(pt(e)||wh(e)))}function fT(e,t){return e!=null&&hT(e,t,dT)}var pT=1,mT=2;function gT(e,t){return Ua(e)&&jh(t)?kh(ko(e),t):function(n){var r=uT(n,e);return r===void 0&&r===t?fT(n,e):jo(t,r,pT|mT)}}function yT(e){return e}function xT(e){return function(t){return t==null?void 0:t[e]}}function bT(e){return function(t){return $h(t,e)}}function vT(e){return Ua(e)?xT(ko(e)):bT(e)}function ST(e){return typeof e=="function"?e:e==null?yT:typeof e=="object"?pt(e)?gT(e[0],e[1]):eT(e):vT(e)}function ET(e,t){return function(n,r){var i=pt(n)?jE:I2,o={};return i(n,e,ST(r),o)}}var ni=ET(function(e,t,n){IE(e,n,t)}),wT=0;function TT(e){var t=++wT;return Ph(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}],CT=[{id:"continuous"},...$s],MT=["coordsys","tool"];var Ls=(e=>(e.REVOLUTE="REVOLUTE",e.PRISMATIC="PRISMATIC",e))(Ls||{});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)||"",de.makeAutoObservable(this,{},{autoBind:!0}),this.jogger.onBlocked=()=>{this.block()},this.loadFromLocalStorage(),this.disposers.push(de.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 mu.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 CT}get discreteIncrementOptions(){return $s}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:$s.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=TT();this.lock(n);try{return await t()}finally{this.unlock(n)}}}const RT=re.observer(({store:e})=>{const{t}=he.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")})]})})}),AT=({title:e,titleId:t,...n},r)=>_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:19,height:10,fill:"none",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M5.131.312a.9.9 0 0 1 0 1.272L3.07 3.645h12.44l-2.06-2.061A.9.9 0 0 1 14.72.313l3.596 3.596a.9.9 0 0 1 0 1.271l-3.596 3.597a.9.9 0 0 1-1.271-1.272l2.061-2.062H3.07L5.13 7.505A.9.9 0 0 1 3.86 8.777L.263 5.18a.9.9 0 0 1 0-1.271L3.86.312a.9.9 0 0 1 1.271 0",clipRule:"evenodd"})),_T=O.forwardRef(AT),IT=({title:e,titleId:t,...n},r)=>_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:19,height:10,fill:"none",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M5.131.312a.9.9 0 0 1 0 1.272L3.07 3.645h12.44l-2.06-2.061A.9.9 0 0 1 14.72.313l3.596 3.596a.9.9 0 0 1 0 1.271l-3.596 3.597a.9.9 0 0 1-1.271-1.272l2.061-2.062H3.07L5.13 7.505A.9.9 0 0 1 3.86 8.777L.263 5.18a.9.9 0 0 1 0-1.271L3.86.312a.9.9 0 0 1 1.271 0",clipRule:"evenodd"})),jT=O.forwardRef(IT),kT=({title:e,titleId:t,...n},r)=>_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:10,height:19,fill:"none",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M9.522 14.811A.899.899 0 1 0 8.25 13.54L6.19 15.601V3.16L8.25 5.221A.9.9 0 0 0 9.522 3.95L5.926.354a.9.9 0 0 0-1.272 0L1.058 3.95a.9.9 0 1 0 1.271 1.271L4.391 3.16v12.442L2.329 13.54a.899.899 0 1 0-1.271 1.271l3.596 3.597a.9.9 0 0 0 1.272 0z",clipRule:"evenodd"})),OT=O.forwardRef(kT),PT=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"M8 16C5.76667 16 3.875 15.225 2.325 13.675C0.775 12.125 0 10.2333 0 8C0 5.76667 0.775 3.875 2.325 2.325C3.875 0.775 5.76667 0 8 0C9.15 0 10.25 0.2375 11.3 0.7125C12.35 1.1875 13.25 1.86667 14 2.75V0H16V7H9V5H13.2C12.6667 4.06667 11.9375 3.33333 11.0125 2.8C10.0875 2.26667 9.08333 2 8 2C6.33333 2 4.91667 2.58333 3.75 3.75C2.58333 4.91667 2 6.33333 2 8C2 9.66667 2.58333 11.0833 3.75 12.25C4.91667 13.4167 6.33333 14 8 14C9.28333 14 10.4417 13.6333 11.475 12.9C11.0583 14.1 12.5083 12.1667 11.475 12.9L12.9 14.325C11.4667 15.4417 9.83333 16 8 16Z",fill:"white"})),DT=O.forwardRef(PT);function $T(e,t){return jo(e,t)}const Lh=({store:e})=>{const{t}=he.useTranslation(),[n,r]=O.useState(e.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached),i=O.useRef(n);Ft.useAnimationFrame(()=>{const s=e.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached;$T(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(", ")})})},LT=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(LT,{fullWidth:!0,variant:"filled",children:[g.jsxRuntimeExports.jsx(M.InputLabel,{id:t.labelId,children:e}),g.jsxRuntimeExports.jsx(M.Select,{...t})]})}const NT=re.observer(({store:e})=>{var o;const{t}=he.useTranslation(),n=O.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:MT.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))})}),zT=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 su(e,t){return process.env.NODE_ENV==="production"?()=>null:function(...r){return e(...r)||t(...r)}}function cr(e){return typeof e=="string"}function FT(e,t,n){return e===void 0||cr(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 au(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 BT(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){const f=$e(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=au(r),l=au(i),c=t(s),u=$e(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 GT(e,t,n){return typeof e=="function"?e(t,n):e}function Ot(e){var d;const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...o}=e,s=i?{}:GT(n,r),{props:a,internalRef:l}=BT({...o,externalSlotProps:s}),c=eo(l,s==null?void 0:s.ref,(d=e.additionalProps)==null?void 0:d.ref);return FT(t,{...a,ref:c},r)}function lu(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 VT={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function UT(e,t,n=(r,i)=>r===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}const HT=2;function _n(e,t,n,r,i){return n===1?Math.min(e+t,i):Math.max(e-t,r)}function Nh(e,t){return e-t}function cu(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 Li(e,t,n){return(e-t)*100/(n-t)}function YT(e,t,n){return(n-t)*e+t}function WT(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 qT(e,t,n){const r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(WT(t)))}function uu({values:e,newValue:t,index:n}){const r=e.slice();return r[n]=t,r.sort(Nh)}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"?UT(e,t):!1}const KT={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}%`})}},JT=e=>e;let ai;function du(){return ai===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?ai=CSS.supports("touch-action","none"):ai=!0),ai}function XT(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=JT,step:p=1,shiftStep:y=10,tabIndex:v,value:E}=e,w=_.useRef(void 0),[T,C]=_.useState(-1),[S,R]=_.useState(-1),[j,P]=_.useState(!1),N=_.useRef(0),B=_.useRef(null),[b,I]=jS({controlled:E,default:n??l,name:"Slider"}),A=u&&(($,G,W)=>{const ee=$.nativeEvent||$,ue=new ee.constructor(ee.type,ee);Object.defineProperty(ue,"target",{writable:!0,value:{value:G,name:c}}),B.current=G,u(ue,G,W)}),z=Array.isArray(b);let V=z?b.slice().sort(Nh):[b];V=V.map($=>$==null?l:In($,l,a));const Z=s===!0&&p!==null?[...Array(Math.floor((a-l)/p)+1)].map(($,G)=>({value:l+p*G})):s||[],H=Z.map($=>$.value),[se,ae]=_.useState(-1),U=_.useRef(null),be=eo(f,U),Oe=$=>G=>{var ee;const W=Number(G.currentTarget.getAttribute("data-index"));lu(G.target)&&ae(W),R(W),(ee=$==null?void 0:$.onFocus)==null||ee.call($,G)},yt=$=>G=>{var W;lu(G.target)||ae(-1),R(-1),(W=$==null?void 0:$.onBlur)==null||W.call($,G)},je=($,G)=>{const W=Number($.currentTarget.getAttribute("data-index")),ee=V[W],ue=H.indexOf(ee);let K=G;if(Z&&p==null){const Me=H[H.length-1];K>=Me?K=Me:K<=H[0]?K=H[0]:K=K<ee?H[ue-1]:H[ue+1]}if(K=In(K,l,a),z){i&&(K=In(K,V[W-1]||-1/0,V[W+1]||1/0));const Me=K;K=uu({values:V,newValue:K,index:W});let Pe=W;i||(Pe=K.indexOf(Me)),oi({sliderRef:U,activeIndex:Pe})}I(K),ae(W),A&&!si(K,b)&&A($,K,W),d&&d($,B.current??K)},xt=$=>G=>{var W;if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(G.key)){G.preventDefault();const ee=Number(G.currentTarget.getAttribute("data-index")),ue=V[ee];let K=null;if(p!=null){const Me=G.shiftKey?y:p;switch(G.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=H[H.length-1],Pe=H.indexOf(ue),Se=[o?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],Ye=[o?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];Se.includes(G.key)?Pe===0?K=H[0]:K=H[Pe-1]:Ye.includes(G.key)&&(Pe===H.length-1?K=Me:K=H[Pe+1])}K!=null&&je(G,K)}(W=$==null?void 0:$.onKeyDown)==null||W.call($,G)};it(()=>{var $;r&&U.current.contains(document.activeElement)&&(($=document.activeElement)==null||$.blur())},[r]),r&&T!==-1&&C(-1),r&&se!==-1&&ae(-1);const ot=$=>G=>{var W;(W=$.onChange)==null||W.call($,G),je(G,G.target.valueAsNumber)},Ge=_.useRef(void 0);let F=h;o&&h==="horizontal"&&(F+="-reverse");const q=({finger:$,move:G=!1})=>{const{current:W}=U,{width:ee,height:ue,bottom:K,left:Me}=W.getBoundingClientRect();let Pe;F.startsWith("vertical")?Pe=(K-$.y)/ue:Pe=($.x-Me)/ee,F.includes("-reverse")&&(Pe=1-Pe);let Se;if(Se=YT(Pe,l,a),p)Se=qT(Se,p,l);else{const qn=cu(H,Se);Se=H[qn]}Se=In(Se,l,a);let Ye=0;if(z){G?Ye=Ge.current:Ye=cu(V,Se),i&&(Se=In(Se,V[Ye-1]||-1/0,V[Ye+1]||1/0));const qn=Se;Se=uu({values:V,newValue:Se,index:Ye}),i&&G||(Ye=Se.indexOf(qn),Ge.current=Ye)}return{newValue:Se,activeIndex:Ye}},X=Ue($=>{const G=ii($,w);if(!G)return;if(N.current+=1,$.type==="mousemove"&&$.buttons===0){D($);return}const{newValue:W,activeIndex:ee}=q({finger:G,move:!0});oi({sliderRef:U,activeIndex:ee,setActive:C}),I(W),!j&&N.current>HT&&P(!0),A&&!si(W,b)&&A($,W,ee)}),D=Ue($=>{const G=ii($,w);if(P(!1),!G)return;const{newValue:W}=q({finger:G,move:!0});C(-1),$.type==="touchend"&&R(-1),d&&d($,B.current??W),w.current=void 0,Q()}),ne=Ue($=>{if(r)return;du()||$.preventDefault();const G=$.changedTouches[0];G!=null&&(w.current=G.identifier);const W=ii($,w);if(W!==!1){const{newValue:ue,activeIndex:K}=q({finger:W});oi({sliderRef:U,activeIndex:K,setActive:C}),I(ue),A&&!si(ue,b)&&A($,ue,K)}N.current=0;const ee=sr(U.current);ee.addEventListener("touchmove",X,{passive:!0}),ee.addEventListener("touchend",D,{passive:!0})}),Q=_.useCallback(()=>{const $=sr(U.current);$.removeEventListener("mousemove",X),$.removeEventListener("mouseup",D),$.removeEventListener("touchmove",X),$.removeEventListener("touchend",D)},[D,X]);_.useEffect(()=>{const{current:$}=U;return $.addEventListener("touchstart",ne,{passive:du()}),()=>{$.removeEventListener("touchstart",ne),Q()}},[Q,ne]),_.useEffect(()=>{r&&Q()},[r,Q]);const Ae=$=>G=>{var ue;if((ue=$.onMouseDown)==null||ue.call($,G),r||G.defaultPrevented||G.button!==0)return;G.preventDefault();const W=ii(G,w);if(W!==!1){const{newValue:K,activeIndex:Me}=q({finger:W});oi({sliderRef:U,activeIndex:Me,setActive:C}),I(K),A&&!si(K,b)&&A(G,K,Me)}N.current=0;const ee=sr(U.current);ee.addEventListener("mousemove",X,{passive:!0}),ee.addEventListener("mouseup",D)},Ce=Li(z?V[0]:l,l,a),me=Li(V[V.length-1],l,a)-Ce,jt=($={})=>{const G=di($),W={onMouseDown:Ae(G||{})},ee={...G,...W};return{...$,ref:be,...ee}},jr=$=>G=>{var ee;(ee=$.onMouseOver)==null||ee.call($,G);const W=Number(G.currentTarget.getAttribute("data-index"));R(W)},kr=$=>G=>{var W;(W=$.onMouseLeave)==null||W.call($,G),R(-1)},Or=($={})=>{const G=di($),W={onMouseOver:jr(G||{}),onMouseLeave:kr(G||{})};return{...$,...G,...W}},Pr=$=>({pointerEvents:T!==-1&&T!==$?"none":void 0});let vn;return h==="vertical"&&(vn=o?"vertical-rl":"vertical-lr"),{active:T,axis:F,axisProps:KT,dragging:j,focusedThumbIndex:se,getHiddenInputProps:($={})=>{const G=di($),W={onChange:ot(G||{}),onFocus:Oe(G||{}),onBlur:yt(G||{}),onKeyDown:xt(G||{})},ee={...G,...W};return{tabIndex:v,"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,...$,...ee,style:{...VT,direction:o?"rtl":"ltr",width:"100%",height:"100%",writingMode:vn}}},getRootProps:jt,getThumbProps:Or,marks:Z,open:S,range:z,rootRef:be,trackLeap:me,trackOffset:Ce,values:V,getThumbStyle:Pr}}const ZT=e=>!e||!cr(e);function QT(e){return typeof e.main=="string"}function eC(e,t=[]){if(!QT(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function Ya(e=[]){return([,t])=>t&&eC(t,e)}function tC(e){return hn("MuiSlider",e)}const Je=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"]),nC=e=>{const{open:t}=e;return{offset:$e(t&&Je.valueLabelOpen),circle:Je.valueLabelCircle,label:Je.valueLabelLabel}};function zh(e){const{children:t,className:n,value:r}=e,i=nC(e);return t?_.cloneElement(t,{className:t.props.className},g.jsxRuntimeExports.jsxs(_.Fragment,{children:[t.props.children,g.jsxRuntimeExports.jsx("span",{className:$e(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"&&(zh.propTypes={children:x.element.isRequired,className:x.string,value:x.node});function hu(e){return e}const rC=He("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${De(n.color)}`],n.size!=="medium"&&t[`size${De(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"},[`&.${Je.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${Je.dragging}`]:{[`& .${Je.thumb}, & .${Je.track}`]:{transition:"none"}},variants:[...Object.entries(e.palette).filter(Ya()).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}}]}))),iC=He("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}}]}),oC=He("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(Ya()).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)})}}}))]}))),sC=He("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.thumb,t[`thumbColor${De(n.color)}`],n.size!=="medium"&&t[`thumbSize${De(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%)"},[`&.${Je.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(Ya()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${Je.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.alpha((e.vars||e).palette[t].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${Je.active}`]:{boxShadow:`0px 0px 0px 14px ${e.alpha((e.vars||e).palette[t].main,.16)}`}}}))]}))),Fh=He(zh,{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%"},[`&.${Je.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%"},[`&.${Je.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"&&(Fh.propTypes={children:x.element.isRequired,index:x.number.isRequired,open:x.bool.isRequired,value:x.node});const aC=He("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>Vs(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}}]}))),lC=He("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>Vs(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}}]}))),cC=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${De(a)}`,l&&`size${De(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${De(l)}`,a&&`thumbColor${De(a)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Sr(c,tC,s)},uC=({children:e})=>e,Bh=_.forwardRef(function(t,n){const r=za({props:t,name:"MuiSlider"}),i=Lp(),{"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:v,marks:E=!1,max:w=100,min:T=0,name:C,onChange:S,onChangeCommitted:R,orientation:j="horizontal",shiftStep:P=10,size:N="medium",step:B=1,scale:b=hu,slotProps:I,slots:A,tabIndex:z,track:V="normal",value:Z,valueLabelDisplay:H="off",valueLabelFormat:se=hu,...ae}=r,U={...r,isRtl:i,max:w,min:T,classes:h,disabled:p,disableSwap:m,orientation:j,marks:E,color:d,size:N,step:B,shiftStep:P,scale:b,track:V,valueLabelDisplay:H,valueLabelFormat:se},{axisProps:be,getRootProps:Oe,getHiddenInputProps:yt,getThumbProps:je,open:xt,active:ot,axis:Ge,focusedThumbIndex:F,range:q,dragging:X,marks:D,values:ne,trackOffset:Q,trackLeap:Ae,getThumbStyle:Ce}=XT({...U,rootRef:n});U.marked=D.length>0&&D.some(ve=>ve.label),U.dragging=X,U.focusedThumbIndex=F;const me=cC(U),jt=(A==null?void 0:A.root)??c.Root??rC,jr=(A==null?void 0:A.rail)??c.Rail??iC,kr=(A==null?void 0:A.track)??c.Track??oC,Or=(A==null?void 0:A.thumb)??c.Thumb??sC,Pr=(A==null?void 0:A.valueLabel)??c.ValueLabel??Fh,vn=(A==null?void 0:A.mark)??c.Mark??aC,Dr=(A==null?void 0:A.markLabel)??c.MarkLabel??lC,$=(A==null?void 0:A.input)??c.Input??"input",G=(I==null?void 0:I.root)??u.root,W=(I==null?void 0:I.rail)??u.rail,ee=(I==null?void 0:I.track)??u.track,ue=(I==null?void 0:I.thumb)??u.thumb,K=(I==null?void 0:I.valueLabel)??u.valueLabel,Me=(I==null?void 0:I.mark)??u.mark,Pe=(I==null?void 0:I.markLabel)??u.markLabel,Se=(I==null?void 0:I.input)??u.input,Ye=Ot({elementType:jt,getSlotProps:Oe,externalSlotProps:G,externalForwardedProps:ae,additionalProps:{...ZT(jt)&&{as:l}},ownerState:{...U,...G==null?void 0:G.ownerState},className:[me.root,f]}),qn=Ot({elementType:jr,externalSlotProps:W,ownerState:U,className:me.rail}),Kh=Ot({elementType:kr,externalSlotProps:ee,additionalProps:{style:{...be[Ge].offset(Q),...be[Ge].leap(Ae)}},ownerState:{...U,...ee==null?void 0:ee.ownerState},className:me.track}),Po=Ot({elementType:Or,getSlotProps:je,externalSlotProps:ue,ownerState:{...U,...ue==null?void 0:ue.ownerState},className:me.thumb}),Jh=Ot({elementType:Pr,externalSlotProps:K,ownerState:{...U,...K==null?void 0:K.ownerState},className:me.valueLabel}),Do=Ot({elementType:vn,externalSlotProps:Me,ownerState:U,className:me.mark}),$o=Ot({elementType:Dr,externalSlotProps:Pe,ownerState:U,className:me.markLabel}),Xh=Ot({elementType:$,getSlotProps:yt,externalSlotProps:Se,ownerState:U});return g.jsxRuntimeExports.jsxs(jt,{...Ye,children:[g.jsxRuntimeExports.jsx(jr,{...qn}),g.jsxRuntimeExports.jsx(kr,{...Kh}),D.filter(ve=>ve.value>=T&&ve.value<=w).map((ve,_e)=>{const Lo=Li(ve.value,T,w),$r=be[Ge].offset(Lo);let bt;return V===!1?bt=ne.includes(ve.value):bt=V==="normal"&&(q?ve.value>=ne[0]&&ve.value<=ne[ne.length-1]:ve.value<=ne[0])||V==="inverted"&&(q?ve.value<=ne[0]||ve.value>=ne[ne.length-1]:ve.value>=ne[0]),g.jsxRuntimeExports.jsxs(_.Fragment,{children:[g.jsxRuntimeExports.jsx(vn,{"data-index":_e,...Do,...!cr(vn)&&{markActive:bt},style:{...$r,...Do.style},className:$e(Do.className,bt&&me.markActive)}),ve.label!=null?g.jsxRuntimeExports.jsx(Dr,{"aria-hidden":!0,"data-index":_e,...$o,...!cr(Dr)&&{markLabelActive:bt},style:{...$r,...$o.style},className:$e(me.markLabel,$o.className,bt&&me.markLabelActive),children:ve.label}):null]},_e)}),ne.map((ve,_e)=>{const Lo=Li(ve,T,w),$r=be[Ge].offset(Lo),bt=H==="off"?uC:Pr;return g.jsxRuntimeExports.jsx(bt,{...!cr(bt)&&{valueLabelFormat:se,valueLabelDisplay:H,value:typeof se=="function"?se(b(ve),_e):se,index:_e,open:xt===_e||ot===_e||H==="on",disabled:p},...Jh,children:g.jsxRuntimeExports.jsx(Or,{"data-index":_e,...Po,className:$e(me.thumb,Po.className,ot===_e&&me.active,F===_e&&me.focusVisible),style:{...$r,...Ce(_e),...Po.style},children:g.jsxRuntimeExports.jsx($,{"data-index":_e,"aria-label":y?y(_e):o,"aria-valuenow":b(ve),"aria-labelledby":a,"aria-valuetext":v?v(b(ve),_e):s,value:ne[_e],...Xh})})},_e)})]})});process.env.NODE_ENV!=="production"&&(Bh.propTypes={"aria-label":su(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":su(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 dC="[object Number]";function hC(e){return typeof e=="number"||un(e)&&yn(e)==dC}const Gh=re.observer(e=>{var o,s,a;const t=M.useTheme(),{store:n}=e,{t:r}=he.useTranslation();function i(l,c){c===e.velocity||!hC(c)||e.onVelocityChange(c)}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(Bh,{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(Wa,{value:e.velocity.toString()}))]})});function Wa({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 Vh=re.observer(({store:e})=>{const{t}=he.useTranslation(),n=re.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(Gh,{store:e,velocity:e.velocityInDisplayUnits,min:e.minVelocityInDisplayUnits,max:e.maxVelocityInDisplayUnits,onVelocityChange:e.setVelocityFromSlider,disabled:e.isLocked,renderValue:r=>g.jsxRuntimeExports.jsx(Wa,{value:n.valueLabelFormat(r),sx:{minWidth:"111px",span:{transform:"translateY(-1.5px)"}}})})}),fC=re.observer(({store:e,children:t})=>{const{t:n}=he.useTranslation(),r=M.useTheme();function i(h,f){(f==="translate"||f==="rotate")&&e.setSelectedCartesianMotionType(f)}Ft.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,v,E;const p=(E=(v=(y=m.componentsExt)==null?void 0:y.JoggingPanel)==null?void 0:v.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(_T,{}),colors:l("X",e.selectedCartesianMotionType,r)},{id:"y",icon:g.jsxRuntimeExports.jsx(jT,{}),colors:l("Y",e.selectedCartesianMotionType,r)},{id:"z",icon:g.jsxRuntimeExports.jsx(OT,{}),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(NT,{store:e}),g.jsxRuntimeExports.jsx(Vh,{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(zT,{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(DT,{}),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(Lh,{store:e}),t&&g.jsxRuntimeExports.jsx(M.Divider,{}),t]})}),pC=re.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===Ls.PRISMATIC?"mm/s":"rad/s",velocityValue:e.jointCategory===Ls.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(Vh,{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,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.currentMotionType==="rotate",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(Lh,{store:e}),t&&g.jsxRuntimeExports.jsx(M.Divider,{}),t]})}),mC=g.externalizeComponent(re.observer(e=>{const t=mu.isString(e.nova)?new Ft.NovaClient({instanceUrl:e.nova}):e.nova,n=re.useLocalObservable(()=>({joggingStore:null,loadingError:null}));async function r(){de.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)}de.runInAction(()=>{n.joggingStore=i}),e.onSetup&&e.onSetup(i)}catch(i){n.loadingError=i}}return O.useEffect(()=>(r(),e.store?()=>null:()=>{var i;(i=n.joggingStore)==null||i.dispose()}),[e.store,e.nova,e.motionGroupId]),O.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(gC,{store:n.joggingStore,children:e.children}):g.jsxRuntimeExports.jsx(gu.LoadingCover,{message:"Loading jogging",error:n.loadingError})})})),gC=re.observer(({store:e,children:t})=>{const{t:n}=he.useTranslation();function r(){if(e.currentTab.id==="cartesian")return g.jsxRuntimeExports.jsx(g.jsxRuntimeExports.Fragment,{children:g.jsxRuntimeExports.jsx(fC,{store:e,children:t})});if(e.currentTab.id==="joint")return g.jsxRuntimeExports.jsx(g.jsxRuntimeExports.Fragment,{children:g.jsxRuntimeExports.jsx(pC,{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(uE,{fontSize:"small",sx:{mr:1}}):g.jsxRuntimeExports.jsx(dE,{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(RT,{store:e})]})}),Uh=e=>{var a;const{value:t,ref:n}=e,r=M.useTheme(),[i,o]=O.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 O.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})})})},yC=g.externalizeComponent(re.observer(({tcpPose:e,showCopyButton:t=!1})=>{const[n,r]=O.useState(null),i=Ft.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(Uh,{value:i}),t&&g.jsxRuntimeExports.jsx(M.Button,{variant:"contained",color:"secondary",size:"small",onClick:o,sx:{flexShrink:0},children:n||"Copy"})]})})),xC=g.externalizeComponent(re.observer(({joints:e,showCopyButton:t=!1})=>{const[n,r]=O.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(Uh,{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")},de.makeObservable(this,{messages:de.observable,addMessage:de.action,clearMessages:de.action})}}const Ir=(e,t,n)=>({id:n||`${Date.now()}-${Math.random().toString(36).substring(2,11)}`,timestamp:new Date,message:e,level:t}),bC=(e,t)=>Ir(e,"debug",t),vC=(e,t)=>Ir(e,"info",t),SC=(e,t)=>Ir(e,"warning",t),EC=(e,t)=>Ir(e,"error",t),Yh=g.externalizeComponent(re.observer(e=>{var u;const{messages:t=[],onClear:n,height:r=400,sx:i}=e,o=M.useTheme(),s=O.useRef(null);O.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]=O.useState(!1),[m,p]=O.useState(!1),[y,v]=O.useState(!1),E=d.message.length>150,w=async()=>{try{await navigator.clipboard.writeText(d.message),p(!0),setTimeout(()=>p(!1),2e3)}catch(C){console.error("Failed to copy message:",C)}},T=E&&!h?d.message.substring(0,150)+"...":d.message;return g.jsxRuntimeExports.jsx(M.Box,{onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!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:T}),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:w,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))})]})})),wC=g.externalizeComponent(re.observer(e=>{const{store:t,onStoreReady:n,...r}=e,i=O.useRef(n);O.useEffect(()=>{i.current=n},[n]);const o=O.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(Yh,{...r,messages:o.messages,onClear:s})}));function TC(){const e=window.location.href;return e.substring(0,e.indexOf("/",e.indexOf("//")+2))}function CC({baseUrl:e=TC(),...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 MC=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"),RC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{fill:"#38C6F4",fillRule:"evenodd",d:"M6.359 14.25v2.934h7.63v-3.521L10.196 9.87 9 8.674l.859-.859.337-.337.858-.858.565.565.631.63.565.565 1.196-1.195.543-.544 1.196-1.195-1.196-1.196-2.304-2.304L11.054.75 9.86 1.946 3.446 8.359 2.25 9.554l1.196 1.196 2.913 2.913zm1.69 0v1.244h4.249v-1.13L7.804 9.87 6.608 8.674l1.196-1.196L9.86 5.424l.007-.008-.543-.543-4.681 4.681 2.912 2.913.496.496v.113h2.124l1.174 1.174zm3.005-10.022-.294.294-.543-.543.837-.837 2.304 2.304-.543.543-.565-.565z",clipRule:"evenodd"})),AC=O.forwardRef(RC);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 Wh=g.externalizeComponent(re.observer(({setupState:e,className:t})=>{const n=M.useTheme(),{t:r}=he.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}}})})),_C=g.externalizeComponent(re.observer(({robotName:e,robotType:t,setupState:n,PreconditionComponent:r=Wh,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(AC,{})}):g.jsxRuntimeExports.jsx(MC,{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})]})})),IC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"M5.248 21c-.334 0-.619-.116-.853-.35a1.153 1.153 0 0 1-.351-.848c0-.333.117-.616.351-.85.234-.233.519-.35.853-.35H7.24L4.558 9.87a2.881 2.881 0 0 1-1.126-1.042A2.77 2.77 0 0 1 3 7.317c0-.793.28-1.467.838-2.023a2.774 2.774 0 0 1 2.033-.834 2.71 2.71 0 0 1 1.728.585c.494.389.832.887 1.014 1.493h3.58V5.239c0-.22.076-.406.226-.555a.76.76 0 0 1 .558-.224c.136 0 .263.035.381.104.118.07.209.167.273.292v.14l1.835-1.702a.979.979 0 0 1 .52-.279.881.881 0 0 1 .58.091l4.01 1.85a.74.74 0 0 1 .36.364.537.537 0 0 1-.002.474.592.592 0 0 1-.366.323.657.657 0 0 1-.477-.039l-3.858-1.774L13.76 6.59v1.454l2.473 2.233 3.858-1.774a.648.648 0 0 1 .485-.03.571.571 0 0 1 .358.314.513.513 0 0 1 .01.482.79.79 0 0 1-.367.357l-4.011 1.882a.881.881 0 0 1-.58.09.979.979 0 0 1-.52-.278L13.63 9.638v.14a.92.92 0 0 1-.273.275.665.665 0 0 1-.381.12.76.76 0 0 1-.558-.224.752.752 0 0 1-.225-.555V8.096h-3.58a2.82 2.82 0 0 1-.215.54 2.552 2.552 0 0 1-.323.479l5.139 9.488h2.673c.335 0 .62.116.854.35.234.233.35.516.35.849 0 .332-.116.615-.35.849a1.167 1.167 0 0 1-.854.349H5.248Zm.623-12.385c.362 0 .67-.126.924-.378a1.25 1.25 0 0 0 .38-.92 1.25 1.25 0 0 0-.38-.92 1.261 1.261 0 0 0-.924-.379 1.26 1.26 0 0 0-.925.379 1.25 1.25 0 0 0-.38.92c0 .36.127.667.38.92.254.252.562.378.925.378Z"})),jC=O.forwardRef(IC),kC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"m13.37 9.12 1.69 1.69 2.99-2.99-3.73-3.73-.95-.95-7.66 7.66-.95.95 3.99 3.99v3.44h7.55v-3.55l-4.72-4.72 1.79-1.79Zm-.91-2.99.91-.91 2.6 2.6-.91.91-2.6-2.6Zm-2.25 10.24h3.74l-1.34-1.34-.04-.04h-2.5l-3.25-3.25 4.59-4.59.92.92L9.5 10.9l5.33 5.33v1.48H10.2v-1.35l.01.01ZM2 2v4.99h1.41V3.4h3.58V2H2ZM22.21 2h-4.98v1.41h3.59v3.58h1.4V2h-.01ZM20.81 20.65h-3.58v1.4h4.98v-4.99h-1.4v3.59ZM3.4 17.06H2v4.98h4.99v-1.4H3.4v-3.58Z"})),OC=O.forwardRef(kC),dt=re.observer(({id:e,icon:t,color:n,title:r,name:i,label:o,explanation:s,literalValue:a,anchorOrigin:l,transformOrigin:c})=>{const u=re.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})]})})]})}),PC=re.observer(({isVirtual:e,motionGroupId:t,anchorOrigin:n,transformOrigin:r,compact:i})=>{const o=M.useTheme(),s=O.useId(),{t:a}=he.useTranslation();return e?g.jsxRuntimeExports.jsx(dt,{id:`motion-group-virtual-${s}`,icon:OC,color:o.palette.tertiary.main,name:a("SafetyBar.ControllerType.Virtual.lb"),label:i?null:a("SafetyBar.ControllerType.Virtual.lb"),explanation:g.jsxRuntimeExports.jsxs(he.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(dt,{id:`motion-group-physical-${s}`,icon:jC,color:o.palette.primary.main,name:a("SafetyBar.ControllerType.Physical.lb"),label:i?null:a("SafetyBar.ControllerType.Physical.lb"),explanation:g.jsxRuntimeExports.jsx(he.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})}),DC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.306 2.768c0-.424.344-.768.768-.768h.406C19.53 2 22 4.551 22 7.699c0 3.237-2.51 5.587-5.31 5.703-.84 1.595-2.478 2.677-4.36 2.677a4.845 4.845 0 0 1-3.146-1.163c-.6 1.783 0 3.922 1.79 4.99 1.929 1.149 4.395.467 5.508-1.524l.212-.378a.75.75 0 1 1 1.308.732l-.231.414c-1.524 2.725-4.9 3.66-7.54 2.085-2.716-1.618-3.432-5.037-2.129-7.599a5.22 5.22 0 0 1-.73-2.677c0-2.192 1.335-4.063 3.212-4.793-1.195-1.427-3.29-1.96-5.08-.892-1.928 1.15-2.589 3.696-1.475 5.687l.231.413a.75.75 0 0 1-1.308.732l-.212-.377c-1.524-2.726-.62-6.211 2.02-7.785 2.716-1.619 5.943-.55 7.44 1.897l.13-.001c2.739 0 4.96 2.292 4.96 5.12 0 .284-.023.563-.066.834 1.795-.354 3.288-1.96 3.288-4.095 0-2.3-1.805-4.163-4.032-4.163h-.406a.768.768 0 0 1-.768-.768Zm.496 8.191c0 .286-.033.564-.094.831a3.62 3.62 0 0 1-.672 1.415 3.425 3.425 0 0 1-2.706 1.338 3.402 3.402 0 0 1-2.384-.98 3.598 3.598 0 0 1-.852-1.306 3.677 3.677 0 0 1-.235-1.298c0-1.623 1.046-2.994 2.48-3.435a3.37 3.37 0 0 1 1.522-.107c1.665.264 2.94 1.75 2.94 3.542Z"})),$C=O.forwardRef(DC),LC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"M19.763 16.432 13.516 5.864c-.674-1.152-2.358-1.152-3.049 0l-6.23 10.568C3.563 17.567 4.405 19 5.753 19H18.23c1.364 0 2.206-1.432 1.532-2.568ZM12 8.498c.539 0 .96.428.96.938v.066l-.32 4.708a.639.639 0 0 1-.64.592.639.639 0 0 1-.64-.592l-.32-4.708A.953.953 0 0 1 12 8.498Zm0 8.79c-.556 0-1.01-.444-1.01-.987 0-.544.454-.988 1.01-.988s1.01.444 1.01.988c0 .542-.454.987-1.01.987Z",fill:"#fff",fillOpacity:.56})),NC=O.forwardRef(LC),zC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"M12.953 5.09a1.497 1.497 0 0 0-1.653-.518l-1.35.43a1.504 1.504 0 0 0-1.726-.376L2.858 6.97c-.736.321-1.06 1.155-.726 1.862.334.707 1.202 1.02 1.937.698l4.27-1.865 1.466 1.973v.402c0 .873-.627 1.63-1.512 1.827l-2.56.567c-1.329.295-2.27 1.431-2.27 2.74v.107c0 .26.22.469.489.469h11.117c1.329 0 2.618.435 3.656 1.233l1.665 1.28A1 1 0 0 0 22 17.47V11.062c0-.312-.108-.616-.308-.863l-3.415-4.218a1.5 1.5 0 0 0-1.618-.471l-.378.12-.866-.475a1.516 1.516 0 0 0-1.188-.114l-1.06.338-.214-.289Z"})),FC=O.forwardRef(zC),BC=re.observer(({operationMode:e,anchorOrigin:t,transformOrigin:n,compact:r})=>{const{t:i}=he.useTranslation(),o=M.useTheme(),s=O.useId();switch(e){case"OPERATION_MODE_AUTO":return g.jsxRuntimeExports.jsx(dt,{id:`operation-mode-auto-${s}`,icon:$C,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(he.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(dt,{id:`operation-mode-manual-${s}`,icon:FC,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(he.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(dt,{id:`operation-mode-error-${s}`,icon:NC,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(he.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})}}),GC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"M19.763 16.432 13.516 5.864c-.674-1.152-2.358-1.152-3.049 0l-6.23 10.568C3.563 17.567 4.405 19 5.753 19H18.23c1.364 0 2.206-1.432 1.532-2.568ZM12 8.498c.539 0 .96.428.96.938v.066l-.32 4.708a.639.639 0 0 1-.64.592.639.639 0 0 1-.64-.592l-.32-4.708A.953.953 0 0 1 12 8.498Zm0 8.79c-.556 0-1.01-.444-1.01-.987 0-.544.454-.988 1.01-.988s1.01.444 1.01.988c0 .542-.454.987-1.01.987Z"})),VC=O.forwardRef(GC),UC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"M10.24 10.636 12 13.764l1.76-3.128h-3.52Z"}),_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.364 12a6.364 6.364 0 1 1-12.728 0 6.364 6.364 0 0 1 12.728 0ZM7.909 9.273 12 16.546l4.09-7.273H7.91Z"}),_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-1.364 0a8.636 8.636 0 1 1-17.273 0 8.636 8.636 0 0 1 17.273 0Z"})),HC=O.forwardRef(UC),YC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"M9.057 15.115c-1.681 0-3.111-.59-4.29-1.768C3.59 12.17 3 10.74 3 9.057c0-.29.021-.582.064-.876a4.1 4.1 0 0 1 .214-.844.78.78 0 0 1 .273-.36c.115-.077.244-.133.389-.168a.857.857 0 0 1 .437.008c.146.04.28.12.4.24l2.806 2.787 2.26-2.261-2.775-2.786a.903.903 0 0 1-.241-.405.875.875 0 0 1-.008-.442 1.13 1.13 0 0 1 .174-.389.82.82 0 0 1 .355-.273c.268-.107.548-.182.838-.224.29-.043.581-.064.871-.064 1.682 0 3.112.59 4.29 1.768 1.179 1.178 1.768 2.608 1.768 4.29 0 .444-.042.858-.126 1.241-.084.384-.21.755-.377 1.113l5.726 5.692A2.2 2.2 0 0 1 21 18.721a2.2 2.2 0 0 1-.662 1.617A2.2 2.2 0 0 1 18.72 21a2.173 2.173 0 0 1-1.617-.679l-5.692-5.709c-.372.161-.75.285-1.133.372-.383.087-.79.13-1.222.13Z",fill:"#fff",fillOpacity:.56})),WC=O.forwardRef(YC),qC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"m10.6 13.8-2.15-2.15a.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275.948.948 0 0 0-.275.7c0 .283.092.517.275.7L9.9 15.9c.2.2.433.3.7.3.267 0 .5-.1.7-.3l5.65-5.65a.948.948 0 0 0 .275-.7.948.948 0 0 0-.275-.7.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275L10.6 13.8ZM12 22a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 2 12c0-1.383.263-2.683.788-3.9a10.099 10.099 0 0 1 2.137-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 12 2c1.383 0 2.683.263 3.9.788a10.098 10.098 0 0 1 3.175 2.137c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 22 12a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 12 22Zm0-2c2.233 0 4.125-.775 5.675-2.325C19.225 16.125 20 14.233 20 12c0-2.233-.775-4.125-2.325-5.675C16.125 4.775 14.233 4 12 4c-2.233 0-4.125.775-5.675 2.325C4.775 7.875 4 9.767 4 12c0 2.233.775 4.125 2.325 5.675C7.875 19.225 9.767 20 12 20Z"})),KC=O.forwardRef(qC),JC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"M9 16h6c.283 0 .52-.096.713-.287A.968.968 0 0 0 16 15V9a.967.967 0 0 0-.287-.713A.968.968 0 0 0 15 8H9a.968.968 0 0 0-.713.287A.968.968 0 0 0 8 9v6c0 .283.096.52.287.713.192.191.43.287.713.287Zm3 6a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 2 12c0-1.383.263-2.683.788-3.9a10.099 10.099 0 0 1 2.137-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 12 2c1.383 0 2.683.263 3.9.788a10.098 10.098 0 0 1 3.175 2.137c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 22 12a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 12 22Zm0-2c2.233 0 4.125-.775 5.675-2.325C19.225 16.125 20 14.233 20 12c0-2.233-.775-4.125-2.325-5.675C16.125 4.775 14.233 4 12 4c-2.233 0-4.125.775-5.675 2.325C4.775 7.875 4 9.767 4 12c0 2.233.775 4.125 2.325 5.675C7.875 19.225 9.767 20 12 20Z"})),XC=O.forwardRef(JC),ZC=re.observer(({safetyState:e,anchorOrigin:t,transformOrigin:n,compact:r})=>{const{t:i}=he.useTranslation(),o=M.useTheme(),s=O.useId();switch(e){case"SAFETY_STATE_NORMAL":return g.jsxRuntimeExports.jsx(dt,{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:KC,color:o.palette.text.secondary,explanation:g.jsxRuntimeExports.jsx(he.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(dt,{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:HC,color:o.palette.error.main,explanation:g.jsxRuntimeExports.jsx(he.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(dt,{id:`safety-state-stop-${s}`,icon:XC,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(he.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(dt,{id:`safety-state-manual-action-required-${s}`,icon:WC,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(he.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(dt,{id:`safety-state-error-${s}`,icon:VC,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(he.Trans,{i18nKey:"SafetyBar.SafetyState.Error.Explanation.lb",children:"The robot controller has entered an unexpected safety state."}),literalValue:e,anchorOrigin:t,transformOrigin:n});default:gu.assertUnreachable(e,`Unknown safety state ${e}`)}}),QC=g.externalizeComponent(re.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(ZC,{safetyState:r,anchorOrigin:i,transformOrigin:o,compact:s}),g.jsxRuntimeExports.jsx(M.Divider,{orientation:"vertical",flexItem:!0}),g.jsxRuntimeExports.jsx(BC,{operationMode:n,anchorOrigin:i,transformOrigin:o,compact:s}),g.jsxRuntimeExports.jsx(M.Divider,{orientation:"vertical",flexItem:!0}),g.jsxRuntimeExports.jsx(PC,{isVirtual:e,motionGroupId:t,anchorOrigin:i,transformOrigin:o,compact:s})]})})),eM=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}}]}}),tM=e=>{const{ref:t,...n}=e;return g.jsxRuntimeExports.jsx(eM,{ref:t,selected:e.selected,...n,color:"secondary",variant:"circular"})};function nM(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 iM=g.externalizeComponent(re.observer(e=>{const{items:t,activeTab:n,defaultActiveTab:r=0,onTabChange:i,sx:o,ref:s}=e,a=n!==void 0,[l,c]=O.useState(r),u=a?n:l;O.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 T,C,S;const m=()=>{if(!h.badge)return;const R=h.badge.content,j=h.badge.max;return typeof R=="number"&&j&&R>j?`${j}+`:R},p=()=>{if(!h.badge)return!1;const R=h.badge.content,j=h.badge.showZero;return!(R===0&&!j)},y=m(),v=p(),E=()=>{a||c(f),i==null||i(f)},w=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 j;return((j=R.palette.backgroundPaperElevation)==null?void 0:j[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 j;return((j=R.palette.backgroundPaperElevation)==null?void 0:j[11])||"#32344B"},color:"text.primary"},"&:focus":{outline:"none"},"&:active":{transform:"none"}}},h.id);return v?g.jsxRuntimeExports.jsx(rM,{component:"span",sx:{display:"inline-flex"},children:g.jsxRuntimeExports.jsx(M.Badge,{badgeContent:y,color:((T=h.badge)==null?void 0:T.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:w})},h.id):w})})}),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(nM,{value:u,index:f,children:h.content},h.id))})]})})),oM=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(":")},fu=(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(" ")},sM=({timerState:e,animationState:t,hasError:n,className:r})=>{const{t:i}=he.useTranslation(),o=Fu(),{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(nf.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:oM(s)})})]})})]})},aM=({timerState:e,animationState:t,hasError:n,compact:r,className:i})=>{const{t:o,i18n:s}=he.useTranslation(),a=Fu(),{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"):fu(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"):fu(l,s.language)})]})},lM=()=>{const[e,t]=O.useState({showPauseAnimation:!1,showErrorAnimation:!1,showMainText:!0}),n=O.useRef(null),r=O.useRef(null),i=O.useRef(null),o=O.useCallback(()=>{t(d=>({...d,showPauseAnimation:!0})),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{t(d=>({...d,showPauseAnimation:!1}))},800)},[]),s=O.useCallback(()=>{t(d=>({...d,showErrorAnimation:!0})),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{t(d=>({...d,showErrorAnimation:!1}))},600)},[]),a=O.useCallback(()=>{t(d=>({...d,showErrorAnimation:!1})),r.current&&clearTimeout(r.current)},[]),l=O.useCallback(()=>{t(d=>({...d,showMainText:!1})),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{t(d=>({...d,showMainText:!0}))},200)},[]),c=O.useCallback(()=>{t(d=>({...d,showMainText:!0}))},[]),u=O.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}},cM=({autoStart:e,hasError:t,onPauseAnimation:n,onErrorAnimation:r,onClearErrorAnimation:i})=>{const[o,s]=O.useState({elapsedTime:0,isRunning:!1,isPausedState:!1,currentProgress:0,wasRunningBeforeError:!1}),a=O.useRef(null),l=O.useRef(null),c=O.useRef(0),u=O.useRef(0),[d]=Ft.useInterpolation([0],{tension:80,friction:18,onChange:([v])=>{s(E=>({...E,currentProgress:v}))}}),h=O.useCallback((v=0)=>{const E=v/60%1*100;s(w=>({...w,elapsedTime:v,isPausedState:!1,currentProgress:E})),c.current=0,u.current=E,d.setImmediate([E]),e?(l.current=Date.now()-v*1e3,s(w=>({...w,isRunning:!0}))):l.current=null},[e,d]),f=O.useCallback(()=>{if(l.current&&o.isRunning){const E=(Date.now()-l.current)/1e3+c.current,w=E/60%1*100;d.setTarget([w]),s(T=>({...T,elapsedTime:Math.floor(E)}))}s(v=>({...v,isRunning:!1,isPausedState:!0})),n()},[o.isRunning,d,n]),m=O.useCallback(()=>{o.isPausedState&&(c.current=o.elapsedTime,l.current=Date.now(),s(v=>({...v,isRunning:!0,isPausedState:!1})))},[o.isPausedState,o.elapsedTime]),p=O.useCallback(()=>{s(v=>({...v,elapsedTime:0,isRunning:!1,isPausedState:!1,currentProgress:0})),c.current=0,l.current=null,u.current=0,d.setImmediate([0])},[d]),y=O.useCallback(()=>o.isPausedState,[o.isPausedState]);return O.useEffect(()=>{t?(o.isRunning&&(s(v=>({...v,wasRunningBeforeError:!0})),f()),r()):(o.wasRunningBeforeError&&!o.isRunning&&(s(v=>({...v,wasRunningBeforeError:!1})),m()),i())},[t,o.isRunning,o.wasRunningBeforeError,f,m,r,i]),O.useEffect(()=>{if(o.isRunning){const v=()=>{if(l.current){const w=(Date.now()-l.current)/1e3+c.current,T=w/60%1*100;s(S=>({...S,elapsedTime:Math.floor(w)})),Math.abs(T-u.current)>.1&&(d.setTarget([T]),u.current=T)}a.current=requestAnimationFrame(v)};a.current=requestAnimationFrame(v)}else a.current&&(cancelAnimationFrame(a.current),a.current=null);return()=>{a.current&&(cancelAnimationFrame(a.current),a.current=null)}},[o.isRunning,d]),O.useEffect(()=>{let v=null;const E=()=>{d.update(),v=requestAnimationFrame(E)};return v=requestAnimationFrame(E),()=>{v&&cancelAnimationFrame(v)}},[d]),{timerState:o,controls:{start:h,pause:f,resume:m,reset:p,isPaused:y}}},uM=g.externalizeComponent(re.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}=lM(),{timerState:h,controls:f}=cM({autoStart:t,hasError:o,onPauseAnimation:a,onErrorAnimation:l,onClearErrorAnimation:c});return O.useEffect(()=>{u()},[u]),O.useEffect(()=>{let m=!0;const p=setTimeout(()=>{m&&e(f)},0);return()=>{m=!1,clearTimeout(p)}},[e,f]),O.useEffect(()=>d,[d]),n==="small"?g.jsxRuntimeExports.jsx(aM,{timerState:h,animationState:s,hasError:o,compact:r,className:i}):g.jsxRuntimeExports.jsx(sM,{timerState:h,animationState:s,hasError:o,className:i})})),pu=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,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&&de.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,pu)||de.runInAction(()=>{this.rapidlyChangingMotionState.joint_position=h.joint_position}),Ba(this.rapidlyChangingMotionState,h,pu)||de.runInAction(()=>{this.rapidlyChangingMotionState.tcp_pose=h.tcp_pose}),this.rapidlyChangingMotionState.standstill!==h.standstill&&de.runInAction(()=>{this.rapidlyChangingMotionState.standstill=h.standstill})}),de.makeAutoObservable(this)}static async connectMultiple(t,n){return Promise.all(n.map(r=>Ni.connect(t,r)))}static async connect(t,n){var v,E;const[r,i]=n.split("@"),o=await t.api.controller.getCurrentRobotControllerState(i),s=o==null?void 0:o.motion_groups.find(w=>w.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=(v=Ie.tryParseJson(l.data))==null?void 0:v.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:
|
|
112
|
+
`))}return!1}const VT={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function UT(e,t,n=(r,i)=>r===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}const HT=2;function _n(e,t,n,r,i){return n===1?Math.min(e+t,i):Math.max(e-t,r)}function Nh(e,t){return e-t}function cu(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 Li(e,t,n){return(e-t)*100/(n-t)}function YT(e,t,n){return(n-t)*e+t}function WT(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 qT(e,t,n){const r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(WT(t)))}function uu({values:e,newValue:t,index:n}){const r=e.slice();return r[n]=t,r.sort(Nh)}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"?UT(e,t):!1}const KT={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}%`})}},JT=e=>e;let ai;function du(){return ai===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?ai=CSS.supports("touch-action","none"):ai=!0),ai}function XT(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=JT,step:p=1,shiftStep:y=10,tabIndex:v,value:E}=e,w=_.useRef(void 0),[T,C]=_.useState(-1),[S,R]=_.useState(-1),[j,P]=_.useState(!1),N=_.useRef(0),B=_.useRef(null),[b,I]=jS({controlled:E,default:n??l,name:"Slider"}),A=u&&(($,G,W)=>{const ee=$.nativeEvent||$,ue=new ee.constructor(ee.type,ee);Object.defineProperty(ue,"target",{writable:!0,value:{value:G,name:c}}),B.current=G,u(ue,G,W)}),z=Array.isArray(b);let V=z?b.slice().sort(Nh):[b];V=V.map($=>$==null?l:In($,l,a));const Z=s===!0&&p!==null?[...Array(Math.floor((a-l)/p)+1)].map(($,G)=>({value:l+p*G})):s||[],H=Z.map($=>$.value),[se,ae]=_.useState(-1),U=_.useRef(null),be=eo(f,U),Oe=$=>G=>{var ee;const W=Number(G.currentTarget.getAttribute("data-index"));lu(G.target)&&ae(W),R(W),(ee=$==null?void 0:$.onFocus)==null||ee.call($,G)},yt=$=>G=>{var W;lu(G.target)||ae(-1),R(-1),(W=$==null?void 0:$.onBlur)==null||W.call($,G)},je=($,G)=>{const W=Number($.currentTarget.getAttribute("data-index")),ee=V[W],ue=H.indexOf(ee);let K=G;if(Z&&p==null){const Me=H[H.length-1];K>=Me?K=Me:K<=H[0]?K=H[0]:K=K<ee?H[ue-1]:H[ue+1]}if(K=In(K,l,a),z){i&&(K=In(K,V[W-1]||-1/0,V[W+1]||1/0));const Me=K;K=uu({values:V,newValue:K,index:W});let Pe=W;i||(Pe=K.indexOf(Me)),oi({sliderRef:U,activeIndex:Pe})}I(K),ae(W),A&&!si(K,b)&&A($,K,W),d&&d($,B.current??K)},xt=$=>G=>{var W;if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(G.key)){G.preventDefault();const ee=Number(G.currentTarget.getAttribute("data-index")),ue=V[ee];let K=null;if(p!=null){const Me=G.shiftKey?y:p;switch(G.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=H[H.length-1],Pe=H.indexOf(ue),Se=[o?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],Ye=[o?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];Se.includes(G.key)?Pe===0?K=H[0]:K=H[Pe-1]:Ye.includes(G.key)&&(Pe===H.length-1?K=Me:K=H[Pe+1])}K!=null&&je(G,K)}(W=$==null?void 0:$.onKeyDown)==null||W.call($,G)};it(()=>{var $;r&&U.current.contains(document.activeElement)&&(($=document.activeElement)==null||$.blur())},[r]),r&&T!==-1&&C(-1),r&&se!==-1&&ae(-1);const ot=$=>G=>{var W;(W=$.onChange)==null||W.call($,G),je(G,G.target.valueAsNumber)},Ge=_.useRef(void 0);let F=h;o&&h==="horizontal"&&(F+="-reverse");const q=({finger:$,move:G=!1})=>{const{current:W}=U,{width:ee,height:ue,bottom:K,left:Me}=W.getBoundingClientRect();let Pe;F.startsWith("vertical")?Pe=(K-$.y)/ue:Pe=($.x-Me)/ee,F.includes("-reverse")&&(Pe=1-Pe);let Se;if(Se=YT(Pe,l,a),p)Se=qT(Se,p,l);else{const qn=cu(H,Se);Se=H[qn]}Se=In(Se,l,a);let Ye=0;if(z){G?Ye=Ge.current:Ye=cu(V,Se),i&&(Se=In(Se,V[Ye-1]||-1/0,V[Ye+1]||1/0));const qn=Se;Se=uu({values:V,newValue:Se,index:Ye}),i&&G||(Ye=Se.indexOf(qn),Ge.current=Ye)}return{newValue:Se,activeIndex:Ye}},X=Ue($=>{const G=ii($,w);if(!G)return;if(N.current+=1,$.type==="mousemove"&&$.buttons===0){D($);return}const{newValue:W,activeIndex:ee}=q({finger:G,move:!0});oi({sliderRef:U,activeIndex:ee,setActive:C}),I(W),!j&&N.current>HT&&P(!0),A&&!si(W,b)&&A($,W,ee)}),D=Ue($=>{const G=ii($,w);if(P(!1),!G)return;const{newValue:W}=q({finger:G,move:!0});C(-1),$.type==="touchend"&&R(-1),d&&d($,B.current??W),w.current=void 0,Q()}),ne=Ue($=>{if(r)return;du()||$.preventDefault();const G=$.changedTouches[0];G!=null&&(w.current=G.identifier);const W=ii($,w);if(W!==!1){const{newValue:ue,activeIndex:K}=q({finger:W});oi({sliderRef:U,activeIndex:K,setActive:C}),I(ue),A&&!si(ue,b)&&A($,ue,K)}N.current=0;const ee=sr(U.current);ee.addEventListener("touchmove",X,{passive:!0}),ee.addEventListener("touchend",D,{passive:!0})}),Q=_.useCallback(()=>{const $=sr(U.current);$.removeEventListener("mousemove",X),$.removeEventListener("mouseup",D),$.removeEventListener("touchmove",X),$.removeEventListener("touchend",D)},[D,X]);_.useEffect(()=>{const{current:$}=U;return $.addEventListener("touchstart",ne,{passive:du()}),()=>{$.removeEventListener("touchstart",ne),Q()}},[Q,ne]),_.useEffect(()=>{r&&Q()},[r,Q]);const Ae=$=>G=>{var ue;if((ue=$.onMouseDown)==null||ue.call($,G),r||G.defaultPrevented||G.button!==0)return;G.preventDefault();const W=ii(G,w);if(W!==!1){const{newValue:K,activeIndex:Me}=q({finger:W});oi({sliderRef:U,activeIndex:Me,setActive:C}),I(K),A&&!si(K,b)&&A(G,K,Me)}N.current=0;const ee=sr(U.current);ee.addEventListener("mousemove",X,{passive:!0}),ee.addEventListener("mouseup",D)},Ce=Li(z?V[0]:l,l,a),me=Li(V[V.length-1],l,a)-Ce,jt=($={})=>{const G=di($),W={onMouseDown:Ae(G||{})},ee={...G,...W};return{...$,ref:be,...ee}},jr=$=>G=>{var ee;(ee=$.onMouseOver)==null||ee.call($,G);const W=Number(G.currentTarget.getAttribute("data-index"));R(W)},kr=$=>G=>{var W;(W=$.onMouseLeave)==null||W.call($,G),R(-1)},Or=($={})=>{const G=di($),W={onMouseOver:jr(G||{}),onMouseLeave:kr(G||{})};return{...$,...G,...W}},Pr=$=>({pointerEvents:T!==-1&&T!==$?"none":void 0});let vn;return h==="vertical"&&(vn=o?"vertical-rl":"vertical-lr"),{active:T,axis:F,axisProps:KT,dragging:j,focusedThumbIndex:se,getHiddenInputProps:($={})=>{const G=di($),W={onChange:ot(G||{}),onFocus:Oe(G||{}),onBlur:yt(G||{}),onKeyDown:xt(G||{})},ee={...G,...W};return{tabIndex:v,"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,...$,...ee,style:{...VT,direction:o?"rtl":"ltr",width:"100%",height:"100%",writingMode:vn}}},getRootProps:jt,getThumbProps:Or,marks:Z,open:S,range:z,rootRef:be,trackLeap:me,trackOffset:Ce,values:V,getThumbStyle:Pr}}const ZT=e=>!e||!cr(e);function QT(e){return typeof e.main=="string"}function eC(e,t=[]){if(!QT(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function Ya(e=[]){return([,t])=>t&&eC(t,e)}function tC(e){return hn("MuiSlider",e)}const Je=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"]),nC=e=>{const{open:t}=e;return{offset:$e(t&&Je.valueLabelOpen),circle:Je.valueLabelCircle,label:Je.valueLabelLabel}};function zh(e){const{children:t,className:n,value:r}=e,i=nC(e);return t?_.cloneElement(t,{className:t.props.className},g.jsxRuntimeExports.jsxs(_.Fragment,{children:[t.props.children,g.jsxRuntimeExports.jsx("span",{className:$e(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"&&(zh.propTypes={children:x.element.isRequired,className:x.string,value:x.node});function hu(e){return e}const rC=He("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${De(n.color)}`],n.size!=="medium"&&t[`size${De(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"},[`&.${Je.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${Je.dragging}`]:{[`& .${Je.thumb}, & .${Je.track}`]:{transition:"none"}},variants:[...Object.entries(e.palette).filter(Ya()).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}}]}))),iC=He("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}}]}),oC=He("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(Ya()).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)})}}}))]}))),sC=He("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.thumb,t[`thumbColor${De(n.color)}`],n.size!=="medium"&&t[`thumbSize${De(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%)"},[`&.${Je.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(Ya()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${Je.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.alpha((e.vars||e).palette[t].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${Je.active}`]:{boxShadow:`0px 0px 0px 14px ${e.alpha((e.vars||e).palette[t].main,.16)}`}}}))]}))),Fh=He(zh,{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%"},[`&.${Je.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%"},[`&.${Je.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"&&(Fh.propTypes={children:x.element.isRequired,index:x.number.isRequired,open:x.bool.isRequired,value:x.node});const aC=He("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>Vs(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}}]}))),lC=He("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>Vs(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}}]}))),cC=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${De(a)}`,l&&`size${De(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${De(l)}`,a&&`thumbColor${De(a)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Sr(c,tC,s)},uC=({children:e})=>e,Bh=_.forwardRef(function(t,n){const r=za({props:t,name:"MuiSlider"}),i=Lp(),{"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:v,marks:E=!1,max:w=100,min:T=0,name:C,onChange:S,onChangeCommitted:R,orientation:j="horizontal",shiftStep:P=10,size:N="medium",step:B=1,scale:b=hu,slotProps:I,slots:A,tabIndex:z,track:V="normal",value:Z,valueLabelDisplay:H="off",valueLabelFormat:se=hu,...ae}=r,U={...r,isRtl:i,max:w,min:T,classes:h,disabled:p,disableSwap:m,orientation:j,marks:E,color:d,size:N,step:B,shiftStep:P,scale:b,track:V,valueLabelDisplay:H,valueLabelFormat:se},{axisProps:be,getRootProps:Oe,getHiddenInputProps:yt,getThumbProps:je,open:xt,active:ot,axis:Ge,focusedThumbIndex:F,range:q,dragging:X,marks:D,values:ne,trackOffset:Q,trackLeap:Ae,getThumbStyle:Ce}=XT({...U,rootRef:n});U.marked=D.length>0&&D.some(ve=>ve.label),U.dragging=X,U.focusedThumbIndex=F;const me=cC(U),jt=(A==null?void 0:A.root)??c.Root??rC,jr=(A==null?void 0:A.rail)??c.Rail??iC,kr=(A==null?void 0:A.track)??c.Track??oC,Or=(A==null?void 0:A.thumb)??c.Thumb??sC,Pr=(A==null?void 0:A.valueLabel)??c.ValueLabel??Fh,vn=(A==null?void 0:A.mark)??c.Mark??aC,Dr=(A==null?void 0:A.markLabel)??c.MarkLabel??lC,$=(A==null?void 0:A.input)??c.Input??"input",G=(I==null?void 0:I.root)??u.root,W=(I==null?void 0:I.rail)??u.rail,ee=(I==null?void 0:I.track)??u.track,ue=(I==null?void 0:I.thumb)??u.thumb,K=(I==null?void 0:I.valueLabel)??u.valueLabel,Me=(I==null?void 0:I.mark)??u.mark,Pe=(I==null?void 0:I.markLabel)??u.markLabel,Se=(I==null?void 0:I.input)??u.input,Ye=Ot({elementType:jt,getSlotProps:Oe,externalSlotProps:G,externalForwardedProps:ae,additionalProps:{...ZT(jt)&&{as:l}},ownerState:{...U,...G==null?void 0:G.ownerState},className:[me.root,f]}),qn=Ot({elementType:jr,externalSlotProps:W,ownerState:U,className:me.rail}),Kh=Ot({elementType:kr,externalSlotProps:ee,additionalProps:{style:{...be[Ge].offset(Q),...be[Ge].leap(Ae)}},ownerState:{...U,...ee==null?void 0:ee.ownerState},className:me.track}),Po=Ot({elementType:Or,getSlotProps:je,externalSlotProps:ue,ownerState:{...U,...ue==null?void 0:ue.ownerState},className:me.thumb}),Jh=Ot({elementType:Pr,externalSlotProps:K,ownerState:{...U,...K==null?void 0:K.ownerState},className:me.valueLabel}),Do=Ot({elementType:vn,externalSlotProps:Me,ownerState:U,className:me.mark}),$o=Ot({elementType:Dr,externalSlotProps:Pe,ownerState:U,className:me.markLabel}),Xh=Ot({elementType:$,getSlotProps:yt,externalSlotProps:Se,ownerState:U});return g.jsxRuntimeExports.jsxs(jt,{...Ye,children:[g.jsxRuntimeExports.jsx(jr,{...qn}),g.jsxRuntimeExports.jsx(kr,{...Kh}),D.filter(ve=>ve.value>=T&&ve.value<=w).map((ve,_e)=>{const Lo=Li(ve.value,T,w),$r=be[Ge].offset(Lo);let bt;return V===!1?bt=ne.includes(ve.value):bt=V==="normal"&&(q?ve.value>=ne[0]&&ve.value<=ne[ne.length-1]:ve.value<=ne[0])||V==="inverted"&&(q?ve.value<=ne[0]||ve.value>=ne[ne.length-1]:ve.value>=ne[0]),g.jsxRuntimeExports.jsxs(_.Fragment,{children:[g.jsxRuntimeExports.jsx(vn,{"data-index":_e,...Do,...!cr(vn)&&{markActive:bt},style:{...$r,...Do.style},className:$e(Do.className,bt&&me.markActive)}),ve.label!=null?g.jsxRuntimeExports.jsx(Dr,{"aria-hidden":!0,"data-index":_e,...$o,...!cr(Dr)&&{markLabelActive:bt},style:{...$r,...$o.style},className:$e(me.markLabel,$o.className,bt&&me.markLabelActive),children:ve.label}):null]},_e)}),ne.map((ve,_e)=>{const Lo=Li(ve,T,w),$r=be[Ge].offset(Lo),bt=H==="off"?uC:Pr;return g.jsxRuntimeExports.jsx(bt,{...!cr(bt)&&{valueLabelFormat:se,valueLabelDisplay:H,value:typeof se=="function"?se(b(ve),_e):se,index:_e,open:xt===_e||ot===_e||H==="on",disabled:p},...Jh,children:g.jsxRuntimeExports.jsx(Or,{"data-index":_e,...Po,className:$e(me.thumb,Po.className,ot===_e&&me.active,F===_e&&me.focusVisible),style:{...$r,...Ce(_e),...Po.style},children:g.jsxRuntimeExports.jsx($,{"data-index":_e,"aria-label":y?y(_e):o,"aria-valuenow":b(ve),"aria-labelledby":a,"aria-valuetext":v?v(b(ve),_e):s,value:ne[_e],...Xh})})},_e)})]})});process.env.NODE_ENV!=="production"&&(Bh.propTypes={"aria-label":su(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":su(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 dC="[object Number]";function hC(e){return typeof e=="number"||un(e)&&yn(e)==dC}const Gh=re.observer(e=>{var o,s,a;const t=M.useTheme(),{store:n}=e,{t:r}=he.useTranslation();function i(l,c){c===e.velocity||!hC(c)||e.onVelocityChange(c)}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(Bh,{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(Wa,{value:e.velocity.toString()}))]})});function Wa({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 Vh=re.observer(({store:e})=>{const{t}=he.useTranslation(),n=re.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(Gh,{store:e,velocity:e.velocityInDisplayUnits,min:e.minVelocityInDisplayUnits,max:e.maxVelocityInDisplayUnits,onVelocityChange:e.setVelocityFromSlider,disabled:e.isLocked,renderValue:r=>g.jsxRuntimeExports.jsx(Wa,{value:n.valueLabelFormat(r),sx:{minWidth:"111px",span:{transform:"translateY(-1.5px)"}}})})}),fC=re.observer(({store:e,children:t})=>{const{t:n}=he.useTranslation(),r=M.useTheme();function i(h,f){(f==="translate"||f==="rotate")&&e.setSelectedCartesianMotionType(f)}Ft.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,v,E;const p=(E=(v=(y=m.componentsExt)==null?void 0:y.JoggingPanel)==null?void 0:v.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(_T,{}),colors:l("X",e.selectedCartesianMotionType,r)},{id:"y",icon:g.jsxRuntimeExports.jsx(jT,{}),colors:l("Y",e.selectedCartesianMotionType,r)},{id:"z",icon:g.jsxRuntimeExports.jsx(OT,{}),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(NT,{store:e}),g.jsxRuntimeExports.jsx(Vh,{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(zT,{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(DT,{}),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(Lh,{store:e}),t&&g.jsxRuntimeExports.jsx(M.Divider,{}),t]})}),pC=re.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===Ls.PRISMATIC?"mm/s":"rad/s",velocityValue:e.jointCategory===Ls.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(Vh,{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,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.currentMotionType==="rotate",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(Lh,{store:e}),t&&g.jsxRuntimeExports.jsx(M.Divider,{}),t]})}),mC=g.externalizeComponent(re.observer(e=>{const t=mu.isString(e.nova)?new Ft.NovaClient({instanceUrl:e.nova}):e.nova,n=re.useLocalObservable(()=>({joggingStore:null,loadingError:null}));async function r(){de.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)}de.runInAction(()=>{n.joggingStore=i}),e.onSetup&&e.onSetup(i)}catch(i){n.loadingError=i}}return O.useEffect(()=>(r(),e.store?()=>null:()=>{var i;(i=n.joggingStore)==null||i.dispose()}),[e.store,e.nova,e.motionGroupId]),O.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(gC,{store:n.joggingStore,children:e.children}):g.jsxRuntimeExports.jsx(gu.LoadingCover,{message:"Loading jogging",error:n.loadingError})})})),gC=re.observer(({store:e,children:t})=>{const{t:n}=he.useTranslation();function r(){if(e.currentTab.id==="cartesian")return g.jsxRuntimeExports.jsx(g.jsxRuntimeExports.Fragment,{children:g.jsxRuntimeExports.jsx(fC,{store:e,children:t})});if(e.currentTab.id==="joint")return g.jsxRuntimeExports.jsx(g.jsxRuntimeExports.Fragment,{children:g.jsxRuntimeExports.jsx(pC,{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(uE,{fontSize:"small",sx:{mr:1}}):g.jsxRuntimeExports.jsx(dE,{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(RT,{store:e})]})}),Uh=e=>{var a;const{value:t,ref:n}=e,r=M.useTheme(),[i,o]=O.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 O.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})})})},yC=g.externalizeComponent(re.observer(({tcpPose:e,showCopyButton:t=!1})=>{const[n,r]=O.useState(null),i=Ft.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(Uh,{value:i}),t&&g.jsxRuntimeExports.jsx(M.Button,{variant:"contained",color:"secondary",size:"small",onClick:o,sx:{flexShrink:0},children:n||"Copy"})]})})),xC=g.externalizeComponent(re.observer(({joints:e,showCopyButton:t=!1})=>{const[n,r]=O.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(Uh,{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")},de.makeObservable(this,{messages:de.observable,addMessage:de.action,clearMessages:de.action})}}const Ir=(e,t,n)=>({id:n||`${Date.now()}-${Math.random().toString(36).substring(2,11)}`,timestamp:new Date,message:e,level:t}),bC=(e,t)=>Ir(e,"debug",t),vC=(e,t)=>Ir(e,"info",t),SC=(e,t)=>Ir(e,"warning",t),EC=(e,t)=>Ir(e,"error",t),Yh=g.externalizeComponent(re.observer(e=>{var u;const{messages:t=[],onClear:n,height:r=400,sx:i}=e,o=M.useTheme(),s=O.useRef(null);O.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]=O.useState(!1),[m,p]=O.useState(!1),[y,v]=O.useState(!1),E=d.message.length>150,w=async()=>{try{await navigator.clipboard.writeText(d.message),p(!0),setTimeout(()=>p(!1),2e3)}catch(C){console.error("Failed to copy message:",C)}},T=E&&!h?d.message.substring(0,150)+"...":d.message;return g.jsxRuntimeExports.jsx(M.Box,{onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!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:T}),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:w,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))})]})})),wC=g.externalizeComponent(re.observer(e=>{const{store:t,onStoreReady:n,...r}=e,i=O.useRef(n);O.useEffect(()=>{i.current=n},[n]);const o=O.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(Yh,{...r,messages:o.messages,onClear:s})}));function TC(){const e=window.location.href;return e.substring(0,e.indexOf("/",e.indexOf("//")+2))}function CC({baseUrl:e=TC(),...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 MC=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"),RC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{fill:"#38C6F4",fillRule:"evenodd",d:"M6.359 14.25v2.934h7.63v-3.521L10.196 9.87 9 8.674l.859-.859.337-.337.858-.858.565.565.631.63.565.565 1.196-1.195.543-.544 1.196-1.195-1.196-1.196-2.304-2.304L11.054.75 9.86 1.946 3.446 8.359 2.25 9.554l1.196 1.196 2.913 2.913zm1.69 0v1.244h4.249v-1.13L7.804 9.87 6.608 8.674l1.196-1.196L9.86 5.424l.007-.008-.543-.543-4.681 4.681 2.912 2.913.496.496v.113h2.124l1.174 1.174zm3.005-10.022-.294.294-.543-.543.837-.837 2.304 2.304-.543.543-.565-.565z",clipRule:"evenodd"})),AC=O.forwardRef(RC);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 Wh=g.externalizeComponent(re.observer(({setupState:e,className:t})=>{const n=M.useTheme(),{t:r}=he.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}}})})),_C=g.externalizeComponent(re.observer(({robotName:e,robotType:t,setupState:n,PreconditionComponent:r=Wh,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(AC,{})}):g.jsxRuntimeExports.jsx(MC,{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})]})})),IC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"M5.248 21c-.334 0-.619-.116-.853-.35a1.153 1.153 0 0 1-.351-.848c0-.333.117-.616.351-.85.234-.233.519-.35.853-.35H7.24L4.558 9.87a2.881 2.881 0 0 1-1.126-1.042A2.77 2.77 0 0 1 3 7.317c0-.793.28-1.467.838-2.023a2.774 2.774 0 0 1 2.033-.834 2.71 2.71 0 0 1 1.728.585c.494.389.832.887 1.014 1.493h3.58V5.239c0-.22.076-.406.226-.555a.76.76 0 0 1 .558-.224c.136 0 .263.035.381.104.118.07.209.167.273.292v.14l1.835-1.702a.979.979 0 0 1 .52-.279.881.881 0 0 1 .58.091l4.01 1.85a.74.74 0 0 1 .36.364.537.537 0 0 1-.002.474.592.592 0 0 1-.366.323.657.657 0 0 1-.477-.039l-3.858-1.774L13.76 6.59v1.454l2.473 2.233 3.858-1.774a.648.648 0 0 1 .485-.03.571.571 0 0 1 .358.314.513.513 0 0 1 .01.482.79.79 0 0 1-.367.357l-4.011 1.882a.881.881 0 0 1-.58.09.979.979 0 0 1-.52-.278L13.63 9.638v.14a.92.92 0 0 1-.273.275.665.665 0 0 1-.381.12.76.76 0 0 1-.558-.224.752.752 0 0 1-.225-.555V8.096h-3.58a2.82 2.82 0 0 1-.215.54 2.552 2.552 0 0 1-.323.479l5.139 9.488h2.673c.335 0 .62.116.854.35.234.233.35.516.35.849 0 .332-.116.615-.35.849a1.167 1.167 0 0 1-.854.349H5.248Zm.623-12.385c.362 0 .67-.126.924-.378a1.25 1.25 0 0 0 .38-.92 1.25 1.25 0 0 0-.38-.92 1.261 1.261 0 0 0-.924-.379 1.26 1.26 0 0 0-.925.379 1.25 1.25 0 0 0-.38.92c0 .36.127.667.38.92.254.252.562.378.925.378Z"})),jC=O.forwardRef(IC),kC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"m13.37 9.12 1.69 1.69 2.99-2.99-3.73-3.73-.95-.95-7.66 7.66-.95.95 3.99 3.99v3.44h7.55v-3.55l-4.72-4.72 1.79-1.79Zm-.91-2.99.91-.91 2.6 2.6-.91.91-2.6-2.6Zm-2.25 10.24h3.74l-1.34-1.34-.04-.04h-2.5l-3.25-3.25 4.59-4.59.92.92L9.5 10.9l5.33 5.33v1.48H10.2v-1.35l.01.01ZM2 2v4.99h1.41V3.4h3.58V2H2ZM22.21 2h-4.98v1.41h3.59v3.58h1.4V2h-.01ZM20.81 20.65h-3.58v1.4h4.98v-4.99h-1.4v3.59ZM3.4 17.06H2v4.98h4.99v-1.4H3.4v-3.58Z"})),OC=O.forwardRef(kC),dt=re.observer(({id:e,icon:t,color:n,title:r,name:i,label:o,explanation:s,literalValue:a,anchorOrigin:l,transformOrigin:c})=>{const u=re.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})]})})]})}),PC=re.observer(({isVirtual:e,motionGroupId:t,anchorOrigin:n,transformOrigin:r,compact:i})=>{const o=M.useTheme(),s=O.useId(),{t:a}=he.useTranslation();return e?g.jsxRuntimeExports.jsx(dt,{id:`motion-group-virtual-${s}`,icon:OC,color:o.palette.tertiary.main,name:a("SafetyBar.ControllerType.Virtual.lb"),label:i?null:a("SafetyBar.ControllerType.Virtual.lb"),explanation:g.jsxRuntimeExports.jsxs(he.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(dt,{id:`motion-group-physical-${s}`,icon:jC,color:o.palette.primary.main,name:a("SafetyBar.ControllerType.Physical.lb"),label:i?null:a("SafetyBar.ControllerType.Physical.lb"),explanation:g.jsxRuntimeExports.jsx(he.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})}),DC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.306 2.768c0-.424.344-.768.768-.768h.406C19.53 2 22 4.551 22 7.699c0 3.237-2.51 5.587-5.31 5.703-.84 1.595-2.478 2.677-4.36 2.677a4.845 4.845 0 0 1-3.146-1.163c-.6 1.783 0 3.922 1.79 4.99 1.929 1.149 4.395.467 5.508-1.524l.212-.378a.75.75 0 1 1 1.308.732l-.231.414c-1.524 2.725-4.9 3.66-7.54 2.085-2.716-1.618-3.432-5.037-2.129-7.599a5.22 5.22 0 0 1-.73-2.677c0-2.192 1.335-4.063 3.212-4.793-1.195-1.427-3.29-1.96-5.08-.892-1.928 1.15-2.589 3.696-1.475 5.687l.231.413a.75.75 0 0 1-1.308.732l-.212-.377c-1.524-2.726-.62-6.211 2.02-7.785 2.716-1.619 5.943-.55 7.44 1.897l.13-.001c2.739 0 4.96 2.292 4.96 5.12 0 .284-.023.563-.066.834 1.795-.354 3.288-1.96 3.288-4.095 0-2.3-1.805-4.163-4.032-4.163h-.406a.768.768 0 0 1-.768-.768Zm.496 8.191c0 .286-.033.564-.094.831a3.62 3.62 0 0 1-.672 1.415 3.425 3.425 0 0 1-2.706 1.338 3.402 3.402 0 0 1-2.384-.98 3.598 3.598 0 0 1-.852-1.306 3.677 3.677 0 0 1-.235-1.298c0-1.623 1.046-2.994 2.48-3.435a3.37 3.37 0 0 1 1.522-.107c1.665.264 2.94 1.75 2.94 3.542Z"})),$C=O.forwardRef(DC),LC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"M19.763 16.432 13.516 5.864c-.674-1.152-2.358-1.152-3.049 0l-6.23 10.568C3.563 17.567 4.405 19 5.753 19H18.23c1.364 0 2.206-1.432 1.532-2.568ZM12 8.498c.539 0 .96.428.96.938v.066l-.32 4.708a.639.639 0 0 1-.64.592.639.639 0 0 1-.64-.592l-.32-4.708A.953.953 0 0 1 12 8.498Zm0 8.79c-.556 0-1.01-.444-1.01-.987 0-.544.454-.988 1.01-.988s1.01.444 1.01.988c0 .542-.454.987-1.01.987Z",fill:"#fff",fillOpacity:.56})),NC=O.forwardRef(LC),zC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"M12.953 5.09a1.497 1.497 0 0 0-1.653-.518l-1.35.43a1.504 1.504 0 0 0-1.726-.376L2.858 6.97c-.736.321-1.06 1.155-.726 1.862.334.707 1.202 1.02 1.937.698l4.27-1.865 1.466 1.973v.402c0 .873-.627 1.63-1.512 1.827l-2.56.567c-1.329.295-2.27 1.431-2.27 2.74v.107c0 .26.22.469.489.469h11.117c1.329 0 2.618.435 3.656 1.233l1.665 1.28A1 1 0 0 0 22 17.47V11.062c0-.312-.108-.616-.308-.863l-3.415-4.218a1.5 1.5 0 0 0-1.618-.471l-.378.12-.866-.475a1.516 1.516 0 0 0-1.188-.114l-1.06.338-.214-.289Z"})),FC=O.forwardRef(zC),BC=re.observer(({operationMode:e,anchorOrigin:t,transformOrigin:n,compact:r})=>{const{t:i}=he.useTranslation(),o=M.useTheme(),s=O.useId();switch(e){case"OPERATION_MODE_AUTO":return g.jsxRuntimeExports.jsx(dt,{id:`operation-mode-auto-${s}`,icon:$C,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(he.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(dt,{id:`operation-mode-manual-${s}`,icon:FC,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(he.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(dt,{id:`operation-mode-error-${s}`,icon:NC,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(he.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})}}),GC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"M19.763 16.432 13.516 5.864c-.674-1.152-2.358-1.152-3.049 0l-6.23 10.568C3.563 17.567 4.405 19 5.753 19H18.23c1.364 0 2.206-1.432 1.532-2.568ZM12 8.498c.539 0 .96.428.96.938v.066l-.32 4.708a.639.639 0 0 1-.64.592.639.639 0 0 1-.64-.592l-.32-4.708A.953.953 0 0 1 12 8.498Zm0 8.79c-.556 0-1.01-.444-1.01-.987 0-.544.454-.988 1.01-.988s1.01.444 1.01.988c0 .542-.454.987-1.01.987Z"})),VC=O.forwardRef(GC),UC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"M10.24 10.636 12 13.764l1.76-3.128h-3.52Z"}),_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.364 12a6.364 6.364 0 1 1-12.728 0 6.364 6.364 0 0 1 12.728 0ZM7.909 9.273 12 16.546l4.09-7.273H7.91Z"}),_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-1.364 0a8.636 8.636 0 1 1-17.273 0 8.636 8.636 0 0 1 17.273 0Z"})),HC=O.forwardRef(UC),YC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"M9.057 15.115c-1.681 0-3.111-.59-4.29-1.768C3.59 12.17 3 10.74 3 9.057c0-.29.021-.582.064-.876a4.1 4.1 0 0 1 .214-.844.78.78 0 0 1 .273-.36c.115-.077.244-.133.389-.168a.857.857 0 0 1 .437.008c.146.04.28.12.4.24l2.806 2.787 2.26-2.261-2.775-2.786a.903.903 0 0 1-.241-.405.875.875 0 0 1-.008-.442 1.13 1.13 0 0 1 .174-.389.82.82 0 0 1 .355-.273c.268-.107.548-.182.838-.224.29-.043.581-.064.871-.064 1.682 0 3.112.59 4.29 1.768 1.179 1.178 1.768 2.608 1.768 4.29 0 .444-.042.858-.126 1.241-.084.384-.21.755-.377 1.113l5.726 5.692A2.2 2.2 0 0 1 21 18.721a2.2 2.2 0 0 1-.662 1.617A2.2 2.2 0 0 1 18.72 21a2.173 2.173 0 0 1-1.617-.679l-5.692-5.709c-.372.161-.75.285-1.133.372-.383.087-.79.13-1.222.13Z",fill:"#fff",fillOpacity:.56})),WC=O.forwardRef(YC),qC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"m10.6 13.8-2.15-2.15a.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275.948.948 0 0 0-.275.7c0 .283.092.517.275.7L9.9 15.9c.2.2.433.3.7.3.267 0 .5-.1.7-.3l5.65-5.65a.948.948 0 0 0 .275-.7.948.948 0 0 0-.275-.7.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275L10.6 13.8ZM12 22a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 2 12c0-1.383.263-2.683.788-3.9a10.099 10.099 0 0 1 2.137-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 12 2c1.383 0 2.683.263 3.9.788a10.098 10.098 0 0 1 3.175 2.137c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 22 12a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 12 22Zm0-2c2.233 0 4.125-.775 5.675-2.325C19.225 16.125 20 14.233 20 12c0-2.233-.775-4.125-2.325-5.675C16.125 4.775 14.233 4 12 4c-2.233 0-4.125.775-5.675 2.325C4.775 7.875 4 9.767 4 12c0 2.233.775 4.125 2.325 5.675C7.875 19.225 9.767 20 12 20Z"})),KC=O.forwardRef(qC),JC=({title:e,titleId:t,...n},r)=>_.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t,...n},e?_.createElement("title",{id:t},e):null,_.createElement("path",{d:"M9 16h6c.283 0 .52-.096.713-.287A.968.968 0 0 0 16 15V9a.967.967 0 0 0-.287-.713A.968.968 0 0 0 15 8H9a.968.968 0 0 0-.713.287A.968.968 0 0 0 8 9v6c0 .283.096.52.287.713.192.191.43.287.713.287Zm3 6a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 2 12c0-1.383.263-2.683.788-3.9a10.099 10.099 0 0 1 2.137-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 12 2c1.383 0 2.683.263 3.9.788a10.098 10.098 0 0 1 3.175 2.137c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 22 12a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 12 22Zm0-2c2.233 0 4.125-.775 5.675-2.325C19.225 16.125 20 14.233 20 12c0-2.233-.775-4.125-2.325-5.675C16.125 4.775 14.233 4 12 4c-2.233 0-4.125.775-5.675 2.325C4.775 7.875 4 9.767 4 12c0 2.233.775 4.125 2.325 5.675C7.875 19.225 9.767 20 12 20Z"})),XC=O.forwardRef(JC),ZC=re.observer(({safetyState:e,anchorOrigin:t,transformOrigin:n,compact:r})=>{const{t:i}=he.useTranslation(),o=M.useTheme(),s=O.useId();switch(e){case"SAFETY_STATE_NORMAL":return g.jsxRuntimeExports.jsx(dt,{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:KC,color:o.palette.text.secondary,explanation:g.jsxRuntimeExports.jsx(he.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(dt,{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:HC,color:o.palette.error.main,explanation:g.jsxRuntimeExports.jsx(he.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(dt,{id:`safety-state-stop-${s}`,icon:XC,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(he.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(dt,{id:`safety-state-manual-action-required-${s}`,icon:WC,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(he.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(dt,{id:`safety-state-error-${s}`,icon:VC,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(he.Trans,{i18nKey:"SafetyBar.SafetyState.Error.Explanation.lb",children:"The robot controller has entered an unexpected safety state."}),literalValue:e,anchorOrigin:t,transformOrigin:n});default:gu.assertUnreachable(e,`Unknown safety state ${e}`)}}),QC=g.externalizeComponent(re.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(ZC,{safetyState:r,anchorOrigin:i,transformOrigin:o,compact:s}),g.jsxRuntimeExports.jsx(M.Divider,{orientation:"vertical",flexItem:!0}),g.jsxRuntimeExports.jsx(BC,{operationMode:n,anchorOrigin:i,transformOrigin:o,compact:s}),g.jsxRuntimeExports.jsx(M.Divider,{orientation:"vertical",flexItem:!0}),g.jsxRuntimeExports.jsx(PC,{isVirtual:e,motionGroupId:t,anchorOrigin:i,transformOrigin:o,compact:s})]})})),eM=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}}]}}),tM=e=>{const{ref:t,...n}=e;return g.jsxRuntimeExports.jsx(eM,{ref:t,selected:e.selected,...n,color:"secondary",variant:"circular"})};function nM(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 iM=g.externalizeComponent(re.observer(e=>{const{items:t,activeTab:n,defaultActiveTab:r=0,onTabChange:i,sx:o,ref:s}=e,a=n!==void 0,[l,c]=O.useState(r),u=a?n:l;O.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 T,C,S;const m=()=>{if(!h.badge)return;const R=h.badge.content,j=h.badge.max;return typeof R=="number"&&j&&R>j?`${j}+`:R},p=()=>{if(!h.badge)return!1;const R=h.badge.content,j=h.badge.showZero;return!(R===0&&!j)},y=m(),v=p(),E=()=>{a||c(f),i==null||i(f)},w=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 j;return((j=R.palette.backgroundPaperElevation)==null?void 0:j[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 j;return((j=R.palette.backgroundPaperElevation)==null?void 0:j[11])||"#32344B"},color:"text.primary"},"&:focus":{outline:"none"},"&:active":{transform:"none"}}},h.id);return v?g.jsxRuntimeExports.jsx(rM,{component:"span",sx:{display:"inline-flex"},children:g.jsxRuntimeExports.jsx(M.Badge,{badgeContent:y,color:((T=h.badge)==null?void 0:T.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:w})},h.id):w})})}),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(nM,{value:u,index:f,children:h.content},h.id))})]})})),oM=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(":")},fu=(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(" ")},sM=({timerState:e,animationState:t,hasError:n,className:r})=>{const{t:i}=he.useTranslation(),o=Fu(),{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(nf.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:oM(s)})})]})})]})},aM=({timerState:e,animationState:t,hasError:n,compact:r,className:i})=>{const{t:o,i18n:s}=he.useTranslation(),a=Fu(),{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"):fu(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"):fu(l,s.language)})]})},lM=()=>{const[e,t]=O.useState({showPauseAnimation:!1,showErrorAnimation:!1,showMainText:!0}),n=O.useRef(null),r=O.useRef(null),i=O.useRef(null),o=O.useCallback(()=>{t(d=>({...d,showPauseAnimation:!0})),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{t(d=>({...d,showPauseAnimation:!1}))},800)},[]),s=O.useCallback(()=>{t(d=>({...d,showErrorAnimation:!0})),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{t(d=>({...d,showErrorAnimation:!1}))},600)},[]),a=O.useCallback(()=>{t(d=>({...d,showErrorAnimation:!1})),r.current&&clearTimeout(r.current)},[]),l=O.useCallback(()=>{t(d=>({...d,showMainText:!1})),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{t(d=>({...d,showMainText:!0}))},200)},[]),c=O.useCallback(()=>{t(d=>({...d,showMainText:!0}))},[]),u=O.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}},cM=({autoStart:e,hasError:t,onPauseAnimation:n,onErrorAnimation:r,onClearErrorAnimation:i})=>{const[o,s]=O.useState({elapsedTime:0,isRunning:!1,isPausedState:!1,currentProgress:0,wasRunningBeforeError:!1}),a=O.useRef(null),l=O.useRef(null),c=O.useRef(0),u=O.useRef(0),[d]=Ft.useInterpolation([0],{tension:80,friction:18,onChange:([v])=>{s(E=>({...E,currentProgress:v}))}}),h=O.useCallback((v=0)=>{const E=v/60%1*100;s(w=>({...w,elapsedTime:v,isPausedState:!1,currentProgress:E})),c.current=0,u.current=E,d.setImmediate([E]),e?(l.current=Date.now()-v*1e3,s(w=>({...w,isRunning:!0}))):l.current=null},[e,d]),f=O.useCallback(()=>{if(l.current&&o.isRunning){const E=(Date.now()-l.current)/1e3+c.current,w=E/60%1*100;d.setTarget([w]),s(T=>({...T,elapsedTime:Math.floor(E)}))}s(v=>({...v,isRunning:!1,isPausedState:!0})),n()},[o.isRunning,d,n]),m=O.useCallback(()=>{o.isPausedState&&(c.current=o.elapsedTime,l.current=Date.now(),s(v=>({...v,isRunning:!0,isPausedState:!1})))},[o.isPausedState,o.elapsedTime]),p=O.useCallback(()=>{s(v=>({...v,elapsedTime:0,isRunning:!1,isPausedState:!1,currentProgress:0})),c.current=0,l.current=null,u.current=0,d.setImmediate([0])},[d]),y=O.useCallback(()=>o.isPausedState,[o.isPausedState]);return O.useEffect(()=>{t?(o.isRunning&&(s(v=>({...v,wasRunningBeforeError:!0})),f()),r()):(o.wasRunningBeforeError&&!o.isRunning&&(s(v=>({...v,wasRunningBeforeError:!1})),m()),i())},[t,o.isRunning,o.wasRunningBeforeError,f,m,r,i]),O.useEffect(()=>{if(o.isRunning){const v=()=>{if(l.current){const w=(Date.now()-l.current)/1e3+c.current,T=w/60%1*100;s(S=>({...S,elapsedTime:Math.floor(w)})),Math.abs(T-u.current)>.1&&(d.setTarget([T]),u.current=T)}a.current=requestAnimationFrame(v)};a.current=requestAnimationFrame(v)}else a.current&&(cancelAnimationFrame(a.current),a.current=null);return()=>{a.current&&(cancelAnimationFrame(a.current),a.current=null)}},[o.isRunning,d]),O.useEffect(()=>{let v=null;const E=()=>{d.update(),v=requestAnimationFrame(E)};return v=requestAnimationFrame(E),()=>{v&&cancelAnimationFrame(v)}},[d]),{timerState:o,controls:{start:h,pause:f,resume:m,reset:p,isPaused:y}}},uM=g.externalizeComponent(re.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}=lM(),{timerState:h,controls:f}=cM({autoStart:t,hasError:o,onPauseAnimation:a,onErrorAnimation:l,onClearErrorAnimation:c});return O.useEffect(()=>{u()},[u]),O.useEffect(()=>{let m=!0;const p=setTimeout(()=>{m&&e(f)},0);return()=>{m=!1,clearTimeout(p)}},[e,f]),O.useEffect(()=>d,[d]),n==="small"?g.jsxRuntimeExports.jsx(aM,{timerState:h,animationState:s,hasError:o,compact:r,className:i}):g.jsxRuntimeExports.jsx(sM,{timerState:h,animationState:s,hasError:o,className:i})})),pu=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,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&&de.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,pu)||de.runInAction(()=>{this.rapidlyChangingMotionState.joint_position=h.joint_position}),Ba(this.rapidlyChangingMotionState,h,pu)||de.runInAction(()=>{this.rapidlyChangingMotionState.tcp_pose=h.tcp_pose}),this.rapidlyChangingMotionState.standstill!==h.standstill&&de.runInAction(()=>{this.rapidlyChangingMotionState.standstill=h.standstill})}),de.makeAutoObservable(this)}static async connectMultiple(t,n){return Promise.all(n.map(r=>Ni.connect(t,r)))}static async connect(t,n){var v,E;const[r,i]=n.split("@"),o=await t.api.controller.getCurrentRobotControllerState(i),s=o==null?void 0:o.motion_groups.find(w=>w.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=(v=Ie.tryParseJson(l.data))==null?void 0:v.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
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(([w,T])=>({id:w,readable_name:T.name,position:T.pose.position,orientation:T.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
114
|
`,y),new Ni(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 wandelscriptIdentifier(){const t=this.motionGroupId.split("@")[0];return`${this.controllerId.replace(/-/g,"_")}_${t}`}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 Ka.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 Ka.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}de.runInAction(()=>{this.activationState="deactivating"});try{await this.nova.api.controller.setDefaultMode(this.controllerId,"ROBOT_SYSTEM_MODE_MONITOR"),de.runInAction(()=>{this.activationState="inactive"})}catch(t){throw de.runInAction(()=>{this.activationState="active"}),t}}async activate(){if(this.activationState!=="inactive"){console.error("Tried to activate while already activating");return}de.runInAction(()=>{this.activationState="activating"});try{await this.nova.api.controller.setDefaultMode(this.controllerId,"ROBOT_SYSTEM_MODE_CONTROL"),de.runInAction(()=>{this.activationState="active"})}catch(t){throw de.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 qh(){var t,n,r,i,o,s,a;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}},WandelscriptEditor:{monacoTheme:{base:"vs-dark",inherit:!0,rules:[{token:"keyword",foreground:"#b349a9ff"}],colors:{"editor.background":M.rgbToHex(((a=e.palette.backgroundPaperElevation)==null?void 0:a[5])??""),"editor.foreground":"#d4d4d4","editorLineNumber.foreground":"#797979","editorLineNumber.activeForeground":"#e9e9e9","editor.lineHighlightBorder":"#e9e9e911"}}}}}}function hM(){const e=qh();return e.palette.mode="light",e}function fM(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?qh():hM();return zu(n,e)}exports.AppHeader=sf;exports.ConnectedMotionGroup=Ni;exports.CycleTimer=RS;exports.JoggerConnection=Ao;exports.JoggingCartesianAxisControl=Is;exports.JoggingJointValueControl=xh;exports.JoggingPanel=mC;exports.JoggingStore=Oo;exports.LogPanel=wC;exports.LogStore=Hh;exports.LogViewer=Yh;exports.MotionStreamConnection=Ro;exports.NoMotionGroupModal=CC;exports.PoseCartesianValues=yC;exports.PoseJointValues=xC;exports.RobotListItem=_C;exports.RobotSetupReadinessIndicator=Wh;exports.RobotSetupReadinessState=qa;exports.SafetyBar=QC;exports.SelectableFab=tM;exports.TabBar=iM;exports.Timer=uM;exports.VelocitySlider=Gh;exports.VelocitySliderLabel=Wa;exports.WandelbotsDataGrid=mh;exports.createDebugMessage=bC;exports.createErrorMessage=EC;exports.createInfoMessage=vC;exports.createLogMessage=Ir;exports.createNovaMuiTheme=fM;exports.createWarningMessage=SC;exports.jointValuesEqual=Fa;exports.poseEqual=bh;exports.tcpMotionEqual=Ba;exports.unwrapRotationVector=vh;
|
|
115
|
-
//# sourceMappingURL=theming-
|
|
115
|
+
//# sourceMappingURL=theming-Cqo-msxF.cjs.map
|