"}function processFirstBlock(e,t,a,r){if(recFileProtocol=0,1==e&&0==t){try{recFileMetadata=JSON.parse(r)}catch(e){return void cleanup()}if(null!=recFileMetadata&&"MeshCentralRelaySession"==recFileMetadata.magic&&1==recFileMetadata.ver){var i="";if(i+=addInfo("Temps",recFileMetadata.time),0!=recFileEndTime){var l=Math.floor((recFileEndTime-a)/1e3);i+=addInfo("Duration",format("{0} second{1}",l,1 Appuyez sur [espace] pour jouer/mettre en pause.",QE("PlayButton",!0),QE("PauseButton",!1),QE("RestartButton",!1),recFileStartTime=recFileLastTime=a):2==recFileMetadata.protocol?(recFileProtocol=2,i+="
Appuyez sur [espace] pour jouer/mettre en pause.",QE("PlayButton",!0),QE("PauseButton",!1),QE("RestartButton",!1),recFileStartTime=recFileLastTime=a,(agentDesktop=CreateAgentRemoteDesktop("Desk")).onScreenSizeChange=deskAdjust,agentDesktop.State=3,deskAdjust()):101==recFileMetadata.protocol&&(recFileProtocol=101,i+="
Press [space] to play/pause.",QE("PlayButton",!0),QE("PauseButton",!1),QE("RestartButton",!1),recFileStartTime=recFileLastTime=a,(amtDesktop=CreateAmtRemoteDesktop("Desk")).onScreenSizeChange=deskAdjust,amtDesktop.State=3,amtDesktop.Start(),deskAdjust()),QV("metadatadiv",!0),QH("metadatadiv",i),QH("deskstatus",recFile.name)}else cleanup()}else cleanup()}function processBlock(e,t,a,r){if(e<0)pause();else{var i=Math.round((a-recFileLastTime)*parseFloat(Q("PlaySpeed").value));i<5?processBlockEx(e,t,a,r):(waitTimerArgs=[e,t,a,r],waitTimer=setTimeout(function(){waitTimer=null,processBlockEx(waitTimerArgs[0],waitTimerArgs[1],waitTimerArgs[2],waitTimerArgs[3])},i))}}function processBlockEx(e,t,a,r){if(0!=playing){var i=0!=(1&t),l=0!=(2&t),n=Math.floor((a-recFileStartTime)/1e3);if(currentDeltaTimeTotalSec!=n){currentDeltaTimeTotalSec=n;var o=Math.floor(n/3600);n-=3600*o;var s=Math.floor(n/60);n-=60*o;var c=Math.floor(n);QH("timespan",pad2(o)+":"+pad2(s)+":"+pad2(c))}2==e&&i&&!l?1==recFileProtocol?agentTerminal.ProcessData(r):2==recFileProtocol?agentDesktop.ProcessData(r):101==recFileProtocol&&(0==readState&&"4100000000000000"==rstr2hex(r)?(readState=1,8MeshCentral Session Player
Drag & drop a .mcrec file or click "Open File..."'),QV("DeskParent",!0),QV("TermParent",!1)}function ondrop(e){if(haltEvent(e),QV("bigfail",!1),QV("bigok",!1),null!=e.dataTransfer){var t=[];for(var a in e.dataTransfer.files)null!=e.dataTransfer.files[a].type&&null!=e.dataTransfer.files[a].size&&0!=e.dataTransfer.files[a].size&&e.dataTransfer.files[a].name.endsWith(".mcrec")&&t.push(e.dataTransfer.files[a]);0!=t.length&&(cleanup(),recFile=t[0],recFilePtr=0,readNextBlock(processFirstBlock),readLastBlock(function(e,t,a){recFileEndTime=3==e?a:0}))}}var xxdialogMode,xxdialogFunc,xxdialogButtons,xxdialogTag,dragtimer=null;function ondragover(e){haltEvent(e),null!=dragtimer&&(clearTimeout(dragtimer),dragtimer=null);QV("bigok",!0),QV("bigfail",!1)}function ondragleave(e){haltEvent(e),dragtimer=setTimeout(function(){QV("bigfail",!1),QV("bigok",!1),dragtimer=null},10)}function onkeypress(e){xxdialogMode||(" "==e.key&&(togglePause(),haltEvent(e)),"1"==e.key&&(Q("PlaySpeed").value=4,haltEvent(e)),"2"==e.key&&(Q("PlaySpeed").value=2,haltEvent(e)),"3"==e.key&&(Q("PlaySpeed").value=1,haltEvent(e)),"4"==e.key&&(Q("PlaySpeed").value=.5,haltEvent(e)),"5"==e.key&&(Q("PlaySpeed").value=.25,haltEvent(e)),"6"==e.key&&(Q("PlaySpeed").value=.1,haltEvent(e)),"0"==e.key&&(pause(),restart(),haltEvent(e)))}function openfile(){setDialogMode(2,"Open File...",3,openfileEx,''),QE("idx_dlgOkButton",!1)}function openfileEx(){var e=Q("p2fileinput").files;if(null!=e){var t=[];for(var a in e)null!=e[a].type&&null!=e[a].size&&0!=e[a].size&&e[a].name.endsWith(".mcrec")&&t.push(e[a])}0!=t.length&&(cleanup(),recFile=t[0],recFilePtr=0,readNextBlock(processFirstBlock),readLastBlock(function(e,t,a){recFileEndTime=3==e?a:0}),Q("OpenFileButton").blur())}function openfileChanged(){var e=Q("p2fileinput").files;if(null!=e){var t=[];for(var a in e)null!=e[a].type&&null!=e[a].size&&0!=e[a].size&&e[a].name.endsWith(".mcrec")&&t.push(e[a])}QE("idx_dlgOkButton",1==t.length)}function togglePause(){return null!=recFile&&(1==playing?pause():recFilePtr!=recFile.size&&play()),!1}function play(){Q("PlayButton").blur(),1!=playing&&0!=recFileProtocol&&(playing=!0,QV("metadatadiv",!1),QE("PlayButton",!1),QE("PauseButton",!0),QE("RestartButton",!1),1==recFileProtocol&&null==agentTerminal&&(QV("DeskParent",!1),QV("TermParent",!0),agentTerminal=CreateAmtRemoteTerminal("Term",{}),agentTerminal.State=3),readNextBlock(processBlock))}function pause(){Q("PauseButton").blur(),0!=playing&&(playing=!1,QE("PlayButton",recFilePtr!=recFile.size),QE("PauseButton",!1),QE("RestartButton",0!=recFilePtr),null!=waitTimer&&(clearTimeout(waitTimer),waitTimer=null,processBlockEx(waitTimerArgs[0],waitTimerArgs[1],waitTimerArgs[2],waitTimerArgs[3]),waitTimerArgs=null))}function restart(){Q("RestartButton").blur(),1!=playing&&(currentDeltaTimeTotalSec=readState=recFilePtr=0,QV("metadatadiv",!0),QE("PlayButton",!0),QE("PauseButton",!1),QE("RestartButton",!1),QS("progressbar").width="0px",QH("timespan","00:00:00"),QV("DeskParent",!0),QV("TermParent",!1),agentDesktop?agentDesktop.Canvas.clearRect(0,0,agentDesktop.CanvasId.width,agentDesktop.CanvasId.height):amtDesktop?(amtDesktop.canvas.clearRect(0,0,amtDesktop.CanvasId.width,amtDesktop.CanvasId.height),(amtDesktop=CreateAmtRemoteDesktop("Desk")).onScreenSizeChange=deskAdjust,amtDesktop.State=3,amtDesktop.Start()):agentTerminal=agentTerminal&&null)}function clearConsoleMsg(){QH("p11DeskConsoleMsg","")}function toggleAspectRatio(e){1===e&&(deskAspectRatio=(deskAspectRatio+1)%3),deskAdjust()}function deskAdjust(){var e=Q("DeskParent").clientHeight,t=Q("DeskParent").clientWidth,a=Q("Desk").height,r=Q("Desk").width;if(2==deskAspectRatio)QS("Desk")["margin-top"]=null,QS("Desk").height="100%",QS("Desk").width="100%",QS("DeskParent").overflow="hidden";else if(1==deskAspectRatio)QS("Desk")["margin-top"]="0px",QS("Desk").height=a+"px",QS("Desk").width=r+"px",QS("DeskParent").overflow="scroll";else{if(a/r