@wandelbots/wandelbots-js-react-components 2.26.0-pr.feature-update-to-react-19.361.d11d634 → 2.26.0-pr.feature-update-to-react-19.361.e3316bb

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"RobotAnimator.d.ts","sourceRoot":"","sources":["../../../src/components/robots/RobotAnimator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,EACX,wBAAwB,EACzB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAA0B,MAAM,OAAO,CAAA;AAC9C,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,OAAO,CAAA;AAG5C,KAAK,kBAAkB,GAAG;IACxB,0BAA0B,EAAE,wBAAwB,CAAA;IACpD,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACvE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,0BAA0B,EAC1B,YAAY,EACZ,iBAAiB,EACjB,QAAQ,GACT,EAAE,kBAAkB,2CA4DpB"}
1
+ {"version":3,"file":"RobotAnimator.d.ts","sourceRoot":"","sources":["../../../src/components/robots/RobotAnimator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,EACX,wBAAwB,EACzB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAA0B,MAAM,OAAO,CAAA;AAC9C,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,OAAO,CAAA;AAG5C,KAAK,kBAAkB,GAAG;IACxB,0BAA0B,EAAE,wBAAwB,CAAA;IACpD,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACvE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,0BAA0B,EAC1B,YAAY,EACZ,iBAAiB,EACjB,QAAQ,GACT,EAAE,kBAAkB,2CAsEpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=RobotAnimator.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RobotAnimator.test.d.ts","sourceRoot":"","sources":["../../../src/components/robots/RobotAnimator.test.tsx"],"names":[],"mappings":""}
package/dist/index.cjs CHANGED
@@ -103,5 +103,5 @@ and limitations under the License.
103
103
  `,u);const g=(yield t.api.controller.getRobotController(i.controller)).configuration.kind==="VirtualController",m=yield me(this,null,function*(){try{return yield t.api.motionGroupInfos.getMounting(c.motion_group)}catch(W){return console.error(`Error fetching mounting for ${c.motion_group}`,W),null}}),x=t.openReconnectingWebsocket(`/controllers/${i.controller}/state-stream?response_rate=1000`),I=yield x.firstMessage(),G=(n=Rt(I.data))==null?void 0:n.result;if(!G)throw new Error(`Unable to parse initial controller state message ${I.data}`);console.log(`Connected controller state websocket to controller ${i.controller}. Initial state:
104
104
  `,G);const{tcps:N}=yield t.api.motionGroupInfos.listTcps(r),D=yield t.api.motionGroupInfos.getMotionGroupSpecification(r),z=yield t.api.motionGroupInfos.getSafetySetup(r);return new Ki(t,i,c,u,d,g,N,D,z,m,G,x)})}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get modelFromController(){return this.motionGroup.model_from_controller}get wandelscriptIdentifier(){const t=this.motionGroupId.split("@")[0];return`${this.controllerId.replaceAll("-","_")}_${t}`}get joggingVelocityRads(){return this.joggingVelocity*Math.PI/180}get joints(){return this.initialMotionState.state.joint_position.joints.map((t,r)=>({index:r}))}get dhParameters(){return this.motionGroupSpecification.dh_parameters}get safetyZones(){return this.safetySetup.safety_zones}get mountingPosition(){return this.mounting?[this.mounting.pose.position.x/1e3,this.mounting.pose.position.y/1e3,this.mounting.pose.position.z/1e3]:[0,0,0]}get mountingQuaternion(){var t,r,a,o,n,s;const l=new Oe.Vector3(((r=(t=this.mounting)==null?void 0:t.pose.orientation)==null?void 0:r.x)||0,((o=(a=this.mounting)==null?void 0:a.pose.orientation)==null?void 0:o.y)||0,((s=(n=this.mounting)==null?void 0:n.pose.orientation)==null?void 0:s.z)||0),i=l.length(),c=l.normalize();return new Oe.Quaternion().setFromAxisAngle(c,i)}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"}deactivate(){return me(this,null,function*(){if(this.activationState!=="active"){console.error("Tried to deactivate while already deactivating");return}Ae.runInAction(()=>{this.activationState="deactivating"});try{yield this.nova.api.controller.setDefaultMode(this.controllerId,"MODE_MONITOR"),Ae.runInAction(()=>{this.activationState="inactive"})}catch(t){throw Ae.runInAction(()=>{this.activationState="active"}),t}})}activate(){return me(this,null,function*(){if(this.activationState!=="inactive"){console.error("Tried to activate while already activating");return}Ae.runInAction(()=>{this.activationState="activating"});try{yield this.nova.api.controller.setDefaultMode(this.controllerId,"MODE_CONTROL"),Ae.runInAction(()=>{this.activationState="active"})}catch(t){throw Ae.runInAction(()=>{this.activationState="inactive"}),t}})}toggleActivation(){this.activationState==="inactive"?this.activate():this.activationState==="active"&&this.deactivate()}dispose(){this.motionStateSocket.close(),this.connectedJoggingCartesianSocket&&this.connectedJoggingCartesianSocket.close(),this.connectedJoggingJointsSocket&&this.connectedJoggingJointsSocket.close()}setJoggingVelocity(t){this.joggingVelocity=t}},IS=class Yi{constructor(t,r={}){this.motionStream=t,this.opts=r,this.cartesianWebsocket=null,this.jointWebsocket=null,this.cartesianJoggingOpts={}}static open(t,r){return me(this,arguments,function*(a,o,n={}){const s=yield a.connectMotionStream(o);return new Yi(s,n)})}get motionGroupId(){return this.motionStream.motionGroupId}get nova(){return this.motionStream.nova}get numJoints(){return this.motionStream.joints.length}get activeJoggingMode(){return this.cartesianWebsocket?"cartesian":this.jointWebsocket?"joint":"increment"}get activeWebsocket(){return this.cartesianWebsocket||this.jointWebsocket}stop(){return me(this,null,function*(){this.cartesianWebsocket&&this.cartesianWebsocket.sendJson({motion_group:this.motionGroupId,position_direction:{x:0,y:0,z:0},rotation_direction:{x:0,y:0,z:0},position_velocity:0,rotation_velocity:0,tcp:this.cartesianJoggingOpts.tcpId,coordinate_system:this.cartesianJoggingOpts.coordSystemId}),this.jointWebsocket&&this.jointWebsocket.sendJson({motion_group:this.motionGroupId,joint_velocities:new Array(this.numJoints).fill(0)})})}dispose(){this.cartesianWebsocket&&this.cartesianWebsocket.dispose(),this.jointWebsocket&&this.jointWebsocket.dispose()}setJoggingMode(t,r){console.log("Setting jogging mode to",t),r&&($g(this.cartesianJoggingOpts,r)||this.cartesianWebsocket&&(this.cartesianWebsocket.dispose(),this.cartesianWebsocket=null),this.cartesianJoggingOpts=r),t!=="cartesian"&&this.cartesianWebsocket&&(this.cartesianWebsocket.dispose(),this.cartesianWebsocket=null),t!=="joint"&&this.jointWebsocket&&(this.jointWebsocket.dispose(),this.jointWebsocket=null),t==="cartesian"&&!this.cartesianWebsocket&&(this.cartesianWebsocket=this.nova.openReconnectingWebsocket("/motion-groups/move-tcp"),this.cartesianWebsocket.addEventListener("message",a=>{const o=Rt(a.data);if(o&&"error"in o)if(this.opts.onError)this.opts.onError(a.data);else throw new Error(a.data)})),t==="joint"&&!this.jointWebsocket&&(this.jointWebsocket=this.nova.openReconnectingWebsocket("/motion-groups/move-joint"),this.jointWebsocket.addEventListener("message",a=>{const o=Rt(a.data);if(o&&"error"in o)if(this.opts.onError)this.opts.onError(a.data);else throw new Error(a.data)}))}startJointRotation(t){return me(this,arguments,function*({joint:r,direction:a,velocityRadsPerSec:o}){if(!this.jointWebsocket)throw new Error("Joint jogging websocket not connected; call setJoggingMode first");const n=new Array(this.numJoints).fill(0);n[r]=a==="-"?-o:o,this.jointWebsocket.sendJson({motion_group:this.motionGroupId,joint_velocities:n})})}startTCPTranslation(t){return me(this,arguments,function*({axis:r,direction:a,velocityMmPerSec:o}){if(!this.cartesianWebsocket)throw new Error("Cartesian jogging websocket not connected; call setJoggingMode first");const n={x:0,y:0,z:0},s=Object.assign({},n);s[r]=a==="-"?-1:1,this.cartesianWebsocket.sendJson({motion_group:this.motionGroupId,position_direction:s,rotation_direction:n,position_velocity:o,rotation_velocity:0,tcp:this.cartesianJoggingOpts.tcpId,coordinate_system:this.cartesianJoggingOpts.coordSystemId})})}startTCPRotation(t){return me(this,arguments,function*({axis:r,direction:a,velocityRadsPerSec:o}){if(!this.cartesianWebsocket)throw new Error("Cartesian jogging websocket not connected; call setJoggingMode first");const n={x:0,y:0,z:0},s=Object.assign({},n);s[r]=a==="-"?-1:1,this.cartesianWebsocket.sendJson({motion_group:this.motionGroupId,position_direction:n,rotation_direction:s,position_velocity:0,rotation_velocity:o,tcp:this.cartesianJoggingOpts.tcpId,coordinate_system:this.cartesianJoggingOpts.coordSystemId})})}runIncrementalCartesianMotion(t){return me(this,arguments,function*({currentTcpPose:r,currentJoints:a,coordSystemId:o,velocityInRelevantUnits:n,axis:s,direction:l,motion:i}){var c;const d=[];if(!Yg(r.coordinate_system,o))throw new Error(`Current TCP pose coordinate system ${r.coordinate_system} does not match target coordinate system ${o}`);if(i.type==="translate"){const y=Object.assign({},r.position);y[s]+=i.distanceMm*(l==="-"?-1:1),d.push({settings:{limits_override:{tcp_velocity_limit:n}},line:{position:y,orientation:r.orientation,coordinate_system:o}})}else if(i.type==="rotate"){const y=new hr(r.orientation.x,r.orientation.y,r.orientation.z),g=y.length(),m=y.clone().normalize(),x=i.distanceRads*(l==="-"?-1:1),I=new hr(0,0,0);I[s]=1;const G=Math.cos(.5*x)*Math.cos(.5*g),N=Math.sin(.5*x)*Math.sin(.5*g),D=Math.sin(.5*x)*Math.cos(.5*g),z=Math.cos(.5*x)*Math.sin(.5*g),W=I.dot(m),j=I.clone().cross(m),U=2*Math.acos(G-N*W),k=U/Math.sin(.5*U),f=new hr().addScaledVector(j,N).addScaledVector(I,D).addScaledVector(m,z).multiplyScalar(k);d.push({settings:{limits_override:{tcp_orientation_velocity_limit:n}},line:{position:r.position,orientation:f,coordinate_system:o}})}const p=yield this.nova.api.motion.planMotion({motion_group:this.motionGroupId,start_joint_position:a,tcp:this.cartesianJoggingOpts.tcpId,commands:d}),u=(c=p.plan_successful_response)==null?void 0:c.motion;if(!u)throw new Error(`Failed to plan jogging increment motion ${JSON.stringify(p)}`);yield this.nova.api.motion.streamMoveForward(u,100,void 0,void 0,void 0,{timeout:1e3*60})})}runIncrementalJointRotation(t){return me(this,arguments,function*({joint:r,currentJoints:a,velocityRadsPerSec:o,direction:n,distanceRads:s}){var l;const i=[...a.joints];i[r]+=s*(n==="-"?-1:1);const c=new Array(a.joints.length).fill(o),d=yield this.nova.api.motion.planMotion({motion_group:this.motionGroupId,start_joint_position:a,commands:[{settings:{limits_override:{joint_velocity_limits:{joints:c}}},joint_ptp:{joints:i}}]}),p=(l=d.plan_successful_response)==null?void 0:l.motion;if(!p){console.error("Failed to plan jogging increment motion",d);return}yield this.nova.api.motion.streamMoveForward(p,100,void 0,void 0,void 0,{timeout:1e3*60})})}},sl=1e-4;function ES(e,t){const r=new Ze.Vector3(t.x,t.y,t.z),a=new Ze.Vector3(e.x,e.y,e.z),o=r.length(),n=r.normalize();let s=a.length(),l=a.normalize();l.dot(n)<0&&(s=-s,l=l.multiplyScalar(-1));let i=s-o;return i-=2*Math.PI*Math.floor((i+Math.PI)/(2*Math.PI)),s=o+i,l.multiplyScalar(s)}var MS=class Xi{constructor(t,r,a,o,n){this.nova=t,this.controller=r,this.motionGroup=a,this.initialMotionState=o,this.motionStateSocket=n,this.rapidlyChangingMotionState=o,n.addEventListener("message",s=>{var l;const i=(l=Rt(s.data))==null?void 0:l.result;if(!i)throw new Error(`Failed to get motion state for ${this.motionGroupId}: ${s.data}`);Wi(this.rapidlyChangingMotionState.state.joint_position.joints,i.state.joint_position.joints,sl)||Ae.runInAction(()=>{this.rapidlyChangingMotionState.state=i.state}),Qi(this.rapidlyChangingMotionState.tcp_pose,i.tcp_pose,sl)||Ae.runInAction(()=>{this.rapidlyChangingMotionState.tcp_pose==null?this.rapidlyChangingMotionState.tcp_pose=i.tcp_pose:this.rapidlyChangingMotionState.tcp_pose={position:i.tcp_pose.position,orientation:ES(i.tcp_pose.orientation,this.rapidlyChangingMotionState.tcp_pose.orientation),tcp:i.tcp_pose.tcp,coordinate_system:i.tcp_pose.coordinate_system}})}),Ae.makeAutoObservable(this)}static open(t,r){return me(this,null,function*(){var a;const{instances:o}=yield t.api.controller.listControllers(),[n,s]=r.split("@"),l=o.find(u=>u.controller===s),i=l==null?void 0:l.physical_motion_groups.find(u=>u.motion_group===r);if(!l||!i)throw new Error(`Controller ${s} or motion group ${r} not found`);const c=t.openReconnectingWebsocket(`/motion-groups/${r}/state-stream`),d=yield c.firstMessage();console.log("got first message",d);const p=(a=Rt(d.data))==null?void 0:a.result;if(!p)throw new Error(`Unable to parse initial motion state message ${d.data}`);return console.log(`Connected motion state websocket to motion group ${i.motion_group}. Initial state:
105
105
  `,p),new Xi(t,l,i,p,c)})}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get modelFromController(){return this.motionGroup.model_from_controller}get wandelscriptIdentifier(){const t=this.motionGroupId.split("@")[0];return`${this.controllerId.replaceAll("-","_")}_${t}`}get joints(){return this.initialMotionState.state.joint_position.joints.map((t,r)=>({index:r}))}dispose(){this.motionStateSocket.close()}},jS=class{constructor(e,t){this.cellId=e,this.opts=t,this.system=this.withUnwrappedResponsesOnly(gS),this.cell=this.withUnwrappedResponsesOnly(M0),this.deviceConfig=this.withCellId(N0),this.motionGroup=this.withCellId(Z0),this.motionGroupInfos=this.withCellId(tS),this.controller=this.withCellId($0),this.program=this.withCellId(lS),this.programValues=this.withCellId(cS),this.controllerIOs=this.withCellId(k0),this.motionGroupKinematic=this.withCellId(nS),this.motion=this.withCellId(Y0),this.coordinateSystems=this.withCellId(B0),this.application=this.withCellId(rl),this.applicationGlobal=this.withUnwrappedResponsesOnly(rl),this.motionGroupJogging=this.withCellId(aS),this.virtualRobot=this.withCellId(SS),this.virtualRobotSetup=this.withCellId(PS),this.virtualRobotMode=this.withCellId(wS),this.virtualRobotBehavior=this.withCellId(xS),this.libraryProgramMetadata=this.withCellId(q0),this.libraryProgram=this.withCellId(z0),this.libraryRecipeMetadata=this.withCellId(Q0),this.libraryRecipe=this.withCellId(H0),this.storeObject=this.withCellId(fS),this.storeCollisionComponents=this.withCellId(pS),this.storeCollisionScenes=this.withCellId(hS)}withCellId(e){var t,r;const a=new e(hn(cr({},this.opts),{isJsonMime:o=>o==="application/json"}),(t=this.opts.basePath)!=null?t:"",(r=this.opts.axiosInstance)!=null?r:v.create());for(const o of Reflect.ownKeys(Reflect.getPrototypeOf(a)))if(o!=="constructor"&&typeof a[o]=="function"){const n=a[o];a[o]=(...s)=>n.apply(a,[this.cellId,...s]).then(l=>l.data)}return a}withUnwrappedResponsesOnly(e){var t,r;const a=new e(hn(cr({},this.opts),{isJsonMime:o=>o==="application/json"}),(t=this.opts.basePath)!=null?t:"",(r=this.opts.axiosInstance)!=null?r:v.create());for(const o of Reflect.ownKeys(Reflect.getPrototypeOf(a)))if(o!=="constructor"&&typeof a[o]=="function"){const n=a[o];a[o]=(...s)=>n.apply(a,s).then(l=>l.data)}return a}},$S=class{constructor(){this.connections=[]}handleAPIRequest(e){return me(this,null,function*(){var t,r,a;const o=[{method:"GET",path:"/cells/:cellId/controllers",handle(){return{instances:[{controller:"mock-ur5e",model_name:"UniversalRobots::Controller",host:"mock-ur5e",allow_software_install_on_controller:!0,physical_motion_groups:[{motion_group:"0@mock-ur5e",name_from_controller:"UR5e",active:!1,model_from_controller:"UniversalRobots_UR5e"}],has_error:!1,error_details:""}]}}},{method:"GET",path:"/cells/:cellId/controllers/:controllerId",handle(){return{configuration:{kind:"VirtualController",manufacturer:"universalrobots",position:"[0,-1.571,-1.571,-1.571,1.571,-1.571,0]",type:"universalrobots-ur5e"},name:"mock-ur5"}}},{method:"GET",path:"/cells/:cellId/motion-groups/:motionGroupId/specification",handle(){return{dh_parameters:[{alpha:1.5707963267948966,theta:0,a:0,d:162.25,reverse_rotation_direction:!1},{alpha:0,theta:0,a:-425,d:0,reverse_rotation_direction:!1},{alpha:0,theta:0,a:-392.2,d:0,reverse_rotation_direction:!1},{alpha:1.5707963267948966,theta:0,a:0,d:133.3,reverse_rotation_direction:!1},{alpha:-1.5707963267948966,theta:0,a:0,d:99.7,reverse_rotation_direction:!1},{alpha:0,theta:0,a:0,d:99.6,reverse_rotation_direction:!1}],mechanical_joint_limits:[{joint:"JOINTNAME_AXIS_1",lower_limit:-6.335545063018799,upper_limit:6.335545063018799,unlimited:!1},{joint:"JOINTNAME_AXIS_2",lower_limit:-6.335545063018799,upper_limit:6.335545063018799,unlimited:!1},{joint:"JOINTNAME_AXIS_3",lower_limit:-6.335545063018799,upper_limit:6.335545063018799,unlimited:!1},{joint:"JOINTNAME_AXIS_4",lower_limit:-6.335545063018799,upper_limit:6.335545063018799,unlimited:!1},{joint:"JOINTNAME_AXIS_5",lower_limit:-6.335545063018799,upper_limit:6.335545063018799,unlimited:!1},{joint:"JOINTNAME_AXIS_6",lower_limit:-6.335545063018799,upper_limit:6.335545063018799,unlimited:!1}]}}},{method:"GET",path:"/cells/:cellId/motion-groups/:motionGroupId/safety-setup",handle(){return{safety_settings:[{safety_state:"SAFETY_NORMAL",settings:{joint_position_limits:[{joint:"JOINTNAME_AXIS_1",lower_limit:-2.96705961227417,upper_limit:2.96705961227417,unlimited:!1},{joint:"JOINTNAME_AXIS_2",lower_limit:-1.7453292608261108,upper_limit:2.7925267219543457,unlimited:!1},{joint:"JOINTNAME_AXIS_3",lower_limit:-3.3161256313323975,upper_limit:.40142571926116943,unlimited:!1},{joint:"JOINTNAME_AXIS_4",lower_limit:-3.4906585216522217,upper_limit:3.4906585216522217,unlimited:!1},{joint:"JOINTNAME_AXIS_5",lower_limit:-2.4434609413146973,upper_limit:2.4434609413146973,unlimited:!1},{joint:"JOINTNAME_AXIS_6",lower_limit:-4.71238899230957,upper_limit:4.71238899230957,unlimited:!1}],joint_velocity_limits:[{joint:"JOINTNAME_AXIS_1",limit:3.1415927410125732},{joint:"JOINTNAME_AXIS_2",limit:3.1415927410125732},{joint:"JOINTNAME_AXIS_3",limit:3.4906585216522217},{joint:"JOINTNAME_AXIS_4",limit:6.108652591705322},{joint:"JOINTNAME_AXIS_5",limit:6.108652591705322},{joint:"JOINTNAME_AXIS_6",limit:6.981317043304443}],joint_acceleration_limits:[],joint_torque_limits:[],tcp_velocity_limit:1800}}],safety_zones:[{id:1,priority:0,geometry:{compound:{child_geometries:[{convex_hull:{vertices:[{x:-800,y:-1330,z:-1820},{x:1650,y:-1330,z:-1820},{x:1650,y:1330,z:-1820},{x:-800,y:1330,z:-1820}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"box"},{convex_hull:{vertices:[{x:-800,y:-1330,z:-1820},{x:1650,y:-1330,z:-1820},{x:1650,y:-1330,z:1500},{x:-800,y:-1330,z:1500}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"box"},{convex_hull:{vertices:[{x:-800,y:-1330,z:-1820},{x:-800,y:1330,z:-1820},{x:-800,y:1330,z:1500},{x:-800,y:-1330,z:1500}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"box"},{convex_hull:{vertices:[{x:1650,y:1330,z:1500},{x:-800,y:1330,z:1500},{x:-800,y:-1330,z:1500},{x:1650,y:-1330,z:1500}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"box"},{convex_hull:{vertices:[{x:1650,y:1330,z:1500},{x:-800,y:1330,z:1500},{x:-800,y:1330,z:-1820},{x:1650,y:1330,z:-1820}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"box"},{convex_hull:{vertices:[{x:1650,y:1330,z:1500},{x:1650,y:-1330,z:1500},{x:1650,y:-1330,z:-1820},{x:1650,y:1330,z:-1820}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"box"}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"Cell workzone"},motion_group_uid:1},{id:2,priority:0,geometry:{convex_hull:{vertices:[{x:1650,y:1330,z:-1850},{x:865,y:1330,z:-1850},{x:865,y:-720,z:-1850},{x:1650,y:-720,z:-1850},{x:1650,y:1330,z:-920},{x:865,y:1330,z:-920},{x:865,y:-720,z:-920},{x:1650,y:-720,z:-920}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"Transport"},motion_group_uid:1},{id:3,priority:0,geometry:{convex_hull:{vertices:[{x:1650,y:1330,z:-600},{x:865,y:1330,z:-600},{x:865,y:430,z:-600},{x:1650,y:430,z:-600},{x:1650,y:1330,z:-1250},{x:865,y:1330,z:-1250},{x:865,y:430,z:-1250},{x:1650,y:430,z:-1250}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"Tunel"},motion_group_uid:1},{id:4,priority:0,geometry:{convex_hull:{vertices:[{x:1650,y:-760,z:-440},{x:900,y:-760,z:-440},{x:900,y:-1330,z:-440},{x:1650,y:-1330,z:-440},{x:1650,y:-760,z:-1800},{x:900,y:-760,z:-1800},{x:900,y:-1330,z:-1800},{x:1650,y:-1330,z:-1800}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"Fanuc controller"},motion_group_uid:1},{id:6,priority:0,geometry:{convex_hull:{vertices:[{x:-200,y:-200,z:-1900},{x:200,y:-200,z:-1900},{x:200,y:200,z:-1900},{x:-200,y:200,z:-1900},{x:-200,y:-200,z:-350},{x:200,y:-200,z:-350},{x:200,y:200,z:-350},{x:-200,y:200,z:-350}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"Robot base"},motion_group_uid:1}],robot_model_geometries:[{link_index:1,geometry:{sphere:{radius:270},init_pose:{position:{x:-70,y:-70,z:-50},orientation:{x:0,y:0,z:0,w:1}},id:"link1_sphere"}},{link_index:2,geometry:{capsule:{radius:160,cylinder_height:800},init_pose:{position:{x:-450,y:40,z:170},orientation:{x:0,y:-.7071067811865475,z:0,w:.7071067811865476}},id:"link2_capsule"}},{link_index:3,geometry:{sphere:{radius:270},init_pose:{position:{x:-110,y:10,z:-100},orientation:{x:0,y:0,z:0,w:1}},id:"link3_sphere"}},{link_index:4,geometry:{capsule:{radius:110,cylinder_height:600},init_pose:{position:{x:0,y:300,z:40},orientation:{x:-.7071067811865475,y:0,z:0,w:.7071067811865476}},id:"link4_capsule"}},{link_index:5,geometry:{sphere:{radius:75},init_pose:{position:{x:0,y:0,z:-50},orientation:{x:0,y:0,z:0,w:1}},id:"link5_sphere"}}],tool_geometries:[]}}},{method:"GET",path:"/cells/:cellId/coordinate-systems",handle(){return{coordinatesystems:[{coordinate_system:"",name:"world",reference_uid:"",position:{x:0,y:0,z:0},rotation:{angles:[0,0,0],type:"ROTATION_VECTOR"}}]}}},{method:"GET",path:"/cells/:cellId/motion-groups/:motionGroupId/tcps",handle(){return{tcps:[{id:"Flange",readable_name:"Default-Flange",position:{x:0,y:0,z:0},rotation:{angles:[0,0,0,0],type:"ROTATION_VECTOR"}},{id:"complex-tcp-position",readable_name:"Complex TCP Position",position:{x:-200,y:300,z:150},rotation:{angles:[-.12139440409113832,-.06356210998212003,-.2023240068185639,0],type:"ROTATION_VECTOR"}}]}}}],n=((t=e.method)==null?void 0:t.toUpperCase())||"GET",s="/cells"+((a=(r=e.url)==null?void 0:r.split("/cells")[1])==null?void 0:a.split("?")[0]);for(const l of o){const i=AS.match(l.path)(s||"");if(n===l.method&&i){const c=l.handle();return{status:200,statusText:"Success",data:JSON.stringify(c),headers:{},config:e,request:{responseURL:e.url}}}}throw new vn(`No mock handler matched this request: ${n} ${s}`,"404",e)})}handleWebsocketConnection(e){this.connections.push(e),setTimeout(()=>{e.dispatchEvent(new Event("open")),console.log("Websocket connection opened from",e.url),e.url.includes("/state-stream")&&e.dispatchEvent(new MessageEvent("message",{data:JSON.stringify(US)})),e.url.includes("/move-joint")&&e.dispatchEvent(new MessageEvent("message",{data:JSON.stringify({result:{motion_group:"0@ur",state:{controller:"ur",operation_mode:"OPERATION_MODE_AUTO",safety_state:"SAFETY_STATE_NORMAL",timestamp:"2024-09-18T12:48:26.096266444Z",velocity_override:100,motion_groups:[{motion_group:"0@ur",controller:"ur",joint_position:{joints:[1.3492152690887451,-1.5659207105636597,1.6653711795806885,-1.0991662740707397,-1.829018235206604,1.264623761177063]},joint_velocity:{joints:[0,0,0,0,0,0]},flange_pose:{position:{x:6.437331889439328,y:-628.4123774830913,z:577.0569957147832},orientation:{x:-1.683333649797158,y:-1.9783363827298732,z:-.4928031860165713},coordinate_system:""},tcp_pose:{position:{x:6.437331889439328,y:-628.4123774830913,z:577.0569957147832},orientation:{x:-1.683333649797158,y:-1.9783363827298732,z:-.4928031860165713},coordinate_system:"",tcp:"Flange"},velocity:{linear:{x:0,y:0,z:0},angular:{x:-0,y:0,z:0},coordinate_system:""},force:{force:{x:0,y:0,z:0},moment:{x:0,y:0,z:0},coordinate_system:""},joint_limit_reached:{limit_reached:[!1,!1,!1,!1,!1,!1]},joint_current:{joints:[0,0,0,0,0,0]},sequence_number:"671259"}],sequence_number:"671259"},movement_state:"MOVEMENT_STATE_MOVING"}})})),e.url.includes("/move-tcp")&&e.dispatchEvent(new MessageEvent("message",{data:JSON.stringify({result:{motion_group:"0@ur",state:{controller:"ur",operation_mode:"OPERATION_MODE_AUTO",safety_state:"SAFETY_STATE_NORMAL",timestamp:"2024-09-18T12:43:12.188335774Z",velocity_override:100,motion_groups:[{motion_group:"0@ur",controller:"ur",joint_position:{joints:[1.3352527618408203,-1.5659207105636597,1.6653711795806885,-1.110615611076355,-1.829018235206604,1.264623761177063]},joint_velocity:{joints:[0,0,0,0,0,0]},flange_pose:{position:{x:-2.763015284002938,y:-630.2151479701106,z:577.524509114342},orientation:{x:-1.704794877102097,y:-1.9722372952861567,z:-.4852079204210754},coordinate_system:""},tcp_pose:{position:{x:-2.763015284002938,y:-630.2151479701106,z:577.524509114342},orientation:{x:-1.704794877102097,y:-1.9722372952861567,z:-.4852079204210754},coordinate_system:"",tcp:"Flange"},velocity:{linear:{x:0,y:0,z:0},angular:{x:-0,y:0,z:0},coordinate_system:""},force:{force:{x:0,y:0,z:0},moment:{x:0,y:0,z:0},coordinate_system:""},joint_limit_reached:{limit_reached:[!1,!1,!1,!1,!1,!1]},joint_current:{joints:[0,0,0,0,0,0]},sequence_number:"627897"}],sequence_number:"627897"},movement_state:"MOVEMENT_STATE_MOVING"}})}))},10)}handleWebsocketMessage(e,t){console.log(`Received message on ${e.url}`,t)}},US={result:{state:{motion_group:"0@universalrobots-ur5e",controller:"universalrobots-ur5e",joint_position:{joints:[1.1699999570846558,-1.5700000524520874,1.3600000143051147,1.0299999713897705,1.2899999618530273,1.2799999713897705]},joint_velocity:{joints:[0,0,0,0,0,0]},flange_pose:{position:{x:1.3300010259703043,y:-409.2680714682808,z:531.0203477065281},orientation:{x:1.7564919306270736,y:-1.7542521568325058,z:.7326972590614671},coordinate_system:""},tcp_pose:{position:{x:1.3300010259703043,y:-409.2680714682808,z:531.0203477065281},orientation:{x:1.7564919306270736,y:-1.7542521568325058,z:.7326972590614671},coordinate_system:"",tcp:"Flange"},velocity:{linear:{x:0,y:0,z:0},angular:{x:0,y:0,z:0},coordinate_system:""},force:{force:{x:0,y:0,z:0},moment:{x:0,y:0,z:0},coordinate_system:""},joint_limit_reached:{limit_reached:[!1,!1,!1,!1,!1,!1]},joint_current:{joints:[0,0,0,0,0,0]},sequence_number:"1"},tcp_pose:{position:{x:302.90748476115556,y:-152.87065869452337,z:424.0454619321661},orientation:{x:2.3403056115045353,y:-1.1706836379431356,z:.9772511964246311},coordinate_system:"",tcp:"Flange"}}},kS=class{constructor(e){this.authPromise=null,this.accessToken=null;var t;const r=(t=e.cellId)!=null?t:"cell";this.config=cr({cellId:r},e),this.accessToken=e.accessToken||zo.getString("wbjs.access_token")||null,this.config.instanceUrl==="https://mock.example.com"&&(this.mock=new $S);const a=v.create({baseURL:Ko(this.config.instanceUrl,"/api/v1"),headers:{"User-Agent":"Wandelbots-Nova-JS-SDK"}});a.interceptors.request.use(o=>me(this,null,function*(){return o.headers.Authorization||(this.accessToken?o.headers.Authorization=`Bearer ${this.accessToken}`:this.config.username&&this.config.password&&(o.headers.Authorization=`Basic ${btoa(e.username+":"+e.password)}`)),o})),typeof window<"u"&&a.interceptors.response.use(o=>o,o=>me(this,null,function*(){var n,s;if(A0(o))if(((n=o.response)==null?void 0:n.status)===401)try{if(yield this.renewAuthentication(),o.config)return this.accessToken?o.config.headers.Authorization=`Bearer ${this.accessToken}`:delete o.config.headers.Authorization,a.request(o.config)}catch(l){return Promise.reject(l)}else((s=o.response)==null?void 0:s.status)===503&&(yield fetch(window.location.href)).status===503&&window.location.reload();return Promise.reject(o)})),this.api=new jS(r,hn(cr({},e),{basePath:Ko(this.config.instanceUrl,"/api/v1"),isJsonMime:o=>o==="application/json",baseOptions:cr(cr({},this.mock?{adapter:o=>this.mock.handleAPIRequest(o)}:{}),e.baseOptions),axiosInstance:a}))}renewAuthentication(){return me(this,null,function*(){if(!this.authPromise){this.authPromise=Zg(this.config.instanceUrl);try{this.accessToken=yield this.authPromise,this.accessToken?zo.setString("wbjs.access_token",this.accessToken):zo.delete("wbjs.access_token")}finally{this.authPromise=null}}})}makeWebsocketURL(e){const t=new URL(Ko(this.config.instanceUrl,`/api/v1/cells/${this.config.cellId}`,e));return t.protocol=t.protocol.replace("http","ws"),t.protocol=t.protocol.replace("https","wss"),this.accessToken?t.searchParams.append("token",this.accessToken):this.config.username&&this.config.password&&(t.username=this.config.username,t.password=this.config.password),t.toString()}openReconnectingWebsocket(e){return new Qg(this.makeWebsocketURL(e),{mock:this.mock})}connectMotionStream(e){return me(this,null,function*(){return yield MS.open(this,e)})}connectJogger(e){return me(this,null,function*(){return yield IS.open(this,e)})}connectMotionGroups(e){return me(this,null,function*(){const{instances:t}=yield this.api.controller.listControllers();return Promise.all(e.map(r=>TS.connect(this,r,t)))})}connectMotionGroup(e){return me(this,null,function*(){return(yield this.connectMotionGroups([e]))[0]})}};function LS(e){try{return JSON.stringify(e)}catch{return}}function BS(e,t){throw new Error(t+` ${JSON.stringify(e)}`)}function FS(e){var t,r,a,o;return e instanceof vn&&e.code==="ERR_NETWORK"?"Failed to connect to the server. Please check your internet connection.":e instanceof vn&&e.response?`${(t=e.response)==null?void 0:t.status} ${(r=e.response)==null?void 0:r.statusText} from ${(a=e.response)==null?void 0:a.config.url}: ${JSON.stringify((o=e.response)==null?void 0:o.data)}`:e instanceof Error?e.message:`Unexpected error: ${LS(e)||e}`}const Bn=e=>{const t=e.softTimeout||3e3,[r,a]=Y.useState(!1),o=F.useTheme();return Y.useEffect(()=>{const n=setTimeout(()=>{a(!0)},t);return()=>clearTimeout(n)}),b.jsx(F.Stack,{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",sx:{color:o.palette.text.primary},children:e.error?b.jsx(Zi,{loadingMessage:e.message,error:e.error}):b.jsxs(b.Fragment,{children:[b.jsx(F.CircularProgress,{sx:{marginBottom:"24px"}}),!!e.message&&b.jsx("div",{children:e.message}),b.jsx(F.Stack,{sx:{visibility:r?"visible":"hidden",marginTop:"1rem",color:o.palette.text.secondary},children:"This is taking longer than expected..."})]})})},Zi=e=>{const t=FS(e.error),r=e.error instanceof Error?e.error.stack:null,a=F.useTheme();return b.jsxs(F.Stack,{sx:{maxHeight:"100%",maxWidth:"min(100%, 800px)",padding:2,overflow:"auto",color:a.palette.error.main,"& pre":{whiteSpace:"pre-wrap",wordBreak:"break-word",paddingBottom:"3rem"}},children:[(e.loadingMessage?`Error while ${_n.lowerFirst(F.capitalize(e.loadingMessage))} - `:"")+t,b.jsx("br",{}),r&&b.jsx("pre",{children:r})]})},NS=({title:e,titleId:t,...r},a)=>L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:19,height:10,fill:"none",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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"})),DS=Y.forwardRef(NS),zS=({title:e,titleId:t,...r},a)=>L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:19,height:10,fill:"none",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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"})),GS=Y.forwardRef(zS),qS=({title:e,titleId:t,...r},a)=>L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:10,height:19,fill:"none",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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"})),JS=Y.forwardRef(qS),HS=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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"})),WS=Y.forwardRef(HS);function QS(){this.__data__=[],this.size=0}function ec(e,t){return e===t||e!==e&&t!==t}function vo(e,t){for(var r=e.length;r--;)if(ec(e[r][0],t))return r;return-1}var KS=Array.prototype,YS=KS.splice;function XS(e){var t=this.__data__,r=vo(t,e);if(r<0)return!1;var a=t.length-1;return r==a?t.pop():YS.call(t,r,1),--this.size,!0}function ZS(e){var t=this.__data__,r=vo(t,e);return r<0?void 0:t[r][1]}function e1(e){return vo(this.__data__,e)>-1}function t1(e,t){var r=this.__data__,a=vo(r,e);return a<0?(++this.size,r.push([e,t])):r[a][1]=t,this}function St(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}St.prototype.clear=QS;St.prototype.delete=XS;St.prototype.get=ZS;St.prototype.has=e1;St.prototype.set=t1;function r1(){this.__data__=new St,this.size=0}function a1(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function o1(e){return this.__data__.get(e)}function n1(e){return this.__data__.has(e)}var s1="[object AsyncFunction]",l1="[object Function]",i1="[object GeneratorFunction]",c1="[object Proxy]";function tc(e){if(!Ft(e))return!1;var t=qt(e);return t==l1||t==i1||t==s1||t==c1}var Yo=dt["__core-js_shared__"],ll=function(){var e=/[^.]+$/.exec(Yo&&Yo.keys&&Yo.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function d1(e){return!!ll&&ll in e}var p1=Function.prototype,u1=p1.toString;function Ht(e){if(e!=null){try{return u1.call(e)}catch{}try{return e+""}catch{}}return""}var h1=/[\\^$.*+?()[\]{}|]/g,m1=/^\[object .+?Constructor\]$/,f1=Function.prototype,y1=Object.prototype,g1=f1.toString,b1=y1.hasOwnProperty,S1=RegExp("^"+g1.call(b1).replace(h1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v1(e){if(!Ft(e)||d1(e))return!1;var t=tc(e)?S1:m1;return t.test(Ht(e))}function x1(e,t){return e==null?void 0:e[t]}function Wt(e,t){var r=x1(e,t);return v1(r)?r:void 0}var Xr=Wt(dt,"Map"),Zr=Wt(Object,"create");function O1(){this.__data__=Zr?Zr(null):{},this.size=0}function w1(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var C1="__lodash_hash_undefined__",P1=Object.prototype,V1=P1.hasOwnProperty;function R1(e){var t=this.__data__;if(Zr){var r=t[e];return r===C1?void 0:r}return V1.call(t,e)?t[e]:void 0}var _1=Object.prototype,A1=_1.hasOwnProperty;function T1(e){var t=this.__data__;return Zr?t[e]!==void 0:A1.call(t,e)}var I1="__lodash_hash_undefined__";function E1(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Zr&&t===void 0?I1:t,this}function zt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}zt.prototype.clear=O1;zt.prototype.delete=w1;zt.prototype.get=R1;zt.prototype.has=T1;zt.prototype.set=E1;function M1(){this.size=0,this.__data__={hash:new zt,map:new(Xr||St),string:new zt}}function j1(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function xo(e,t){var r=e.__data__;return j1(t)?r[typeof t=="string"?"string":"hash"]:r.map}function $1(e){var t=xo(this,e).delete(e);return this.size-=t?1:0,t}function U1(e){return xo(this,e).get(e)}function k1(e){return xo(this,e).has(e)}function L1(e,t){var r=xo(this,e),a=r.size;return r.set(e,t),this.size+=r.size==a?0:1,this}function vt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}vt.prototype.clear=M1;vt.prototype.delete=$1;vt.prototype.get=U1;vt.prototype.has=k1;vt.prototype.set=L1;var B1=200;function F1(e,t){var r=this.__data__;if(r instanceof St){var a=r.__data__;if(!Xr||a.length<B1-1)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new vt(a)}return r.set(e,t),this.size=r.size,this}function yt(e){var t=this.__data__=new St(e);this.size=t.size}yt.prototype.clear=r1;yt.prototype.delete=a1;yt.prototype.get=o1;yt.prototype.has=n1;yt.prototype.set=F1;var N1="__lodash_hash_undefined__";function D1(e){return this.__data__.set(e,N1),this}function z1(e){return this.__data__.has(e)}function Ha(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new vt;++t<r;)this.add(e[t])}Ha.prototype.add=Ha.prototype.push=D1;Ha.prototype.has=z1;function G1(e,t){for(var r=-1,a=e==null?0:e.length;++r<a;)if(t(e[r],r,e))return!0;return!1}function q1(e,t){return e.has(t)}var J1=1,H1=2;function rc(e,t,r,a,o,n){var s=r&J1,l=e.length,i=t.length;if(l!=i&&!(s&&i>l))return!1;var c=n.get(e),d=n.get(t);if(c&&d)return c==t&&d==e;var p=-1,u=!0,y=r&H1?new Ha:void 0;for(n.set(e,t),n.set(t,e);++p<l;){var g=e[p],m=t[p];if(a)var x=s?a(m,g,p,t,e,n):a(g,m,p,e,t,n);if(x!==void 0){if(x)continue;u=!1;break}if(y){if(!G1(t,function(I,G){if(!q1(y,G)&&(g===I||o(g,I,r,a,n)))return y.push(G)})){u=!1;break}}else if(!(g===m||o(g,m,r,a,n))){u=!1;break}}return n.delete(e),n.delete(t),u}var il=dt.Uint8Array;function W1(e){var t=-1,r=Array(e.size);return e.forEach(function(a,o){r[++t]=[o,a]}),r}function Q1(e){var t=-1,r=Array(e.size);return e.forEach(function(a){r[++t]=a}),r}var K1=1,Y1=2,X1="[object Boolean]",Z1="[object Date]",ev="[object Error]",tv="[object Map]",rv="[object Number]",av="[object RegExp]",ov="[object Set]",nv="[object String]",sv="[object Symbol]",lv="[object ArrayBuffer]",iv="[object DataView]",cl=Tt?Tt.prototype:void 0,Xo=cl?cl.valueOf:void 0;function cv(e,t,r,a,o,n,s){switch(r){case iv:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case lv:return!(e.byteLength!=t.byteLength||!n(new il(e),new il(t)));case X1:case Z1:case rv:return ec(+e,+t);case ev:return e.name==t.name&&e.message==t.message;case av:case nv:return e==t+"";case tv:var l=W1;case ov:var i=a&K1;if(l||(l=Q1),e.size!=t.size&&!i)return!1;var c=s.get(e);if(c)return c==t;a|=Y1,s.set(e,t);var d=rc(l(e),l(t),a,o,n,s);return s.delete(e),d;case sv:if(Xo)return Xo.call(e)==Xo.call(t)}return!1}function dv(e,t){for(var r=-1,a=t.length,o=e.length;++r<a;)e[o+r]=t[r];return e}var ct=Array.isArray;function pv(e,t,r){var a=t(e);return ct(e)?a:dv(a,r(e))}function uv(e,t){for(var r=-1,a=e==null?0:e.length,o=0,n=[];++r<a;){var s=e[r];t(s,r,e)&&(n[o++]=s)}return n}function hv(){return[]}var mv=Object.prototype,fv=mv.propertyIsEnumerable,dl=Object.getOwnPropertySymbols,yv=dl?function(e){return e==null?[]:(e=Object(e),uv(dl(e),function(t){return fv.call(e,t)}))}:hv;function gv(e,t){for(var r=-1,a=Array(e);++r<e;)a[r]=t(r);return a}var bv="[object Arguments]";function pl(e){return Nt(e)&&qt(e)==bv}var ac=Object.prototype,Sv=ac.hasOwnProperty,vv=ac.propertyIsEnumerable,oc=pl(function(){return arguments}())?pl:function(e){return Nt(e)&&Sv.call(e,"callee")&&!vv.call(e,"callee")};function xv(){return!1}var nc=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ul=nc&&typeof module=="object"&&module&&!module.nodeType&&module,Ov=ul&&ul.exports===nc,hl=Ov?dt.Buffer:void 0,wv=hl?hl.isBuffer:void 0,On=wv||xv,Cv=9007199254740991,Pv=/^(?:0|[1-9]\d*)$/;function sc(e,t){var r=typeof e;return t=t??Cv,!!t&&(r=="number"||r!="symbol"&&Pv.test(e))&&e>-1&&e%1==0&&e<t}var Vv=9007199254740991;function Fn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Vv}var Rv="[object Arguments]",_v="[object Array]",Av="[object Boolean]",Tv="[object Date]",Iv="[object Error]",Ev="[object Function]",Mv="[object Map]",jv="[object Number]",$v="[object Object]",Uv="[object RegExp]",kv="[object Set]",Lv="[object String]",Bv="[object WeakMap]",Fv="[object ArrayBuffer]",Nv="[object DataView]",Dv="[object Float32Array]",zv="[object Float64Array]",Gv="[object Int8Array]",qv="[object Int16Array]",Jv="[object Int32Array]",Hv="[object Uint8Array]",Wv="[object Uint8ClampedArray]",Qv="[object Uint16Array]",Kv="[object Uint32Array]",he={};he[Dv]=he[zv]=he[Gv]=he[qv]=he[Jv]=he[Hv]=he[Wv]=he[Qv]=he[Kv]=!0;he[Rv]=he[_v]=he[Fv]=he[Av]=he[Nv]=he[Tv]=he[Iv]=he[Ev]=he[Mv]=he[jv]=he[$v]=he[Uv]=he[kv]=he[Lv]=he[Bv]=!1;function Yv(e){return Nt(e)&&Fn(e.length)&&!!he[qt(e)]}function Xv(e){return function(t){return e(t)}}var lc=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Gr=lc&&typeof module=="object"&&module&&!module.nodeType&&module,Zv=Gr&&Gr.exports===lc,Zo=Zv&&si.process,ml=function(){try{var e=Gr&&Gr.require&&Gr.require("util").types;return e||Zo&&Zo.binding&&Zo.binding("util")}catch{}}(),fl=ml&&ml.isTypedArray,ic=fl?Xv(fl):Yv,ex=Object.prototype,tx=ex.hasOwnProperty;function rx(e,t){var r=ct(e),a=!r&&oc(e),o=!r&&!a&&On(e),n=!r&&!a&&!o&&ic(e),s=r||a||o||n,l=s?gv(e.length,String):[],i=l.length;for(var c in e)tx.call(e,c)&&!(s&&(c=="length"||o&&(c=="offset"||c=="parent")||n&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||sc(c,i)))&&l.push(c);return l}var ax=Object.prototype;function ox(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ax;return e===r}function nx(e,t){return function(r){return e(t(r))}}var sx=nx(Object.keys,Object),lx=Object.prototype,ix=lx.hasOwnProperty;function cx(e){if(!ox(e))return sx(e);var t=[];for(var r in Object(e))ix.call(e,r)&&r!="constructor"&&t.push(r);return t}function cc(e){return e!=null&&Fn(e.length)&&!tc(e)}function Nn(e){return cc(e)?rx(e):cx(e)}function yl(e){return pv(e,Nn,yv)}var dx=1,px=Object.prototype,ux=px.hasOwnProperty;function hx(e,t,r,a,o,n){var s=r&dx,l=yl(e),i=l.length,c=yl(t),d=c.length;if(i!=d&&!s)return!1;for(var p=i;p--;){var u=l[p];if(!(s?u in t:ux.call(t,u)))return!1}var y=n.get(e),g=n.get(t);if(y&&g)return y==t&&g==e;var m=!0;n.set(e,t),n.set(t,e);for(var x=s;++p<i;){u=l[p];var I=e[u],G=t[u];if(a)var N=s?a(G,I,u,t,e,n):a(I,G,u,e,t,n);if(!(N===void 0?I===G||o(I,G,r,a,n):N)){m=!1;break}x||(x=u=="constructor")}if(m&&!x){var D=e.constructor,z=t.constructor;D!=z&&"constructor"in e&&"constructor"in t&&!(typeof D=="function"&&D instanceof D&&typeof z=="function"&&z instanceof z)&&(m=!1)}return n.delete(e),n.delete(t),m}var wn=Wt(dt,"DataView"),Cn=Wt(dt,"Promise"),Pn=Wt(dt,"Set"),Vn=Wt(dt,"WeakMap"),gl="[object Map]",mx="[object Object]",bl="[object Promise]",Sl="[object Set]",vl="[object WeakMap]",xl="[object DataView]",fx=Ht(wn),yx=Ht(Xr),gx=Ht(Cn),bx=Ht(Pn),Sx=Ht(Vn),Pt=qt;(wn&&Pt(new wn(new ArrayBuffer(1)))!=xl||Xr&&Pt(new Xr)!=gl||Cn&&Pt(Cn.resolve())!=bl||Pn&&Pt(new Pn)!=Sl||Vn&&Pt(new Vn)!=vl)&&(Pt=function(e){var t=qt(e),r=t==mx?e.constructor:void 0,a=r?Ht(r):"";if(a)switch(a){case fx:return xl;case yx:return gl;case gx:return bl;case bx:return Sl;case Sx:return vl}return t});var vx=1,Ol="[object Arguments]",wl="[object Array]",Ca="[object Object]",xx=Object.prototype,Cl=xx.hasOwnProperty;function Ox(e,t,r,a,o,n){var s=ct(e),l=ct(t),i=s?wl:Pt(e),c=l?wl:Pt(t);i=i==Ol?Ca:i,c=c==Ol?Ca:c;var d=i==Ca,p=c==Ca,u=i==c;if(u&&On(e)){if(!On(t))return!1;s=!0,d=!1}if(u&&!d)return n||(n=new yt),s||ic(e)?rc(e,t,r,a,o,n):cv(e,t,i,r,a,o,n);if(!(r&vx)){var y=d&&Cl.call(e,"__wrapped__"),g=p&&Cl.call(t,"__wrapped__");if(y||g){var m=y?e.value():e,x=g?t.value():t;return n||(n=new yt),o(m,x,r,a,n)}}return u?(n||(n=new yt),hx(e,t,r,a,o,n)):!1}function Oo(e,t,r,a,o){return e===t?!0:e==null||t==null||!Nt(e)&&!Nt(t)?e!==e&&t!==t:Ox(e,t,r,a,Oo,o)}function wx(e,t){return Oo(e,t)}const dc=({store:e})=>{const{t}=we.useTranslation(),[r,a]=Y.useState(e.jogger.motionStream.rapidlyChangingMotionState.state.joint_limit_reached.limit_reached),o=Y.useRef(r);gr(()=>{const s=e.jogger.motionStream.rapidlyChangingMotionState.state.joint_limit_reached.limit_reached;wx(o.current,s)||(o.current=s,a(s))});const n=[];for(const[s,l]of r.entries())l&&n.push(s);return b.jsx(F.Typography,{color:"error",sx:{margin:"0.5rem 1rem",textAlign:"center",minHeight:"1.5rem",visibility:n.length?"visible":"hidden"},children:t("Jogging.JointLimitsReached.lb",{jointNumbers:n.map(s=>s+1).join(", ")})})},Cx=F.styled(F.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 Pa({labelValue:e,...t}){return b.jsxs(Cx,{fullWidth:!0,variant:"filled",children:[b.jsx(F.InputLabel,{id:t.labelId,children:e}),b.jsx(F.Select,{...t})]})}var Pl=function(){try{var e=Wt(Object,"defineProperty");return e({},"",{}),e}catch{}}();function Px(e,t,r){t=="__proto__"&&Pl?Pl(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function Vx(e,t,r,a){for(var o=-1,n=e==null?0:e.length;++o<n;){var s=e[o];t(a,s,r(s),e)}return a}function Rx(e){return function(t,r,a){for(var o=-1,n=Object(t),s=a(t),l=s.length;l--;){var i=s[++o];if(r(n[i],i,n)===!1)break}return t}}var _x=Rx();function Ax(e,t){return e&&_x(e,t,Nn)}function Tx(e,t){return function(r,a){if(r==null)return r;if(!cc(r))return e(r,a);for(var o=r.length,n=-1,s=Object(r);++n<o&&a(s[n],n,s)!==!1;);return r}}var Ix=Tx(Ax);function Ex(e,t,r,a){return Ix(e,function(o,n,s){t(a,o,r(o),s)}),a}var Mx=1,jx=2;function $x(e,t,r,a){var o=r.length,n=o;if(e==null)return!n;for(e=Object(e);o--;){var s=r[o];if(s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<n;){s=r[o];var l=s[0],i=e[l],c=s[1];if(s[2]){if(i===void 0&&!(l in e))return!1}else{var d=new yt,p;if(!(p===void 0?Oo(c,i,Mx|jx,a,d):p))return!1}}return!0}function pc(e){return e===e&&!Ft(e)}function Ux(e){for(var t=Nn(e),r=t.length;r--;){var a=t[r],o=e[a];t[r]=[a,o,pc(o)]}return t}function uc(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function kx(e){var t=Ux(e);return t.length==1&&t[0][2]?uc(t[0][0],t[0][1]):function(r){return r===e||$x(r,e,t)}}var Lx=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Bx=/^\w*$/;function Dn(e,t){if(ct(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||co(e)?!0:Bx.test(e)||!Lx.test(e)||t!=null&&e in Object(t)}var Fx="Expected a function";function zn(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Fx);var r=function(){var a=arguments,o=t?t.apply(this,a):a[0],n=r.cache;if(n.has(o))return n.get(o);var s=e.apply(this,a);return r.cache=n.set(o,s)||n,s};return r.cache=new(zn.Cache||vt),r}zn.Cache=vt;var Nx=500;function Dx(e){var t=zn(e,function(a){return r.size===Nx&&r.clear(),a}),r=t.cache;return t}var zx=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gx=/\\(\\)?/g,qx=Dx(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(zx,function(r,a,o,n){t.push(o?n.replace(Gx,"$1"):a||r)}),t});function Jx(e,t){for(var r=-1,a=e==null?0:e.length,o=Array(a);++r<a;)o[r]=t(e[r],r,e);return o}var Vl=Tt?Tt.prototype:void 0,Rl=Vl?Vl.toString:void 0;function hc(e){if(typeof e=="string")return e;if(ct(e))return Jx(e,hc)+"";if(co(e))return Rl?Rl.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function mc(e){return e==null?"":hc(e)}function fc(e,t){return ct(e)?e:Dn(e,t)?[e]:qx(mc(e))}function wo(e){if(typeof e=="string"||co(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function yc(e,t){t=fc(t,e);for(var r=0,a=t.length;e!=null&&r<a;)e=e[wo(t[r++])];return r&&r==a?e:void 0}function Hx(e,t,r){var a=e==null?void 0:yc(e,t);return a===void 0?r:a}function Wx(e,t){return e!=null&&t in Object(e)}function Qx(e,t,r){t=fc(t,e);for(var a=-1,o=t.length,n=!1;++a<o;){var s=wo(t[a]);if(!(n=e!=null&&r(e,s)))break;e=e[s]}return n||++a!=o?n:(o=e==null?0:e.length,!!o&&Fn(o)&&sc(s,o)&&(ct(e)||oc(e)))}function Kx(e,t){return e!=null&&Qx(e,t,Wx)}var Yx=1,Xx=2;function Zx(e,t){return Dn(e)&&pc(t)?uc(wo(e),t):function(r){var a=Hx(r,e);return a===void 0&&a===t?Kx(r,e):Oo(t,a,Yx|Xx)}}function eO(e){return e}function tO(e){return function(t){return t==null?void 0:t[e]}}function rO(e){return function(t){return yc(t,e)}}function aO(e){return Dn(e)?tO(wo(e)):rO(e)}function oO(e){return typeof e=="function"?e:e==null?eO:typeof e=="object"?ct(e)?Zx(e[0],e[1]):kx(e):aO(e)}function nO(e,t){return function(r,a){var o=ct(r)?Vx:Ex,n={};return o(r,e,oO(a),n)}}var Va=nO(function(e,t,r){Px(e,r,t)}),sO=0;function lO(e){var t=++sO;return mc(e)+t}const Rn=[{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}],iO=[{id:"continuous"},...Rn],cO=["coordsys","tool"];class Co{constructor(t,r,a,o){var n,s;this.jogger=t,this.motionGroupSpec=r,this.coordSystems=a,this.tcps=o,this.selectedTabId="cartesian",this.activationState="inactive",this.activationError=null,this.activationCounter=0,this.locks=new Set,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=!0,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 l of a)if(l.coordinate_system===""){l.coordinate_system="world";break}this.selectedCoordSystemId=((n=a[0])==null?void 0:n.coordinate_system)||"world",this.selectedTcpId=((s=o[0])==null?void 0:s.id)||"",Ae.makeAutoObservable(this,{},{autoBind:!0}),this.loadFromLocalStorage(),this.disposers.push(Ae.autorun(()=>this.saveToLocalStorage())),window.joggingStore=this}static async loadFor(t){const{nova:r}=t,[a,{coordinatesystems:o},{tcps:n}]=await Promise.all([r.api.motionGroupInfos.getMotionGroupSpecification(t.motionGroupId),r.api.coordinateSystems.listCoordinateSystems("ROTATION_VECTOR"),r.api.motionGroupInfos.listTcps(t.motionGroupId,"ROTATION_VECTOR")]);return new Co(t,a,o||[],n||[])}dispose(){for(const t of this.disposers)t();this.jogger.dispose()}get coordSystemCountByName(){return _n.countBy(this.coordSystems,t=>t.name)}async deactivate(){const t=this.jogger.activeWebsocket;this.jogger.setJoggingMode("increment"),t&&await t.closed()}async activate(){if(this.currentTab.id==="cartesian"){const t={tcpId:this.selectedTcpId,coordSystemId:this.activeCoordSystemId};this.activeDiscreteIncrement?this.jogger.setJoggingMode("increment",t):this.jogger.setJoggingMode("cartesian",t)}else this.jogger.setJoggingMode("joint");return this.jogger}loadFromLocalStorage(){const t=kt.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(){return[{id:"cartesian",label:"cartesian"},{id:"joint",label:"joint"}]}get incrementOptions(){return iO}get discreteIncrementOptions(){return Rn}get incrementOptionsById(){return Va(this.incrementOptions,t=>t.id)}get tabsById(){return Va(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 Va(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 Va(this.tcps,t=>t.id)}get activeDiscreteIncrement(){return this.selectedOrientation==="tool"?void 0:Rn.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"?"translate":"rotate"}onTabChange(t,r){const a=this.tabs[r]||this.tabs[0];this.selectedTabId=a.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)}async withMotionLock(t){const r=lO();this.lock(r);try{return await t()}finally{this.unlock(r)}}}const dO=Re.observer(({store:e})=>{var o;const{t}=we.useTranslation(),r=[];function a(n){switch(n){case"coordsys":return t("Jogging.Orientation.coordsys");case"tool":return t("Jogging.Orientation.tool");default:return n}}return e.showCoordSystemSelect&&r.push(b.jsx(Pa,{labelId:"jogging-coord-select",labelValue:t("Jogging.CoordinateSystem.hlb"),value:e.selectedCoordSystemId,size:"small",variant:"filled",displayEmpty:!0,onChange:n=>e.setSelectedCoordSystemId(n.target.value),disabled:e.isLocked,children:e.coordSystems.map(n=>b.jsx(F.MenuItem,{value:n.coordinate_system,children:n.name&&e.coordSystemCountByName[n.name]>1?`${n.name} / ${n.coordinate_system}`:n.name||n.coordinate_system},n.coordinate_system))},"coord")),e.showTcpSelect&&r.push(b.jsx(Pa,{labelId:"jogging-tcp-select",labelValue:"TCP",value:e.selectedTcpId,size:"small",variant:"filled",onChange:n=>e.setSelectedTcpId(n.target.value),disabled:e.isLocked,children:e.tcps.map(n=>b.jsx(F.MenuItem,{value:n.id,children:n.id},n.id))},"tcp")),e.showOrientationSelect&&r.push(b.jsx(Pa,{labelValue:t("Jogging.Cartesian.Orientation.lb"),id:"orientation-select",labelId:"orientation-select",value:e.selectedOrientation,onChange:n=>e.setSelectedOrientation(n.target.value),disabled:e.isLocked,children:cO.map(n=>b.jsx(F.MenuItem,{value:n,children:a(n)},n))},"orientation")),e.showIncrementSelect&&r.push(b.jsxs(Pa,{labelValue:t("Jogging.Increment.hlb"),labelId:"jogging-increment-select",size:"small",variant:"filled",value:((o=e.activeDiscreteIncrement)==null?void 0:o.id)||"continuous",onChange:n=>e.setSelectedIncrementId(n.target.value),disabled:e.isLocked,children:[b.jsx(F.MenuItem,{value:"continuous",children:t("Jogging.Increment.Continuous.dd")},"continuous"),e.selectedOrientation==="tool"?null:e.discreteIncrementOptions.map(n=>b.jsx(F.MenuItem,{value:n.id,children:e.currentMotionType==="translate"?`${n.mm}mm`:`${n.degrees}°`},n.id))]},"increment")),b.jsx(F.Box,{component:"div",sx:{display:"grid",gap:"16px",gridTemplateColumns:"1fr 1fr",gridAutoRows:"min-content","& label":{opacity:.7,fontSize:"12px",marginBottom:"4px"}},children:r.map((n,s)=>b.jsx(F.Box,{sx:{gridColumn:r.length%2===1&&s===r.length-1?"span 2":"auto"},children:n},s))})}),pO=F.styled(F.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 _l(e,t){return process.env.NODE_ENV==="production"?()=>null:function(...a){return e(...a)||t(...a)}}function uO(e){return typeof e=="string"}function hO(e,t,r){return e===void 0||uO(e)?t:{...t,ownerState:{...t.ownerState,...r}}}function Ua(e,t=[]){if(e===void 0)return{};const r={};return Object.keys(e).filter(a=>a.match(/^on[A-Z]/)&&typeof e[a]=="function"&&!t.includes(a)).forEach(a=>{r[a]=e[a]}),r}function Al(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(r=>!(r.match(/^on[A-Z]/)&&typeof e[r]=="function")).forEach(r=>{t[r]=e[r]}),t}function mO(e){const{getSlotProps:t,additionalProps:r,externalSlotProps:a,externalForwardedProps:o,className:n}=e;if(!t){const y=ft(r==null?void 0:r.className,n,o==null?void 0:o.className,a==null?void 0:a.className),g={...r==null?void 0:r.style,...o==null?void 0:o.style,...a==null?void 0:a.style},m={...r,...o,...a};return y.length>0&&(m.className=y),Object.keys(g).length>0&&(m.style=g),{props:m,internalRef:void 0}}const s=Ua({...o,...a}),l=Al(a),i=Al(o),c=t(s),d=ft(c==null?void 0:c.className,r==null?void 0:r.className,n,o==null?void 0:o.className,a==null?void 0:a.className),p={...c==null?void 0:c.style,...r==null?void 0:r.style,...o==null?void 0:o.style,...a==null?void 0:a.style},u={...c,...r,...i,...l};return d.length>0&&(u.className=d),Object.keys(p).length>0&&(u.style=p),{props:u,internalRef:c.ref}}function fO(e,t,r){return typeof e=="function"?e(t,r):e}function Ct(e){var p;const{elementType:t,externalSlotProps:r,ownerState:a,skipResolvingSlotProps:o=!1,...n}=e,s=o?{}:fO(r,a),{props:l,internalRef:i}=mO({...n,externalSlotProps:s}),c=ni(i,s==null?void 0:s.ref,(p=e.additionalProps)==null?void 0:p.ref);return hO(t,{...l,ref:c},a)}function Tl(e){try{return e.matches(":focus-visible")}catch{process.env.NODE_ENV!=="production"&&!/jsdom/.test(window.navigator.userAgent)&&console.warn(["MUI: The `:focus-visible` pseudo class is not supported in this browser.","Some components rely on this feature to work properly."].join(`
106
- `))}return!1}const yO={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function gO(e,t,r=(a,o)=>a===o){return e.length===t.length&&e.every((a,o)=>r(a,t[o]))}const bO=2;function lr(e,t,r,a,o){return r===1?Math.min(e+t,o):Math.max(e-t,a)}function gc(e,t){return e-t}function Il(e,t){const{index:r}=e.reduce((a,o,n)=>{const s=Math.abs(t-o);return a===null||s<a.distance||s===a.distance?{distance:s,index:n}:a},null)??{};return r}function Ra(e,t){if(t.current!==void 0&&e.changedTouches){const r=e;for(let a=0;a<r.changedTouches.length;a+=1){const o=r.changedTouches[a];if(o.identifier===t.current)return{x:o.clientX,y:o.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function Wa(e,t,r){return(e-t)*100/(r-t)}function SO(e,t,r){return(r-t)*e+t}function vO(e){if(Math.abs(e)<1){const r=e.toExponential().split("e-"),a=r[0].split(".")[1];return(a?a.length:0)+parseInt(r[1],10)}const t=e.toString().split(".")[1];return t?t.length:0}function xO(e,t,r){const a=Math.round((e-r)/t)*t+r;return Number(a.toFixed(vO(t)))}function El({values:e,newValue:t,index:r}){const a=e.slice();return a[r]=t,a.sort(gc)}function _a({sliderRef:e,activeIndex:t,setActive:r}){var o,n,s;const a=Ea(e.current);(!((o=e.current)!=null&&o.contains(a.activeElement))||Number((n=a==null?void 0:a.activeElement)==null?void 0:n.getAttribute("data-index"))!==t)&&((s=e.current)==null||s.querySelector(`[type="range"][data-index="${t}"]`).focus()),r&&r(t)}function Aa(e,t){return typeof e=="number"&&typeof t=="number"?e===t:typeof e=="object"&&typeof t=="object"?gO(e,t):!1}const OO={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}%`})}},wO=e=>e;let Ta;function Ml(){return Ta===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?Ta=CSS.supports("touch-action","none"):Ta=!0),Ta}function CO(e){const{"aria-labelledby":t,defaultValue:r,disabled:a=!1,disableSwap:o=!1,isRtl:n=!1,marks:s=!1,max:l=100,min:i=0,name:c,onChange:d,onChangeCommitted:p,orientation:u="horizontal",rootRef:y,scale:g=wO,step:m=1,shiftStep:x=10,tabIndex:I,value:G}=e,N=L.useRef(void 0),[D,z]=L.useState(-1),[W,j]=L.useState(-1),[U,k]=L.useState(!1),f=L.useRef(0),M=L.useRef(null),[B,J]=Du({controlled:G,default:r??i,name:"Slider"}),H=d&&((q,Q,Z)=>{const ne=q.nativeEvent||q,ce=new ne.constructor(ne.type,ne);Object.defineProperty(ce,"target",{writable:!0,value:{value:Q,name:c}}),M.current=Q,d(ce,Q,Z)}),oe=Array.isArray(B);let te=oe?B.slice().sort(gc):[B];te=te.map(q=>q==null?i:ir(q,i,l));const xe=s===!0&&m!==null?[...Array(Math.floor((l-i)/m)+1)].map((q,Q)=>({value:i+m*Q})):s||[],X=xe.map(q=>q.value),[be,$]=L.useState(-1),K=L.useRef(null),se=ni(y,K),Pe=q=>Q=>{var ne;const Z=Number(Q.currentTarget.getAttribute("data-index"));Tl(Q.target)&&$(Z),j(Z),(ne=q==null?void 0:q.onFocus)==null||ne.call(q,Q)},Je=q=>Q=>{var Z;Tl(Q.target)||$(-1),j(-1),(Z=q==null?void 0:q.onBlur)==null||Z.call(q,Q)},je=(q,Q)=>{const Z=Number(q.currentTarget.getAttribute("data-index")),ne=te[Z],ce=X.indexOf(ne);let ee=Q;if(xe&&m==null){const Te=X[X.length-1];ee>=Te?ee=Te:ee<=X[0]?ee=X[0]:ee=ee<ne?X[ce-1]:X[ce+1]}if(ee=ir(ee,i,l),oe){o&&(ee=ir(ee,te[Z-1]||-1/0,te[Z+1]||1/0));const Te=ee;ee=El({values:te,newValue:ee,index:Z});let ke=Z;o||(ke=ee.indexOf(Te)),_a({sliderRef:K,activeIndex:ke})}J(ee),$(Z),H&&!Aa(ee,B)&&H(q,ee,Z),p&&p(q,M.current??ee)},Et=q=>Q=>{var Z;if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(Q.key)){Q.preventDefault();const ne=Number(Q.currentTarget.getAttribute("data-index")),ce=te[ne];let ee=null;if(m!=null){const Te=Q.shiftKey?x:m;switch(Q.key){case"ArrowUp":ee=lr(ce,Te,1,i,l);break;case"ArrowRight":ee=lr(ce,Te,n?-1:1,i,l);break;case"ArrowDown":ee=lr(ce,Te,-1,i,l);break;case"ArrowLeft":ee=lr(ce,Te,n?1:-1,i,l);break;case"PageUp":ee=lr(ce,x,1,i,l);break;case"PageDown":ee=lr(ce,x,-1,i,l);break;case"Home":ee=i;break;case"End":ee=l;break}}else if(xe){const Te=X[X.length-1],ke=X.indexOf(ce),_e=[n?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],He=[n?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];_e.includes(Q.key)?ke===0?ee=X[0]:ee=X[ke-1]:He.includes(Q.key)&&(ke===X.length-1?ee=Te:ee=X[ke+1])}ee!=null&&je(Q,ee)}(Z=q==null?void 0:q.onKeyDown)==null||Z.call(q,Q)};Kl(()=>{var q;a&&K.current.contains(document.activeElement)&&((q=document.activeElement)==null||q.blur())},[a]),a&&D!==-1&&z(-1),a&&be!==-1&&$(-1);const xt=q=>Q=>{var Z;(Z=q.onChange)==null||Z.call(q,Q),je(Q,Q.target.valueAsNumber)},ye=L.useRef(void 0);let Fe=u;n&&u==="horizontal"&&(Fe+="-reverse");const Ye=({finger:q,move:Q=!1})=>{const{current:Z}=K,{width:ne,height:ce,bottom:ee,left:Te}=Z.getBoundingClientRect();let ke;Fe.startsWith("vertical")?ke=(ee-q.y)/ce:ke=(q.x-Te)/ne,Fe.includes("-reverse")&&(ke=1-ke);let _e;if(_e=SO(ke,i,l),m)_e=xO(_e,m,i);else{const Vr=Il(X,_e);_e=X[Vr]}_e=ir(_e,i,l);let He=0;if(oe){Q?He=ye.current:He=Il(te,_e),o&&(_e=ir(_e,te[He-1]||-1/0,te[He+1]||1/0));const Vr=_e;_e=El({values:te,newValue:_e,index:He}),o&&Q||(He=_e.indexOf(Vr),ye.current=He)}return{newValue:_e,activeIndex:He}},pt=ko(q=>{const Q=Ra(q,N);if(!Q)return;if(f.current+=1,q.type==="mousemove"&&q.buttons===0){at(q);return}const{newValue:Z,activeIndex:ne}=Ye({finger:Q,move:!0});_a({sliderRef:K,activeIndex:ne,setActive:z}),J(Z),!U&&f.current>bO&&k(!0),H&&!Aa(Z,B)&&H(q,Z,ne)}),at=ko(q=>{const Q=Ra(q,N);if(k(!1),!Q)return;const{newValue:Z}=Ye({finger:Q,move:!0});z(-1),q.type==="touchend"&&j(-1),p&&p(q,M.current??Z),N.current=void 0,Mt()}),$e=ko(q=>{if(a)return;Ml()||q.preventDefault();const Q=q.changedTouches[0];Q!=null&&(N.current=Q.identifier);const Z=Ra(q,N);if(Z!==!1){const{newValue:ce,activeIndex:ee}=Ye({finger:Z});_a({sliderRef:K,activeIndex:ee,setActive:z}),J(ce),H&&!Aa(ce,B)&&H(q,ce,ee)}f.current=0;const ne=Ea(K.current);ne.addEventListener("touchmove",pt,{passive:!0}),ne.addEventListener("touchend",at,{passive:!0})}),Mt=L.useCallback(()=>{const q=Ea(K.current);q.removeEventListener("mousemove",pt),q.removeEventListener("mouseup",at),q.removeEventListener("touchmove",pt),q.removeEventListener("touchend",at)},[at,pt]);L.useEffect(()=>{const{current:q}=K;return q.addEventListener("touchstart",$e,{passive:Ml()}),()=>{q.removeEventListener("touchstart",$e),Mt()}},[Mt,$e]),L.useEffect(()=>{a&&Mt()},[a,Mt]);const Po=q=>Q=>{var ce;if((ce=q.onMouseDown)==null||ce.call(q,Q),a||Q.defaultPrevented||Q.button!==0)return;Q.preventDefault();const Z=Ra(Q,N);if(Z!==!1){const{newValue:ee,activeIndex:Te}=Ye({finger:Z});_a({sliderRef:K,activeIndex:Te,setActive:z}),J(ee),H&&!Aa(ee,B)&&H(Q,ee,Te)}f.current=0;const ne=Ea(K.current);ne.addEventListener("mousemove",pt,{passive:!0}),ne.addEventListener("mouseup",at)},sa=Wa(oe?te[0]:i,i,l),Ue=Wa(te[te.length-1],i,l)-sa,Pr=(q={})=>{const Q=Ua(q),Z={onMouseDown:Po(Q||{})},ne={...Q,...Z};return{...q,ref:se,...ne}},la=q=>Q=>{var ne;(ne=q.onMouseOver)==null||ne.call(q,Q);const Z=Number(Q.currentTarget.getAttribute("data-index"));j(Z)},ia=q=>Q=>{var Z;(Z=q.onMouseLeave)==null||Z.call(q,Q),j(-1)},ca=(q={})=>{const Q=Ua(q),Z={onMouseOver:la(Q||{}),onMouseLeave:ia(Q||{})};return{...q,...Q,...Z}},da=q=>({pointerEvents:D!==-1&&D!==q?"none":void 0});let Qt;return u==="vertical"&&(Qt=n?"vertical-rl":"vertical-lr"),{active:D,axis:Fe,axisProps:OO,dragging:U,focusedThumbIndex:be,getHiddenInputProps:(q={})=>{const Q=Ua(q),Z={onChange:xt(Q||{}),onFocus:Pe(Q||{}),onBlur:Je(Q||{}),onKeyDown:Et(Q||{})},ne={...Q,...Z};return{tabIndex:I,"aria-labelledby":t,"aria-orientation":u,"aria-valuemax":g(l),"aria-valuemin":g(i),name:c,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":e.step??void 0,disabled:a,...q,...ne,style:{...yO,direction:n?"rtl":"ltr",width:"100%",height:"100%",writingMode:Qt}}},getRootProps:Pr,getThumbProps:ca,marks:xe,open:W,range:oe,rootRef:se,trackLeap:Ue,trackOffset:sa,values:te,getThumbStyle:da}}function ka(e){return typeof e=="string"}const PO=e=>!e||!ka(e);function VO(e){return typeof e.main=="string"}function RO(e,t=[]){if(!VO(e))return!1;for(const r of t)if(!e.hasOwnProperty(r)||typeof e[r]!="string")return!1;return!0}function Gn(e=[]){return([,t])=>t&&RO(t,e)}function _O(e){return ra("MuiSlider",e)}const Qe=Gl("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"]),AO=e=>{const{open:t}=e;return{offset:ft(t&&Qe.valueLabelOpen),circle:Qe.valueLabelCircle,label:Qe.valueLabelLabel}};function bc(e){const{children:t,className:r,value:a}=e,o=AO(e);return t?L.cloneElement(t,{className:t.props.className},b.jsxs(L.Fragment,{children:[t.props.children,b.jsx("span",{className:ft(o.offset,r),"aria-hidden":!0,children:b.jsx("span",{className:o.circle,children:b.jsx("span",{className:o.label,children:a})})})]})):null}process.env.NODE_ENV!=="production"&&(bc.propTypes={children:S.element.isRequired,className:S.string,value:S.node});function jl(e){return e}const TO=gt("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`color${Le(r.color)}`],r.size!=="medium"&&t[`size${Le(r.size)}`],r.marked&&t.marked,r.orientation==="vertical"&&t.vertical,r.track==="inverted"&&t.trackInverted,r.track===!1&&t.trackFalse]}})(Gt(({theme:e})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${Qe.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${Qe.dragging}`]:{[`& .${Qe.thumb}, & .${Qe.track}`]:{transition:"none"}},variants:[...Object.entries(e.palette).filter(Gn()).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}}]}))),IO=gt("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}}]}),EO=gt("span",{name:"MuiSlider",slot:"Track"})(Gt(({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(Gn()).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:Jr(e.palette[t].main,.62),borderColor:Jr(e.palette[t].main,.62),...e.applyStyles("dark",{backgroundColor:qr(e.palette[t].main,.5)}),...e.applyStyles("dark",{borderColor:qr(e.palette[t].main,.5)})}}}))]}))),MO=gt("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.thumb,t[`thumbColor${Le(r.color)}`],r.size!=="medium"&&t[`thumbSize${Le(r.size)}`]]}})(Gt(({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%)"},[`&.${Qe.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(Gn()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${Qe.focusVisible}`]:{...e.vars?{boxShadow:`0px 0px 0px 8px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${an(e.palette[t].main,.16)}`},"@media (hover: none)":{boxShadow:"none"}},[`&.${Qe.active}`]:{...e.vars?{boxShadow:`0px 0px 0px 14px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${an(e.palette[t].main,.16)}`}}}}))]}))),Sc=gt(bc,{name:"MuiSlider",slot:"ValueLabel"})(Gt(({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%"},[`&.${Qe.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%"},[`&.${Qe.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"&&(Sc.propTypes={children:S.element.isRequired,index:S.number.isRequired,open:S.bool.isRequired,value:S.node});const jO=gt("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>Mn(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:r}=e;return[t.mark,r&&t.markActive]}})(Gt(({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}}]}))),$O=gt("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>Mn(e)&&e!=="markLabelActive"})(Gt(({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}}]}))),UO=e=>{const{disabled:t,dragging:r,marked:a,orientation:o,track:n,classes:s,color:l,size:i}=e,c={root:["root",t&&"disabled",r&&"dragging",a&&"marked",o==="vertical"&&"vertical",n==="inverted"&&"trackInverted",n===!1&&"trackFalse",l&&`color${Le(l)}`,i&&`size${Le(i)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",i&&`thumbSize${Le(i)}`,l&&`thumbColor${Le(l)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return In(c,_O,s)},kO=({children:e})=>e,vc=L.forwardRef(function(t,r){const a=jn({props:t,name:"MuiSlider"}),o=Mp(),{"aria-label":n,"aria-valuetext":s,"aria-labelledby":l,component:i="span",components:c={},componentsProps:d={},color:p="primary",classes:u,className:y,disableSwap:g=!1,disabled:m=!1,getAriaLabel:x,getAriaValueText:I,marks:G=!1,max:N=100,min:D=0,name:z,onChange:W,onChangeCommitted:j,orientation:U="horizontal",shiftStep:k=10,size:f="medium",step:M=1,scale:B=jl,slotProps:J,slots:H,tabIndex:oe,track:te="normal",value:xe,valueLabelDisplay:X="off",valueLabelFormat:be=jl,...$}=a,K={...a,isRtl:o,max:N,min:D,classes:u,disabled:m,disableSwap:g,orientation:U,marks:G,color:p,size:f,step:M,shiftStep:k,scale:B,track:te,valueLabelDisplay:X,valueLabelFormat:be},{axisProps:se,getRootProps:Pe,getHiddenInputProps:Je,getThumbProps:je,open:Et,active:xt,axis:ye,focusedThumbIndex:Fe,range:Ye,dragging:pt,marks:at,values:$e,trackOffset:Mt,trackLeap:Po,getThumbStyle:sa}=CO({...K,rootRef:r});K.marked=at.length>0&&at.some(Ve=>Ve.label),K.dragging=pt,K.focusedThumbIndex=Fe;const Ue=UO(K),Pr=(H==null?void 0:H.root)??c.Root??TO,la=(H==null?void 0:H.rail)??c.Rail??IO,ia=(H==null?void 0:H.track)??c.Track??EO,ca=(H==null?void 0:H.thumb)??c.Thumb??MO,da=(H==null?void 0:H.valueLabel)??c.ValueLabel??Sc,Qt=(H==null?void 0:H.mark)??c.Mark??jO,pa=(H==null?void 0:H.markLabel)??c.MarkLabel??$O,q=(H==null?void 0:H.input)??c.Input??"input",Q=(J==null?void 0:J.root)??d.root,Z=(J==null?void 0:J.rail)??d.rail,ne=(J==null?void 0:J.track)??d.track,ce=(J==null?void 0:J.thumb)??d.thumb,ee=(J==null?void 0:J.valueLabel)??d.valueLabel,Te=(J==null?void 0:J.mark)??d.mark,ke=(J==null?void 0:J.markLabel)??d.markLabel,_e=(J==null?void 0:J.input)??d.input,He=Ct({elementType:Pr,getSlotProps:Pe,externalSlotProps:Q,externalForwardedProps:$,additionalProps:{...PO(Pr)&&{as:i}},ownerState:{...K,...Q==null?void 0:Q.ownerState},className:[Ue.root,y]}),Vr=Ct({elementType:la,externalSlotProps:Z,ownerState:K,className:Ue.rail}),Ac=Ct({elementType:ia,externalSlotProps:ne,additionalProps:{style:{...se[ye].offset(Mt),...se[ye].leap(Po)}},ownerState:{...K,...ne==null?void 0:ne.ownerState},className:Ue.track}),Vo=Ct({elementType:ca,getSlotProps:je,externalSlotProps:ce,ownerState:{...K,...ce==null?void 0:ce.ownerState},className:Ue.thumb}),Tc=Ct({elementType:da,externalSlotProps:ee,ownerState:{...K,...ee==null?void 0:ee.ownerState},className:Ue.valueLabel}),Ro=Ct({elementType:Qt,externalSlotProps:Te,ownerState:K,className:Ue.mark}),_o=Ct({elementType:pa,externalSlotProps:ke,ownerState:K,className:Ue.markLabel}),Ic=Ct({elementType:q,getSlotProps:Je,externalSlotProps:_e,ownerState:K});return b.jsxs(Pr,{...He,children:[b.jsx(la,{...Vr}),b.jsx(ia,{...Ac}),at.filter(Ve=>Ve.value>=D&&Ve.value<=N).map((Ve,Ie)=>{const Ao=Wa(Ve.value,D,N),ua=se[ye].offset(Ao);let ut;return te===!1?ut=$e.includes(Ve.value):ut=te==="normal"&&(Ye?Ve.value>=$e[0]&&Ve.value<=$e[$e.length-1]:Ve.value<=$e[0])||te==="inverted"&&(Ye?Ve.value<=$e[0]||Ve.value>=$e[$e.length-1]:Ve.value>=$e[0]),b.jsxs(L.Fragment,{children:[b.jsx(Qt,{"data-index":Ie,...Ro,...!ka(Qt)&&{markActive:ut},style:{...ua,...Ro.style},className:ft(Ro.className,ut&&Ue.markActive)}),Ve.label!=null?b.jsx(pa,{"aria-hidden":!0,"data-index":Ie,..._o,...!ka(pa)&&{markLabelActive:ut},style:{...ua,..._o.style},className:ft(Ue.markLabel,_o.className,ut&&Ue.markLabelActive),children:Ve.label}):null]},Ie)}),$e.map((Ve,Ie)=>{const Ao=Wa(Ve,D,N),ua=se[ye].offset(Ao),ut=X==="off"?kO:da;return b.jsx(ut,{...!ka(ut)&&{valueLabelFormat:be,valueLabelDisplay:X,value:typeof be=="function"?be(B(Ve),Ie):be,index:Ie,open:Et===Ie||xt===Ie||X==="on",disabled:m},...Tc,children:b.jsx(ca,{"data-index":Ie,...Vo,className:ft(Ue.thumb,Vo.className,xt===Ie&&Ue.active,Fe===Ie&&Ue.focusVisible),style:{...ua,...sa(Ie),...Vo.style},children:b.jsx(q,{"data-index":Ie,"aria-label":x?x(Ie):n,"aria-valuenow":B(Ve),"aria-labelledby":l,"aria-valuetext":I?I(B(Ve),Ie):s,value:$e[Ie],...Ic})})},Ie)})]})});process.env.NODE_ENV!=="production"&&(vc.propTypes={"aria-label":_l(S.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":S.string,"aria-valuetext":_l(S.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:S.node,classes:S.object,className:S.string,color:S.oneOfType([S.oneOf(["primary","secondary","error","info","success","warning"]),S.string]),components:S.shape({Input:S.elementType,Mark:S.elementType,MarkLabel:S.elementType,Rail:S.elementType,Root:S.elementType,Thumb:S.elementType,Track:S.elementType,ValueLabel:S.elementType}),componentsProps:S.shape({input:S.oneOfType([S.func,S.object]),mark:S.oneOfType([S.func,S.object]),markLabel:S.oneOfType([S.func,S.object]),rail:S.oneOfType([S.func,S.object]),root:S.oneOfType([S.func,S.object]),thumb:S.oneOfType([S.func,S.object]),track:S.oneOfType([S.func,S.object]),valueLabel:S.oneOfType([S.func,S.shape({children:S.element,className:S.string,open:S.bool,style:S.object,value:S.node,valueLabelDisplay:S.oneOf(["auto","off","on"])})])}),defaultValue:S.oneOfType([S.arrayOf(S.number),S.number]),disabled:S.bool,disableSwap:S.bool,getAriaLabel:S.func,getAriaValueText:S.func,marks:S.oneOfType([S.arrayOf(S.shape({label:S.node,value:S.number.isRequired})),S.bool]),max:S.number,min:S.number,name:S.string,onChange:S.func,onChangeCommitted:S.func,orientation:S.oneOf(["horizontal","vertical"]),scale:S.func,shiftStep:S.number,size:S.oneOfType([S.oneOf(["small","medium"]),S.string]),slotProps:S.shape({input:S.oneOfType([S.func,S.object]),mark:S.oneOfType([S.func,S.object]),markLabel:S.oneOfType([S.func,S.object]),rail:S.oneOfType([S.func,S.object]),root:S.oneOfType([S.func,S.object]),thumb:S.oneOfType([S.func,S.object]),track:S.oneOfType([S.func,S.object]),valueLabel:S.oneOfType([S.func,S.shape({children:S.element,className:S.string,open:S.bool,style:S.object,value:S.node,valueLabelDisplay:S.oneOf(["auto","off","on"])})])}),slots:S.shape({input:S.elementType,mark:S.elementType,markLabel:S.elementType,rail:S.elementType,root:S.elementType,thumb:S.elementType,track:S.elementType,valueLabel:S.elementType}),step:S.number,sx:S.oneOfType([S.arrayOf(S.oneOfType([S.func,S.object,S.bool])),S.func,S.object]),tabIndex:S.number,track:S.oneOf(["inverted","normal",!1]),value:S.oneOfType([S.arrayOf(S.number),S.number]),valueLabelDisplay:S.oneOf(["auto","off","on"]),valueLabelFormat:S.oneOfType([S.func,S.string])});var LO="[object Number]";function BO(e){return typeof e=="number"||Nt(e)&&qt(e)==LO}const xc=Re.observer(e=>{var n,s,l;const t=F.useTheme(),{store:r}=e,{t:a}=we.useTranslation();function o(i,c){c===e.velocity||!BO(c)||e.onVelocityChange(c)}return b.jsxs(F.Stack,{direction:"row",gap:2,alignItems:"center",children:[r.showVelocityLegend&&b.jsx(F.Typography,{sx:{color:(l=(s=(n=t.componentsExt)==null?void 0:n.JoggingPanel)==null?void 0:s.VelocitySlider)==null?void 0:l.sliderLegendColor,fontSize:"14px"},children:a("Jogging.Velocity.bt")}),b.jsx(vc,{value:e.velocity,color:"secondary",onChange:o,min:e.min,max:e.max,"aria-labelledby":"input-slider",disabled:e.disabled,sx:{"& .MuiSlider-valueLabelOpen":{zIndex:100,backgroundColor:"transparent",top:"0px"}}}),r.showVelocitySliderLabel&&(e.renderValue?e.renderValue(e.velocity):b.jsx(qn,{value:e.velocity.toString()}))]})});function qn({value:e,sx:t}){var a;const r=F.useTheme();return b.jsx(F.Stack,{direction:"row",justifyContent:"center",alignItems:"center",gap:"5px",sx:{padding:"6px 12px",background:(a=r.palette.backgroundPaperElevation)==null?void 0:a[8],borderRadius:"10px",minWidth:"111px",...t},children:b.jsx(F.Typography,{component:"span",sx:{textAlign:"right",fontSize:"14px",opacity:.8,color:r.palette.text.primary,whiteSpace:"nowrap"},children:e})})}const Oc=Re.observer(({store:e})=>{const{t}=we.useTranslation(),r=Re.useLocalObservable(()=>({get valueLabelFormat(){return e.currentMotionType==="translate"?a=>`v = ${t("Jogging.Cartesian.Translation.velocityMmPerSec.lb",{amount:a})}`:a=>`ω = ${t("Jogging.Cartesian.Rotation.velocityDegPerSec.lb",{amount:a})}`}}));return b.jsx(xc,{store:e,velocity:e.velocityInDisplayUnits,min:e.minVelocityInDisplayUnits,max:e.maxVelocityInDisplayUnits,onVelocityChange:e.setVelocityFromSlider,disabled:e.isLocked,renderValue:a=>b.jsx(qn,{value:r.valueLabelFormat(a),sx:{minWidth:"111px",span:{transform:"translateY(-1.5px)"}}})})}),FO=Re.observer(({store:e,children:t})=>{const{t:r}=we.useTranslation(),a=F.useTheme();function o(u,y){(y==="translate"||y==="rotate")&&e.setSelectedCartesianMotionType(y)}oi(()=>[e.selectedCoordSystemId,e.selectedTcpId],()=>{e.jogger.motionStream.motionStateSocket.changeUrl(e.jogger.nova.makeWebsocketURL(`/motion-groups/${e.jogger.motionGroupId}/state-stream?tcp=${e.selectedTcpId}&response_coordinate_system=${e.selectedCoordSystemId}`))},{fireImmediately:!0});async function n(u,y){const g=await e.activate(),m=g.motionStream.rapidlyChangingMotionState.tcp_pose,x=g.motionStream.rapidlyChangingMotionState.state.joint_position;m&&await e.withMotionLock(async()=>{try{e.setCurrentIncrementJog({axis:u.axis,direction:u.direction}),await e.jogger.runIncrementalCartesianMotion({currentTcpPose:m,currentJoints:x,coordSystemId:e.activeCoordSystemId,velocityInRelevantUnits:e.selectedCartesianMotionType==="translate"?e.translationVelocityMmPerSec:e.rotationVelocityRadsPerSec,axis:u.axis,direction:u.direction,motion:e.selectedCartesianMotionType==="translate"?{type:"translate",distanceMm:y.mm}:{type:"rotate",distanceRads:kt.degreesToRadians(y.degrees)}})}finally{e.setCurrentIncrementJog(null),await e.deactivate()}})}async function s(u){if(!e.isLocked){if(await e.activate(),e.activeDiscreteIncrement)return n(u,e.activeDiscreteIncrement);u.motionType==="translate"?await e.jogger.startTCPTranslation({axis:u.axis,direction:u.direction,velocityMmPerSec:e.translationVelocityMmPerSec}):await e.jogger.startTCPRotation({axis:u.axis,direction:u.direction,velocityRadsPerSec:e.rotationVelocityRadsPerSec})}}async function l(){e.isLocked||e.activeDiscreteIncrement||await e.deactivate()}function i(u,y,g){var x,I,G;const m=(G=(I=(x=g.componentsExt)==null?void 0:x.JoggingPanel)==null?void 0:I.JoggingCartesian)==null?void 0:G.Axis;if(m)return y==="translate"?m[u]:m.CustomRotation??m[u]}const c=[{id:"x",icon:b.jsx(DS,{}),colors:i("X",e.selectedCartesianMotionType,a)},{id:"y",icon:b.jsx(GS,{}),colors:i("Y",e.selectedCartesianMotionType,a)},{id:"z",icon:b.jsx(JS,{}),colors:i("Z",e.selectedCartesianMotionType,a)}];function d(u){return r("General.mm.variable",{amount:u.toFixed(1)})}function p(u){return r("General.degree.variable",{amount:kt.radiansToDegrees(u).toFixed(1)})}return b.jsxs(F.Stack,{flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[b.jsxs(F.Stack,{gap:2,children:[b.jsx(dO,{store:e}),b.jsx(Oc,{store:e}),b.jsx(F.Divider,{})]}),b.jsx(F.Stack,{marginLeft:"auto",marginRight:"auto",gap:"24px",justifyContent:"center",sx:{flexGrow:"1"},children:b.jsxs(F.Stack,{alignItems:"center",justifyContent:"center",gap:"24px",sx:{flexGrow:1},children:[b.jsxs(pO,{value:e.selectedCartesianMotionType,onChange:o,exclusive:!0,"aria-label":r("Jogging.Cartesian.MotionType.lb"),sx:{justifyContent:"center"},children:[b.jsx(F.ToggleButton,{value:"translate",children:r("Jogging.Cartesian.Translation.bt")}),b.jsx(F.ToggleButton,{value:"rotate",children:r("Jogging.Cartesian.Rotation.bt")})]}),e.selectedCartesianMotionType==="translate"&&c.map(u=>{var y,g;return b.jsx(nn,{colors:u.colors,disabled:e.isLocked,activeJoggingDirection:((y=e.incrementJogInProgress)==null?void 0:y.axis)===u.id?e.incrementJogInProgress.direction:void 0,label:b.jsxs(b.Fragment,{children:[u.icon,b.jsx(F.Typography,{sx:{fontSize:"24px",color:((g=u.colors)==null?void 0:g.labelColor)??a.palette.text.primary},children:u.id.toUpperCase()})]}),getDisplayedValue:()=>{var m;return d(((m=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:m.position[u.id])||0)},startJogging:m=>s({axis:u.id,motionType:"translate",direction:m}),stopJogging:l},u.id)}),e.selectedCartesianMotionType==="rotate"&&c.map(u=>{var y,g;return b.jsx(nn,{colors:u.colors,disabled:e.isLocked,activeJoggingDirection:((y=e.incrementJogInProgress)==null?void 0:y.axis)===u.id?e.incrementJogInProgress.direction:void 0,label:b.jsxs(b.Fragment,{children:[b.jsx(WS,{}),b.jsx(F.Typography,{sx:{fontSize:"24px",color:((g=u.colors)==null?void 0:g.labelColor)??a.palette.text.primary},children:u.id.toUpperCase()})]}),getDisplayedValue:()=>{var m,x;return p(((x=(m=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:m.orientation)==null?void 0:x[u.id])||0)},startJogging:m=>s({axis:u.id,motionType:"rotate",direction:m}),stopJogging:l},u.id)})]})}),b.jsx(dc,{store:e}),t&&b.jsx(F.Divider,{}),t]})}),NO=Re.observer(({store:e,children:t})=>{const r=F.useTheme();async function a(n){await e.activate(),await e.jogger.startJointRotation({joint:n.joint,direction:n.direction,velocityRadsPerSec:e.rotationVelocityRadsPerSec})}async function o(){await e.jogger.stop(),await e.deactivate()}return b.jsxs(F.Stack,{flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[b.jsx(Oc,{store:e}),b.jsx(F.Divider,{}),b.jsx(F.Stack,{justifyContent:"center",alignItems:"stretch",sx:{flexGrow:"1"},id:"JointControls",children:b.jsx(F.Stack,{alignItems:"center",gap:"24px",children:e.jogger.motionStream.joints.map(n=>{var c;const s=(c=e.motionGroupSpec.mechanical_joint_limits)==null?void 0:c[n.index],l=(s==null?void 0:s.lower_limit)!==void 0?kt.radiansToDegrees(s.lower_limit):void 0,i=(s==null?void 0:s.upper_limit)!==void 0?kt.radiansToDegrees(s.upper_limit):void 0;return b.jsxs(F.Stack,{direction:"row",alignItems:"center",justifyContent:"center",spacing:1.5,width:"100%",children:[e.showJointsLegend&&b.jsx(F.Typography,{color:e.isLocked?r.palette.text.disabled:r.palette.text.secondary,children:`G${n.index+1}`}),b.jsx(ii,{disabled:e.isLocked,lowerLimitDegs:l,upperLimitDegs:i,getValueDegs:()=>{const d=e.jogger.motionStream.rapidlyChangingMotionState.state.joint_position.joints[n.index];return d!==void 0?kt.radiansToDegrees(d):void 0},startJogging:d=>a({joint:n.index,direction:d}),stopJogging:o})]},`joint-${n.index}`)})})}),b.jsx(dc,{store:e}),t&&b.jsx(F.Divider,{}),t]})}),DO=yr(Re.observer(e=>{const t=_n.isString(e.nova)?new kS({instanceUrl:e.nova}):e.nova,r=Re.useLocalObservable(()=>({joggingStore:null,loadingError:null}));async function a(){Ae.runInAction(()=>{r.loadingError=null,r.joggingStore=null});try{let o=e.store;if(!o){const n=await t.connectJogger(e.motionGroupId);o=await Co.loadFor(n)}Ae.runInAction(()=>{r.joggingStore=o}),e.onSetup&&e.onSetup(o)}catch(o){r.loadingError=o}}return Y.useEffect(()=>(a(),e.store?()=>null:()=>{var o;(o=r.joggingStore)==null||o.dispose()}),[e.store,e.nova,e.motionGroupId]),Y.useEffect(()=>{const o=r.joggingStore;o&&(e.locked?o.lock("external"):o.unlock("external"))},[r.joggingStore,e.locked]),b.jsx(F.Stack,{sx:{maxWidth:"460px",minWidth:"320px",position:"relative",...e.sx},children:r.joggingStore?b.jsx(zO,{store:r.joggingStore,children:e.children}):b.jsx(Bn,{message:"Loading jogging",error:r.loadingError})})})),zO=Re.observer(({store:e,children:t})=>{const{t:r}=we.useTranslation();function a(){if(e.currentTab.id==="cartesian")return b.jsx(b.Fragment,{children:b.jsx(FO,{store:e,children:t})});if(e.currentTab.id==="joint")return b.jsx(b.Fragment,{children:b.jsx(NO,{store:e,children:t})})}return b.jsxs(F.Stack,{flexGrow:1,sx:{overflow:"hidden"},children:[b.jsx(F.Tabs,{value:e.tabIndex,onChange:e.onTabChange,variant:"fullWidth",children:e.tabs.map(o=>{const n=o.label==="cartesian"?r("Jogging.Cartesian.bt"):r("Jogging.Joints.bt"),s=o.label==="cartesian"?b.jsx(fh,{fontSize:"small",sx:{mr:1}}):b.jsx(yh,{fontSize:"small",sx:{mr:1}});return b.jsx(F.Tab,{label:e.showTabIcons?b.jsxs(F.Stack,{direction:"row",alignItems:"center",children:[s,n]}):n,id:`jogging-tab-${o.id}`,"aria-controls":`jogging-tab-${o.id}`},o.id)})}),b.jsx(F.Stack,{flexGrow:1,position:"relative",sx:{overflowY:"auto",overflowX:"hidden"},children:a()})]})}),wc=Y.forwardRef(({label:e,value:t},r)=>{var l;const a=F.useTheme(),[o,n]=Y.useState(!1);async function s(){if(!r||!("current"in r))return console.warn("No copy target found"),!1;try{return await navigator.clipboard.writeText(t),console.log("Copied!"),n(!0),!0}catch(i){console.error(i);const c=window.getSelection(),d=document.createRange();d.selectNodeContents(r.current),c.removeAllRanges(),c.addRange(d)}return!1}return Y.useEffect(()=>{if(!o)return;const i=setTimeout(()=>n(!1),3e3);return()=>{i&&clearTimeout(i)}},[o]),b.jsx(F.Tooltip,{open:o,title:"Copied!",children:b.jsx(F.Stack,{justifyContent:"center",sx:{height:"100%",boxSizing:"border-box",padding:"6px 12px",background:(l=a.palette.backgroundPaperElevation)==null?void 0:l[8],borderRadius:"10px",minWidth:"0",cursor:"pointer"},onClick:()=>s(),children:b.jsx(F.Typography,{ref:r,align:"center",sx:{pointerEvents:"none",fontSize:"12px",color:a.palette.text.primary,whiteSpace:"nowrap",minWidth:0,textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:t})})})}),GO=Re.observer(({motionStream:e})=>{const t=Y.useRef(null);function r(){const a=e.rapidlyChangingMotionState.tcp_pose;return a?kt.poseToWandelscriptString(a):""}return gr(()=>{if(!t.current)return;const a=r();t.current.textContent!==a&&(t.current.textContent=a)}),b.jsx(F.Stack,{alignItems:"left",spacing:2,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},children:b.jsx(wc,{value:r(),ref:t})})}),qO=Re.observer(({motionStream:e})=>{const t=Y.useRef(null);function r(){const{joints:a}=e.rapidlyChangingMotionState.state.joint_position;return`[${a.map(o=>parseFloat(o.toFixed(4))).join(", ")}]`}return gr(()=>{if(!t.current)return;const a=r();t.current.textContent!==a&&(t.current.textContent=a)}),b.jsx(F.Stack,{alignItems:"left",spacing:2,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},children:b.jsx(wc,{value:r(),ref:t})})});function JO(){const e=window.location.href;return e.substring(0,e.indexOf("/",e.indexOf("//")+2))}function HO({baseUrl:e=JO(),...t}){return b.jsxs(F.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:[b.jsx(F.DialogTitle,{id:"no-motion-group-modal-title",children:"No motion group found"}),b.jsxs(F.DialogContent,{sx:{marginTop:"3rem",marginBottom:"1.5rem",textAlign:"center"},children:[b.jsx(F.Typography,{color:"#fff",children:"Found no devices to connect to."}),b.jsx(F.Typography,{color:"#fff",children:"Please ensure a motion group has been created."})]}),b.jsx(F.DialogActions,{children:b.jsxs(F.Stack,{width:"100%",maxWidth:"300px",margin:"auto",marginBottom:"2rem",children:[b.jsx(F.Button,{href:`${e}/settings`,variant:"contained",sx:{borderRadius:"8px",width:"100%"},children:"Go to settings app"}),b.jsx(F.Button,{href:`${e}`,variant:"text",sx:{marginTop:"1rem",color:"#fff",textDecoration:"underline",fontSize:"0.75rem"},children:"Back to Homescreen"})]})})]})}const WO=Array(6).fill(2*Math.PI),$l="0.0.0-semantically-released";function Jn(e){let t=$l;return $l.startsWith("0.")&&(t=""),`https://cdn.jsdelivr.net/gh/wandelbotsgmbh/wandelbots-js-react-components${t?`@${t}`:""}/public/models/${e}.glb`}function QO(e){function t(r){return r.children.length===0?[r]:[r,...r.children.flatMap(a=>t(a))]}return t(e).filter(r=>Pc(r))}function Cc(e){return e.name.endsWith("_FLG")}function Pc(e){return/_J[0-9]+$/.test(e.name)}function KO(e,t){let r;function a(o){if(Cc(o)){if(r)throw Error(`Found multiple flange groups in robot model ${t}; first ${r.name} then ${o.name}. Only one _FLG group is allowed.`);r=o}Pc(o),o.children.map(a)}if(a(e.scene),!r)throw Error(`No flange group found in robot model ${t}. Flange must be identified with a name ending in _FLG.`);return{gltf:e}}function Vc({rapidlyChangingMotionState:e,dhParameters:t,onRotationChanged:r,children:a}){tn.Globals.assign({frameLoop:"always"});const o=Y.useRef([]),{invalidate:n}=Bc.useThree();function s(p){p&&(o.current=QO(p),l(),n())}function l(){const p=o.current.map((u,y)=>d[y].get());if(r)r(o.current,p);else for(const[u,y]of o.current.entries()){const g=t[u],m=g.theta||0,x=g.reverse_rotation_direction?-1:1;y.rotation.y=x*p[u]+m}}const i=Y.useMemo(()=>e.state.joint_position.joints.filter(p=>p!==void 0),[e.state.joint_position.joints]),c=Y.useMemo(()=>Object.fromEntries(i.map((p,u)=>[u,p])),[i]),d=tn.useSpring({to:c,config:{tension:120,friction:20},onChange:()=>{l(),n()}});return b.jsx("group",{ref:s,children:a})}const YO="line",XO="mesh";function ZO({rapidlyChangingMotionState:e,dhParameters:t,...r}){const a=new Ze.Matrix4,o=Y.useRef([]),n=Y.useRef([]);Y.useEffect(()=>{o.current=new Array(t.length).fill(null),n.current=new Array(t.length).fill(null)},[t.length]);function s(c,d){const p=new Ze.Vector3,u=new Ze.Quaternion,y=new Ze.Vector3;a.decompose(p,u,y);const g=p.clone(),m=new Ze.Matrix4().makeRotationY(c.theta+d*(c.reverse_rotation_direction?-1:1)).multiply(new Ze.Matrix4().makeTranslation(0,c.d/1e3,0)).multiply(new Ze.Matrix4().makeTranslation(c.a/1e3,0,0)).multiply(new Ze.Matrix4().makeRotationX(c.alpha));return a.multiply(m),a.decompose(p,u,y),{a:g,b:p}}function l(c,d,p,u){if(!t)return;const y=t[c];if(!y)return;const{a:g,b:m}=s(y,u);d.geometry.setPositions([g.toArray(),m.toArray()].flat()),p.position.set(m.x,m.y,m.z)}function i(c,d){a.identity();for(let p=0;p<Math.min(c.length,d.length);p++){const u=o.current[p],y=n.current[p];u&&y&&l(p,u,y,d[p])}}return b.jsx(b.Fragment,{children:b.jsx(Vc,{rapidlyChangingMotionState:e,dhParameters:t,onRotationChanged:i,children:b.jsxs("group",{...r,name:"Scene",children:[b.jsxs("mesh",{children:[b.jsx("sphereGeometry",{args:[.01,32,32]}),b.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]}),t.map((c,d)=>{const{a:p,b:u}=s(c,e.state.joint_position.joints[d]??0),y=`dhrobot_J0${d}`;return b.jsxs("group",{name:y,children:[b.jsx(et.Line,{ref:g=>{o.current[d]=g},name:YO,points:[p,u],color:"white",lineWidth:5}),b.jsxs("mesh",{ref:g=>{n.current[d]=g},name:XO,position:u,children:[b.jsx("sphereGeometry",{args:[.01,32,32]}),b.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]},"mesh_"+d)]},y)})]})})})}const ew=console.warn;function tw(){return Y.useEffect(()=>{console.warn=e=>{e!=="Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"&&ew(e)}},[]),b.jsx(b.Fragment,{})}function rw(e){return e.type==="Mesh"}function aw({modelURL:e,flangeRef:t,postModelRender:r,...a}){const{gltf:o}=KO(et.useGLTF(e),e.split("/").pop()||e),n=Y.useCallback(l=>{l&&r&&r()},[e]);function s(l){return rw(l)?b.jsx("mesh",{name:l.name,geometry:l.geometry,material:l.material,position:l.position,rotation:l.rotation},l.uuid):b.jsx(tn.animated.group,{name:l.name,position:l.position,rotation:l.rotation,ref:Cc(l)?t:void 0,children:l.children.map(s)},l.uuid)}return b.jsx("group",{...a,dispose:null,ref:n,children:s(o.scene)})}const ow=(e,t)=>{e.userData.isGhost||(e.traverse(r=>{if(r instanceof Oe.Mesh){r.material instanceof Oe.Material&&(r.material.colorWrite=!1);const a=r.clone(),o=r.clone();a.material=new Oe.MeshStandardMaterial({depthTest:!0,depthWrite:!0,colorWrite:!1,polygonOffset:!0,polygonOffsetFactor:-1,side:Oe.DoubleSide}),a.userData.isGhost=!0,o.material=new Oe.MeshStandardMaterial({color:t,opacity:.3,depthTest:!0,depthWrite:!1,transparent:!0,polygonOffset:!0,polygonOffsetFactor:-2,side:Oe.DoubleSide}),o.userData.isGhost=!0,r.parent&&(r.parent.add(a),r.parent.add(o))}}),e.userData.isGhost=!0)},nw=e=>{if(!e.userData.isGhost)return;const t=[];e.traverse(r=>{var a;r instanceof Oe.Mesh&&((a=r.userData)!=null&&a.isGhost?t.push(r):r.material instanceof Oe.Material&&(r.material.colorWrite=!0))}),t.forEach(r=>{r.parent&&r.parent.remove(r)}),e.userData.isGhost=!1},Rc=yr(({rapidlyChangingMotionState:e,modelFromController:t,dhParameters:r,getModel:a=Jn,flangeRef:o,postModelRender:n,transparentColor:s,...l})=>{const[i,c]=Y.useState(null),d=Y.useCallback(u=>{c(u)},[]);Y.useEffect(()=>{i&&(s?ow(i,s):nw(i))},[i,s]);const p=b.jsx(ZO,{rapidlyChangingMotionState:e,dhParameters:r,...l});return b.jsxs(qc.ErrorBoundary,{fallback:p,onError:u=>{console.error(u)},children:[b.jsx(Y.Suspense,{fallback:p,children:b.jsx("group",{ref:d,children:b.jsx(Vc,{rapidlyChangingMotionState:e,dhParameters:r,children:b.jsx(aw,{modelURL:a(t),postModelRender:n,flangeRef:o,...l})})})}),b.jsx(tw,{})]})});function sw({connectedMotionGroup:e,getModel:t=Jn,flangeRef:r,transparentColor:a,...o}){return e.dhParameters?b.jsx(Rc,{rapidlyChangingMotionState:e.rapidlyChangingMotionState,modelFromController:e.modelFromController||"",dhParameters:e.dhParameters,getModel:t,flangeRef:r,transparentColor:a,...o}):null}const lw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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"})),iw=Y.forwardRef(lw),cw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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"})),dw=Y.forwardRef(cw),it=Re.observer(({id:e,icon:t,color:r,title:a,name:o,explanation:n,literalValue:s,anchorOrigin:l,transformOrigin:i})=>{const c=Re.useLocalObservable(()=>({anchorEl:null,get isPopoverOpen(){return!!c.anchorEl},openPopover(d){c.anchorEl=d.currentTarget},closePopover(){c.anchorEl=null}}));return b.jsxs(b.Fragment,{children:[b.jsx(F.Stack,{"aria-owns":c.isPopoverOpen?e:void 0,"aria-haspopup":"true",onMouseEnter:c.openPopover,onMouseLeave:c.closePopover,sx:{cursor:"pointer"},children:b.jsx(F.SvgIcon,{component:t,sx:{color:r}})}),b.jsx(F.Popover,{id:e,sx:{pointerEvents:"none"},open:c.isPopoverOpen,anchorEl:c.anchorEl,anchorOrigin:l??{vertical:"bottom",horizontal:"left"},transformOrigin:i??{vertical:"top",horizontal:"left"},onClose:c.closePopover,disableRestoreFocus:!0,children:b.jsxs(F.Stack,{gap:"1rem",padding:2,maxWidth:"450px",sx:{wordWrap:"break-word"},children:[b.jsxs("div",{children:[a&&b.jsx(F.Typography,{component:"span",fontSize:"14px",children:`${a}: `}),b.jsx(F.Typography,{component:"span",color:r,fontWeight:"bold",fontSize:"14px",children:o})]}),b.jsx(F.Typography,{fontSize:"14px",children:n}),s&&b.jsx(F.Typography,{fontSize:"12px",children:s})]})})]})}),pw=Re.observer(({isVirtual:e,motionGroupId:t,anchorOrigin:r,transformOrigin:a})=>{const o=F.useTheme(),{t:n}=we.useTranslation();return e?b.jsx(it,{id:"motion-group-virtual",icon:dw,color:o.palette.tertiary.main,name:n("SafetyBar.ControllerType.Virtual.lb"),explanation:b.jsxs(we.Trans,{i18nKey:"SafetyBar.MotionGroup.Virtual.Explanation.lb",values:{motionGroupId:t},children:["Motion group ",b.jsx("code",{children:t})," refers to a virtual robot with no physical counterpart. It can be freely manipulated without special safety precautions."]}),anchorOrigin:r,transformOrigin:a}):b.jsx(it,{id:"motion-group-physical",icon:iw,color:o.palette.primary.main,name:n("SafetyBar.ControllerType.Physical.lb"),explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.MotionGroup.Physical.Explanation.lb",values:{motionGroupId:t},components:{code:b.jsx("code",{}),strong:b.jsx("strong",{})}}),anchorOrigin:r,transformOrigin:a})}),uw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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"})),hw=Y.forwardRef(uw),mw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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})),fw=Y.forwardRef(mw),yw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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"})),gw=Y.forwardRef(yw),bw=Re.observer(({operationMode:e,anchorOrigin:t,transformOrigin:r})=>{const{t:a}=we.useTranslation(),o=F.useTheme();switch(e){case"OPERATION_MODE_AUTO":return b.jsx(it,{id:"operation-mode-auto",icon:hw,title:a("SafetyBar.OperationMode.ti"),name:a("SafetyBar.OperationMode.Automatic.ti"),color:"rgba(255, 255, 255, 0.57)",explanation:b.jsx(we.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:r});case"OPERATION_MODE_MANUAL":case"OPERATION_MODE_MANUAL_T1":case"OPERATION_MODE_MANUAL_T2":return b.jsx(it,{id:"operation-mode-manual",icon:gw,color:o.palette.warning.main,title:a("SafetyBar.OperationMode.ti"),name:a("SafetyBar.OperationMode.Manual.lb"),explanation:b.jsx(we.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:r});default:return b.jsx(it,{id:"operation-mode-error",icon:fw,color:o.palette.warning.main,title:a("SafetyBar.OperationMode.ti"),name:a("SafetyBar.OperationMode.Error.lb"),explanation:b.jsx(we.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:r})}}),Sw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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"})),vw=Y.forwardRef(Sw),xw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"M10.24 10.636 12 13.764l1.76-3.128h-3.52Z"}),L.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"}),L.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"})),Ow=Y.forwardRef(xw),ww=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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})),Cw=Y.forwardRef(ww),Pw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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"})),Vw=Y.forwardRef(Pw),Rw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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"})),_w=Y.forwardRef(Rw),Aw=Re.observer(({safetyState:e,anchorOrigin:t,transformOrigin:r})=>{const{t:a}=we.useTranslation(),o=F.useTheme();switch(e){case"SAFETY_STATE_NORMAL":return b.jsx(it,{id:"safety-state-normal",title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.Normal.lb"),icon:Vw,color:"rgba(255, 255, 255, 0.57)",explanation:b.jsx(we.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:r});case"SAFETY_STATE_DEVICE_EMERGENCY_STOP":case"SAFETY_STATE_ROBOT_EMERGENCY_STOP":return b.jsx(it,{id:"safety-state-estop",title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.Estop.lb"),icon:Ow,color:o.palette.error.main,explanation:b.jsx(we.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:r});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 b.jsx(it,{id:"safety-state-stop",icon:_w,title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.Stop.lb"),color:o.palette.warning.main,explanation:b.jsx(we.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:r});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 b.jsx(it,{id:"safety-state-manual-action-required",icon:Cw,color:o.palette.warning.main,title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.ManualActionRequired.lb"),explanation:b.jsx(we.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:r});case"SAFETY_STATE_UNKNOWN":case"SAFETY_STATE_FAULT":return b.jsx(it,{id:"safety-state-error",icon:vw,color:o.palette.error.main,title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.Error.lb"),explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.SafetyState.Error.Explanation.lb",children:"The robot controller has entered an unexpected safety state."}),literalValue:e,anchorOrigin:t,transformOrigin:r});default:BS(e,`Unknown safety state ${e}`)}}),Tw=yr(Re.observer(e=>b.jsxs(F.Stack,{direction:"row",gap:"8px",alignItems:"center",sx:{height:"24px"},children:[b.jsx(Aw,{safetyState:e.safetyState,anchorOrigin:e.anchorOrigin,transformOrigin:e.transformOrigin}),b.jsx(F.Divider,{orientation:"vertical",flexItem:!0}),b.jsx(bw,{operationMode:e.operationMode,anchorOrigin:e.anchorOrigin,transformOrigin:e.transformOrigin}),b.jsx(F.Divider,{orientation:"vertical",flexItem:!0}),b.jsx(pw,{isVirtual:e.isVirtual,motionGroupId:e.motionGroupId,anchorOrigin:e.anchorOrigin,transformOrigin:e.transformOrigin})]}))),Iw=F.styled(F.Fab,{shouldForwardProp:e=>e!=="selected"})(({theme:e})=>{var t,r,a;return{borderRadius:"20px","&:hover":{background:(t=e.palette.backgroundPaperElevation)==null?void 0:t[7]},variants:[{props:({selected:o})=>!o,style:{background:(r=e.palette.backgroundPaperElevation)==null?void 0:r[0],color:e.palette.action.disabled,"> img":{opacity:.4}}},{props:({selected:o})=>o,style:{background:(a=e.palette.backgroundPaperElevation)==null?void 0:a[11],border:`1px solid ${e.palette.divider}`,color:e.palette.primary.contrastText}}]}}),Ew=Y.forwardRef((e,t)=>b.jsx(Iw,{ref:t,selected:e.selected,...e,color:"secondary",variant:"circular"})),Mw={$schema:"https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",name:"wandelscript",patterns:[{include:"#keywords"},{include:"#strings"},{include:"#comments"},{include:"#functions"}],repository:{keywords:{patterns:[{name:"keyword.control.flow.wandelscript",match:"\\b(move|via|to|interrupt|def|False|True|for|if|else|elif|while|return|switch|activate|deactivate|print|and|or|not)\\b"}]},strings:{name:"string.quoted.double.wandelscript",begin:'"',end:'"',patterns:[{name:"constant.character.escape.wandelscript",match:"\\\\."}]},comments:{patterns:[{begin:"#",beginCaptures:{0:{name:"punctuation.definition.comment.wandelscript"}},end:"$",name:"comment.line.number-sign.wandelscript"}]},functions:{patterns:[{match:"[a-zA-Z_-]+\\(",name:"entity.name.function.wandelscript"}]}},scopeName:"source.wandelscript"},jw=Y.lazy(()=>import("@monaco-editor/react"));let en=null;async function $w(){if(!en){const[{createHighlighter:e},{shikiToMonaco:t}]=await Promise.all([import("shiki"),import("@shikijs/monaco")]);en={shiki:await e({langs:[Mw],themes:["dark-plus","light-plus"]}),shikiToMonaco:t}}return en}const Uw=yr(e=>{const t=F.useTheme(),[r,a]=Y.useState("dark-plus"),o=t.palette.mode==="dark"?"dark-plus":"light-plus";async function n(s){var c,d;s.languages.register({id:"wandelscript"}),s.languages.setLanguageConfiguration("wandelscript",{comments:{lineComment:"#"},brackets:[["(",")"],["[","]"]],autoClosingPairs:[{open:"[",close:"]"},{open:"(",close:")"}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"}]});const{shiki:l,shikiToMonaco:i}=await $w();i(l,s),s.editor.defineTheme(o,((d=(c=t.componentsExt)==null?void 0:c.WandelscriptEditor)==null?void 0:d.monacoTheme)??{base:t.palette.mode==="dark"?"vs-dark":"vs",inherit:!0,rules:[],colors:{}}),e.monacoSetup&&e.monacoSetup(s),a(o)}return b.jsx(Y.Suspense,{fallback:b.jsx(Bn,{}),children:b.jsx(jw,{value:e.code,onMount:(s,l)=>{n(l)},onChange:e.onChange,defaultLanguage:"wandelscript",theme:r,options:{minimap:{enabled:!1},wordWrap:"on",automaticLayout:!0,...e.monacoOptions}})})});function _c(){var t,r,a,o,n,s,l;const e=F.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`}}},MuiButton:{styleOverrides:{root:{textTransform:"none",borderRadius:"10px"}},variants:[{props:{color:"secondary",variant:"contained"},style:{border:`1px solid ${e.palette.divider}`,background:(a=(r=(t=e.paletteExt)==null?void 0:t.secondary)==null?void 0:r.tonal)==null?void 0:a.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:(o=e.palette.backgroundPaperElevation)==null?void 0:o[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=(n=e.paletteExt)==null?void 0:n.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":F.rgbToHex(((l=e.palette.backgroundPaperElevation)==null?void 0:l[5])??""),"editor.foreground":"#d4d4d4","editorLineNumber.foreground":"#797979","editorLineNumber.activeForeground":"#e9e9e9","editor.lineHighlightBorder":"#e9e9e911"}}}}}}function kw(){const e=_c();return e.palette.mode="light",e}function Lw(e){var a,o,n,s;let t=!0;((a=e.palette)==null?void 0:a.mode)==="light"?t=!1:((o=e.palette)==null?void 0:o.mode)!=="dark"&&(t=!(typeof window<"u"&&((s=(n=window.matchMedia)==null?void 0:n.call(window,"(prefers-color-scheme: light)"))==null?void 0:s.matches)));const r=t?_c():kw();return ai(r,e)}exports.JoggingCartesianAxisControl=nn;exports.JoggingJointRotationControl=ii;exports.JoggingPanel=DO;exports.JoggingStore=Co;exports.LoadingCover=Bn;exports.LoadingErrorMessage=Zi;exports.NoMotionGroupModal=HO;exports.PoseCartesianValues=GO;exports.PoseJointValues=qO;exports.PresetEnvironment=Qc;exports.Robot=sw;exports.SafetyBar=Tw;exports.SafetyZonesRenderer=Xc;exports.SelectableFab=Ew;exports.SupportedRobot=Rc;exports.TrajectoryRenderer=Zc;exports.VelocitySlider=xc;exports.VelocitySliderLabel=qn;exports.WandelscriptEditor=Uw;exports.createNovaMuiTheme=Lw;exports.defaultAxisConfig=WO;exports.defaultGetModel=Jn;exports.i18n=$n;exports.useAnimationFrame=gr;exports.useAutorun=Lu;exports.useMounted=lo;exports.useReaction=oi;
106
+ `))}return!1}const yO={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function gO(e,t,r=(a,o)=>a===o){return e.length===t.length&&e.every((a,o)=>r(a,t[o]))}const bO=2;function lr(e,t,r,a,o){return r===1?Math.min(e+t,o):Math.max(e-t,a)}function gc(e,t){return e-t}function Il(e,t){const{index:r}=e.reduce((a,o,n)=>{const s=Math.abs(t-o);return a===null||s<a.distance||s===a.distance?{distance:s,index:n}:a},null)??{};return r}function Ra(e,t){if(t.current!==void 0&&e.changedTouches){const r=e;for(let a=0;a<r.changedTouches.length;a+=1){const o=r.changedTouches[a];if(o.identifier===t.current)return{x:o.clientX,y:o.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function Wa(e,t,r){return(e-t)*100/(r-t)}function SO(e,t,r){return(r-t)*e+t}function vO(e){if(Math.abs(e)<1){const r=e.toExponential().split("e-"),a=r[0].split(".")[1];return(a?a.length:0)+parseInt(r[1],10)}const t=e.toString().split(".")[1];return t?t.length:0}function xO(e,t,r){const a=Math.round((e-r)/t)*t+r;return Number(a.toFixed(vO(t)))}function El({values:e,newValue:t,index:r}){const a=e.slice();return a[r]=t,a.sort(gc)}function _a({sliderRef:e,activeIndex:t,setActive:r}){var o,n,s;const a=Ea(e.current);(!((o=e.current)!=null&&o.contains(a.activeElement))||Number((n=a==null?void 0:a.activeElement)==null?void 0:n.getAttribute("data-index"))!==t)&&((s=e.current)==null||s.querySelector(`[type="range"][data-index="${t}"]`).focus()),r&&r(t)}function Aa(e,t){return typeof e=="number"&&typeof t=="number"?e===t:typeof e=="object"&&typeof t=="object"?gO(e,t):!1}const OO={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}%`})}},wO=e=>e;let Ta;function Ml(){return Ta===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?Ta=CSS.supports("touch-action","none"):Ta=!0),Ta}function CO(e){const{"aria-labelledby":t,defaultValue:r,disabled:a=!1,disableSwap:o=!1,isRtl:n=!1,marks:s=!1,max:l=100,min:i=0,name:c,onChange:d,onChangeCommitted:p,orientation:u="horizontal",rootRef:y,scale:g=wO,step:m=1,shiftStep:x=10,tabIndex:I,value:G}=e,N=L.useRef(void 0),[D,z]=L.useState(-1),[W,j]=L.useState(-1),[U,k]=L.useState(!1),f=L.useRef(0),M=L.useRef(null),[B,J]=Du({controlled:G,default:r??i,name:"Slider"}),H=d&&((q,Q,Z)=>{const ne=q.nativeEvent||q,ce=new ne.constructor(ne.type,ne);Object.defineProperty(ce,"target",{writable:!0,value:{value:Q,name:c}}),M.current=Q,d(ce,Q,Z)}),oe=Array.isArray(B);let te=oe?B.slice().sort(gc):[B];te=te.map(q=>q==null?i:ir(q,i,l));const xe=s===!0&&m!==null?[...Array(Math.floor((l-i)/m)+1)].map((q,Q)=>({value:i+m*Q})):s||[],X=xe.map(q=>q.value),[be,$]=L.useState(-1),K=L.useRef(null),se=ni(y,K),Pe=q=>Q=>{var ne;const Z=Number(Q.currentTarget.getAttribute("data-index"));Tl(Q.target)&&$(Z),j(Z),(ne=q==null?void 0:q.onFocus)==null||ne.call(q,Q)},Je=q=>Q=>{var Z;Tl(Q.target)||$(-1),j(-1),(Z=q==null?void 0:q.onBlur)==null||Z.call(q,Q)},je=(q,Q)=>{const Z=Number(q.currentTarget.getAttribute("data-index")),ne=te[Z],ce=X.indexOf(ne);let ee=Q;if(xe&&m==null){const Te=X[X.length-1];ee>=Te?ee=Te:ee<=X[0]?ee=X[0]:ee=ee<ne?X[ce-1]:X[ce+1]}if(ee=ir(ee,i,l),oe){o&&(ee=ir(ee,te[Z-1]||-1/0,te[Z+1]||1/0));const Te=ee;ee=El({values:te,newValue:ee,index:Z});let ke=Z;o||(ke=ee.indexOf(Te)),_a({sliderRef:K,activeIndex:ke})}J(ee),$(Z),H&&!Aa(ee,B)&&H(q,ee,Z),p&&p(q,M.current??ee)},Et=q=>Q=>{var Z;if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(Q.key)){Q.preventDefault();const ne=Number(Q.currentTarget.getAttribute("data-index")),ce=te[ne];let ee=null;if(m!=null){const Te=Q.shiftKey?x:m;switch(Q.key){case"ArrowUp":ee=lr(ce,Te,1,i,l);break;case"ArrowRight":ee=lr(ce,Te,n?-1:1,i,l);break;case"ArrowDown":ee=lr(ce,Te,-1,i,l);break;case"ArrowLeft":ee=lr(ce,Te,n?1:-1,i,l);break;case"PageUp":ee=lr(ce,x,1,i,l);break;case"PageDown":ee=lr(ce,x,-1,i,l);break;case"Home":ee=i;break;case"End":ee=l;break}}else if(xe){const Te=X[X.length-1],ke=X.indexOf(ce),_e=[n?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],He=[n?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];_e.includes(Q.key)?ke===0?ee=X[0]:ee=X[ke-1]:He.includes(Q.key)&&(ke===X.length-1?ee=Te:ee=X[ke+1])}ee!=null&&je(Q,ee)}(Z=q==null?void 0:q.onKeyDown)==null||Z.call(q,Q)};Kl(()=>{var q;a&&K.current.contains(document.activeElement)&&((q=document.activeElement)==null||q.blur())},[a]),a&&D!==-1&&z(-1),a&&be!==-1&&$(-1);const xt=q=>Q=>{var Z;(Z=q.onChange)==null||Z.call(q,Q),je(Q,Q.target.valueAsNumber)},ye=L.useRef(void 0);let Fe=u;n&&u==="horizontal"&&(Fe+="-reverse");const Ye=({finger:q,move:Q=!1})=>{const{current:Z}=K,{width:ne,height:ce,bottom:ee,left:Te}=Z.getBoundingClientRect();let ke;Fe.startsWith("vertical")?ke=(ee-q.y)/ce:ke=(q.x-Te)/ne,Fe.includes("-reverse")&&(ke=1-ke);let _e;if(_e=SO(ke,i,l),m)_e=xO(_e,m,i);else{const Vr=Il(X,_e);_e=X[Vr]}_e=ir(_e,i,l);let He=0;if(oe){Q?He=ye.current:He=Il(te,_e),o&&(_e=ir(_e,te[He-1]||-1/0,te[He+1]||1/0));const Vr=_e;_e=El({values:te,newValue:_e,index:He}),o&&Q||(He=_e.indexOf(Vr),ye.current=He)}return{newValue:_e,activeIndex:He}},pt=ko(q=>{const Q=Ra(q,N);if(!Q)return;if(f.current+=1,q.type==="mousemove"&&q.buttons===0){at(q);return}const{newValue:Z,activeIndex:ne}=Ye({finger:Q,move:!0});_a({sliderRef:K,activeIndex:ne,setActive:z}),J(Z),!U&&f.current>bO&&k(!0),H&&!Aa(Z,B)&&H(q,Z,ne)}),at=ko(q=>{const Q=Ra(q,N);if(k(!1),!Q)return;const{newValue:Z}=Ye({finger:Q,move:!0});z(-1),q.type==="touchend"&&j(-1),p&&p(q,M.current??Z),N.current=void 0,Mt()}),$e=ko(q=>{if(a)return;Ml()||q.preventDefault();const Q=q.changedTouches[0];Q!=null&&(N.current=Q.identifier);const Z=Ra(q,N);if(Z!==!1){const{newValue:ce,activeIndex:ee}=Ye({finger:Z});_a({sliderRef:K,activeIndex:ee,setActive:z}),J(ce),H&&!Aa(ce,B)&&H(q,ce,ee)}f.current=0;const ne=Ea(K.current);ne.addEventListener("touchmove",pt,{passive:!0}),ne.addEventListener("touchend",at,{passive:!0})}),Mt=L.useCallback(()=>{const q=Ea(K.current);q.removeEventListener("mousemove",pt),q.removeEventListener("mouseup",at),q.removeEventListener("touchmove",pt),q.removeEventListener("touchend",at)},[at,pt]);L.useEffect(()=>{const{current:q}=K;return q.addEventListener("touchstart",$e,{passive:Ml()}),()=>{q.removeEventListener("touchstart",$e),Mt()}},[Mt,$e]),L.useEffect(()=>{a&&Mt()},[a,Mt]);const Po=q=>Q=>{var ce;if((ce=q.onMouseDown)==null||ce.call(q,Q),a||Q.defaultPrevented||Q.button!==0)return;Q.preventDefault();const Z=Ra(Q,N);if(Z!==!1){const{newValue:ee,activeIndex:Te}=Ye({finger:Z});_a({sliderRef:K,activeIndex:Te,setActive:z}),J(ee),H&&!Aa(ee,B)&&H(Q,ee,Te)}f.current=0;const ne=Ea(K.current);ne.addEventListener("mousemove",pt,{passive:!0}),ne.addEventListener("mouseup",at)},sa=Wa(oe?te[0]:i,i,l),Ue=Wa(te[te.length-1],i,l)-sa,Pr=(q={})=>{const Q=Ua(q),Z={onMouseDown:Po(Q||{})},ne={...Q,...Z};return{...q,ref:se,...ne}},la=q=>Q=>{var ne;(ne=q.onMouseOver)==null||ne.call(q,Q);const Z=Number(Q.currentTarget.getAttribute("data-index"));j(Z)},ia=q=>Q=>{var Z;(Z=q.onMouseLeave)==null||Z.call(q,Q),j(-1)},ca=(q={})=>{const Q=Ua(q),Z={onMouseOver:la(Q||{}),onMouseLeave:ia(Q||{})};return{...q,...Q,...Z}},da=q=>({pointerEvents:D!==-1&&D!==q?"none":void 0});let Qt;return u==="vertical"&&(Qt=n?"vertical-rl":"vertical-lr"),{active:D,axis:Fe,axisProps:OO,dragging:U,focusedThumbIndex:be,getHiddenInputProps:(q={})=>{const Q=Ua(q),Z={onChange:xt(Q||{}),onFocus:Pe(Q||{}),onBlur:Je(Q||{}),onKeyDown:Et(Q||{})},ne={...Q,...Z};return{tabIndex:I,"aria-labelledby":t,"aria-orientation":u,"aria-valuemax":g(l),"aria-valuemin":g(i),name:c,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":e.step??void 0,disabled:a,...q,...ne,style:{...yO,direction:n?"rtl":"ltr",width:"100%",height:"100%",writingMode:Qt}}},getRootProps:Pr,getThumbProps:ca,marks:xe,open:W,range:oe,rootRef:se,trackLeap:Ue,trackOffset:sa,values:te,getThumbStyle:da}}function ka(e){return typeof e=="string"}const PO=e=>!e||!ka(e);function VO(e){return typeof e.main=="string"}function RO(e,t=[]){if(!VO(e))return!1;for(const r of t)if(!e.hasOwnProperty(r)||typeof e[r]!="string")return!1;return!0}function Gn(e=[]){return([,t])=>t&&RO(t,e)}function _O(e){return ra("MuiSlider",e)}const Qe=Gl("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"]),AO=e=>{const{open:t}=e;return{offset:ft(t&&Qe.valueLabelOpen),circle:Qe.valueLabelCircle,label:Qe.valueLabelLabel}};function bc(e){const{children:t,className:r,value:a}=e,o=AO(e);return t?L.cloneElement(t,{className:t.props.className},b.jsxs(L.Fragment,{children:[t.props.children,b.jsx("span",{className:ft(o.offset,r),"aria-hidden":!0,children:b.jsx("span",{className:o.circle,children:b.jsx("span",{className:o.label,children:a})})})]})):null}process.env.NODE_ENV!=="production"&&(bc.propTypes={children:S.element.isRequired,className:S.string,value:S.node});function jl(e){return e}const TO=gt("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`color${Le(r.color)}`],r.size!=="medium"&&t[`size${Le(r.size)}`],r.marked&&t.marked,r.orientation==="vertical"&&t.vertical,r.track==="inverted"&&t.trackInverted,r.track===!1&&t.trackFalse]}})(Gt(({theme:e})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${Qe.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${Qe.dragging}`]:{[`& .${Qe.thumb}, & .${Qe.track}`]:{transition:"none"}},variants:[...Object.entries(e.palette).filter(Gn()).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}}]}))),IO=gt("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}}]}),EO=gt("span",{name:"MuiSlider",slot:"Track"})(Gt(({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(Gn()).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:Jr(e.palette[t].main,.62),borderColor:Jr(e.palette[t].main,.62),...e.applyStyles("dark",{backgroundColor:qr(e.palette[t].main,.5)}),...e.applyStyles("dark",{borderColor:qr(e.palette[t].main,.5)})}}}))]}))),MO=gt("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.thumb,t[`thumbColor${Le(r.color)}`],r.size!=="medium"&&t[`thumbSize${Le(r.size)}`]]}})(Gt(({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%)"},[`&.${Qe.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(Gn()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${Qe.focusVisible}`]:{...e.vars?{boxShadow:`0px 0px 0px 8px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${an(e.palette[t].main,.16)}`},"@media (hover: none)":{boxShadow:"none"}},[`&.${Qe.active}`]:{...e.vars?{boxShadow:`0px 0px 0px 14px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${an(e.palette[t].main,.16)}`}}}}))]}))),Sc=gt(bc,{name:"MuiSlider",slot:"ValueLabel"})(Gt(({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%"},[`&.${Qe.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%"},[`&.${Qe.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"&&(Sc.propTypes={children:S.element.isRequired,index:S.number.isRequired,open:S.bool.isRequired,value:S.node});const jO=gt("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>Mn(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:r}=e;return[t.mark,r&&t.markActive]}})(Gt(({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}}]}))),$O=gt("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>Mn(e)&&e!=="markLabelActive"})(Gt(({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}}]}))),UO=e=>{const{disabled:t,dragging:r,marked:a,orientation:o,track:n,classes:s,color:l,size:i}=e,c={root:["root",t&&"disabled",r&&"dragging",a&&"marked",o==="vertical"&&"vertical",n==="inverted"&&"trackInverted",n===!1&&"trackFalse",l&&`color${Le(l)}`,i&&`size${Le(i)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",i&&`thumbSize${Le(i)}`,l&&`thumbColor${Le(l)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return In(c,_O,s)},kO=({children:e})=>e,vc=L.forwardRef(function(t,r){const a=jn({props:t,name:"MuiSlider"}),o=Mp(),{"aria-label":n,"aria-valuetext":s,"aria-labelledby":l,component:i="span",components:c={},componentsProps:d={},color:p="primary",classes:u,className:y,disableSwap:g=!1,disabled:m=!1,getAriaLabel:x,getAriaValueText:I,marks:G=!1,max:N=100,min:D=0,name:z,onChange:W,onChangeCommitted:j,orientation:U="horizontal",shiftStep:k=10,size:f="medium",step:M=1,scale:B=jl,slotProps:J,slots:H,tabIndex:oe,track:te="normal",value:xe,valueLabelDisplay:X="off",valueLabelFormat:be=jl,...$}=a,K={...a,isRtl:o,max:N,min:D,classes:u,disabled:m,disableSwap:g,orientation:U,marks:G,color:p,size:f,step:M,shiftStep:k,scale:B,track:te,valueLabelDisplay:X,valueLabelFormat:be},{axisProps:se,getRootProps:Pe,getHiddenInputProps:Je,getThumbProps:je,open:Et,active:xt,axis:ye,focusedThumbIndex:Fe,range:Ye,dragging:pt,marks:at,values:$e,trackOffset:Mt,trackLeap:Po,getThumbStyle:sa}=CO({...K,rootRef:r});K.marked=at.length>0&&at.some(Ve=>Ve.label),K.dragging=pt,K.focusedThumbIndex=Fe;const Ue=UO(K),Pr=(H==null?void 0:H.root)??c.Root??TO,la=(H==null?void 0:H.rail)??c.Rail??IO,ia=(H==null?void 0:H.track)??c.Track??EO,ca=(H==null?void 0:H.thumb)??c.Thumb??MO,da=(H==null?void 0:H.valueLabel)??c.ValueLabel??Sc,Qt=(H==null?void 0:H.mark)??c.Mark??jO,pa=(H==null?void 0:H.markLabel)??c.MarkLabel??$O,q=(H==null?void 0:H.input)??c.Input??"input",Q=(J==null?void 0:J.root)??d.root,Z=(J==null?void 0:J.rail)??d.rail,ne=(J==null?void 0:J.track)??d.track,ce=(J==null?void 0:J.thumb)??d.thumb,ee=(J==null?void 0:J.valueLabel)??d.valueLabel,Te=(J==null?void 0:J.mark)??d.mark,ke=(J==null?void 0:J.markLabel)??d.markLabel,_e=(J==null?void 0:J.input)??d.input,He=Ct({elementType:Pr,getSlotProps:Pe,externalSlotProps:Q,externalForwardedProps:$,additionalProps:{...PO(Pr)&&{as:i}},ownerState:{...K,...Q==null?void 0:Q.ownerState},className:[Ue.root,y]}),Vr=Ct({elementType:la,externalSlotProps:Z,ownerState:K,className:Ue.rail}),Ac=Ct({elementType:ia,externalSlotProps:ne,additionalProps:{style:{...se[ye].offset(Mt),...se[ye].leap(Po)}},ownerState:{...K,...ne==null?void 0:ne.ownerState},className:Ue.track}),Vo=Ct({elementType:ca,getSlotProps:je,externalSlotProps:ce,ownerState:{...K,...ce==null?void 0:ce.ownerState},className:Ue.thumb}),Tc=Ct({elementType:da,externalSlotProps:ee,ownerState:{...K,...ee==null?void 0:ee.ownerState},className:Ue.valueLabel}),Ro=Ct({elementType:Qt,externalSlotProps:Te,ownerState:K,className:Ue.mark}),_o=Ct({elementType:pa,externalSlotProps:ke,ownerState:K,className:Ue.markLabel}),Ic=Ct({elementType:q,getSlotProps:Je,externalSlotProps:_e,ownerState:K});return b.jsxs(Pr,{...He,children:[b.jsx(la,{...Vr}),b.jsx(ia,{...Ac}),at.filter(Ve=>Ve.value>=D&&Ve.value<=N).map((Ve,Ie)=>{const Ao=Wa(Ve.value,D,N),ua=se[ye].offset(Ao);let ut;return te===!1?ut=$e.includes(Ve.value):ut=te==="normal"&&(Ye?Ve.value>=$e[0]&&Ve.value<=$e[$e.length-1]:Ve.value<=$e[0])||te==="inverted"&&(Ye?Ve.value<=$e[0]||Ve.value>=$e[$e.length-1]:Ve.value>=$e[0]),b.jsxs(L.Fragment,{children:[b.jsx(Qt,{"data-index":Ie,...Ro,...!ka(Qt)&&{markActive:ut},style:{...ua,...Ro.style},className:ft(Ro.className,ut&&Ue.markActive)}),Ve.label!=null?b.jsx(pa,{"aria-hidden":!0,"data-index":Ie,..._o,...!ka(pa)&&{markLabelActive:ut},style:{...ua,..._o.style},className:ft(Ue.markLabel,_o.className,ut&&Ue.markLabelActive),children:Ve.label}):null]},Ie)}),$e.map((Ve,Ie)=>{const Ao=Wa(Ve,D,N),ua=se[ye].offset(Ao),ut=X==="off"?kO:da;return b.jsx(ut,{...!ka(ut)&&{valueLabelFormat:be,valueLabelDisplay:X,value:typeof be=="function"?be(B(Ve),Ie):be,index:Ie,open:Et===Ie||xt===Ie||X==="on",disabled:m},...Tc,children:b.jsx(ca,{"data-index":Ie,...Vo,className:ft(Ue.thumb,Vo.className,xt===Ie&&Ue.active,Fe===Ie&&Ue.focusVisible),style:{...ua,...sa(Ie),...Vo.style},children:b.jsx(q,{"data-index":Ie,"aria-label":x?x(Ie):n,"aria-valuenow":B(Ve),"aria-labelledby":l,"aria-valuetext":I?I(B(Ve),Ie):s,value:$e[Ie],...Ic})})},Ie)})]})});process.env.NODE_ENV!=="production"&&(vc.propTypes={"aria-label":_l(S.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":S.string,"aria-valuetext":_l(S.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:S.node,classes:S.object,className:S.string,color:S.oneOfType([S.oneOf(["primary","secondary","error","info","success","warning"]),S.string]),components:S.shape({Input:S.elementType,Mark:S.elementType,MarkLabel:S.elementType,Rail:S.elementType,Root:S.elementType,Thumb:S.elementType,Track:S.elementType,ValueLabel:S.elementType}),componentsProps:S.shape({input:S.oneOfType([S.func,S.object]),mark:S.oneOfType([S.func,S.object]),markLabel:S.oneOfType([S.func,S.object]),rail:S.oneOfType([S.func,S.object]),root:S.oneOfType([S.func,S.object]),thumb:S.oneOfType([S.func,S.object]),track:S.oneOfType([S.func,S.object]),valueLabel:S.oneOfType([S.func,S.shape({children:S.element,className:S.string,open:S.bool,style:S.object,value:S.node,valueLabelDisplay:S.oneOf(["auto","off","on"])})])}),defaultValue:S.oneOfType([S.arrayOf(S.number),S.number]),disabled:S.bool,disableSwap:S.bool,getAriaLabel:S.func,getAriaValueText:S.func,marks:S.oneOfType([S.arrayOf(S.shape({label:S.node,value:S.number.isRequired})),S.bool]),max:S.number,min:S.number,name:S.string,onChange:S.func,onChangeCommitted:S.func,orientation:S.oneOf(["horizontal","vertical"]),scale:S.func,shiftStep:S.number,size:S.oneOfType([S.oneOf(["small","medium"]),S.string]),slotProps:S.shape({input:S.oneOfType([S.func,S.object]),mark:S.oneOfType([S.func,S.object]),markLabel:S.oneOfType([S.func,S.object]),rail:S.oneOfType([S.func,S.object]),root:S.oneOfType([S.func,S.object]),thumb:S.oneOfType([S.func,S.object]),track:S.oneOfType([S.func,S.object]),valueLabel:S.oneOfType([S.func,S.shape({children:S.element,className:S.string,open:S.bool,style:S.object,value:S.node,valueLabelDisplay:S.oneOf(["auto","off","on"])})])}),slots:S.shape({input:S.elementType,mark:S.elementType,markLabel:S.elementType,rail:S.elementType,root:S.elementType,thumb:S.elementType,track:S.elementType,valueLabel:S.elementType}),step:S.number,sx:S.oneOfType([S.arrayOf(S.oneOfType([S.func,S.object,S.bool])),S.func,S.object]),tabIndex:S.number,track:S.oneOf(["inverted","normal",!1]),value:S.oneOfType([S.arrayOf(S.number),S.number]),valueLabelDisplay:S.oneOf(["auto","off","on"]),valueLabelFormat:S.oneOfType([S.func,S.string])});var LO="[object Number]";function BO(e){return typeof e=="number"||Nt(e)&&qt(e)==LO}const xc=Re.observer(e=>{var n,s,l;const t=F.useTheme(),{store:r}=e,{t:a}=we.useTranslation();function o(i,c){c===e.velocity||!BO(c)||e.onVelocityChange(c)}return b.jsxs(F.Stack,{direction:"row",gap:2,alignItems:"center",children:[r.showVelocityLegend&&b.jsx(F.Typography,{sx:{color:(l=(s=(n=t.componentsExt)==null?void 0:n.JoggingPanel)==null?void 0:s.VelocitySlider)==null?void 0:l.sliderLegendColor,fontSize:"14px"},children:a("Jogging.Velocity.bt")}),b.jsx(vc,{value:e.velocity,color:"secondary",onChange:o,min:e.min,max:e.max,"aria-labelledby":"input-slider",disabled:e.disabled,sx:{"& .MuiSlider-valueLabelOpen":{zIndex:100,backgroundColor:"transparent",top:"0px"}}}),r.showVelocitySliderLabel&&(e.renderValue?e.renderValue(e.velocity):b.jsx(qn,{value:e.velocity.toString()}))]})});function qn({value:e,sx:t}){var a;const r=F.useTheme();return b.jsx(F.Stack,{direction:"row",justifyContent:"center",alignItems:"center",gap:"5px",sx:{padding:"6px 12px",background:(a=r.palette.backgroundPaperElevation)==null?void 0:a[8],borderRadius:"10px",minWidth:"111px",...t},children:b.jsx(F.Typography,{component:"span",sx:{textAlign:"right",fontSize:"14px",opacity:.8,color:r.palette.text.primary,whiteSpace:"nowrap"},children:e})})}const Oc=Re.observer(({store:e})=>{const{t}=we.useTranslation(),r=Re.useLocalObservable(()=>({get valueLabelFormat(){return e.currentMotionType==="translate"?a=>`v = ${t("Jogging.Cartesian.Translation.velocityMmPerSec.lb",{amount:a})}`:a=>`ω = ${t("Jogging.Cartesian.Rotation.velocityDegPerSec.lb",{amount:a})}`}}));return b.jsx(xc,{store:e,velocity:e.velocityInDisplayUnits,min:e.minVelocityInDisplayUnits,max:e.maxVelocityInDisplayUnits,onVelocityChange:e.setVelocityFromSlider,disabled:e.isLocked,renderValue:a=>b.jsx(qn,{value:r.valueLabelFormat(a),sx:{minWidth:"111px",span:{transform:"translateY(-1.5px)"}}})})}),FO=Re.observer(({store:e,children:t})=>{const{t:r}=we.useTranslation(),a=F.useTheme();function o(u,y){(y==="translate"||y==="rotate")&&e.setSelectedCartesianMotionType(y)}oi(()=>[e.selectedCoordSystemId,e.selectedTcpId],()=>{e.jogger.motionStream.motionStateSocket.changeUrl(e.jogger.nova.makeWebsocketURL(`/motion-groups/${e.jogger.motionGroupId}/state-stream?tcp=${e.selectedTcpId}&response_coordinate_system=${e.selectedCoordSystemId}`))},{fireImmediately:!0});async function n(u,y){const g=await e.activate(),m=g.motionStream.rapidlyChangingMotionState.tcp_pose,x=g.motionStream.rapidlyChangingMotionState.state.joint_position;m&&await e.withMotionLock(async()=>{try{e.setCurrentIncrementJog({axis:u.axis,direction:u.direction}),await e.jogger.runIncrementalCartesianMotion({currentTcpPose:m,currentJoints:x,coordSystemId:e.activeCoordSystemId,velocityInRelevantUnits:e.selectedCartesianMotionType==="translate"?e.translationVelocityMmPerSec:e.rotationVelocityRadsPerSec,axis:u.axis,direction:u.direction,motion:e.selectedCartesianMotionType==="translate"?{type:"translate",distanceMm:y.mm}:{type:"rotate",distanceRads:kt.degreesToRadians(y.degrees)}})}finally{e.setCurrentIncrementJog(null),await e.deactivate()}})}async function s(u){if(!e.isLocked){if(await e.activate(),e.activeDiscreteIncrement)return n(u,e.activeDiscreteIncrement);u.motionType==="translate"?await e.jogger.startTCPTranslation({axis:u.axis,direction:u.direction,velocityMmPerSec:e.translationVelocityMmPerSec}):await e.jogger.startTCPRotation({axis:u.axis,direction:u.direction,velocityRadsPerSec:e.rotationVelocityRadsPerSec})}}async function l(){e.isLocked||e.activeDiscreteIncrement||await e.deactivate()}function i(u,y,g){var x,I,G;const m=(G=(I=(x=g.componentsExt)==null?void 0:x.JoggingPanel)==null?void 0:I.JoggingCartesian)==null?void 0:G.Axis;if(m)return y==="translate"?m[u]:m.CustomRotation??m[u]}const c=[{id:"x",icon:b.jsx(DS,{}),colors:i("X",e.selectedCartesianMotionType,a)},{id:"y",icon:b.jsx(GS,{}),colors:i("Y",e.selectedCartesianMotionType,a)},{id:"z",icon:b.jsx(JS,{}),colors:i("Z",e.selectedCartesianMotionType,a)}];function d(u){return r("General.mm.variable",{amount:u.toFixed(1)})}function p(u){return r("General.degree.variable",{amount:kt.radiansToDegrees(u).toFixed(1)})}return b.jsxs(F.Stack,{flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[b.jsxs(F.Stack,{gap:2,children:[b.jsx(dO,{store:e}),b.jsx(Oc,{store:e}),b.jsx(F.Divider,{})]}),b.jsx(F.Stack,{marginLeft:"auto",marginRight:"auto",gap:"24px",justifyContent:"center",sx:{flexGrow:"1"},children:b.jsxs(F.Stack,{alignItems:"center",justifyContent:"center",gap:"24px",sx:{flexGrow:1},children:[b.jsxs(pO,{value:e.selectedCartesianMotionType,onChange:o,exclusive:!0,"aria-label":r("Jogging.Cartesian.MotionType.lb"),sx:{justifyContent:"center"},children:[b.jsx(F.ToggleButton,{value:"translate",children:r("Jogging.Cartesian.Translation.bt")}),b.jsx(F.ToggleButton,{value:"rotate",children:r("Jogging.Cartesian.Rotation.bt")})]}),e.selectedCartesianMotionType==="translate"&&c.map(u=>{var y,g;return b.jsx(nn,{colors:u.colors,disabled:e.isLocked,activeJoggingDirection:((y=e.incrementJogInProgress)==null?void 0:y.axis)===u.id?e.incrementJogInProgress.direction:void 0,label:b.jsxs(b.Fragment,{children:[u.icon,b.jsx(F.Typography,{sx:{fontSize:"24px",color:((g=u.colors)==null?void 0:g.labelColor)??a.palette.text.primary},children:u.id.toUpperCase()})]}),getDisplayedValue:()=>{var m;return d(((m=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:m.position[u.id])||0)},startJogging:m=>s({axis:u.id,motionType:"translate",direction:m}),stopJogging:l},u.id)}),e.selectedCartesianMotionType==="rotate"&&c.map(u=>{var y,g;return b.jsx(nn,{colors:u.colors,disabled:e.isLocked,activeJoggingDirection:((y=e.incrementJogInProgress)==null?void 0:y.axis)===u.id?e.incrementJogInProgress.direction:void 0,label:b.jsxs(b.Fragment,{children:[b.jsx(WS,{}),b.jsx(F.Typography,{sx:{fontSize:"24px",color:((g=u.colors)==null?void 0:g.labelColor)??a.palette.text.primary},children:u.id.toUpperCase()})]}),getDisplayedValue:()=>{var m,x;return p(((x=(m=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:m.orientation)==null?void 0:x[u.id])||0)},startJogging:m=>s({axis:u.id,motionType:"rotate",direction:m}),stopJogging:l},u.id)})]})}),b.jsx(dc,{store:e}),t&&b.jsx(F.Divider,{}),t]})}),NO=Re.observer(({store:e,children:t})=>{const r=F.useTheme();async function a(n){await e.activate(),await e.jogger.startJointRotation({joint:n.joint,direction:n.direction,velocityRadsPerSec:e.rotationVelocityRadsPerSec})}async function o(){await e.jogger.stop(),await e.deactivate()}return b.jsxs(F.Stack,{flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[b.jsx(Oc,{store:e}),b.jsx(F.Divider,{}),b.jsx(F.Stack,{justifyContent:"center",alignItems:"stretch",sx:{flexGrow:"1"},id:"JointControls",children:b.jsx(F.Stack,{alignItems:"center",gap:"24px",children:e.jogger.motionStream.joints.map(n=>{var c;const s=(c=e.motionGroupSpec.mechanical_joint_limits)==null?void 0:c[n.index],l=(s==null?void 0:s.lower_limit)!==void 0?kt.radiansToDegrees(s.lower_limit):void 0,i=(s==null?void 0:s.upper_limit)!==void 0?kt.radiansToDegrees(s.upper_limit):void 0;return b.jsxs(F.Stack,{direction:"row",alignItems:"center",justifyContent:"center",spacing:1.5,width:"100%",children:[e.showJointsLegend&&b.jsx(F.Typography,{color:e.isLocked?r.palette.text.disabled:r.palette.text.secondary,children:`G${n.index+1}`}),b.jsx(ii,{disabled:e.isLocked,lowerLimitDegs:l,upperLimitDegs:i,getValueDegs:()=>{const d=e.jogger.motionStream.rapidlyChangingMotionState.state.joint_position.joints[n.index];return d!==void 0?kt.radiansToDegrees(d):void 0},startJogging:d=>a({joint:n.index,direction:d}),stopJogging:o})]},`joint-${n.index}`)})})}),b.jsx(dc,{store:e}),t&&b.jsx(F.Divider,{}),t]})}),DO=yr(Re.observer(e=>{const t=_n.isString(e.nova)?new kS({instanceUrl:e.nova}):e.nova,r=Re.useLocalObservable(()=>({joggingStore:null,loadingError:null}));async function a(){Ae.runInAction(()=>{r.loadingError=null,r.joggingStore=null});try{let o=e.store;if(!o){const n=await t.connectJogger(e.motionGroupId);o=await Co.loadFor(n)}Ae.runInAction(()=>{r.joggingStore=o}),e.onSetup&&e.onSetup(o)}catch(o){r.loadingError=o}}return Y.useEffect(()=>(a(),e.store?()=>null:()=>{var o;(o=r.joggingStore)==null||o.dispose()}),[e.store,e.nova,e.motionGroupId]),Y.useEffect(()=>{const o=r.joggingStore;o&&(e.locked?o.lock("external"):o.unlock("external"))},[r.joggingStore,e.locked]),b.jsx(F.Stack,{sx:{maxWidth:"460px",minWidth:"320px",position:"relative",...e.sx},children:r.joggingStore?b.jsx(zO,{store:r.joggingStore,children:e.children}):b.jsx(Bn,{message:"Loading jogging",error:r.loadingError})})})),zO=Re.observer(({store:e,children:t})=>{const{t:r}=we.useTranslation();function a(){if(e.currentTab.id==="cartesian")return b.jsx(b.Fragment,{children:b.jsx(FO,{store:e,children:t})});if(e.currentTab.id==="joint")return b.jsx(b.Fragment,{children:b.jsx(NO,{store:e,children:t})})}return b.jsxs(F.Stack,{flexGrow:1,sx:{overflow:"hidden"},children:[b.jsx(F.Tabs,{value:e.tabIndex,onChange:e.onTabChange,variant:"fullWidth",children:e.tabs.map(o=>{const n=o.label==="cartesian"?r("Jogging.Cartesian.bt"):r("Jogging.Joints.bt"),s=o.label==="cartesian"?b.jsx(fh,{fontSize:"small",sx:{mr:1}}):b.jsx(yh,{fontSize:"small",sx:{mr:1}});return b.jsx(F.Tab,{label:e.showTabIcons?b.jsxs(F.Stack,{direction:"row",alignItems:"center",children:[s,n]}):n,id:`jogging-tab-${o.id}`,"aria-controls":`jogging-tab-${o.id}`},o.id)})}),b.jsx(F.Stack,{flexGrow:1,position:"relative",sx:{overflowY:"auto",overflowX:"hidden"},children:a()})]})}),wc=Y.forwardRef(({label:e,value:t},r)=>{var l;const a=F.useTheme(),[o,n]=Y.useState(!1);async function s(){if(!r||!("current"in r))return console.warn("No copy target found"),!1;try{return await navigator.clipboard.writeText(t),console.log("Copied!"),n(!0),!0}catch(i){console.error(i);const c=window.getSelection(),d=document.createRange();d.selectNodeContents(r.current),c.removeAllRanges(),c.addRange(d)}return!1}return Y.useEffect(()=>{if(!o)return;const i=setTimeout(()=>n(!1),3e3);return()=>{i&&clearTimeout(i)}},[o]),b.jsx(F.Tooltip,{open:o,title:"Copied!",children:b.jsx(F.Stack,{justifyContent:"center",sx:{height:"100%",boxSizing:"border-box",padding:"6px 12px",background:(l=a.palette.backgroundPaperElevation)==null?void 0:l[8],borderRadius:"10px",minWidth:"0",cursor:"pointer"},onClick:()=>s(),children:b.jsx(F.Typography,{ref:r,align:"center",sx:{pointerEvents:"none",fontSize:"12px",color:a.palette.text.primary,whiteSpace:"nowrap",minWidth:0,textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:t})})})}),GO=Re.observer(({motionStream:e})=>{const t=Y.useRef(null);function r(){const a=e.rapidlyChangingMotionState.tcp_pose;return a?kt.poseToWandelscriptString(a):""}return gr(()=>{if(!t.current)return;const a=r();t.current.textContent!==a&&(t.current.textContent=a)}),b.jsx(F.Stack,{alignItems:"left",spacing:2,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},children:b.jsx(wc,{value:r(),ref:t})})}),qO=Re.observer(({motionStream:e})=>{const t=Y.useRef(null);function r(){const{joints:a}=e.rapidlyChangingMotionState.state.joint_position;return`[${a.map(o=>parseFloat(o.toFixed(4))).join(", ")}]`}return gr(()=>{if(!t.current)return;const a=r();t.current.textContent!==a&&(t.current.textContent=a)}),b.jsx(F.Stack,{alignItems:"left",spacing:2,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},children:b.jsx(wc,{value:r(),ref:t})})});function JO(){const e=window.location.href;return e.substring(0,e.indexOf("/",e.indexOf("//")+2))}function HO({baseUrl:e=JO(),...t}){return b.jsxs(F.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:[b.jsx(F.DialogTitle,{id:"no-motion-group-modal-title",children:"No motion group found"}),b.jsxs(F.DialogContent,{sx:{marginTop:"3rem",marginBottom:"1.5rem",textAlign:"center"},children:[b.jsx(F.Typography,{color:"#fff",children:"Found no devices to connect to."}),b.jsx(F.Typography,{color:"#fff",children:"Please ensure a motion group has been created."})]}),b.jsx(F.DialogActions,{children:b.jsxs(F.Stack,{width:"100%",maxWidth:"300px",margin:"auto",marginBottom:"2rem",children:[b.jsx(F.Button,{href:`${e}/settings`,variant:"contained",sx:{borderRadius:"8px",width:"100%"},children:"Go to settings app"}),b.jsx(F.Button,{href:`${e}`,variant:"text",sx:{marginTop:"1rem",color:"#fff",textDecoration:"underline",fontSize:"0.75rem"},children:"Back to Homescreen"})]})})]})}const WO=Array(6).fill(2*Math.PI),$l="0.0.0-semantically-released";function Jn(e){let t=$l;return $l.startsWith("0.")&&(t=""),`https://cdn.jsdelivr.net/gh/wandelbotsgmbh/wandelbots-js-react-components${t?`@${t}`:""}/public/models/${e}.glb`}function QO(e){function t(r){return r.children.length===0?[r]:[r,...r.children.flatMap(a=>t(a))]}return t(e).filter(r=>Pc(r))}function Cc(e){return e.name.endsWith("_FLG")}function Pc(e){return/_J[0-9]+$/.test(e.name)}function KO(e,t){let r;function a(o){if(Cc(o)){if(r)throw Error(`Found multiple flange groups in robot model ${t}; first ${r.name} then ${o.name}. Only one _FLG group is allowed.`);r=o}Pc(o),o.children.map(a)}if(a(e.scene),!r)throw Error(`No flange group found in robot model ${t}. Flange must be identified with a name ending in _FLG.`);return{gltf:e}}function Vc({rapidlyChangingMotionState:e,dhParameters:t,onRotationChanged:r,children:a}){tn.Globals.assign({frameLoop:"always"});const o=Y.useRef([]),{invalidate:n}=Bc.useThree();function s(p){p&&(o.current=QO(p),d(),n())}const l=Y.useMemo(()=>e.state.joint_position.joints.filter(p=>p!==void 0),[e.state.joint_position.joints]),i=Y.useMemo(()=>{const p={config:{tension:120,friction:20},onChange:()=>{d(),n()}};return t.forEach((u,y)=>{p[`joint${y}`]=l[y]||0}),p},[l,t.length]),c=tn.useSpring(i);function d(){const p=t.map((u,y)=>{const g=c[`joint${y}`];return g?g.get():0});if(r)r(o.current,p);else for(const[u,y]of o.current.entries()){const g=t[u],m=g.theta||0,x=g.reverse_rotation_direction?-1:1;y.rotation.y=x*p[u]+m}}return b.jsx("group",{ref:s,children:a})}const YO="line",XO="mesh";function ZO({rapidlyChangingMotionState:e,dhParameters:t,...r}){const a=new Ze.Matrix4,o=Y.useRef([]),n=Y.useRef([]);Y.useEffect(()=>{o.current=new Array(t.length).fill(null),n.current=new Array(t.length).fill(null)},[t.length]);function s(c,d){const p=new Ze.Vector3,u=new Ze.Quaternion,y=new Ze.Vector3;a.decompose(p,u,y);const g=p.clone(),m=new Ze.Matrix4().makeRotationY(c.theta+d*(c.reverse_rotation_direction?-1:1)).multiply(new Ze.Matrix4().makeTranslation(0,c.d/1e3,0)).multiply(new Ze.Matrix4().makeTranslation(c.a/1e3,0,0)).multiply(new Ze.Matrix4().makeRotationX(c.alpha));return a.multiply(m),a.decompose(p,u,y),{a:g,b:p}}function l(c,d,p,u){if(!t)return;const y=t[c];if(!y)return;const{a:g,b:m}=s(y,u);d.geometry.setPositions([g.toArray(),m.toArray()].flat()),p.position.set(m.x,m.y,m.z)}function i(c,d){a.identity();for(let p=0;p<Math.min(c.length,d.length);p++){const u=o.current[p],y=n.current[p];u&&y&&l(p,u,y,d[p])}}return b.jsx(b.Fragment,{children:b.jsx(Vc,{rapidlyChangingMotionState:e,dhParameters:t,onRotationChanged:i,children:b.jsxs("group",{...r,name:"Scene",children:[b.jsxs("mesh",{children:[b.jsx("sphereGeometry",{args:[.01,32,32]}),b.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]}),t.map((c,d)=>{const{a:p,b:u}=s(c,e.state.joint_position.joints[d]??0),y=`dhrobot_J0${d}`;return b.jsxs("group",{name:y,children:[b.jsx(et.Line,{ref:g=>{o.current[d]=g},name:YO,points:[p,u],color:"white",lineWidth:5}),b.jsxs("mesh",{ref:g=>{n.current[d]=g},name:XO,position:u,children:[b.jsx("sphereGeometry",{args:[.01,32,32]}),b.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]},"mesh_"+d)]},y)})]})})})}const ew=console.warn;function tw(){return Y.useEffect(()=>{console.warn=e=>{e!=="Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"&&ew(e)}},[]),b.jsx(b.Fragment,{})}function rw(e){return e.type==="Mesh"}function aw({modelURL:e,flangeRef:t,postModelRender:r,...a}){const{gltf:o}=KO(et.useGLTF(e),e.split("/").pop()||e),n=Y.useCallback(l=>{l&&r&&r()},[e]);function s(l){return rw(l)?b.jsx("mesh",{name:l.name,geometry:l.geometry,material:l.material,position:l.position,rotation:l.rotation},l.uuid):b.jsx(tn.animated.group,{name:l.name,position:l.position,rotation:l.rotation,ref:Cc(l)?t:void 0,children:l.children.map(s)},l.uuid)}return b.jsx("group",{...a,dispose:null,ref:n,children:s(o.scene)})}const ow=(e,t)=>{e.userData.isGhost||(e.traverse(r=>{if(r instanceof Oe.Mesh){r.material instanceof Oe.Material&&(r.material.colorWrite=!1);const a=r.clone(),o=r.clone();a.material=new Oe.MeshStandardMaterial({depthTest:!0,depthWrite:!0,colorWrite:!1,polygonOffset:!0,polygonOffsetFactor:-1,side:Oe.DoubleSide}),a.userData.isGhost=!0,o.material=new Oe.MeshStandardMaterial({color:t,opacity:.3,depthTest:!0,depthWrite:!1,transparent:!0,polygonOffset:!0,polygonOffsetFactor:-2,side:Oe.DoubleSide}),o.userData.isGhost=!0,r.parent&&(r.parent.add(a),r.parent.add(o))}}),e.userData.isGhost=!0)},nw=e=>{if(!e.userData.isGhost)return;const t=[];e.traverse(r=>{var a;r instanceof Oe.Mesh&&((a=r.userData)!=null&&a.isGhost?t.push(r):r.material instanceof Oe.Material&&(r.material.colorWrite=!0))}),t.forEach(r=>{r.parent&&r.parent.remove(r)}),e.userData.isGhost=!1},Rc=yr(({rapidlyChangingMotionState:e,modelFromController:t,dhParameters:r,getModel:a=Jn,flangeRef:o,postModelRender:n,transparentColor:s,...l})=>{const[i,c]=Y.useState(null),d=Y.useCallback(u=>{c(u)},[]);Y.useEffect(()=>{i&&(s?ow(i,s):nw(i))},[i,s]);const p=b.jsx(ZO,{rapidlyChangingMotionState:e,dhParameters:r,...l});return b.jsxs(qc.ErrorBoundary,{fallback:p,onError:u=>{console.error(u)},children:[b.jsx(Y.Suspense,{fallback:p,children:b.jsx("group",{ref:d,children:b.jsx(Vc,{rapidlyChangingMotionState:e,dhParameters:r,children:b.jsx(aw,{modelURL:a(t),postModelRender:n,flangeRef:o,...l})})})}),b.jsx(tw,{})]})});function sw({connectedMotionGroup:e,getModel:t=Jn,flangeRef:r,transparentColor:a,...o}){return e.dhParameters?b.jsx(Rc,{rapidlyChangingMotionState:e.rapidlyChangingMotionState,modelFromController:e.modelFromController||"",dhParameters:e.dhParameters,getModel:t,flangeRef:r,transparentColor:a,...o}):null}const lw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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"})),iw=Y.forwardRef(lw),cw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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"})),dw=Y.forwardRef(cw),it=Re.observer(({id:e,icon:t,color:r,title:a,name:o,explanation:n,literalValue:s,anchorOrigin:l,transformOrigin:i})=>{const c=Re.useLocalObservable(()=>({anchorEl:null,get isPopoverOpen(){return!!c.anchorEl},openPopover(d){c.anchorEl=d.currentTarget},closePopover(){c.anchorEl=null}}));return b.jsxs(b.Fragment,{children:[b.jsx(F.Stack,{"aria-owns":c.isPopoverOpen?e:void 0,"aria-haspopup":"true",onMouseEnter:c.openPopover,onMouseLeave:c.closePopover,sx:{cursor:"pointer"},children:b.jsx(F.SvgIcon,{component:t,sx:{color:r}})}),b.jsx(F.Popover,{id:e,sx:{pointerEvents:"none"},open:c.isPopoverOpen,anchorEl:c.anchorEl,anchorOrigin:l??{vertical:"bottom",horizontal:"left"},transformOrigin:i??{vertical:"top",horizontal:"left"},onClose:c.closePopover,disableRestoreFocus:!0,children:b.jsxs(F.Stack,{gap:"1rem",padding:2,maxWidth:"450px",sx:{wordWrap:"break-word"},children:[b.jsxs("div",{children:[a&&b.jsx(F.Typography,{component:"span",fontSize:"14px",children:`${a}: `}),b.jsx(F.Typography,{component:"span",color:r,fontWeight:"bold",fontSize:"14px",children:o})]}),b.jsx(F.Typography,{fontSize:"14px",children:n}),s&&b.jsx(F.Typography,{fontSize:"12px",children:s})]})})]})}),pw=Re.observer(({isVirtual:e,motionGroupId:t,anchorOrigin:r,transformOrigin:a})=>{const o=F.useTheme(),{t:n}=we.useTranslation();return e?b.jsx(it,{id:"motion-group-virtual",icon:dw,color:o.palette.tertiary.main,name:n("SafetyBar.ControllerType.Virtual.lb"),explanation:b.jsxs(we.Trans,{i18nKey:"SafetyBar.MotionGroup.Virtual.Explanation.lb",values:{motionGroupId:t},children:["Motion group ",b.jsx("code",{children:t})," refers to a virtual robot with no physical counterpart. It can be freely manipulated without special safety precautions."]}),anchorOrigin:r,transformOrigin:a}):b.jsx(it,{id:"motion-group-physical",icon:iw,color:o.palette.primary.main,name:n("SafetyBar.ControllerType.Physical.lb"),explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.MotionGroup.Physical.Explanation.lb",values:{motionGroupId:t},components:{code:b.jsx("code",{}),strong:b.jsx("strong",{})}}),anchorOrigin:r,transformOrigin:a})}),uw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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"})),hw=Y.forwardRef(uw),mw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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})),fw=Y.forwardRef(mw),yw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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"})),gw=Y.forwardRef(yw),bw=Re.observer(({operationMode:e,anchorOrigin:t,transformOrigin:r})=>{const{t:a}=we.useTranslation(),o=F.useTheme();switch(e){case"OPERATION_MODE_AUTO":return b.jsx(it,{id:"operation-mode-auto",icon:hw,title:a("SafetyBar.OperationMode.ti"),name:a("SafetyBar.OperationMode.Automatic.ti"),color:"rgba(255, 255, 255, 0.57)",explanation:b.jsx(we.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:r});case"OPERATION_MODE_MANUAL":case"OPERATION_MODE_MANUAL_T1":case"OPERATION_MODE_MANUAL_T2":return b.jsx(it,{id:"operation-mode-manual",icon:gw,color:o.palette.warning.main,title:a("SafetyBar.OperationMode.ti"),name:a("SafetyBar.OperationMode.Manual.lb"),explanation:b.jsx(we.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:r});default:return b.jsx(it,{id:"operation-mode-error",icon:fw,color:o.palette.warning.main,title:a("SafetyBar.OperationMode.ti"),name:a("SafetyBar.OperationMode.Error.lb"),explanation:b.jsx(we.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:r})}}),Sw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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"})),vw=Y.forwardRef(Sw),xw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"M10.24 10.636 12 13.764l1.76-3.128h-3.52Z"}),L.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"}),L.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"})),Ow=Y.forwardRef(xw),ww=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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})),Cw=Y.forwardRef(ww),Pw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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"})),Vw=Y.forwardRef(Pw),Rw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.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"})),_w=Y.forwardRef(Rw),Aw=Re.observer(({safetyState:e,anchorOrigin:t,transformOrigin:r})=>{const{t:a}=we.useTranslation(),o=F.useTheme();switch(e){case"SAFETY_STATE_NORMAL":return b.jsx(it,{id:"safety-state-normal",title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.Normal.lb"),icon:Vw,color:"rgba(255, 255, 255, 0.57)",explanation:b.jsx(we.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:r});case"SAFETY_STATE_DEVICE_EMERGENCY_STOP":case"SAFETY_STATE_ROBOT_EMERGENCY_STOP":return b.jsx(it,{id:"safety-state-estop",title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.Estop.lb"),icon:Ow,color:o.palette.error.main,explanation:b.jsx(we.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:r});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 b.jsx(it,{id:"safety-state-stop",icon:_w,title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.Stop.lb"),color:o.palette.warning.main,explanation:b.jsx(we.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:r});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 b.jsx(it,{id:"safety-state-manual-action-required",icon:Cw,color:o.palette.warning.main,title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.ManualActionRequired.lb"),explanation:b.jsx(we.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:r});case"SAFETY_STATE_UNKNOWN":case"SAFETY_STATE_FAULT":return b.jsx(it,{id:"safety-state-error",icon:vw,color:o.palette.error.main,title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.Error.lb"),explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.SafetyState.Error.Explanation.lb",children:"The robot controller has entered an unexpected safety state."}),literalValue:e,anchorOrigin:t,transformOrigin:r});default:BS(e,`Unknown safety state ${e}`)}}),Tw=yr(Re.observer(e=>b.jsxs(F.Stack,{direction:"row",gap:"8px",alignItems:"center",sx:{height:"24px"},children:[b.jsx(Aw,{safetyState:e.safetyState,anchorOrigin:e.anchorOrigin,transformOrigin:e.transformOrigin}),b.jsx(F.Divider,{orientation:"vertical",flexItem:!0}),b.jsx(bw,{operationMode:e.operationMode,anchorOrigin:e.anchorOrigin,transformOrigin:e.transformOrigin}),b.jsx(F.Divider,{orientation:"vertical",flexItem:!0}),b.jsx(pw,{isVirtual:e.isVirtual,motionGroupId:e.motionGroupId,anchorOrigin:e.anchorOrigin,transformOrigin:e.transformOrigin})]}))),Iw=F.styled(F.Fab,{shouldForwardProp:e=>e!=="selected"})(({theme:e})=>{var t,r,a;return{borderRadius:"20px","&:hover":{background:(t=e.palette.backgroundPaperElevation)==null?void 0:t[7]},variants:[{props:({selected:o})=>!o,style:{background:(r=e.palette.backgroundPaperElevation)==null?void 0:r[0],color:e.palette.action.disabled,"> img":{opacity:.4}}},{props:({selected:o})=>o,style:{background:(a=e.palette.backgroundPaperElevation)==null?void 0:a[11],border:`1px solid ${e.palette.divider}`,color:e.palette.primary.contrastText}}]}}),Ew=Y.forwardRef((e,t)=>b.jsx(Iw,{ref:t,selected:e.selected,...e,color:"secondary",variant:"circular"})),Mw={$schema:"https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",name:"wandelscript",patterns:[{include:"#keywords"},{include:"#strings"},{include:"#comments"},{include:"#functions"}],repository:{keywords:{patterns:[{name:"keyword.control.flow.wandelscript",match:"\\b(move|via|to|interrupt|def|False|True|for|if|else|elif|while|return|switch|activate|deactivate|print|and|or|not)\\b"}]},strings:{name:"string.quoted.double.wandelscript",begin:'"',end:'"',patterns:[{name:"constant.character.escape.wandelscript",match:"\\\\."}]},comments:{patterns:[{begin:"#",beginCaptures:{0:{name:"punctuation.definition.comment.wandelscript"}},end:"$",name:"comment.line.number-sign.wandelscript"}]},functions:{patterns:[{match:"[a-zA-Z_-]+\\(",name:"entity.name.function.wandelscript"}]}},scopeName:"source.wandelscript"},jw=Y.lazy(()=>import("@monaco-editor/react"));let en=null;async function $w(){if(!en){const[{createHighlighter:e},{shikiToMonaco:t}]=await Promise.all([import("shiki"),import("@shikijs/monaco")]);en={shiki:await e({langs:[Mw],themes:["dark-plus","light-plus"]}),shikiToMonaco:t}}return en}const Uw=yr(e=>{const t=F.useTheme(),[r,a]=Y.useState("dark-plus"),o=t.palette.mode==="dark"?"dark-plus":"light-plus";async function n(s){var c,d;s.languages.register({id:"wandelscript"}),s.languages.setLanguageConfiguration("wandelscript",{comments:{lineComment:"#"},brackets:[["(",")"],["[","]"]],autoClosingPairs:[{open:"[",close:"]"},{open:"(",close:")"}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"}]});const{shiki:l,shikiToMonaco:i}=await $w();i(l,s),s.editor.defineTheme(o,((d=(c=t.componentsExt)==null?void 0:c.WandelscriptEditor)==null?void 0:d.monacoTheme)??{base:t.palette.mode==="dark"?"vs-dark":"vs",inherit:!0,rules:[],colors:{}}),e.monacoSetup&&e.monacoSetup(s),a(o)}return b.jsx(Y.Suspense,{fallback:b.jsx(Bn,{}),children:b.jsx(jw,{value:e.code,onMount:(s,l)=>{n(l)},onChange:e.onChange,defaultLanguage:"wandelscript",theme:r,options:{minimap:{enabled:!1},wordWrap:"on",automaticLayout:!0,...e.monacoOptions}})})});function _c(){var t,r,a,o,n,s,l;const e=F.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`}}},MuiButton:{styleOverrides:{root:{textTransform:"none",borderRadius:"10px"}},variants:[{props:{color:"secondary",variant:"contained"},style:{border:`1px solid ${e.palette.divider}`,background:(a=(r=(t=e.paletteExt)==null?void 0:t.secondary)==null?void 0:r.tonal)==null?void 0:a.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:(o=e.palette.backgroundPaperElevation)==null?void 0:o[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=(n=e.paletteExt)==null?void 0:n.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":F.rgbToHex(((l=e.palette.backgroundPaperElevation)==null?void 0:l[5])??""),"editor.foreground":"#d4d4d4","editorLineNumber.foreground":"#797979","editorLineNumber.activeForeground":"#e9e9e9","editor.lineHighlightBorder":"#e9e9e911"}}}}}}function kw(){const e=_c();return e.palette.mode="light",e}function Lw(e){var a,o,n,s;let t=!0;((a=e.palette)==null?void 0:a.mode)==="light"?t=!1:((o=e.palette)==null?void 0:o.mode)!=="dark"&&(t=!(typeof window<"u"&&((s=(n=window.matchMedia)==null?void 0:n.call(window,"(prefers-color-scheme: light)"))==null?void 0:s.matches)));const r=t?_c():kw();return ai(r,e)}exports.JoggingCartesianAxisControl=nn;exports.JoggingJointRotationControl=ii;exports.JoggingPanel=DO;exports.JoggingStore=Co;exports.LoadingCover=Bn;exports.LoadingErrorMessage=Zi;exports.NoMotionGroupModal=HO;exports.PoseCartesianValues=GO;exports.PoseJointValues=qO;exports.PresetEnvironment=Qc;exports.Robot=sw;exports.SafetyBar=Tw;exports.SafetyZonesRenderer=Xc;exports.SelectableFab=Ew;exports.SupportedRobot=Rc;exports.TrajectoryRenderer=Zc;exports.VelocitySlider=xc;exports.VelocitySliderLabel=qn;exports.WandelscriptEditor=Uw;exports.createNovaMuiTheme=Lw;exports.defaultAxisConfig=WO;exports.defaultGetModel=Jn;exports.i18n=$n;exports.useAnimationFrame=gr;exports.useAutorun=Lu;exports.useMounted=lo;exports.useReaction=oi;
107
107
  //# sourceMappingURL=index.cjs.map