rustdesk/web/assets/index.b043e392.js
2022-02-07 00:16:09 +08:00

22 lines
155 KiB
JavaScript

var Hi=Object.defineProperty;var Gi=(e,r,i)=>r in e?Hi(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i;var _=(e,r,i)=>(Gi(e,typeof r!="symbol"?r+"":r,i),i);import{m as a,l as Me,s as Zi,Q as Yi,a as Ki,b as fr,P as Qi}from"./vendor.b7bb6fa2.js";const Xi=function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))t(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&t(u)}).observe(document,{childList:!0,subtree:!0});function i(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerpolicy&&(o.referrerPolicy=n.referrerpolicy),n.crossorigin==="use-credentials"?o.credentials="include":n.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function t(n){if(n.ep)return;n.ep=!0;const o=i(n);fetch(n.href,o)}};Xi();var k;(function(e){e[e.Unknown=0]="Unknown",e[e.Alt=1]="Alt",e[e.Backspace=2]="Backspace",e[e.CapsLock=3]="CapsLock",e[e.Control=4]="Control",e[e.Delete=5]="Delete",e[e.DownArrow=6]="DownArrow",e[e.End=7]="End",e[e.Escape=8]="Escape",e[e.F1=9]="F1",e[e.F10=10]="F10",e[e.F11=11]="F11",e[e.F12=12]="F12",e[e.F2=13]="F2",e[e.F3=14]="F3",e[e.F4=15]="F4",e[e.F5=16]="F5",e[e.F6=17]="F6",e[e.F7=18]="F7",e[e.F8=19]="F8",e[e.F9=20]="F9",e[e.Home=21]="Home",e[e.LeftArrow=22]="LeftArrow",e[e.Meta=23]="Meta",e[e.Option=24]="Option",e[e.PageDown=25]="PageDown",e[e.PageUp=26]="PageUp",e[e.Return=27]="Return",e[e.RightArrow=28]="RightArrow",e[e.Shift=29]="Shift",e[e.Space=30]="Space",e[e.Tab=31]="Tab",e[e.UpArrow=32]="UpArrow",e[e.Numpad0=33]="Numpad0",e[e.Numpad1=34]="Numpad1",e[e.Numpad2=35]="Numpad2",e[e.Numpad3=36]="Numpad3",e[e.Numpad4=37]="Numpad4",e[e.Numpad5=38]="Numpad5",e[e.Numpad6=39]="Numpad6",e[e.Numpad7=40]="Numpad7",e[e.Numpad8=41]="Numpad8",e[e.Numpad9=42]="Numpad9",e[e.Cancel=43]="Cancel",e[e.Clear=44]="Clear",e[e.Menu=45]="Menu",e[e.Pause=46]="Pause",e[e.Kana=47]="Kana",e[e.Hangul=48]="Hangul",e[e.Junja=49]="Junja",e[e.Final=50]="Final",e[e.Hanja=51]="Hanja",e[e.Kanji=52]="Kanji",e[e.Convert=53]="Convert",e[e.Select=54]="Select",e[e.Print=55]="Print",e[e.Execute=56]="Execute",e[e.Snapshot=57]="Snapshot",e[e.Insert=58]="Insert",e[e.Help=59]="Help",e[e.Sleep=60]="Sleep",e[e.Separator=61]="Separator",e[e.Scroll=62]="Scroll",e[e.NumLock=63]="NumLock",e[e.RWin=64]="RWin",e[e.Apps=65]="Apps",e[e.Multiply=66]="Multiply",e[e.Add=67]="Add",e[e.Subtract=68]="Subtract",e[e.Decimal=69]="Decimal",e[e.Divide=70]="Divide",e[e.Equals=71]="Equals",e[e.NumpadEnter=72]="NumpadEnter",e[e.RShift=73]="RShift",e[e.RControl=74]="RControl",e[e.RAlt=75]="RAlt",e[e.CtrlAltDel=100]="CtrlAltDel",e[e.LockScreen=101]="LockScreen",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(k||(k={}));function ge(e){switch(e){case 0:case"Unknown":return 0;case 1:case"Alt":return 1;case 2:case"Backspace":return 2;case 3:case"CapsLock":return 3;case 4:case"Control":return 4;case 5:case"Delete":return 5;case 6:case"DownArrow":return 6;case 7:case"End":return 7;case 8:case"Escape":return 8;case 9:case"F1":return 9;case 10:case"F10":return 10;case 11:case"F11":return 11;case 12:case"F12":return 12;case 13:case"F2":return 13;case 14:case"F3":return 14;case 15:case"F4":return 15;case 16:case"F5":return 16;case 17:case"F6":return 17;case 18:case"F7":return 18;case 19:case"F8":return 19;case 20:case"F9":return 20;case 21:case"Home":return 21;case 22:case"LeftArrow":return 22;case 23:case"Meta":return 23;case 24:case"Option":return 24;case 25:case"PageDown":return 25;case 26:case"PageUp":return 26;case 27:case"Return":return 27;case 28:case"RightArrow":return 28;case 29:case"Shift":return 29;case 30:case"Space":return 30;case 31:case"Tab":return 31;case 32:case"UpArrow":return 32;case 33:case"Numpad0":return 33;case 34:case"Numpad1":return 34;case 35:case"Numpad2":return 35;case 36:case"Numpad3":return 36;case 37:case"Numpad4":return 37;case 38:case"Numpad5":return 38;case 39:case"Numpad6":return 39;case 40:case"Numpad7":return 40;case 41:case"Numpad8":return 41;case 42:case"Numpad9":return 42;case 43:case"Cancel":return 43;case 44:case"Clear":return 44;case 45:case"Menu":return 45;case 46:case"Pause":return 46;case 47:case"Kana":return 47;case 48:case"Hangul":return 48;case 49:case"Junja":return 49;case 50:case"Final":return 50;case 51:case"Hanja":return 51;case 52:case"Kanji":return 52;case 53:case"Convert":return 53;case 54:case"Select":return 54;case 55:case"Print":return 55;case 56:case"Execute":return 56;case 57:case"Snapshot":return 57;case 58:case"Insert":return 58;case 59:case"Help":return 59;case 60:case"Sleep":return 60;case 61:case"Separator":return 61;case 62:case"Scroll":return 62;case 63:case"NumLock":return 63;case 64:case"RWin":return 64;case 65:case"Apps":return 65;case 66:case"Multiply":return 66;case 67:case"Add":return 67;case 68:case"Subtract":return 68;case 69:case"Decimal":return 69;case 70:case"Divide":return 70;case 71:case"Equals":return 71;case 72:case"NumpadEnter":return 72;case 73:case"RShift":return 73;case 74:case"RControl":return 74;case 75:case"RAlt":return 75;case 100:case"CtrlAltDel":return 100;case 101:case"LockScreen":return 101;case-1:case"UNRECOGNIZED":default:return-1}}function Ye(e){switch(e){case 0:return"Unknown";case 1:return"Alt";case 2:return"Backspace";case 3:return"CapsLock";case 4:return"Control";case 5:return"Delete";case 6:return"DownArrow";case 7:return"End";case 8:return"Escape";case 9:return"F1";case 10:return"F10";case 11:return"F11";case 12:return"F12";case 13:return"F2";case 14:return"F3";case 15:return"F4";case 16:return"F5";case 17:return"F6";case 18:return"F7";case 19:return"F8";case 20:return"F9";case 21:return"Home";case 22:return"LeftArrow";case 23:return"Meta";case 24:return"Option";case 25:return"PageDown";case 26:return"PageUp";case 27:return"Return";case 28:return"RightArrow";case 29:return"Shift";case 30:return"Space";case 31:return"Tab";case 32:return"UpArrow";case 33:return"Numpad0";case 34:return"Numpad1";case 35:return"Numpad2";case 36:return"Numpad3";case 37:return"Numpad4";case 38:return"Numpad5";case 39:return"Numpad6";case 40:return"Numpad7";case 41:return"Numpad8";case 42:return"Numpad9";case 43:return"Cancel";case 44:return"Clear";case 45:return"Menu";case 46:return"Pause";case 47:return"Kana";case 48:return"Hangul";case 49:return"Junja";case 50:return"Final";case 51:return"Hanja";case 52:return"Kanji";case 53:return"Convert";case 54:return"Select";case 55:return"Print";case 56:return"Execute";case 57:return"Snapshot";case 58:return"Insert";case 59:return"Help";case 60:return"Sleep";case 61:return"Separator";case 62:return"Scroll";case 63:return"NumLock";case 64:return"RWin";case 65:return"Apps";case 66:return"Multiply";case 67:return"Add";case 68:return"Subtract";case 69:return"Decimal";case 70:return"Divide";case 71:return"Equals";case 72:return"NumpadEnter";case 73:return"RShift";case 74:return"RControl";case 75:return"RAlt";case 100:return"CtrlAltDel";case 101:return"LockScreen";default:return"UNKNOWN"}}var vr;(function(e){e[e.Dir=0]="Dir",e[e.DirLink=2]="DirLink",e[e.DirDrive=3]="DirDrive",e[e.File=4]="File",e[e.FileLink=5]="FileLink",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(vr||(vr={}));function $i(e){switch(e){case 0:case"Dir":return 0;case 2:case"DirLink":return 2;case 3:case"DirDrive":return 3;case 4:case"File":return 4;case 5:case"FileLink":return 5;case-1:case"UNRECOGNIZED":default:return-1}}function ji(e){switch(e){case 0:return"Dir";case 2:return"DirLink";case 3:return"DirDrive";case 4:return"File";case 5:return"FileLink";default:return"UNKNOWN"}}var L;(function(e){e[e.NotSet=0]="NotSet",e[e.Low=2]="Low",e[e.Balanced=3]="Balanced",e[e.Best=4]="Best",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(L||(L={}));function en(e){switch(e){case 0:case"NotSet":return 0;case 2:case"Low":return 2;case 3:case"Balanced":return 3;case 4:case"Best":return 4;case-1:case"UNRECOGNIZED":default:return-1}}function rn(e){switch(e){case 0:return"NotSet";case 2:return"Low";case 3:return"Balanced";case 4:return"Best";default:return"UNKNOWN"}}var V;(function(e){e[e.Keyboard=0]="Keyboard",e[e.Clipboard=2]="Clipboard",e[e.Audio=3]="Audio",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(V||(V={}));function nn(e){switch(e){case 0:case"Keyboard":return 0;case 2:case"Clipboard":return 2;case 3:case"Audio":return 3;case-1:case"UNRECOGNIZED":default:return-1}}function tn(e){switch(e){case 0:return"Keyboard";case 2:return"Clipboard";case 3:return"Audio";default:return"UNKNOWN"}}var R;(function(e){e[e.NotSet=0]="NotSet",e[e.No=1]="No",e[e.Yes=2]="Yes",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(R||(R={}));function P(e){switch(e){case 0:case"NotSet":return 0;case 1:case"No":return 1;case 2:case"Yes":return 2;case-1:case"UNRECOGNIZED":default:return-1}}function x(e){switch(e){case 0:return"NotSet";case 1:return"No";case 2:return"Yes";default:return"UNKNOWN"}}function hr(){return{data:new Uint8Array,key:!1,pts:0}}const z={encode(e,r=a.Writer.create()){return e.data.length!==0&&r.uint32(10).bytes(e.data),e.key===!0&&r.uint32(16).bool(e.key),e.pts!==0&&r.uint32(24).int64(e.pts),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=hr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.data=i.bytes();break;case 2:n.key=i.bool();break;case 3:n.pts=T(i.int64());break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{data:s(e.data)?A(e.data):new Uint8Array,key:s(e.key)?Boolean(e.key):!1,pts:s(e.pts)?Number(e.pts):0}},toJSON(e){const r={};return e.data!==void 0&&(r.data=F(e.data!==void 0?e.data:new Uint8Array)),e.key!==void 0&&(r.key=e.key),e.pts!==void 0&&(r.pts=Math.round(e.pts)),r},fromPartial(e){var i,t,n;const r=hr();return r.data=(i=e.data)!=null?i:new Uint8Array,r.key=(t=e.key)!=null?t:!1,r.pts=(n=e.pts)!=null?n:0,r}};function yr(){return{frames:[]}}const W={encode(e,r=a.Writer.create()){for(const i of e.frames)z.encode(i,r.uint32(10).fork()).ldelim();return r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=yr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.frames.push(z.decode(i,i.uint32()));break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{frames:Array.isArray(e==null?void 0:e.frames)?e.frames.map(r=>z.fromJSON(r)):[]}},toJSON(e){const r={};return e.frames?r.frames=e.frames.map(i=>i?z.toJSON(i):void 0):r.frames=[],r},fromPartial(e){var i;const r=yr();return r.frames=((i=e.frames)==null?void 0:i.map(t=>z.fromPartial(t)))||[],r}};function kr(){return{compress:!1}}const H={encode(e,r=a.Writer.create()){return e.compress===!0&&r.uint32(8).bool(e.compress),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=kr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.compress=i.bool();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{compress:s(e.compress)?Boolean(e.compress):!1}},toJSON(e){const r={};return e.compress!==void 0&&(r.compress=e.compress),r},fromPartial(e){var i;const r=kr();return r.compress=(i=e.compress)!=null?i:!1,r}};function mr(){return{compress:!1,stride:0}}const G={encode(e,r=a.Writer.create()){return e.compress===!0&&r.uint32(8).bool(e.compress),e.stride!==0&&r.uint32(16).int32(e.stride),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=mr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.compress=i.bool();break;case 2:n.stride=i.int32();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{compress:s(e.compress)?Boolean(e.compress):!1,stride:s(e.stride)?Number(e.stride):0}},toJSON(e){const r={};return e.compress!==void 0&&(r.compress=e.compress),e.stride!==void 0&&(r.stride=Math.round(e.stride)),r},fromPartial(e){var i,t;const r=mr();return r.compress=(i=e.compress)!=null?i:!1,r.stride=(t=e.stride)!=null?t:0,r}};function Er(){return{vp9s:void 0,rgb:void 0,yuv:void 0}}const Z={encode(e,r=a.Writer.create()){return e.vp9s!==void 0&&W.encode(e.vp9s,r.uint32(50).fork()).ldelim(),e.rgb!==void 0&&H.encode(e.rgb,r.uint32(58).fork()).ldelim(),e.yuv!==void 0&&G.encode(e.yuv,r.uint32(66).fork()).ldelim(),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Er();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 6:n.vp9s=W.decode(i,i.uint32());break;case 7:n.rgb=H.decode(i,i.uint32());break;case 8:n.yuv=G.decode(i,i.uint32());break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{vp9s:s(e.vp9s)?W.fromJSON(e.vp9s):void 0,rgb:s(e.rgb)?H.fromJSON(e.rgb):void 0,yuv:s(e.yuv)?G.fromJSON(e.yuv):void 0}},toJSON(e){const r={};return e.vp9s!==void 0&&(r.vp9s=e.vp9s?W.toJSON(e.vp9s):void 0),e.rgb!==void 0&&(r.rgb=e.rgb?H.toJSON(e.rgb):void 0),e.yuv!==void 0&&(r.yuv=e.yuv?G.toJSON(e.yuv):void 0),r},fromPartial(e){const r=Er();return r.vp9s=e.vp9s!==void 0&&e.vp9s!==null?W.fromPartial(e.vp9s):void 0,r.rgb=e.rgb!==void 0&&e.rgb!==null?H.fromPartial(e.rgb):void 0,r.yuv=e.yuv!==void 0&&e.yuv!==null?G.fromPartial(e.yuv):void 0,r}};function Sr(){return{x:0,y:0,width:0,height:0,name:"",online:!1}}const Y={encode(e,r=a.Writer.create()){return e.x!==0&&r.uint32(8).sint32(e.x),e.y!==0&&r.uint32(16).sint32(e.y),e.width!==0&&r.uint32(24).int32(e.width),e.height!==0&&r.uint32(32).int32(e.height),e.name!==""&&r.uint32(42).string(e.name),e.online===!0&&r.uint32(48).bool(e.online),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Sr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.x=i.sint32();break;case 2:n.y=i.sint32();break;case 3:n.width=i.int32();break;case 4:n.height=i.int32();break;case 5:n.name=i.string();break;case 6:n.online=i.bool();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{x:s(e.x)?Number(e.x):0,y:s(e.y)?Number(e.y):0,width:s(e.width)?Number(e.width):0,height:s(e.height)?Number(e.height):0,name:s(e.name)?String(e.name):"",online:s(e.online)?Boolean(e.online):!1}},toJSON(e){const r={};return e.x!==void 0&&(r.x=Math.round(e.x)),e.y!==void 0&&(r.y=Math.round(e.y)),e.width!==void 0&&(r.width=Math.round(e.width)),e.height!==void 0&&(r.height=Math.round(e.height)),e.name!==void 0&&(r.name=e.name),e.online!==void 0&&(r.online=e.online),r},fromPartial(e){var i,t,n,o,u,c;const r=Sr();return r.x=(i=e.x)!=null?i:0,r.y=(t=e.y)!=null?t:0,r.width=(n=e.width)!=null?n:0,r.height=(o=e.height)!=null?o:0,r.name=(u=e.name)!=null?u:"",r.online=(c=e.online)!=null?c:!1,r}};function wr(){return{host:"",port:0}}const K={encode(e,r=a.Writer.create()){return e.host!==""&&r.uint32(10).string(e.host),e.port!==0&&r.uint32(16).int32(e.port),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=wr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.host=i.string();break;case 2:n.port=i.int32();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{host:s(e.host)?String(e.host):"",port:s(e.port)?Number(e.port):0}},toJSON(e){const r={};return e.host!==void 0&&(r.host=e.host),e.port!==void 0&&(r.port=Math.round(e.port)),r},fromPartial(e){var i,t;const r=wr();return r.host=(i=e.host)!=null?i:"",r.port=(t=e.port)!=null?t:0,r}};function Nr(){return{dir:"",show_hidden:!1}}const Q={encode(e,r=a.Writer.create()){return e.dir!==""&&r.uint32(10).string(e.dir),e.show_hidden===!0&&r.uint32(16).bool(e.show_hidden),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Nr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.dir=i.string();break;case 2:n.show_hidden=i.bool();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{dir:s(e.dir)?String(e.dir):"",show_hidden:s(e.show_hidden)?Boolean(e.show_hidden):!1}},toJSON(e){const r={};return e.dir!==void 0&&(r.dir=e.dir),e.show_hidden!==void 0&&(r.show_hidden=e.show_hidden),r},fromPartial(e){var i,t;const r=Nr();return r.dir=(i=e.dir)!=null?i:"",r.show_hidden=(t=e.show_hidden)!=null?t:!1,r}};function Ar(){return{username:"",password:new Uint8Array,my_id:"",my_name:"",option:void 0,file_transfer:void 0,port_forward:void 0,video_ack_required:!1}}const I={encode(e,r=a.Writer.create()){return e.username!==""&&r.uint32(10).string(e.username),e.password.length!==0&&r.uint32(18).bytes(e.password),e.my_id!==""&&r.uint32(34).string(e.my_id),e.my_name!==""&&r.uint32(42).string(e.my_name),e.option!==void 0&&f.encode(e.option,r.uint32(50).fork()).ldelim(),e.file_transfer!==void 0&&Q.encode(e.file_transfer,r.uint32(58).fork()).ldelim(),e.port_forward!==void 0&&K.encode(e.port_forward,r.uint32(66).fork()).ldelim(),e.video_ack_required===!0&&r.uint32(72).bool(e.video_ack_required),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Ar();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.username=i.string();break;case 2:n.password=i.bytes();break;case 4:n.my_id=i.string();break;case 5:n.my_name=i.string();break;case 6:n.option=f.decode(i,i.uint32());break;case 7:n.file_transfer=Q.decode(i,i.uint32());break;case 8:n.port_forward=K.decode(i,i.uint32());break;case 9:n.video_ack_required=i.bool();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{username:s(e.username)?String(e.username):"",password:s(e.password)?A(e.password):new Uint8Array,my_id:s(e.my_id)?String(e.my_id):"",my_name:s(e.my_name)?String(e.my_name):"",option:s(e.option)?f.fromJSON(e.option):void 0,file_transfer:s(e.file_transfer)?Q.fromJSON(e.file_transfer):void 0,port_forward:s(e.port_forward)?K.fromJSON(e.port_forward):void 0,video_ack_required:s(e.video_ack_required)?Boolean(e.video_ack_required):!1}},toJSON(e){const r={};return e.username!==void 0&&(r.username=e.username),e.password!==void 0&&(r.password=F(e.password!==void 0?e.password:new Uint8Array)),e.my_id!==void 0&&(r.my_id=e.my_id),e.my_name!==void 0&&(r.my_name=e.my_name),e.option!==void 0&&(r.option=e.option?f.toJSON(e.option):void 0),e.file_transfer!==void 0&&(r.file_transfer=e.file_transfer?Q.toJSON(e.file_transfer):void 0),e.port_forward!==void 0&&(r.port_forward=e.port_forward?K.toJSON(e.port_forward):void 0),e.video_ack_required!==void 0&&(r.video_ack_required=e.video_ack_required),r},fromPartial(e){var i,t,n,o,u;const r=Ar();return r.username=(i=e.username)!=null?i:"",r.password=(t=e.password)!=null?t:new Uint8Array,r.my_id=(n=e.my_id)!=null?n:"",r.my_name=(o=e.my_name)!=null?o:"",r.option=e.option!==void 0&&e.option!==null?f.fromPartial(e.option):void 0,r.file_transfer=e.file_transfer!==void 0&&e.file_transfer!==null?Q.fromPartial(e.file_transfer):void 0,r.port_forward=e.port_forward!==void 0&&e.port_forward!==null?K.fromPartial(e.port_forward):void 0,r.video_ack_required=(u=e.video_ack_required)!=null?u:!1,r}};function Fr(){return{text:""}}const X={encode(e,r=a.Writer.create()){return e.text!==""&&r.uint32(10).string(e.text),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Fr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.text=i.string();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{text:s(e.text)?String(e.text):""}},toJSON(e){const r={};return e.text!==void 0&&(r.text=e.text),r},fromPartial(e){var i;const r=Fr();return r.text=(i=e.text)!=null?i:"",r}};function Dr(){return{username:"",hostname:"",platform:"",displays:[],current_display:0,sas_enabled:!1,version:""}}const $={encode(e,r=a.Writer.create()){e.username!==""&&r.uint32(10).string(e.username),e.hostname!==""&&r.uint32(18).string(e.hostname),e.platform!==""&&r.uint32(26).string(e.platform);for(const i of e.displays)Y.encode(i,r.uint32(34).fork()).ldelim();return e.current_display!==0&&r.uint32(40).int32(e.current_display),e.sas_enabled===!0&&r.uint32(48).bool(e.sas_enabled),e.version!==""&&r.uint32(58).string(e.version),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Dr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.username=i.string();break;case 2:n.hostname=i.string();break;case 3:n.platform=i.string();break;case 4:n.displays.push(Y.decode(i,i.uint32()));break;case 5:n.current_display=i.int32();break;case 6:n.sas_enabled=i.bool();break;case 7:n.version=i.string();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{username:s(e.username)?String(e.username):"",hostname:s(e.hostname)?String(e.hostname):"",platform:s(e.platform)?String(e.platform):"",displays:Array.isArray(e==null?void 0:e.displays)?e.displays.map(r=>Y.fromJSON(r)):[],current_display:s(e.current_display)?Number(e.current_display):0,sas_enabled:s(e.sas_enabled)?Boolean(e.sas_enabled):!1,version:s(e.version)?String(e.version):""}},toJSON(e){const r={};return e.username!==void 0&&(r.username=e.username),e.hostname!==void 0&&(r.hostname=e.hostname),e.platform!==void 0&&(r.platform=e.platform),e.displays?r.displays=e.displays.map(i=>i?Y.toJSON(i):void 0):r.displays=[],e.current_display!==void 0&&(r.current_display=Math.round(e.current_display)),e.sas_enabled!==void 0&&(r.sas_enabled=e.sas_enabled),e.version!==void 0&&(r.version=e.version),r},fromPartial(e){var i,t,n,o,u,c,l;const r=Dr();return r.username=(i=e.username)!=null?i:"",r.hostname=(t=e.hostname)!=null?t:"",r.platform=(n=e.platform)!=null?n:"",r.displays=((o=e.displays)==null?void 0:o.map(p=>Y.fromPartial(p)))||[],r.current_display=(u=e.current_display)!=null?u:0,r.sas_enabled=(c=e.sas_enabled)!=null?c:!1,r.version=(l=e.version)!=null?l:"",r}};function Or(){return{error:void 0,peer_info:void 0}}const j={encode(e,r=a.Writer.create()){return e.error!==void 0&&r.uint32(10).string(e.error),e.peer_info!==void 0&&$.encode(e.peer_info,r.uint32(18).fork()).ldelim(),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Or();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.error=i.string();break;case 2:n.peer_info=$.decode(i,i.uint32());break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{error:s(e.error)?String(e.error):void 0,peer_info:s(e.peer_info)?$.fromJSON(e.peer_info):void 0}},toJSON(e){const r={};return e.error!==void 0&&(r.error=e.error),e.peer_info!==void 0&&(r.peer_info=e.peer_info?$.toJSON(e.peer_info):void 0),r},fromPartial(e){var i;const r=Or();return r.error=(i=e.error)!=null?i:void 0,r.peer_info=e.peer_info!==void 0&&e.peer_info!==null?$.fromPartial(e.peer_info):void 0,r}};function Rr(){return{mask:0,x:0,y:0,modifiers:[]}}const b={encode(e,r=a.Writer.create()){e.mask!==0&&r.uint32(8).int32(e.mask),e.x!==0&&r.uint32(16).sint32(e.x),e.y!==0&&r.uint32(24).sint32(e.y),r.uint32(34).fork();for(const i of e.modifiers)r.int32(i);return r.ldelim(),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Rr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.mask=i.int32();break;case 2:n.x=i.sint32();break;case 3:n.y=i.sint32();break;case 4:if((o&7)==2){const u=i.uint32()+i.pos;for(;i.pos<u;)n.modifiers.push(i.int32())}else n.modifiers.push(i.int32());break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{mask:s(e.mask)?Number(e.mask):0,x:s(e.x)?Number(e.x):0,y:s(e.y)?Number(e.y):0,modifiers:Array.isArray(e==null?void 0:e.modifiers)?e.modifiers.map(r=>ge(r)):[]}},toJSON(e){const r={};return e.mask!==void 0&&(r.mask=Math.round(e.mask)),e.x!==void 0&&(r.x=Math.round(e.x)),e.y!==void 0&&(r.y=Math.round(e.y)),e.modifiers?r.modifiers=e.modifiers.map(i=>Ye(i)):r.modifiers=[],r},fromPartial(e){var i,t,n,o;const r=Rr();return r.mask=(i=e.mask)!=null?i:0,r.x=(t=e.x)!=null?t:0,r.y=(n=e.y)!=null?n:0,r.modifiers=((o=e.modifiers)==null?void 0:o.map(u=>u))||[],r}};function Cr(){return{down:!1,press:!1,control_key:void 0,chr:void 0,unicode:void 0,seq:void 0,modifiers:[]}}const v={encode(e,r=a.Writer.create()){e.down===!0&&r.uint32(8).bool(e.down),e.press===!0&&r.uint32(16).bool(e.press),e.control_key!==void 0&&r.uint32(24).int32(e.control_key),e.chr!==void 0&&r.uint32(32).uint32(e.chr),e.unicode!==void 0&&r.uint32(40).uint32(e.unicode),e.seq!==void 0&&r.uint32(50).string(e.seq),r.uint32(66).fork();for(const i of e.modifiers)r.int32(i);return r.ldelim(),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Cr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.down=i.bool();break;case 2:n.press=i.bool();break;case 3:n.control_key=i.int32();break;case 4:n.chr=i.uint32();break;case 5:n.unicode=i.uint32();break;case 6:n.seq=i.string();break;case 8:if((o&7)==2){const u=i.uint32()+i.pos;for(;i.pos<u;)n.modifiers.push(i.int32())}else n.modifiers.push(i.int32());break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{down:s(e.down)?Boolean(e.down):!1,press:s(e.press)?Boolean(e.press):!1,control_key:s(e.control_key)?ge(e.control_key):void 0,chr:s(e.chr)?Number(e.chr):void 0,unicode:s(e.unicode)?Number(e.unicode):void 0,seq:s(e.seq)?String(e.seq):void 0,modifiers:Array.isArray(e==null?void 0:e.modifiers)?e.modifiers.map(r=>ge(r)):[]}},toJSON(e){const r={};return e.down!==void 0&&(r.down=e.down),e.press!==void 0&&(r.press=e.press),e.control_key!==void 0&&(r.control_key=e.control_key!==void 0?Ye(e.control_key):void 0),e.chr!==void 0&&(r.chr=Math.round(e.chr)),e.unicode!==void 0&&(r.unicode=Math.round(e.unicode)),e.seq!==void 0&&(r.seq=e.seq),e.modifiers?r.modifiers=e.modifiers.map(i=>Ye(i)):r.modifiers=[],r},fromPartial(e){var i,t,n,o,u,c,l;const r=Cr();return r.down=(i=e.down)!=null?i:!1,r.press=(t=e.press)!=null?t:!1,r.control_key=(n=e.control_key)!=null?n:void 0,r.chr=(o=e.chr)!=null?o:void 0,r.unicode=(u=e.unicode)!=null?u:void 0,r.seq=(c=e.seq)!=null?c:void 0,r.modifiers=((l=e.modifiers)==null?void 0:l.map(p=>p))||[],r}};function Br(){return{id:0,hotx:0,hoty:0,width:0,height:0,colors:new Uint8Array}}const ee={encode(e,r=a.Writer.create()){return e.id!==0&&r.uint32(8).uint64(e.id),e.hotx!==0&&r.uint32(16).sint32(e.hotx),e.hoty!==0&&r.uint32(24).sint32(e.hoty),e.width!==0&&r.uint32(32).int32(e.width),e.height!==0&&r.uint32(40).int32(e.height),e.colors.length!==0&&r.uint32(50).bytes(e.colors),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Br();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.id=T(i.uint64());break;case 2:n.hotx=i.sint32();break;case 3:n.hoty=i.sint32();break;case 4:n.width=i.int32();break;case 5:n.height=i.int32();break;case 6:n.colors=i.bytes();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{id:s(e.id)?Number(e.id):0,hotx:s(e.hotx)?Number(e.hotx):0,hoty:s(e.hoty)?Number(e.hoty):0,width:s(e.width)?Number(e.width):0,height:s(e.height)?Number(e.height):0,colors:s(e.colors)?A(e.colors):new Uint8Array}},toJSON(e){const r={};return e.id!==void 0&&(r.id=Math.round(e.id)),e.hotx!==void 0&&(r.hotx=Math.round(e.hotx)),e.hoty!==void 0&&(r.hoty=Math.round(e.hoty)),e.width!==void 0&&(r.width=Math.round(e.width)),e.height!==void 0&&(r.height=Math.round(e.height)),e.colors!==void 0&&(r.colors=F(e.colors!==void 0?e.colors:new Uint8Array)),r},fromPartial(e){var i,t,n,o,u,c;const r=Br();return r.id=(i=e.id)!=null?i:0,r.hotx=(t=e.hotx)!=null?t:0,r.hoty=(n=e.hoty)!=null?n:0,r.width=(o=e.width)!=null?o:0,r.height=(u=e.height)!=null?u:0,r.colors=(c=e.colors)!=null?c:new Uint8Array,r}};function Pr(){return{x:0,y:0}}const re={encode(e,r=a.Writer.create()){return e.x!==0&&r.uint32(8).sint32(e.x),e.y!==0&&r.uint32(16).sint32(e.y),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Pr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.x=i.sint32();break;case 2:n.y=i.sint32();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{x:s(e.x)?Number(e.x):0,y:s(e.y)?Number(e.y):0}},toJSON(e){const r={};return e.x!==void 0&&(r.x=Math.round(e.x)),e.y!==void 0&&(r.y=Math.round(e.y)),r},fromPartial(e){var i,t;const r=Pr();return r.x=(i=e.x)!=null?i:0,r.y=(t=e.y)!=null?t:0,r}};function xr(){return{salt:"",challenge:""}}const ie={encode(e,r=a.Writer.create()){return e.salt!==""&&r.uint32(10).string(e.salt),e.challenge!==""&&r.uint32(18).string(e.challenge),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=xr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.salt=i.string();break;case 2:n.challenge=i.string();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{salt:s(e.salt)?String(e.salt):"",challenge:s(e.challenge)?String(e.challenge):""}},toJSON(e){const r={};return e.salt!==void 0&&(r.salt=e.salt),e.challenge!==void 0&&(r.challenge=e.challenge),r},fromPartial(e){var i,t;const r=xr();return r.salt=(i=e.salt)!=null?i:"",r.challenge=(t=e.challenge)!=null?t:"",r}};function Ir(){return{compress:!1,content:new Uint8Array}}const ne={encode(e,r=a.Writer.create()){return e.compress===!0&&r.uint32(8).bool(e.compress),e.content.length!==0&&r.uint32(18).bytes(e.content),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Ir();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.compress=i.bool();break;case 2:n.content=i.bytes();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{compress:s(e.compress)?Boolean(e.compress):!1,content:s(e.content)?A(e.content):new Uint8Array}},toJSON(e){const r={};return e.compress!==void 0&&(r.compress=e.compress),e.content!==void 0&&(r.content=F(e.content!==void 0?e.content:new Uint8Array)),r},fromPartial(e){var i,t;const r=Ir();return r.compress=(i=e.compress)!=null?i:!1,r.content=(t=e.content)!=null?t:new Uint8Array,r}};function br(){return{entry_type:0,name:"",is_hidden:!1,size:0,modified_time:0}}const m={encode(e,r=a.Writer.create()){return e.entry_type!==0&&r.uint32(8).int32(e.entry_type),e.name!==""&&r.uint32(18).string(e.name),e.is_hidden===!0&&r.uint32(24).bool(e.is_hidden),e.size!==0&&r.uint32(32).uint64(e.size),e.modified_time!==0&&r.uint32(40).uint64(e.modified_time),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=br();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.entry_type=i.int32();break;case 2:n.name=i.string();break;case 3:n.is_hidden=i.bool();break;case 4:n.size=T(i.uint64());break;case 5:n.modified_time=T(i.uint64());break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{entry_type:s(e.entry_type)?$i(e.entry_type):0,name:s(e.name)?String(e.name):"",is_hidden:s(e.is_hidden)?Boolean(e.is_hidden):!1,size:s(e.size)?Number(e.size):0,modified_time:s(e.modified_time)?Number(e.modified_time):0}},toJSON(e){const r={};return e.entry_type!==void 0&&(r.entry_type=ji(e.entry_type)),e.name!==void 0&&(r.name=e.name),e.is_hidden!==void 0&&(r.is_hidden=e.is_hidden),e.size!==void 0&&(r.size=Math.round(e.size)),e.modified_time!==void 0&&(r.modified_time=Math.round(e.modified_time)),r},fromPartial(e){var i,t,n,o,u;const r=br();return r.entry_type=(i=e.entry_type)!=null?i:0,r.name=(t=e.name)!=null?t:"",r.is_hidden=(n=e.is_hidden)!=null?n:!1,r.size=(o=e.size)!=null?o:0,r.modified_time=(u=e.modified_time)!=null?u:0,r}};function Jr(){return{id:0,path:"",entries:[]}}const te={encode(e,r=a.Writer.create()){e.id!==0&&r.uint32(8).int32(e.id),e.path!==""&&r.uint32(18).string(e.path);for(const i of e.entries)m.encode(i,r.uint32(26).fork()).ldelim();return r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Jr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.id=i.int32();break;case 2:n.path=i.string();break;case 3:n.entries.push(m.decode(i,i.uint32()));break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{id:s(e.id)?Number(e.id):0,path:s(e.path)?String(e.path):"",entries:Array.isArray(e==null?void 0:e.entries)?e.entries.map(r=>m.fromJSON(r)):[]}},toJSON(e){const r={};return e.id!==void 0&&(r.id=Math.round(e.id)),e.path!==void 0&&(r.path=e.path),e.entries?r.entries=e.entries.map(i=>i?m.toJSON(i):void 0):r.entries=[],r},fromPartial(e){var i,t,n;const r=Jr();return r.id=(i=e.id)!=null?i:0,r.path=(t=e.path)!=null?t:"",r.entries=((n=e.entries)==null?void 0:n.map(o=>m.fromPartial(o)))||[],r}};function Tr(){return{path:"",include_hidden:!1}}const oe={encode(e,r=a.Writer.create()){return e.path!==""&&r.uint32(10).string(e.path),e.include_hidden===!0&&r.uint32(16).bool(e.include_hidden),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Tr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.path=i.string();break;case 2:n.include_hidden=i.bool();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{path:s(e.path)?String(e.path):"",include_hidden:s(e.include_hidden)?Boolean(e.include_hidden):!1}},toJSON(e){const r={};return e.path!==void 0&&(r.path=e.path),e.include_hidden!==void 0&&(r.include_hidden=e.include_hidden),r},fromPartial(e){var i,t;const r=Tr();return r.path=(i=e.path)!=null?i:"",r.include_hidden=(t=e.include_hidden)!=null?t:!1,r}};function Ur(){return{id:0,path:"",include_hidden:!1}}const ae={encode(e,r=a.Writer.create()){return e.id!==0&&r.uint32(8).int32(e.id),e.path!==""&&r.uint32(18).string(e.path),e.include_hidden===!0&&r.uint32(24).bool(e.include_hidden),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Ur();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.id=i.int32();break;case 2:n.path=i.string();break;case 3:n.include_hidden=i.bool();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{id:s(e.id)?Number(e.id):0,path:s(e.path)?String(e.path):"",include_hidden:s(e.include_hidden)?Boolean(e.include_hidden):!1}},toJSON(e){const r={};return e.id!==void 0&&(r.id=Math.round(e.id)),e.path!==void 0&&(r.path=e.path),e.include_hidden!==void 0&&(r.include_hidden=e.include_hidden),r},fromPartial(e){var i,t,n;const r=Ur();return r.id=(i=e.id)!=null?i:0,r.path=(t=e.path)!=null?t:"",r.include_hidden=(n=e.include_hidden)!=null?n:!1,r}};function qr(){return{read_dir:void 0,send:void 0,receive:void 0,create:void 0,remove_dir:void 0,remove_file:void 0,all_files:void 0,cancel:void 0}}const se={encode(e,r=a.Writer.create()){return e.read_dir!==void 0&&oe.encode(e.read_dir,r.uint32(10).fork()).ldelim(),e.send!==void 0&&_e.encode(e.send,r.uint32(18).fork()).ldelim(),e.receive!==void 0&&fe.encode(e.receive,r.uint32(26).fork()).ldelim(),e.create!==void 0&&ye.encode(e.create,r.uint32(34).fork()).ldelim(),e.remove_dir!==void 0&&ve.encode(e.remove_dir,r.uint32(42).fork()).ldelim(),e.remove_file!==void 0&&he.encode(e.remove_file,r.uint32(50).fork()).ldelim(),e.all_files!==void 0&&ae.encode(e.all_files,r.uint32(58).fork()).ldelim(),e.cancel!==void 0&&ue.encode(e.cancel,r.uint32(66).fork()).ldelim(),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=qr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.read_dir=oe.decode(i,i.uint32());break;case 2:n.send=_e.decode(i,i.uint32());break;case 3:n.receive=fe.decode(i,i.uint32());break;case 4:n.create=ye.decode(i,i.uint32());break;case 5:n.remove_dir=ve.decode(i,i.uint32());break;case 6:n.remove_file=he.decode(i,i.uint32());break;case 7:n.all_files=ae.decode(i,i.uint32());break;case 8:n.cancel=ue.decode(i,i.uint32());break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{read_dir:s(e.read_dir)?oe.fromJSON(e.read_dir):void 0,send:s(e.send)?_e.fromJSON(e.send):void 0,receive:s(e.receive)?fe.fromJSON(e.receive):void 0,create:s(e.create)?ye.fromJSON(e.create):void 0,remove_dir:s(e.remove_dir)?ve.fromJSON(e.remove_dir):void 0,remove_file:s(e.remove_file)?he.fromJSON(e.remove_file):void 0,all_files:s(e.all_files)?ae.fromJSON(e.all_files):void 0,cancel:s(e.cancel)?ue.fromJSON(e.cancel):void 0}},toJSON(e){const r={};return e.read_dir!==void 0&&(r.read_dir=e.read_dir?oe.toJSON(e.read_dir):void 0),e.send!==void 0&&(r.send=e.send?_e.toJSON(e.send):void 0),e.receive!==void 0&&(r.receive=e.receive?fe.toJSON(e.receive):void 0),e.create!==void 0&&(r.create=e.create?ye.toJSON(e.create):void 0),e.remove_dir!==void 0&&(r.remove_dir=e.remove_dir?ve.toJSON(e.remove_dir):void 0),e.remove_file!==void 0&&(r.remove_file=e.remove_file?he.toJSON(e.remove_file):void 0),e.all_files!==void 0&&(r.all_files=e.all_files?ae.toJSON(e.all_files):void 0),e.cancel!==void 0&&(r.cancel=e.cancel?ue.toJSON(e.cancel):void 0),r},fromPartial(e){const r=qr();return r.read_dir=e.read_dir!==void 0&&e.read_dir!==null?oe.fromPartial(e.read_dir):void 0,r.send=e.send!==void 0&&e.send!==null?_e.fromPartial(e.send):void 0,r.receive=e.receive!==void 0&&e.receive!==null?fe.fromPartial(e.receive):void 0,r.create=e.create!==void 0&&e.create!==null?ye.fromPartial(e.create):void 0,r.remove_dir=e.remove_dir!==void 0&&e.remove_dir!==null?ve.fromPartial(e.remove_dir):void 0,r.remove_file=e.remove_file!==void 0&&e.remove_file!==null?he.fromPartial(e.remove_file):void 0,r.all_files=e.all_files!==void 0&&e.all_files!==null?ae.fromPartial(e.all_files):void 0,r.cancel=e.cancel!==void 0&&e.cancel!==null?ue.fromPartial(e.cancel):void 0,r}};function Mr(){return{id:0}}const ue={encode(e,r=a.Writer.create()){return e.id!==0&&r.uint32(8).int32(e.id),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Mr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.id=i.int32();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{id:s(e.id)?Number(e.id):0}},toJSON(e){const r={};return e.id!==void 0&&(r.id=Math.round(e.id)),r},fromPartial(e){var i;const r=Mr();return r.id=(i=e.id)!=null?i:0,r}};function gr(){return{dir:void 0,block:void 0,error:void 0,done:void 0}}const de={encode(e,r=a.Writer.create()){return e.dir!==void 0&&te.encode(e.dir,r.uint32(10).fork()).ldelim(),e.block!==void 0&&ce.encode(e.block,r.uint32(18).fork()).ldelim(),e.error!==void 0&&le.encode(e.error,r.uint32(26).fork()).ldelim(),e.done!==void 0&&pe.encode(e.done,r.uint32(34).fork()).ldelim(),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=gr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.dir=te.decode(i,i.uint32());break;case 2:n.block=ce.decode(i,i.uint32());break;case 3:n.error=le.decode(i,i.uint32());break;case 4:n.done=pe.decode(i,i.uint32());break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{dir:s(e.dir)?te.fromJSON(e.dir):void 0,block:s(e.block)?ce.fromJSON(e.block):void 0,error:s(e.error)?le.fromJSON(e.error):void 0,done:s(e.done)?pe.fromJSON(e.done):void 0}},toJSON(e){const r={};return e.dir!==void 0&&(r.dir=e.dir?te.toJSON(e.dir):void 0),e.block!==void 0&&(r.block=e.block?ce.toJSON(e.block):void 0),e.error!==void 0&&(r.error=e.error?le.toJSON(e.error):void 0),e.done!==void 0&&(r.done=e.done?pe.toJSON(e.done):void 0),r},fromPartial(e){const r=gr();return r.dir=e.dir!==void 0&&e.dir!==null?te.fromPartial(e.dir):void 0,r.block=e.block!==void 0&&e.block!==null?ce.fromPartial(e.block):void 0,r.error=e.error!==void 0&&e.error!==null?le.fromPartial(e.error):void 0,r.done=e.done!==void 0&&e.done!==null?pe.fromPartial(e.done):void 0,r}};function Lr(){return{id:0,file_num:0,data:new Uint8Array,compressed:!1}}const ce={encode(e,r=a.Writer.create()){return e.id!==0&&r.uint32(8).int32(e.id),e.file_num!==0&&r.uint32(16).sint32(e.file_num),e.data.length!==0&&r.uint32(26).bytes(e.data),e.compressed===!0&&r.uint32(32).bool(e.compressed),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Lr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.id=i.int32();break;case 2:n.file_num=i.sint32();break;case 3:n.data=i.bytes();break;case 4:n.compressed=i.bool();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{id:s(e.id)?Number(e.id):0,file_num:s(e.file_num)?Number(e.file_num):0,data:s(e.data)?A(e.data):new Uint8Array,compressed:s(e.compressed)?Boolean(e.compressed):!1}},toJSON(e){const r={};return e.id!==void 0&&(r.id=Math.round(e.id)),e.file_num!==void 0&&(r.file_num=Math.round(e.file_num)),e.data!==void 0&&(r.data=F(e.data!==void 0?e.data:new Uint8Array)),e.compressed!==void 0&&(r.compressed=e.compressed),r},fromPartial(e){var i,t,n,o;const r=Lr();return r.id=(i=e.id)!=null?i:0,r.file_num=(t=e.file_num)!=null?t:0,r.data=(n=e.data)!=null?n:new Uint8Array,r.compressed=(o=e.compressed)!=null?o:!1,r}};function Vr(){return{id:0,error:"",file_num:0}}const le={encode(e,r=a.Writer.create()){return e.id!==0&&r.uint32(8).int32(e.id),e.error!==""&&r.uint32(18).string(e.error),e.file_num!==0&&r.uint32(24).sint32(e.file_num),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Vr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.id=i.int32();break;case 2:n.error=i.string();break;case 3:n.file_num=i.sint32();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{id:s(e.id)?Number(e.id):0,error:s(e.error)?String(e.error):"",file_num:s(e.file_num)?Number(e.file_num):0}},toJSON(e){const r={};return e.id!==void 0&&(r.id=Math.round(e.id)),e.error!==void 0&&(r.error=e.error),e.file_num!==void 0&&(r.file_num=Math.round(e.file_num)),r},fromPartial(e){var i,t,n;const r=Vr();return r.id=(i=e.id)!=null?i:0,r.error=(t=e.error)!=null?t:"",r.file_num=(n=e.file_num)!=null?n:0,r}};function zr(){return{id:0,path:"",include_hidden:!1}}const _e={encode(e,r=a.Writer.create()){return e.id!==0&&r.uint32(8).int32(e.id),e.path!==""&&r.uint32(18).string(e.path),e.include_hidden===!0&&r.uint32(24).bool(e.include_hidden),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=zr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.id=i.int32();break;case 2:n.path=i.string();break;case 3:n.include_hidden=i.bool();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{id:s(e.id)?Number(e.id):0,path:s(e.path)?String(e.path):"",include_hidden:s(e.include_hidden)?Boolean(e.include_hidden):!1}},toJSON(e){const r={};return e.id!==void 0&&(r.id=Math.round(e.id)),e.path!==void 0&&(r.path=e.path),e.include_hidden!==void 0&&(r.include_hidden=e.include_hidden),r},fromPartial(e){var i,t,n;const r=zr();return r.id=(i=e.id)!=null?i:0,r.path=(t=e.path)!=null?t:"",r.include_hidden=(n=e.include_hidden)!=null?n:!1,r}};function Wr(){return{id:0,file_num:0}}const pe={encode(e,r=a.Writer.create()){return e.id!==0&&r.uint32(8).int32(e.id),e.file_num!==0&&r.uint32(16).sint32(e.file_num),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Wr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.id=i.int32();break;case 2:n.file_num=i.sint32();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{id:s(e.id)?Number(e.id):0,file_num:s(e.file_num)?Number(e.file_num):0}},toJSON(e){const r={};return e.id!==void 0&&(r.id=Math.round(e.id)),e.file_num!==void 0&&(r.file_num=Math.round(e.file_num)),r},fromPartial(e){var i,t;const r=Wr();return r.id=(i=e.id)!=null?i:0,r.file_num=(t=e.file_num)!=null?t:0,r}};function Hr(){return{id:0,path:"",files:[]}}const fe={encode(e,r=a.Writer.create()){e.id!==0&&r.uint32(8).int32(e.id),e.path!==""&&r.uint32(18).string(e.path);for(const i of e.files)m.encode(i,r.uint32(26).fork()).ldelim();return r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Hr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.id=i.int32();break;case 2:n.path=i.string();break;case 3:n.files.push(m.decode(i,i.uint32()));break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{id:s(e.id)?Number(e.id):0,path:s(e.path)?String(e.path):"",files:Array.isArray(e==null?void 0:e.files)?e.files.map(r=>m.fromJSON(r)):[]}},toJSON(e){const r={};return e.id!==void 0&&(r.id=Math.round(e.id)),e.path!==void 0&&(r.path=e.path),e.files?r.files=e.files.map(i=>i?m.toJSON(i):void 0):r.files=[],r},fromPartial(e){var i,t,n;const r=Hr();return r.id=(i=e.id)!=null?i:0,r.path=(t=e.path)!=null?t:"",r.files=((n=e.files)==null?void 0:n.map(o=>m.fromPartial(o)))||[],r}};function Gr(){return{id:0,path:"",recursive:!1}}const ve={encode(e,r=a.Writer.create()){return e.id!==0&&r.uint32(8).int32(e.id),e.path!==""&&r.uint32(18).string(e.path),e.recursive===!0&&r.uint32(24).bool(e.recursive),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Gr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.id=i.int32();break;case 2:n.path=i.string();break;case 3:n.recursive=i.bool();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{id:s(e.id)?Number(e.id):0,path:s(e.path)?String(e.path):"",recursive:s(e.recursive)?Boolean(e.recursive):!1}},toJSON(e){const r={};return e.id!==void 0&&(r.id=Math.round(e.id)),e.path!==void 0&&(r.path=e.path),e.recursive!==void 0&&(r.recursive=e.recursive),r},fromPartial(e){var i,t,n;const r=Gr();return r.id=(i=e.id)!=null?i:0,r.path=(t=e.path)!=null?t:"",r.recursive=(n=e.recursive)!=null?n:!1,r}};function Zr(){return{id:0,path:"",file_num:0}}const he={encode(e,r=a.Writer.create()){return e.id!==0&&r.uint32(8).int32(e.id),e.path!==""&&r.uint32(18).string(e.path),e.file_num!==0&&r.uint32(24).sint32(e.file_num),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Zr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.id=i.int32();break;case 2:n.path=i.string();break;case 3:n.file_num=i.sint32();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{id:s(e.id)?Number(e.id):0,path:s(e.path)?String(e.path):"",file_num:s(e.file_num)?Number(e.file_num):0}},toJSON(e){const r={};return e.id!==void 0&&(r.id=Math.round(e.id)),e.path!==void 0&&(r.path=e.path),e.file_num!==void 0&&(r.file_num=Math.round(e.file_num)),r},fromPartial(e){var i,t,n;const r=Zr();return r.id=(i=e.id)!=null?i:0,r.path=(t=e.path)!=null?t:"",r.file_num=(n=e.file_num)!=null?n:0,r}};function Yr(){return{id:0,path:""}}const ye={encode(e,r=a.Writer.create()){return e.id!==0&&r.uint32(8).int32(e.id),e.path!==""&&r.uint32(18).string(e.path),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Yr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.id=i.int32();break;case 2:n.path=i.string();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{id:s(e.id)?Number(e.id):0,path:s(e.path)?String(e.path):""}},toJSON(e){const r={};return e.id!==void 0&&(r.id=Math.round(e.id)),e.path!==void 0&&(r.path=e.path),r},fromPartial(e){var i,t;const r=Yr();return r.id=(i=e.id)!=null?i:0,r.path=(t=e.path)!=null?t:"",r}};function Kr(){return{display:0,x:0,y:0,width:0,height:0}}const J={encode(e,r=a.Writer.create()){return e.display!==0&&r.uint32(8).int32(e.display),e.x!==0&&r.uint32(16).sint32(e.x),e.y!==0&&r.uint32(24).sint32(e.y),e.width!==0&&r.uint32(32).int32(e.width),e.height!==0&&r.uint32(40).int32(e.height),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Kr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.display=i.int32();break;case 2:n.x=i.sint32();break;case 3:n.y=i.sint32();break;case 4:n.width=i.int32();break;case 5:n.height=i.int32();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{display:s(e.display)?Number(e.display):0,x:s(e.x)?Number(e.x):0,y:s(e.y)?Number(e.y):0,width:s(e.width)?Number(e.width):0,height:s(e.height)?Number(e.height):0}},toJSON(e){const r={};return e.display!==void 0&&(r.display=Math.round(e.display)),e.x!==void 0&&(r.x=Math.round(e.x)),e.y!==void 0&&(r.y=Math.round(e.y)),e.width!==void 0&&(r.width=Math.round(e.width)),e.height!==void 0&&(r.height=Math.round(e.height)),r},fromPartial(e){var i,t,n,o,u;const r=Kr();return r.display=(i=e.display)!=null?i:0,r.x=(t=e.x)!=null?t:0,r.y=(n=e.y)!=null?n:0,r.width=(o=e.width)!=null?o:0,r.height=(u=e.height)!=null?u:0,r}};function Qr(){return{permission:0,enabled:!1}}const ke={encode(e,r=a.Writer.create()){return e.permission!==0&&r.uint32(8).int32(e.permission),e.enabled===!0&&r.uint32(16).bool(e.enabled),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Qr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.permission=i.int32();break;case 2:n.enabled=i.bool();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{permission:s(e.permission)?nn(e.permission):0,enabled:s(e.enabled)?Boolean(e.enabled):!1}},toJSON(e){const r={};return e.permission!==void 0&&(r.permission=tn(e.permission)),e.enabled!==void 0&&(r.enabled=e.enabled),r},fromPartial(e){var i,t;const r=Qr();return r.permission=(i=e.permission)!=null?i:0,r.enabled=(t=e.enabled)!=null?t:!1,r}};function Xr(){return{image_quality:0,lock_after_session_end:0,show_remote_cursor:0,privacy_mode:0,block_input:0,custom_image_quality:0,disable_audio:0,disable_clipboard:0}}const f={encode(e,r=a.Writer.create()){return e.image_quality!==0&&r.uint32(8).int32(e.image_quality),e.lock_after_session_end!==0&&r.uint32(16).int32(e.lock_after_session_end),e.show_remote_cursor!==0&&r.uint32(24).int32(e.show_remote_cursor),e.privacy_mode!==0&&r.uint32(32).int32(e.privacy_mode),e.block_input!==0&&r.uint32(40).int32(e.block_input),e.custom_image_quality!==0&&r.uint32(48).int32(e.custom_image_quality),e.disable_audio!==0&&r.uint32(56).int32(e.disable_audio),e.disable_clipboard!==0&&r.uint32(64).int32(e.disable_clipboard),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Xr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.image_quality=i.int32();break;case 2:n.lock_after_session_end=i.int32();break;case 3:n.show_remote_cursor=i.int32();break;case 4:n.privacy_mode=i.int32();break;case 5:n.block_input=i.int32();break;case 6:n.custom_image_quality=i.int32();break;case 7:n.disable_audio=i.int32();break;case 8:n.disable_clipboard=i.int32();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{image_quality:s(e.image_quality)?en(e.image_quality):0,lock_after_session_end:s(e.lock_after_session_end)?P(e.lock_after_session_end):0,show_remote_cursor:s(e.show_remote_cursor)?P(e.show_remote_cursor):0,privacy_mode:s(e.privacy_mode)?P(e.privacy_mode):0,block_input:s(e.block_input)?P(e.block_input):0,custom_image_quality:s(e.custom_image_quality)?Number(e.custom_image_quality):0,disable_audio:s(e.disable_audio)?P(e.disable_audio):0,disable_clipboard:s(e.disable_clipboard)?P(e.disable_clipboard):0}},toJSON(e){const r={};return e.image_quality!==void 0&&(r.image_quality=rn(e.image_quality)),e.lock_after_session_end!==void 0&&(r.lock_after_session_end=x(e.lock_after_session_end)),e.show_remote_cursor!==void 0&&(r.show_remote_cursor=x(e.show_remote_cursor)),e.privacy_mode!==void 0&&(r.privacy_mode=x(e.privacy_mode)),e.block_input!==void 0&&(r.block_input=x(e.block_input)),e.custom_image_quality!==void 0&&(r.custom_image_quality=Math.round(e.custom_image_quality)),e.disable_audio!==void 0&&(r.disable_audio=x(e.disable_audio)),e.disable_clipboard!==void 0&&(r.disable_clipboard=x(e.disable_clipboard)),r},fromPartial(e){var i,t,n,o,u,c,l,p;const r=Xr();return r.image_quality=(i=e.image_quality)!=null?i:0,r.lock_after_session_end=(t=e.lock_after_session_end)!=null?t:0,r.show_remote_cursor=(n=e.show_remote_cursor)!=null?n:0,r.privacy_mode=(o=e.privacy_mode)!=null?o:0,r.block_input=(u=e.block_input)!=null?u:0,r.custom_image_quality=(c=e.custom_image_quality)!=null?c:0,r.disable_audio=(l=e.disable_audio)!=null?l:0,r.disable_clipboard=(p=e.disable_clipboard)!=null?p:0,r}};function $r(){return{opt:void 0,error:""}}const me={encode(e,r=a.Writer.create()){return e.opt!==void 0&&f.encode(e.opt,r.uint32(10).fork()).ldelim(),e.error!==""&&r.uint32(18).string(e.error),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=$r();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.opt=f.decode(i,i.uint32());break;case 2:n.error=i.string();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{opt:s(e.opt)?f.fromJSON(e.opt):void 0,error:s(e.error)?String(e.error):""}},toJSON(e){const r={};return e.opt!==void 0&&(r.opt=e.opt?f.toJSON(e.opt):void 0),e.error!==void 0&&(r.error=e.error),r},fromPartial(e){var i;const r=$r();return r.opt=e.opt!==void 0&&e.opt!==null?f.fromPartial(e.opt):void 0,r.error=(i=e.error)!=null?i:"",r}};function jr(){return{time:0,from_client:!1}}const Ee={encode(e,r=a.Writer.create()){return e.time!==0&&r.uint32(8).int64(e.time),e.from_client===!0&&r.uint32(16).bool(e.from_client),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=jr();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.time=T(i.int64());break;case 2:n.from_client=i.bool();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{time:s(e.time)?Number(e.time):0,from_client:s(e.from_client)?Boolean(e.from_client):!1}},toJSON(e){const r={};return e.time!==void 0&&(r.time=Math.round(e.time)),e.from_client!==void 0&&(r.from_client=e.from_client),r},fromPartial(e){var i,t;const r=jr();return r.time=(i=e.time)!=null?i:0,r.from_client=(t=e.from_client)!=null?t:!1,r}};function ei(){return{asymmetric_value:new Uint8Array,symmetric_value:new Uint8Array}}const C={encode(e,r=a.Writer.create()){return e.asymmetric_value.length!==0&&r.uint32(10).bytes(e.asymmetric_value),e.symmetric_value.length!==0&&r.uint32(18).bytes(e.symmetric_value),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=ei();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.asymmetric_value=i.bytes();break;case 2:n.symmetric_value=i.bytes();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{asymmetric_value:s(e.asymmetric_value)?A(e.asymmetric_value):new Uint8Array,symmetric_value:s(e.symmetric_value)?A(e.symmetric_value):new Uint8Array}},toJSON(e){const r={};return e.asymmetric_value!==void 0&&(r.asymmetric_value=F(e.asymmetric_value!==void 0?e.asymmetric_value:new Uint8Array)),e.symmetric_value!==void 0&&(r.symmetric_value=F(e.symmetric_value!==void 0?e.symmetric_value:new Uint8Array)),r},fromPartial(e){var i,t;const r=ei();return r.asymmetric_value=(i=e.asymmetric_value)!=null?i:new Uint8Array,r.symmetric_value=(t=e.symmetric_value)!=null?t:new Uint8Array,r}};function ri(){return{id:new Uint8Array}}const Se={encode(e,r=a.Writer.create()){return e.id.length!==0&&r.uint32(10).bytes(e.id),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=ri();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.id=i.bytes();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{id:s(e.id)?A(e.id):new Uint8Array}},toJSON(e){const r={};return e.id!==void 0&&(r.id=F(e.id!==void 0?e.id:new Uint8Array)),r},fromPartial(e){var i;const r=ri();return r.id=(i=e.id)!=null?i:new Uint8Array,r}};function ii(){return{sample_rate:0,channels:0}}const we={encode(e,r=a.Writer.create()){return e.sample_rate!==0&&r.uint32(8).uint32(e.sample_rate),e.channels!==0&&r.uint32(16).uint32(e.channels),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=ii();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.sample_rate=i.uint32();break;case 2:n.channels=i.uint32();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{sample_rate:s(e.sample_rate)?Number(e.sample_rate):0,channels:s(e.channels)?Number(e.channels):0}},toJSON(e){const r={};return e.sample_rate!==void 0&&(r.sample_rate=Math.round(e.sample_rate)),e.channels!==void 0&&(r.channels=Math.round(e.channels)),r},fromPartial(e){var i,t;const r=ii();return r.sample_rate=(i=e.sample_rate)!=null?i:0,r.channels=(t=e.channels)!=null?t:0,r}};function ni(){return{data:new Uint8Array}}const Ne={encode(e,r=a.Writer.create()){return e.data.length!==0&&r.uint32(10).bytes(e.data),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=ni();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.data=i.bytes();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{data:s(e.data)?A(e.data):new Uint8Array}},toJSON(e){const r={};return e.data!==void 0&&(r.data=F(e.data!==void 0?e.data:new Uint8Array)),r},fromPartial(e){var i;const r=ni();return r.data=(i=e.data)!=null?i:new Uint8Array,r}};function ti(){return{chat_message:void 0,switch_display:void 0,permission_info:void 0,option:void 0,audio_format:void 0,close_reason:void 0,refresh_video:void 0,option_response:void 0,video_received:void 0}}const E={encode(e,r=a.Writer.create()){return e.chat_message!==void 0&&X.encode(e.chat_message,r.uint32(34).fork()).ldelim(),e.switch_display!==void 0&&J.encode(e.switch_display,r.uint32(42).fork()).ldelim(),e.permission_info!==void 0&&ke.encode(e.permission_info,r.uint32(50).fork()).ldelim(),e.option!==void 0&&f.encode(e.option,r.uint32(58).fork()).ldelim(),e.audio_format!==void 0&&we.encode(e.audio_format,r.uint32(66).fork()).ldelim(),e.close_reason!==void 0&&r.uint32(74).string(e.close_reason),e.refresh_video!==void 0&&r.uint32(80).bool(e.refresh_video),e.option_response!==void 0&&me.encode(e.option_response,r.uint32(90).fork()).ldelim(),e.video_received!==void 0&&r.uint32(96).bool(e.video_received),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=ti();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 4:n.chat_message=X.decode(i,i.uint32());break;case 5:n.switch_display=J.decode(i,i.uint32());break;case 6:n.permission_info=ke.decode(i,i.uint32());break;case 7:n.option=f.decode(i,i.uint32());break;case 8:n.audio_format=we.decode(i,i.uint32());break;case 9:n.close_reason=i.string();break;case 10:n.refresh_video=i.bool();break;case 11:n.option_response=me.decode(i,i.uint32());break;case 12:n.video_received=i.bool();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{chat_message:s(e.chat_message)?X.fromJSON(e.chat_message):void 0,switch_display:s(e.switch_display)?J.fromJSON(e.switch_display):void 0,permission_info:s(e.permission_info)?ke.fromJSON(e.permission_info):void 0,option:s(e.option)?f.fromJSON(e.option):void 0,audio_format:s(e.audio_format)?we.fromJSON(e.audio_format):void 0,close_reason:s(e.close_reason)?String(e.close_reason):void 0,refresh_video:s(e.refresh_video)?Boolean(e.refresh_video):void 0,option_response:s(e.option_response)?me.fromJSON(e.option_response):void 0,video_received:s(e.video_received)?Boolean(e.video_received):void 0}},toJSON(e){const r={};return e.chat_message!==void 0&&(r.chat_message=e.chat_message?X.toJSON(e.chat_message):void 0),e.switch_display!==void 0&&(r.switch_display=e.switch_display?J.toJSON(e.switch_display):void 0),e.permission_info!==void 0&&(r.permission_info=e.permission_info?ke.toJSON(e.permission_info):void 0),e.option!==void 0&&(r.option=e.option?f.toJSON(e.option):void 0),e.audio_format!==void 0&&(r.audio_format=e.audio_format?we.toJSON(e.audio_format):void 0),e.close_reason!==void 0&&(r.close_reason=e.close_reason),e.refresh_video!==void 0&&(r.refresh_video=e.refresh_video),e.option_response!==void 0&&(r.option_response=e.option_response?me.toJSON(e.option_response):void 0),e.video_received!==void 0&&(r.video_received=e.video_received),r},fromPartial(e){var i,t,n;const r=ti();return r.chat_message=e.chat_message!==void 0&&e.chat_message!==null?X.fromPartial(e.chat_message):void 0,r.switch_display=e.switch_display!==void 0&&e.switch_display!==null?J.fromPartial(e.switch_display):void 0,r.permission_info=e.permission_info!==void 0&&e.permission_info!==null?ke.fromPartial(e.permission_info):void 0,r.option=e.option!==void 0&&e.option!==null?f.fromPartial(e.option):void 0,r.audio_format=e.audio_format!==void 0&&e.audio_format!==null?we.fromPartial(e.audio_format):void 0,r.close_reason=(i=e.close_reason)!=null?i:void 0,r.refresh_video=(t=e.refresh_video)!=null?t:void 0,r.option_response=e.option_response!==void 0&&e.option_response!==null?me.fromPartial(e.option_response):void 0,r.video_received=(n=e.video_received)!=null?n:void 0,r}};function oi(){return{signed_id:void 0,public_key:void 0,test_delay:void 0,video_frame:void 0,login_request:void 0,login_response:void 0,hash:void 0,mouse_event:void 0,audio_frame:void 0,cursor_data:void 0,cursor_position:void 0,cursor_id:void 0,key_event:void 0,clipboard:void 0,file_action:void 0,file_response:void 0,misc:void 0}}const Ke={encode(e,r=a.Writer.create()){return e.signed_id!==void 0&&Se.encode(e.signed_id,r.uint32(26).fork()).ldelim(),e.public_key!==void 0&&C.encode(e.public_key,r.uint32(34).fork()).ldelim(),e.test_delay!==void 0&&Ee.encode(e.test_delay,r.uint32(42).fork()).ldelim(),e.video_frame!==void 0&&Z.encode(e.video_frame,r.uint32(50).fork()).ldelim(),e.login_request!==void 0&&I.encode(e.login_request,r.uint32(58).fork()).ldelim(),e.login_response!==void 0&&j.encode(e.login_response,r.uint32(66).fork()).ldelim(),e.hash!==void 0&&ie.encode(e.hash,r.uint32(74).fork()).ldelim(),e.mouse_event!==void 0&&b.encode(e.mouse_event,r.uint32(82).fork()).ldelim(),e.audio_frame!==void 0&&Ne.encode(e.audio_frame,r.uint32(90).fork()).ldelim(),e.cursor_data!==void 0&&ee.encode(e.cursor_data,r.uint32(98).fork()).ldelim(),e.cursor_position!==void 0&&re.encode(e.cursor_position,r.uint32(106).fork()).ldelim(),e.cursor_id!==void 0&&r.uint32(112).uint64(e.cursor_id),e.key_event!==void 0&&v.encode(e.key_event,r.uint32(122).fork()).ldelim(),e.clipboard!==void 0&&ne.encode(e.clipboard,r.uint32(130).fork()).ldelim(),e.file_action!==void 0&&se.encode(e.file_action,r.uint32(138).fork()).ldelim(),e.file_response!==void 0&&de.encode(e.file_response,r.uint32(146).fork()).ldelim(),e.misc!==void 0&&E.encode(e.misc,r.uint32(154).fork()).ldelim(),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=oi();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 3:n.signed_id=Se.decode(i,i.uint32());break;case 4:n.public_key=C.decode(i,i.uint32());break;case 5:n.test_delay=Ee.decode(i,i.uint32());break;case 6:n.video_frame=Z.decode(i,i.uint32());break;case 7:n.login_request=I.decode(i,i.uint32());break;case 8:n.login_response=j.decode(i,i.uint32());break;case 9:n.hash=ie.decode(i,i.uint32());break;case 10:n.mouse_event=b.decode(i,i.uint32());break;case 11:n.audio_frame=Ne.decode(i,i.uint32());break;case 12:n.cursor_data=ee.decode(i,i.uint32());break;case 13:n.cursor_position=re.decode(i,i.uint32());break;case 14:n.cursor_id=T(i.uint64());break;case 15:n.key_event=v.decode(i,i.uint32());break;case 16:n.clipboard=ne.decode(i,i.uint32());break;case 17:n.file_action=se.decode(i,i.uint32());break;case 18:n.file_response=de.decode(i,i.uint32());break;case 19:n.misc=E.decode(i,i.uint32());break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{signed_id:s(e.signed_id)?Se.fromJSON(e.signed_id):void 0,public_key:s(e.public_key)?C.fromJSON(e.public_key):void 0,test_delay:s(e.test_delay)?Ee.fromJSON(e.test_delay):void 0,video_frame:s(e.video_frame)?Z.fromJSON(e.video_frame):void 0,login_request:s(e.login_request)?I.fromJSON(e.login_request):void 0,login_response:s(e.login_response)?j.fromJSON(e.login_response):void 0,hash:s(e.hash)?ie.fromJSON(e.hash):void 0,mouse_event:s(e.mouse_event)?b.fromJSON(e.mouse_event):void 0,audio_frame:s(e.audio_frame)?Ne.fromJSON(e.audio_frame):void 0,cursor_data:s(e.cursor_data)?ee.fromJSON(e.cursor_data):void 0,cursor_position:s(e.cursor_position)?re.fromJSON(e.cursor_position):void 0,cursor_id:s(e.cursor_id)?Number(e.cursor_id):void 0,key_event:s(e.key_event)?v.fromJSON(e.key_event):void 0,clipboard:s(e.clipboard)?ne.fromJSON(e.clipboard):void 0,file_action:s(e.file_action)?se.fromJSON(e.file_action):void 0,file_response:s(e.file_response)?de.fromJSON(e.file_response):void 0,misc:s(e.misc)?E.fromJSON(e.misc):void 0}},toJSON(e){const r={};return e.signed_id!==void 0&&(r.signed_id=e.signed_id?Se.toJSON(e.signed_id):void 0),e.public_key!==void 0&&(r.public_key=e.public_key?C.toJSON(e.public_key):void 0),e.test_delay!==void 0&&(r.test_delay=e.test_delay?Ee.toJSON(e.test_delay):void 0),e.video_frame!==void 0&&(r.video_frame=e.video_frame?Z.toJSON(e.video_frame):void 0),e.login_request!==void 0&&(r.login_request=e.login_request?I.toJSON(e.login_request):void 0),e.login_response!==void 0&&(r.login_response=e.login_response?j.toJSON(e.login_response):void 0),e.hash!==void 0&&(r.hash=e.hash?ie.toJSON(e.hash):void 0),e.mouse_event!==void 0&&(r.mouse_event=e.mouse_event?b.toJSON(e.mouse_event):void 0),e.audio_frame!==void 0&&(r.audio_frame=e.audio_frame?Ne.toJSON(e.audio_frame):void 0),e.cursor_data!==void 0&&(r.cursor_data=e.cursor_data?ee.toJSON(e.cursor_data):void 0),e.cursor_position!==void 0&&(r.cursor_position=e.cursor_position?re.toJSON(e.cursor_position):void 0),e.cursor_id!==void 0&&(r.cursor_id=Math.round(e.cursor_id)),e.key_event!==void 0&&(r.key_event=e.key_event?v.toJSON(e.key_event):void 0),e.clipboard!==void 0&&(r.clipboard=e.clipboard?ne.toJSON(e.clipboard):void 0),e.file_action!==void 0&&(r.file_action=e.file_action?se.toJSON(e.file_action):void 0),e.file_response!==void 0&&(r.file_response=e.file_response?de.toJSON(e.file_response):void 0),e.misc!==void 0&&(r.misc=e.misc?E.toJSON(e.misc):void 0),r},fromPartial(e){var i;const r=oi();return r.signed_id=e.signed_id!==void 0&&e.signed_id!==null?Se.fromPartial(e.signed_id):void 0,r.public_key=e.public_key!==void 0&&e.public_key!==null?C.fromPartial(e.public_key):void 0,r.test_delay=e.test_delay!==void 0&&e.test_delay!==null?Ee.fromPartial(e.test_delay):void 0,r.video_frame=e.video_frame!==void 0&&e.video_frame!==null?Z.fromPartial(e.video_frame):void 0,r.login_request=e.login_request!==void 0&&e.login_request!==null?I.fromPartial(e.login_request):void 0,r.login_response=e.login_response!==void 0&&e.login_response!==null?j.fromPartial(e.login_response):void 0,r.hash=e.hash!==void 0&&e.hash!==null?ie.fromPartial(e.hash):void 0,r.mouse_event=e.mouse_event!==void 0&&e.mouse_event!==null?b.fromPartial(e.mouse_event):void 0,r.audio_frame=e.audio_frame!==void 0&&e.audio_frame!==null?Ne.fromPartial(e.audio_frame):void 0,r.cursor_data=e.cursor_data!==void 0&&e.cursor_data!==null?ee.fromPartial(e.cursor_data):void 0,r.cursor_position=e.cursor_position!==void 0&&e.cursor_position!==null?re.fromPartial(e.cursor_position):void 0,r.cursor_id=(i=e.cursor_id)!=null?i:void 0,r.key_event=e.key_event!==void 0&&e.key_event!==null?v.fromPartial(e.key_event):void 0,r.clipboard=e.clipboard!==void 0&&e.clipboard!==null?ne.fromPartial(e.clipboard):void 0,r.file_action=e.file_action!==void 0&&e.file_action!==null?se.fromPartial(e.file_action):void 0,r.file_response=e.file_response!==void 0&&e.file_response!==null?de.fromPartial(e.file_response):void 0,r.misc=e.misc!==void 0&&e.misc!==null?E.fromPartial(e.misc):void 0,r}};var B=(()=>{if(typeof B!="undefined")return B;if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;throw"Unable to locate global object"})();const on=B.atob||(e=>B.Buffer.from(e,"base64").toString("binary"));function A(e){const r=on(e),i=new Uint8Array(r.length);for(let t=0;t<r.length;++t)i[t]=r.charCodeAt(t);return i}const an=B.btoa||(e=>B.Buffer.from(e,"binary").toString("base64"));function F(e){const r=[];for(const i of e)r.push(String.fromCharCode(i));return an(r.join(""))}function T(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new B.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}a.util.Long!==Me&&(a.util.Long=Me,a.configure());function s(e){return e!=null}var Qe;(function(e){e[e.DEFAULT_CONN=0]="DEFAULT_CONN",e[e.FILE_TRANSFER=1]="FILE_TRANSFER",e[e.PORT_FORWARD=2]="PORT_FORWARD",e[e.RDP=3]="RDP",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Qe||(Qe={}));function ai(e){switch(e){case 0:case"DEFAULT_CONN":return 0;case 1:case"FILE_TRANSFER":return 1;case 2:case"PORT_FORWARD":return 2;case 3:case"RDP":return 3;case-1:case"UNRECOGNIZED":default:return-1}}function si(e){switch(e){case 0:return"DEFAULT_CONN";case 1:return"FILE_TRANSFER";case 2:return"PORT_FORWARD";case 3:return"RDP";default:return"UNKNOWN"}}var Xe;(function(e){e[e.UNKNOWN_NAT=0]="UNKNOWN_NAT",e[e.ASYMMETRIC=1]="ASYMMETRIC",e[e.SYMMETRIC=2]="SYMMETRIC",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Xe||(Xe={}));function Le(e){switch(e){case 0:case"UNKNOWN_NAT":return 0;case 1:case"ASYMMETRIC":return 1;case 2:case"SYMMETRIC":return 2;case-1:case"UNRECOGNIZED":default:return-1}}function Ve(e){switch(e){case 0:return"UNKNOWN_NAT";case 1:return"ASYMMETRIC";case 2:return"SYMMETRIC";default:return"UNKNOWN"}}var ui;(function(e){e[e.OK=0]="OK",e[e.UUID_MISMATCH=2]="UUID_MISMATCH",e[e.ID_EXISTS=3]="ID_EXISTS",e[e.TOO_FREQUENT=4]="TOO_FREQUENT",e[e.INVALID_ID_FORMAT=5]="INVALID_ID_FORMAT",e[e.NOT_SUPPORT=6]="NOT_SUPPORT",e[e.SERVER_ERROR=7]="SERVER_ERROR",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(ui||(ui={}));function sn(e){switch(e){case 0:case"OK":return 0;case 2:case"UUID_MISMATCH":return 2;case 3:case"ID_EXISTS":return 3;case 4:case"TOO_FREQUENT":return 4;case 5:case"INVALID_ID_FORMAT":return 5;case 6:case"NOT_SUPPORT":return 6;case 7:case"SERVER_ERROR":return 7;case-1:case"UNRECOGNIZED":default:return-1}}function un(e){switch(e){case 0:return"OK";case 2:return"UUID_MISMATCH";case 3:return"ID_EXISTS";case 4:return"TOO_FREQUENT";case 5:return"INVALID_ID_FORMAT";case 6:return"NOT_SUPPORT";case 7:return"SERVER_ERROR";default:return"UNKNOWN"}}var U;(function(e){e[e.ID_NOT_EXIST=0]="ID_NOT_EXIST",e[e.OFFLINE=2]="OFFLINE",e[e.LICENSE_MISMATCH=3]="LICENSE_MISMATCH",e[e.LICENSE_OVERUSE=4]="LICENSE_OVERUSE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(U||(U={}));function dn(e){switch(e){case 0:case"ID_NOT_EXIST":return 0;case 2:case"OFFLINE":return 2;case 3:case"LICENSE_MISMATCH":return 3;case 4:case"LICENSE_OVERUSE":return 4;case-1:case"UNRECOGNIZED":default:return-1}}function cn(e){switch(e){case 0:return"ID_NOT_EXIST";case 2:return"OFFLINE";case 3:return"LICENSE_MISMATCH";case 4:return"LICENSE_OVERUSE";default:return"UNKNOWN"}}function di(){return{id:"",serial:0}}const Ae={encode(e,r=a.Writer.create()){return e.id!==""&&r.uint32(10).string(e.id),e.serial!==0&&r.uint32(16).int32(e.serial),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=di();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.id=i.string();break;case 2:n.serial=i.int32();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{id:d(e.id)?String(e.id):"",serial:d(e.serial)?Number(e.serial):0}},toJSON(e){const r={};return e.id!==void 0&&(r.id=e.id),e.serial!==void 0&&(r.serial=Math.round(e.serial)),r},fromPartial(e){var i,t;const r=di();return r.id=(i=e.id)!=null?i:"",r.serial=(t=e.serial)!=null?t:0,r}};function ci(){return{request_pk:!1}}const Fe={encode(e,r=a.Writer.create()){return e.request_pk===!0&&r.uint32(16).bool(e.request_pk),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=ci();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 2:n.request_pk=i.bool();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{request_pk:d(e.request_pk)?Boolean(e.request_pk):!1}},toJSON(e){const r={};return e.request_pk!==void 0&&(r.request_pk=e.request_pk),r},fromPartial(e){var i;const r=ci();return r.request_pk=(i=e.request_pk)!=null?i:!1,r}};function li(){return{id:"",nat_type:0,licence_key:"",conn_type:0}}const q={encode(e,r=a.Writer.create()){return e.id!==""&&r.uint32(10).string(e.id),e.nat_type!==0&&r.uint32(16).int32(e.nat_type),e.licence_key!==""&&r.uint32(26).string(e.licence_key),e.conn_type!==0&&r.uint32(32).int32(e.conn_type),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=li();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.id=i.string();break;case 2:n.nat_type=i.int32();break;case 3:n.licence_key=i.string();break;case 4:n.conn_type=i.int32();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{id:d(e.id)?String(e.id):"",nat_type:d(e.nat_type)?Le(e.nat_type):0,licence_key:d(e.licence_key)?String(e.licence_key):"",conn_type:d(e.conn_type)?ai(e.conn_type):0}},toJSON(e){const r={};return e.id!==void 0&&(r.id=e.id),e.nat_type!==void 0&&(r.nat_type=Ve(e.nat_type)),e.licence_key!==void 0&&(r.licence_key=e.licence_key),e.conn_type!==void 0&&(r.conn_type=si(e.conn_type)),r},fromPartial(e){var i,t,n,o;const r=li();return r.id=(i=e.id)!=null?i:"",r.nat_type=(t=e.nat_type)!=null?t:0,r.licence_key=(n=e.licence_key)!=null?n:"",r.conn_type=(o=e.conn_type)!=null?o:0,r}};function _i(){return{socket_addr:new Uint8Array,relay_server:"",nat_type:0}}const De={encode(e,r=a.Writer.create()){return e.socket_addr.length!==0&&r.uint32(10).bytes(e.socket_addr),e.relay_server!==""&&r.uint32(18).string(e.relay_server),e.nat_type!==0&&r.uint32(24).int32(e.nat_type),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=_i();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.socket_addr=i.bytes();break;case 2:n.relay_server=i.string();break;case 3:n.nat_type=i.int32();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{socket_addr:d(e.socket_addr)?h(e.socket_addr):new Uint8Array,relay_server:d(e.relay_server)?String(e.relay_server):"",nat_type:d(e.nat_type)?Le(e.nat_type):0}},toJSON(e){const r={};return e.socket_addr!==void 0&&(r.socket_addr=y(e.socket_addr!==void 0?e.socket_addr:new Uint8Array)),e.relay_server!==void 0&&(r.relay_server=e.relay_server),e.nat_type!==void 0&&(r.nat_type=Ve(e.nat_type)),r},fromPartial(e){var i,t,n;const r=_i();return r.socket_addr=(i=e.socket_addr)!=null?i:new Uint8Array,r.relay_server=(t=e.relay_server)!=null?t:"",r.nat_type=(n=e.nat_type)!=null?n:0,r}};function pi(){return{serial:0}}const Oe={encode(e,r=a.Writer.create()){return e.serial!==0&&r.uint32(8).int32(e.serial),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=pi();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.serial=i.int32();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{serial:d(e.serial)?Number(e.serial):0}},toJSON(e){const r={};return e.serial!==void 0&&(r.serial=Math.round(e.serial)),r},fromPartial(e){var i;const r=pi();return r.serial=(i=e.serial)!=null?i:0,r}};function fi(){return{port:0,cu:void 0}}const Re={encode(e,r=a.Writer.create()){return e.port!==0&&r.uint32(8).int32(e.port),e.cu!==void 0&&S.encode(e.cu,r.uint32(18).fork()).ldelim(),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=fi();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.port=i.int32();break;case 2:n.cu=S.decode(i,i.uint32());break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{port:d(e.port)?Number(e.port):0,cu:d(e.cu)?S.fromJSON(e.cu):void 0}},toJSON(e){const r={};return e.port!==void 0&&(r.port=Math.round(e.port)),e.cu!==void 0&&(r.cu=e.cu?S.toJSON(e.cu):void 0),r},fromPartial(e){var i;const r=fi();return r.port=(i=e.port)!=null?i:0,r.cu=e.cu!==void 0&&e.cu!==null?S.fromPartial(e.cu):void 0,r}};function vi(){return{socket_addr:new Uint8Array,id:"",relay_server:"",nat_type:0,version:""}}const Ce={encode(e,r=a.Writer.create()){return e.socket_addr.length!==0&&r.uint32(10).bytes(e.socket_addr),e.id!==""&&r.uint32(18).string(e.id),e.relay_server!==""&&r.uint32(26).string(e.relay_server),e.nat_type!==0&&r.uint32(32).int32(e.nat_type),e.version!==""&&r.uint32(42).string(e.version),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=vi();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.socket_addr=i.bytes();break;case 2:n.id=i.string();break;case 3:n.relay_server=i.string();break;case 4:n.nat_type=i.int32();break;case 5:n.version=i.string();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{socket_addr:d(e.socket_addr)?h(e.socket_addr):new Uint8Array,id:d(e.id)?String(e.id):"",relay_server:d(e.relay_server)?String(e.relay_server):"",nat_type:d(e.nat_type)?Le(e.nat_type):0,version:d(e.version)?String(e.version):""}},toJSON(e){const r={};return e.socket_addr!==void 0&&(r.socket_addr=y(e.socket_addr!==void 0?e.socket_addr:new Uint8Array)),e.id!==void 0&&(r.id=e.id),e.relay_server!==void 0&&(r.relay_server=e.relay_server),e.nat_type!==void 0&&(r.nat_type=Ve(e.nat_type)),e.version!==void 0&&(r.version=e.version),r},fromPartial(e){var i,t,n,o,u;const r=vi();return r.socket_addr=(i=e.socket_addr)!=null?i:new Uint8Array,r.id=(t=e.id)!=null?t:"",r.relay_server=(n=e.relay_server)!=null?n:"",r.nat_type=(o=e.nat_type)!=null?o:0,r.version=(u=e.version)!=null?u:"",r}};function hi(){return{id:"",uuid:new Uint8Array,pk:new Uint8Array,old_id:""}}const Be={encode(e,r=a.Writer.create()){return e.id!==""&&r.uint32(10).string(e.id),e.uuid.length!==0&&r.uint32(18).bytes(e.uuid),e.pk.length!==0&&r.uint32(26).bytes(e.pk),e.old_id!==""&&r.uint32(34).string(e.old_id),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=hi();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.id=i.string();break;case 2:n.uuid=i.bytes();break;case 3:n.pk=i.bytes();break;case 4:n.old_id=i.string();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{id:d(e.id)?String(e.id):"",uuid:d(e.uuid)?h(e.uuid):new Uint8Array,pk:d(e.pk)?h(e.pk):new Uint8Array,old_id:d(e.old_id)?String(e.old_id):""}},toJSON(e){const r={};return e.id!==void 0&&(r.id=e.id),e.uuid!==void 0&&(r.uuid=y(e.uuid!==void 0?e.uuid:new Uint8Array)),e.pk!==void 0&&(r.pk=y(e.pk!==void 0?e.pk:new Uint8Array)),e.old_id!==void 0&&(r.old_id=e.old_id),r},fromPartial(e){var i,t,n,o;const r=hi();return r.id=(i=e.id)!=null?i:"",r.uuid=(t=e.uuid)!=null?t:new Uint8Array,r.pk=(n=e.pk)!=null?n:new Uint8Array,r.old_id=(o=e.old_id)!=null?o:"",r}};function yi(){return{result:0}}const Pe={encode(e,r=a.Writer.create()){return e.result!==0&&r.uint32(8).int32(e.result),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=yi();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.result=i.int32();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{result:d(e.result)?sn(e.result):0}},toJSON(e){const r={};return e.result!==void 0&&(r.result=un(e.result)),r},fromPartial(e){var i;const r=yi();return r.result=(i=e.result)!=null?i:0,r}};function ki(){return{socket_addr:new Uint8Array,pk:new Uint8Array,failure:0,relay_server:"",nat_type:void 0,is_local:void 0,other_failure:""}}const xe={encode(e,r=a.Writer.create()){return e.socket_addr.length!==0&&r.uint32(10).bytes(e.socket_addr),e.pk.length!==0&&r.uint32(18).bytes(e.pk),e.failure!==0&&r.uint32(24).int32(e.failure),e.relay_server!==""&&r.uint32(34).string(e.relay_server),e.nat_type!==void 0&&r.uint32(40).int32(e.nat_type),e.is_local!==void 0&&r.uint32(48).bool(e.is_local),e.other_failure!==""&&r.uint32(58).string(e.other_failure),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=ki();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.socket_addr=i.bytes();break;case 2:n.pk=i.bytes();break;case 3:n.failure=i.int32();break;case 4:n.relay_server=i.string();break;case 5:n.nat_type=i.int32();break;case 6:n.is_local=i.bool();break;case 7:n.other_failure=i.string();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{socket_addr:d(e.socket_addr)?h(e.socket_addr):new Uint8Array,pk:d(e.pk)?h(e.pk):new Uint8Array,failure:d(e.failure)?dn(e.failure):0,relay_server:d(e.relay_server)?String(e.relay_server):"",nat_type:d(e.nat_type)?Le(e.nat_type):void 0,is_local:d(e.is_local)?Boolean(e.is_local):void 0,other_failure:d(e.other_failure)?String(e.other_failure):""}},toJSON(e){const r={};return e.socket_addr!==void 0&&(r.socket_addr=y(e.socket_addr!==void 0?e.socket_addr:new Uint8Array)),e.pk!==void 0&&(r.pk=y(e.pk!==void 0?e.pk:new Uint8Array)),e.failure!==void 0&&(r.failure=cn(e.failure)),e.relay_server!==void 0&&(r.relay_server=e.relay_server),e.nat_type!==void 0&&(r.nat_type=e.nat_type!==void 0?Ve(e.nat_type):void 0),e.is_local!==void 0&&(r.is_local=e.is_local),e.other_failure!==void 0&&(r.other_failure=e.other_failure),r},fromPartial(e){var i,t,n,o,u,c,l;const r=ki();return r.socket_addr=(i=e.socket_addr)!=null?i:new Uint8Array,r.pk=(t=e.pk)!=null?t:new Uint8Array,r.failure=(n=e.failure)!=null?n:0,r.relay_server=(o=e.relay_server)!=null?o:"",r.nat_type=(u=e.nat_type)!=null?u:void 0,r.is_local=(c=e.is_local)!=null?c:void 0,r.other_failure=(l=e.other_failure)!=null?l:"",r}};function mi(){return{serial:0,rendezvous_servers:[]}}const S={encode(e,r=a.Writer.create()){e.serial!==0&&r.uint32(8).int32(e.serial);for(const i of e.rendezvous_servers)r.uint32(18).string(i);return r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=mi();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.serial=i.int32();break;case 2:n.rendezvous_servers.push(i.string());break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{serial:d(e.serial)?Number(e.serial):0,rendezvous_servers:Array.isArray(e==null?void 0:e.rendezvous_servers)?e.rendezvous_servers.map(r=>String(r)):[]}},toJSON(e){const r={};return e.serial!==void 0&&(r.serial=Math.round(e.serial)),e.rendezvous_servers?r.rendezvous_servers=e.rendezvous_servers.map(i=>i):r.rendezvous_servers=[],r},fromPartial(e){var i,t;const r=mi();return r.serial=(i=e.serial)!=null?i:0,r.rendezvous_servers=((t=e.rendezvous_servers)==null?void 0:t.map(n=>n))||[],r}};function Ei(){return{id:"",uuid:"",socket_addr:new Uint8Array,relay_server:"",secure:!1,licence_key:"",conn_type:0}}const M={encode(e,r=a.Writer.create()){return e.id!==""&&r.uint32(10).string(e.id),e.uuid!==""&&r.uint32(18).string(e.uuid),e.socket_addr.length!==0&&r.uint32(26).bytes(e.socket_addr),e.relay_server!==""&&r.uint32(34).string(e.relay_server),e.secure===!0&&r.uint32(40).bool(e.secure),e.licence_key!==""&&r.uint32(50).string(e.licence_key),e.conn_type!==0&&r.uint32(56).int32(e.conn_type),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Ei();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.id=i.string();break;case 2:n.uuid=i.string();break;case 3:n.socket_addr=i.bytes();break;case 4:n.relay_server=i.string();break;case 5:n.secure=i.bool();break;case 6:n.licence_key=i.string();break;case 7:n.conn_type=i.int32();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{id:d(e.id)?String(e.id):"",uuid:d(e.uuid)?String(e.uuid):"",socket_addr:d(e.socket_addr)?h(e.socket_addr):new Uint8Array,relay_server:d(e.relay_server)?String(e.relay_server):"",secure:d(e.secure)?Boolean(e.secure):!1,licence_key:d(e.licence_key)?String(e.licence_key):"",conn_type:d(e.conn_type)?ai(e.conn_type):0}},toJSON(e){const r={};return e.id!==void 0&&(r.id=e.id),e.uuid!==void 0&&(r.uuid=e.uuid),e.socket_addr!==void 0&&(r.socket_addr=y(e.socket_addr!==void 0?e.socket_addr:new Uint8Array)),e.relay_server!==void 0&&(r.relay_server=e.relay_server),e.secure!==void 0&&(r.secure=e.secure),e.licence_key!==void 0&&(r.licence_key=e.licence_key),e.conn_type!==void 0&&(r.conn_type=si(e.conn_type)),r},fromPartial(e){var i,t,n,o,u,c,l;const r=Ei();return r.id=(i=e.id)!=null?i:"",r.uuid=(t=e.uuid)!=null?t:"",r.socket_addr=(n=e.socket_addr)!=null?n:new Uint8Array,r.relay_server=(o=e.relay_server)!=null?o:"",r.secure=(u=e.secure)!=null?u:!1,r.licence_key=(c=e.licence_key)!=null?c:"",r.conn_type=(l=e.conn_type)!=null?l:0,r}};function Si(){return{socket_addr:new Uint8Array,uuid:"",relay_server:"",id:void 0,pk:void 0,refuse_reason:"",version:""}}const Ie={encode(e,r=a.Writer.create()){return e.socket_addr.length!==0&&r.uint32(10).bytes(e.socket_addr),e.uuid!==""&&r.uint32(18).string(e.uuid),e.relay_server!==""&&r.uint32(26).string(e.relay_server),e.id!==void 0&&r.uint32(34).string(e.id),e.pk!==void 0&&r.uint32(42).bytes(e.pk),e.refuse_reason!==""&&r.uint32(50).string(e.refuse_reason),e.version!==""&&r.uint32(58).string(e.version),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Si();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.socket_addr=i.bytes();break;case 2:n.uuid=i.string();break;case 3:n.relay_server=i.string();break;case 4:n.id=i.string();break;case 5:n.pk=i.bytes();break;case 6:n.refuse_reason=i.string();break;case 7:n.version=i.string();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{socket_addr:d(e.socket_addr)?h(e.socket_addr):new Uint8Array,uuid:d(e.uuid)?String(e.uuid):"",relay_server:d(e.relay_server)?String(e.relay_server):"",id:d(e.id)?String(e.id):void 0,pk:d(e.pk)?h(e.pk):void 0,refuse_reason:d(e.refuse_reason)?String(e.refuse_reason):"",version:d(e.version)?String(e.version):""}},toJSON(e){const r={};return e.socket_addr!==void 0&&(r.socket_addr=y(e.socket_addr!==void 0?e.socket_addr:new Uint8Array)),e.uuid!==void 0&&(r.uuid=e.uuid),e.relay_server!==void 0&&(r.relay_server=e.relay_server),e.id!==void 0&&(r.id=e.id),e.pk!==void 0&&(r.pk=e.pk!==void 0?y(e.pk):void 0),e.refuse_reason!==void 0&&(r.refuse_reason=e.refuse_reason),e.version!==void 0&&(r.version=e.version),r},fromPartial(e){var i,t,n,o,u,c,l;const r=Si();return r.socket_addr=(i=e.socket_addr)!=null?i:new Uint8Array,r.uuid=(t=e.uuid)!=null?t:"",r.relay_server=(n=e.relay_server)!=null?n:"",r.id=(o=e.id)!=null?o:void 0,r.pk=(u=e.pk)!=null?u:void 0,r.refuse_reason=(c=e.refuse_reason)!=null?c:"",r.version=(l=e.version)!=null?l:"",r}};function wi(){return{url:""}}const be={encode(e,r=a.Writer.create()){return e.url!==""&&r.uint32(10).string(e.url),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=wi();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.url=i.string();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{url:d(e.url)?String(e.url):""}},toJSON(e){const r={};return e.url!==void 0&&(r.url=e.url),r},fromPartial(e){var i;const r=wi();return r.url=(i=e.url)!=null?i:"",r}};function Ni(){return{socket_addr:new Uint8Array,relay_server:""}}const Je={encode(e,r=a.Writer.create()){return e.socket_addr.length!==0&&r.uint32(10).bytes(e.socket_addr),e.relay_server!==""&&r.uint32(18).string(e.relay_server),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Ni();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.socket_addr=i.bytes();break;case 2:n.relay_server=i.string();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{socket_addr:d(e.socket_addr)?h(e.socket_addr):new Uint8Array,relay_server:d(e.relay_server)?String(e.relay_server):""}},toJSON(e){const r={};return e.socket_addr!==void 0&&(r.socket_addr=y(e.socket_addr!==void 0?e.socket_addr:new Uint8Array)),e.relay_server!==void 0&&(r.relay_server=e.relay_server),r},fromPartial(e){var i,t;const r=Ni();return r.socket_addr=(i=e.socket_addr)!=null?i:new Uint8Array,r.relay_server=(t=e.relay_server)!=null?t:"",r}};function Ai(){return{socket_addr:new Uint8Array,local_addr:new Uint8Array,relay_server:"",id:"",version:""}}const Te={encode(e,r=a.Writer.create()){return e.socket_addr.length!==0&&r.uint32(10).bytes(e.socket_addr),e.local_addr.length!==0&&r.uint32(18).bytes(e.local_addr),e.relay_server!==""&&r.uint32(26).string(e.relay_server),e.id!==""&&r.uint32(34).string(e.id),e.version!==""&&r.uint32(42).string(e.version),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Ai();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.socket_addr=i.bytes();break;case 2:n.local_addr=i.bytes();break;case 3:n.relay_server=i.string();break;case 4:n.id=i.string();break;case 5:n.version=i.string();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{socket_addr:d(e.socket_addr)?h(e.socket_addr):new Uint8Array,local_addr:d(e.local_addr)?h(e.local_addr):new Uint8Array,relay_server:d(e.relay_server)?String(e.relay_server):"",id:d(e.id)?String(e.id):"",version:d(e.version)?String(e.version):""}},toJSON(e){const r={};return e.socket_addr!==void 0&&(r.socket_addr=y(e.socket_addr!==void 0?e.socket_addr:new Uint8Array)),e.local_addr!==void 0&&(r.local_addr=y(e.local_addr!==void 0?e.local_addr:new Uint8Array)),e.relay_server!==void 0&&(r.relay_server=e.relay_server),e.id!==void 0&&(r.id=e.id),e.version!==void 0&&(r.version=e.version),r},fromPartial(e){var i,t,n,o,u;const r=Ai();return r.socket_addr=(i=e.socket_addr)!=null?i:new Uint8Array,r.local_addr=(t=e.local_addr)!=null?t:new Uint8Array,r.relay_server=(n=e.relay_server)!=null?n:"",r.id=(o=e.id)!=null?o:"",r.version=(u=e.version)!=null?u:"",r}};function Fi(){return{cmd:"",mac:"",id:"",username:"",hostname:"",platform:"",misc:""}}const Ue={encode(e,r=a.Writer.create()){return e.cmd!==""&&r.uint32(10).string(e.cmd),e.mac!==""&&r.uint32(18).string(e.mac),e.id!==""&&r.uint32(26).string(e.id),e.username!==""&&r.uint32(34).string(e.username),e.hostname!==""&&r.uint32(42).string(e.hostname),e.platform!==""&&r.uint32(50).string(e.platform),e.misc!==""&&r.uint32(58).string(e.misc),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Fi();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 1:n.cmd=i.string();break;case 2:n.mac=i.string();break;case 3:n.id=i.string();break;case 4:n.username=i.string();break;case 5:n.hostname=i.string();break;case 6:n.platform=i.string();break;case 7:n.misc=i.string();break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{cmd:d(e.cmd)?String(e.cmd):"",mac:d(e.mac)?String(e.mac):"",id:d(e.id)?String(e.id):"",username:d(e.username)?String(e.username):"",hostname:d(e.hostname)?String(e.hostname):"",platform:d(e.platform)?String(e.platform):"",misc:d(e.misc)?String(e.misc):""}},toJSON(e){const r={};return e.cmd!==void 0&&(r.cmd=e.cmd),e.mac!==void 0&&(r.mac=e.mac),e.id!==void 0&&(r.id=e.id),e.username!==void 0&&(r.username=e.username),e.hostname!==void 0&&(r.hostname=e.hostname),e.platform!==void 0&&(r.platform=e.platform),e.misc!==void 0&&(r.misc=e.misc),r},fromPartial(e){var i,t,n,o,u,c,l;const r=Fi();return r.cmd=(i=e.cmd)!=null?i:"",r.mac=(t=e.mac)!=null?t:"",r.id=(n=e.id)!=null?n:"",r.username=(o=e.username)!=null?o:"",r.hostname=(u=e.hostname)!=null?u:"",r.platform=(c=e.platform)!=null?c:"",r.misc=(l=e.misc)!=null?l:"",r}};function Di(){return{register_peer:void 0,register_peer_response:void 0,punch_hole_request:void 0,punch_hole:void 0,punch_hole_sent:void 0,punch_hole_response:void 0,fetch_local_addr:void 0,local_addr:void 0,configure_update:void 0,register_pk:void 0,register_pk_response:void 0,software_update:void 0,request_relay:void 0,relay_response:void 0,test_nat_request:void 0,test_nat_response:void 0,peer_discovery:void 0}}const $e={encode(e,r=a.Writer.create()){return e.register_peer!==void 0&&Ae.encode(e.register_peer,r.uint32(50).fork()).ldelim(),e.register_peer_response!==void 0&&Fe.encode(e.register_peer_response,r.uint32(58).fork()).ldelim(),e.punch_hole_request!==void 0&&q.encode(e.punch_hole_request,r.uint32(66).fork()).ldelim(),e.punch_hole!==void 0&&De.encode(e.punch_hole,r.uint32(74).fork()).ldelim(),e.punch_hole_sent!==void 0&&Ce.encode(e.punch_hole_sent,r.uint32(82).fork()).ldelim(),e.punch_hole_response!==void 0&&xe.encode(e.punch_hole_response,r.uint32(90).fork()).ldelim(),e.fetch_local_addr!==void 0&&Je.encode(e.fetch_local_addr,r.uint32(98).fork()).ldelim(),e.local_addr!==void 0&&Te.encode(e.local_addr,r.uint32(106).fork()).ldelim(),e.configure_update!==void 0&&S.encode(e.configure_update,r.uint32(114).fork()).ldelim(),e.register_pk!==void 0&&Be.encode(e.register_pk,r.uint32(122).fork()).ldelim(),e.register_pk_response!==void 0&&Pe.encode(e.register_pk_response,r.uint32(130).fork()).ldelim(),e.software_update!==void 0&&be.encode(e.software_update,r.uint32(138).fork()).ldelim(),e.request_relay!==void 0&&M.encode(e.request_relay,r.uint32(146).fork()).ldelim(),e.relay_response!==void 0&&Ie.encode(e.relay_response,r.uint32(154).fork()).ldelim(),e.test_nat_request!==void 0&&Oe.encode(e.test_nat_request,r.uint32(162).fork()).ldelim(),e.test_nat_response!==void 0&&Re.encode(e.test_nat_response,r.uint32(170).fork()).ldelim(),e.peer_discovery!==void 0&&Ue.encode(e.peer_discovery,r.uint32(178).fork()).ldelim(),r},decode(e,r){const i=e instanceof a.Reader?e:new a.Reader(e);let t=r===void 0?i.len:i.pos+r;const n=Di();for(;i.pos<t;){const o=i.uint32();switch(o>>>3){case 6:n.register_peer=Ae.decode(i,i.uint32());break;case 7:n.register_peer_response=Fe.decode(i,i.uint32());break;case 8:n.punch_hole_request=q.decode(i,i.uint32());break;case 9:n.punch_hole=De.decode(i,i.uint32());break;case 10:n.punch_hole_sent=Ce.decode(i,i.uint32());break;case 11:n.punch_hole_response=xe.decode(i,i.uint32());break;case 12:n.fetch_local_addr=Je.decode(i,i.uint32());break;case 13:n.local_addr=Te.decode(i,i.uint32());break;case 14:n.configure_update=S.decode(i,i.uint32());break;case 15:n.register_pk=Be.decode(i,i.uint32());break;case 16:n.register_pk_response=Pe.decode(i,i.uint32());break;case 17:n.software_update=be.decode(i,i.uint32());break;case 18:n.request_relay=M.decode(i,i.uint32());break;case 19:n.relay_response=Ie.decode(i,i.uint32());break;case 20:n.test_nat_request=Oe.decode(i,i.uint32());break;case 21:n.test_nat_response=Re.decode(i,i.uint32());break;case 22:n.peer_discovery=Ue.decode(i,i.uint32());break;default:i.skipType(o&7);break}}return n},fromJSON(e){return{register_peer:d(e.register_peer)?Ae.fromJSON(e.register_peer):void 0,register_peer_response:d(e.register_peer_response)?Fe.fromJSON(e.register_peer_response):void 0,punch_hole_request:d(e.punch_hole_request)?q.fromJSON(e.punch_hole_request):void 0,punch_hole:d(e.punch_hole)?De.fromJSON(e.punch_hole):void 0,punch_hole_sent:d(e.punch_hole_sent)?Ce.fromJSON(e.punch_hole_sent):void 0,punch_hole_response:d(e.punch_hole_response)?xe.fromJSON(e.punch_hole_response):void 0,fetch_local_addr:d(e.fetch_local_addr)?Je.fromJSON(e.fetch_local_addr):void 0,local_addr:d(e.local_addr)?Te.fromJSON(e.local_addr):void 0,configure_update:d(e.configure_update)?S.fromJSON(e.configure_update):void 0,register_pk:d(e.register_pk)?Be.fromJSON(e.register_pk):void 0,register_pk_response:d(e.register_pk_response)?Pe.fromJSON(e.register_pk_response):void 0,software_update:d(e.software_update)?be.fromJSON(e.software_update):void 0,request_relay:d(e.request_relay)?M.fromJSON(e.request_relay):void 0,relay_response:d(e.relay_response)?Ie.fromJSON(e.relay_response):void 0,test_nat_request:d(e.test_nat_request)?Oe.fromJSON(e.test_nat_request):void 0,test_nat_response:d(e.test_nat_response)?Re.fromJSON(e.test_nat_response):void 0,peer_discovery:d(e.peer_discovery)?Ue.fromJSON(e.peer_discovery):void 0}},toJSON(e){const r={};return e.register_peer!==void 0&&(r.register_peer=e.register_peer?Ae.toJSON(e.register_peer):void 0),e.register_peer_response!==void 0&&(r.register_peer_response=e.register_peer_response?Fe.toJSON(e.register_peer_response):void 0),e.punch_hole_request!==void 0&&(r.punch_hole_request=e.punch_hole_request?q.toJSON(e.punch_hole_request):void 0),e.punch_hole!==void 0&&(r.punch_hole=e.punch_hole?De.toJSON(e.punch_hole):void 0),e.punch_hole_sent!==void 0&&(r.punch_hole_sent=e.punch_hole_sent?Ce.toJSON(e.punch_hole_sent):void 0),e.punch_hole_response!==void 0&&(r.punch_hole_response=e.punch_hole_response?xe.toJSON(e.punch_hole_response):void 0),e.fetch_local_addr!==void 0&&(r.fetch_local_addr=e.fetch_local_addr?Je.toJSON(e.fetch_local_addr):void 0),e.local_addr!==void 0&&(r.local_addr=e.local_addr?Te.toJSON(e.local_addr):void 0),e.configure_update!==void 0&&(r.configure_update=e.configure_update?S.toJSON(e.configure_update):void 0),e.register_pk!==void 0&&(r.register_pk=e.register_pk?Be.toJSON(e.register_pk):void 0),e.register_pk_response!==void 0&&(r.register_pk_response=e.register_pk_response?Pe.toJSON(e.register_pk_response):void 0),e.software_update!==void 0&&(r.software_update=e.software_update?be.toJSON(e.software_update):void 0),e.request_relay!==void 0&&(r.request_relay=e.request_relay?M.toJSON(e.request_relay):void 0),e.relay_response!==void 0&&(r.relay_response=e.relay_response?Ie.toJSON(e.relay_response):void 0),e.test_nat_request!==void 0&&(r.test_nat_request=e.test_nat_request?Oe.toJSON(e.test_nat_request):void 0),e.test_nat_response!==void 0&&(r.test_nat_response=e.test_nat_response?Re.toJSON(e.test_nat_response):void 0),e.peer_discovery!==void 0&&(r.peer_discovery=e.peer_discovery?Ue.toJSON(e.peer_discovery):void 0),r},fromPartial(e){const r=Di();return r.register_peer=e.register_peer!==void 0&&e.register_peer!==null?Ae.fromPartial(e.register_peer):void 0,r.register_peer_response=e.register_peer_response!==void 0&&e.register_peer_response!==null?Fe.fromPartial(e.register_peer_response):void 0,r.punch_hole_request=e.punch_hole_request!==void 0&&e.punch_hole_request!==null?q.fromPartial(e.punch_hole_request):void 0,r.punch_hole=e.punch_hole!==void 0&&e.punch_hole!==null?De.fromPartial(e.punch_hole):void 0,r.punch_hole_sent=e.punch_hole_sent!==void 0&&e.punch_hole_sent!==null?Ce.fromPartial(e.punch_hole_sent):void 0,r.punch_hole_response=e.punch_hole_response!==void 0&&e.punch_hole_response!==null?xe.fromPartial(e.punch_hole_response):void 0,r.fetch_local_addr=e.fetch_local_addr!==void 0&&e.fetch_local_addr!==null?Je.fromPartial(e.fetch_local_addr):void 0,r.local_addr=e.local_addr!==void 0&&e.local_addr!==null?Te.fromPartial(e.local_addr):void 0,r.configure_update=e.configure_update!==void 0&&e.configure_update!==null?S.fromPartial(e.configure_update):void 0,r.register_pk=e.register_pk!==void 0&&e.register_pk!==null?Be.fromPartial(e.register_pk):void 0,r.register_pk_response=e.register_pk_response!==void 0&&e.register_pk_response!==null?Pe.fromPartial(e.register_pk_response):void 0,r.software_update=e.software_update!==void 0&&e.software_update!==null?be.fromPartial(e.software_update):void 0,r.request_relay=e.request_relay!==void 0&&e.request_relay!==null?M.fromPartial(e.request_relay):void 0,r.relay_response=e.relay_response!==void 0&&e.relay_response!==null?Ie.fromPartial(e.relay_response):void 0,r.test_nat_request=e.test_nat_request!==void 0&&e.test_nat_request!==null?Oe.fromPartial(e.test_nat_request):void 0,r.test_nat_response=e.test_nat_response!==void 0&&e.test_nat_response!==null?Re.fromPartial(e.test_nat_response):void 0,r.peer_discovery=e.peer_discovery!==void 0&&e.peer_discovery!==null?Ue.fromPartial(e.peer_discovery):void 0,r}};var g=(()=>{if(typeof g!="undefined")return g;if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;throw"Unable to locate global object"})();const ln=g.atob||(e=>g.Buffer.from(e,"base64").toString("binary"));function h(e){const r=ln(e),i=new Uint8Array(r.length);for(let t=0;t<r.length;++t)i[t]=r.charCodeAt(t);return i}const _n=g.btoa||(e=>g.Buffer.from(e,"binary").toString("base64"));function y(e){const r=[];for(const i of e)r.push(String.fromCharCode(i));return _n(r.join(""))}a.util.Long!==Me&&(a.util.Long=Me,a.configure());function d(e){return e!=null}class je{constructor(r,i=!0){_(this,"_websocket");_(this,"_eventHandlers");_(this,"_buf");_(this,"_status");_(this,"_latency");_(this,"_secretKey");_(this,"_uri");_(this,"_isRendezvous");this._eventHandlers={message:t=>{},open:()=>{},close:()=>{},error:()=>{}},this._uri=r,this._status="",this._buf=[],this._websocket=new WebSocket(r),this._websocket.onmessage=this._recv_message.bind(this),this._websocket.binaryType="arraybuffer",this._latency=new Date().getTime(),this._isRendezvous=i}latency(){return this._latency}setSecretKey(r){this._secretKey=[r,0,0]}sendMessage(r){let i=Ke.encode(Ke.fromPartial(r)).finish(),t=this._secretKey;t&&(t[1]+=1,i=Cn(i,t[1],t[0])),this._websocket.send(i)}sendRendezvous(r){this._websocket.send($e.encode($e.fromPartial(r)).finish())}parseMessage(r){return Ke.decode(r)}parseRendezvous(r){return $e.decode(r)}off(r){this._eventHandlers[r]=()=>{}}on(r,i){this._eventHandlers[r]=i}async open(r=12e3){return new Promise((i,t)=>{setTimeout(()=>{this._status!="open"&&t(this._status||"Timeout")},r),this._websocket.onopen=()=>{var n;this._latency=new Date().getTime()-this._latency,this._status="open",console.debug(">> WebSock.onopen"),((n=this._websocket)==null?void 0:n.protocol)&&console.info("Server choose sub-protocol: "+this._websocket.protocol),this._eventHandlers.open(),console.info("WebSock.onopen"),i(this)},this._websocket.onclose=n=>{this._status=="open",this._status=n,console.error("WebSock.onclose: "),console.error(n),this._eventHandlers.close(n),t("Reset by the peer")},this._websocket.onerror=n=>{if(!this._status){t("Failed to connect to "+this._uri);return}this._status=n,console.error("WebSock.onerror: "),console.error(n),this._eventHandlers.error(n)}})}async next(r=12e3){const i=(t,n,o)=>{if(this._buf.length)t(this._buf[0]),this._buf.splice(0,1);else{if(this._status!="open"){n(this._status);return}new Date().getTime()>o+r?n("Timeout"):setTimeout(()=>i(t,n,o),1)}};return new Promise((t,n)=>{i(t,n,new Date().getTime())})}close(){this._status="",this._websocket&&((this._websocket.readyState===WebSocket.OPEN||this._websocket.readyState===WebSocket.CONNECTING)&&(console.info("Closing WebSocket connection"),this._websocket.close()),this._websocket.onmessage=()=>{})}_recv_message(r){if(r.data instanceof window.ArrayBuffer){let i=new Uint8Array(r.data);const t=this._secretKey;t&&(t[2]+=1,i=Bn(i,t[2],t[0])),this._buf.push(this._isRendezvous?this.parseRendezvous(i):this.parseMessage(i))}this._eventHandlers.message(r.data)}}async function Oi(e){const r=await Zi();console.log("isSIMD: "+r),window.OGVLoader.loadClass(r?"OGVDecoderVideoVP9SIMDW":"OGVDecoderVideoVP9W",i=>{window.videoCodecClass=i,i({videoFormat:{}}).then(t=>{t.init(()=>{e(t)})})},{worker:!0,threading:!0})}const Ri={cn:{Status:"\u72B6\u6001","Your Desktop":"\u4F60\u7684\u684C\u9762",desk_tip:"\u4F60\u7684\u684C\u9762\u53EF\u4EE5\u901A\u8FC7\u4E0B\u9762\u7684ID\u548C\u5BC6\u7801\u8BBF\u95EE\u3002",Password:"\u5BC6\u7801",Ready:"\u5C31\u7EEA",connecting_status:"\u6B63\u5728\u63A5\u5165RustDesk\u7F51\u7EDC...","Enable Service":"\u5141\u8BB8\u670D\u52A1","Start Service":"\u542F\u52A8\u670D\u52A1","Service is not running":"\u670D\u52A1\u6CA1\u6709\u542F\u52A8",not_ready_status:"\u672A\u5C31\u7EEA\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u8FDE\u63A5","Control Remote Desktop":"\u63A7\u5236\u8FDC\u7A0B\u684C\u9762","Transfer File":"\u4F20\u8F93\u6587\u4EF6",Connect:"\u8FDE\u63A5","Recent Sessions":"\u6700\u8FD1\u8BBF\u95EE\u8FC7","Address Book":"\u5730\u5740\u7C3F",Confirmation:"\u786E\u8BA4","TCP Tunneling":"TCP\u96A7\u9053",Remove:"\u5220\u9664","Refresh random password":"\u5237\u65B0\u968F\u673A\u5BC6\u7801","Set your own password":"\u8BBE\u7F6E\u5BC6\u7801","Enable Keyboard/Mouse":"\u5141\u8BB8\u63A7\u5236\u952E\u76D8/\u9F20\u6807","Enable Clipboard":"\u5141\u8BB8\u540C\u6B65\u526A\u8D34\u677F","Enable File Transfer":"\u5141\u8BB8\u4F20\u8F93\u6587\u4EF6","Enable TCP Tunneling":"\u5141\u8BB8\u5EFA\u7ACBTCP\u96A7\u9053","IP Whitelisting":"IP\u767D\u540D\u5355","ID/Relay Server":"ID/\u4E2D\u7EE7\u670D\u52A1\u5668","Stop service":"\u505C\u6B62\u670D\u52A1","Change ID":"\u6539\u53D8ID",Website:"\u7F51\u7AD9",About:"\u5173\u4E8E",Mute:"\u9759\u97F3","Audio Input":"\u97F3\u9891\u8F93\u5165","ID Server":"ID\u670D\u52A1\u5668","Relay Server":"\u4E2D\u7EE7\u670D\u52A1\u5668","API Server":"API\u670D\u52A1\u5668",invalid_http:"\u5FC5\u987B\u4EE5http://\u6216\u8005https://\u5F00\u5934","Invalid IP":"\u65E0\u6548IP",id_change_tip:"\u53EA\u53EF\u4EE5\u4F7F\u7528\u5B57\u6BCDa-z, A-Z, 0-9, _ (\u4E0B\u5212\u7EBF)\u3002\u9996\u5B57\u6BCD\u5FC5\u987B\u662Fa-z, A-Z\u3002\u957F\u5EA6\u57286\u4E0E16\u4E4B\u95F4\u3002","Invalid format":"\u65E0\u6548\u683C\u5F0F","This function is turned off by the server":"\u670D\u52A1\u5668\u5173\u95ED\u4E86\u6B64\u529F\u80FD","Not available":"\u5DF2\u88AB\u5360\u7528","Too frequent":"\u4FEE\u6539\u592A\u9891\u7E41\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",Cancel:"\u53D6\u6D88",Skip:"\u8DF3\u8FC7",Close:"\u5173\u95ED",Retry:"\u518D\u8BD5",OK:"\u786E\u8BA4","Password Required":"\u9700\u8981\u5BC6\u7801","Please enter your password":"\u8BF7\u8F93\u5165\u5BC6\u7801","Remember password":"\u8BB0\u4F4F\u5BC6\u7801","Wrong Password":"\u5BC6\u7801\u9519\u8BEF","Do you want to enter again?":"\u8FD8\u60F3\u8F93\u5165\u4E00\u6B21\u5417?","Connection Error":"\u8FDE\u63A5\u9519\u8BEF",Error:"\u9519\u8BEF","Reset by the peer":"\u8FDE\u63A5\u88AB\u5BF9\u65B9\u5173\u95ED","Connecting...":"\u6B63\u5728\u8FDE\u63A5...","Connection in progress. Please wait.":"\u8FDE\u63A5\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u7A0D\u7B49\u3002","Please try 1 minute later":"\u4E00\u5206\u949F\u540E\u518D\u8BD5","Login Error":"\u767B\u5F55\u9519\u8BEF",Successful:"\u6210\u529F","Connected, waiting for image...":"\u5DF2\u8FDE\u63A5\uFF0C\u7B49\u5F85\u753B\u9762\u4F20\u8F93...",Name:"\u6587\u4EF6\u540D",Modified:"\u4FEE\u6539\u65F6\u95F4",Size:"\u5927\u5C0F","Show Hidden Files":"\u663E\u793A\u9690\u85CF\u6587\u4EF6",Receive:"\u63A5\u53D7",Send:"\u53D1\u9001","Remote Computer":"\u8FDC\u7A0B\u7535\u8111","Local Computer":"\u672C\u5730\u7535\u8111","Confirm Delete":"\u786E\u8BA4\u5220\u9664","Are you sure you want to delete this file?":"\u662F\u5426\u5220\u9664\u6B64\u6587\u4EF6?","Do this for all conflicts":"\u5E94\u7528\u4E8E\u5176\u5B83\u51B2\u7A81",Deleting:"\u6B63\u5728\u5220\u9664",files:"\u6587\u4EF6",Waiting:"\u7B49\u5F85...",Finished:"\u5B8C\u6210","Custom Image Quality":"\u8BBE\u7F6E\u753B\u9762\u8D28\u91CF","Privacy mode":"\u9690\u79C1\u6A21\u5F0F","Block user input":"\u963B\u6B62\u7528\u6237\u8F93\u5165","Unblock user input":"\u53D6\u6D88\u963B\u6B62\u7528\u6237\u8F93\u5165","Adjust Window":"\u8C03\u8282\u7A97\u53E3",Original:"\u539F\u59CB\u6BD4\u4F8B",Shrink:"\u6536\u7F29",Stretch:"\u4F38\u5C55","Good image quality":"\u597D\u753B\u8D28",Balanced:"\u4E00\u822C\u753B\u8D28","Optimize reaction time":"\u4F18\u5316\u53CD\u5E94\u65F6\u95F4",Custom:"\u81EA\u5B9A\u4E49\u753B\u8D28","Show remote cursor":"\u663E\u793A\u8FDC\u7A0B\u5149\u6807","Disable clipboard":"\u7981\u6B62\u526A\u8D34\u677F","Lock after session end":"\u65AD\u5F00\u540E\u9501\u5B9A\u8FDC\u7A0B\u7535\u8111",Insert:"\u63D2\u5165","Insert Lock":"\u9501\u5B9A\u8FDC\u7A0B\u7535\u8111",Refresh:"\u5237\u65B0\u753B\u9762","ID does not exist":"ID\u4E0D\u5B58\u5728","Failed to connect to rendezvous server":"\u8FDE\u63A5\u6CE8\u518C\u670D\u52A1\u5668\u5931\u8D25","Please try later":"\u8BF7\u7A0D\u540E\u518D\u8BD5","Remote desktop is offline":"\u8FDC\u7A0B\u7535\u8111\u4E0D\u5728\u7EBF","Key mismatch":"Key\u4E0D\u5339\u914D",Timeout:"\u8FDE\u63A5\u8D85\u65F6","Failed to connect to relay server":"\u65E0\u6CD5\u8FDE\u63A5\u5230\u4E2D\u7EE7\u670D\u52A1\u5668","Failed to connect via rendezvous server":"\u65E0\u6CD5\u901A\u8FC7\u6CE8\u518C\u670D\u52A1\u5668\u5EFA\u7ACB\u8FDE\u63A5","Failed to connect via relay server":"\u65E0\u6CD5\u901A\u8FC7\u4E2D\u7EE7\u670D\u52A1\u5668\u5EFA\u7ACB\u8FDE\u63A5","Failed to make direct connection to remote desktop":"\u65E0\u6CD5\u5EFA\u7ACB\u76F4\u63A5\u8FDE\u63A5","Set Password":"\u8BBE\u7F6E\u5BC6\u7801","OS Password":"\u64CD\u4F5C\u7CFB\u7EDF\u5BC6\u7801",install_tip:"\u4F60\u6B63\u5728\u8FD0\u884C\u672A\u5B89\u88C5\u7248\u672C\uFF0C\u7531\u4E8EUAC\u9650\u5236\uFF0C\u4F5C\u4E3A\u88AB\u63A7\u7AEF\uFF0C\u4F1A\u5728\u67D0\u4E9B\u60C5\u51B5\u4E0B\u65E0\u6CD5\u63A7\u5236\u9F20\u6807\u952E\u76D8\uFF0C\u6216\u8005\u5F55\u5236\u5C4F\u5E55\uFF0C\u8BF7\u70B9\u51FB\u4E0B\u9762\u7684\u6309\u94AE\u5C06RustDesk\u5B89\u88C5\u5230\u7CFB\u7EDF\uFF0C\u4ECE\u800C\u89C4\u907F\u4E0A\u8FF0\u95EE\u9898\u3002","Click to upgrade":"\u70B9\u51FB\u8FD9\u91CC\u5347\u7EA7","Click to download":"\u70B9\u51FB\u8FD9\u91CC\u4E0B\u8F7D","Click to update":"\u70B9\u51FB\u8FD9\u91CC\u66F4\u65B0","Configuration Permissions":"\u914D\u7F6E\u6743\u9650",Configure:"\u914D\u7F6E",config_acc:'\u4E3A\u4E86\u80FD\u591F\u8FDC\u7A0B\u63A7\u5236\u4F60\u7684\u684C\u9762, \u8BF7\u7ED9\u4E88RustDesk"\u8F85\u52A9\u529F\u80FD" \u6743\u9650\u3002',config_screen:'\u4E3A\u4E86\u80FD\u591F\u8FDC\u7A0B\u8BBF\u95EE\u4F60\u7684\u684C\u9762, \u8BF7\u7ED9\u4E88RustDesk"\u5C4F\u5E55\u5F55\u5236" \u6743\u9650\u3002',"Installing ...":"\u5B89\u88C5 ...",Install:"\u5B89\u88C5",Installation:"\u5B89\u88C5","Installation Path":"\u5B89\u88C5\u8DEF\u5F84","Create start menu shortcuts":"\u521B\u5EFA\u542F\u52A8\u83DC\u5355\u5FEB\u6377\u65B9\u5F0F","Create desktop icon":"\u521B\u5EFA\u684C\u9762\u56FE\u6807",agreement_tip:"\u5F00\u59CB\u5B89\u88C5\u5373\u8868\u793A\u63A5\u53D7\u8BB8\u53EF\u534F\u8BAE\u3002","Accept and Install":"\u540C\u610F\u5E76\u5B89\u88C5","End-user license agreement":"\u7528\u6237\u534F\u8BAE","Generating ...":"\u6B63\u5728\u4EA7\u751F ...","Your installation is lower version.":"\u4F60\u5B89\u88C5\u7684\u7248\u672C\u6BD4\u5F53\u524D\u8FD0\u884C\u7684\u4F4E\u3002",not_close_tcp_tip:"\u8BF7\u5728\u4F7F\u7528\u96A7\u9053\u7684\u65F6\u5019\uFF0C\u4E0D\u8981\u5173\u95ED\u672C\u7A97\u53E3","Listening ...":"\u6B63\u5728\u7B49\u5F85\u96A7\u9053\u8FDE\u63A5 ...","Remote Host":"\u8FDC\u7A0B\u4E3B\u673A","Remote Port":"\u8FDC\u7A0B\u7AEF\u53E3",Action:"\u52A8\u4F5C",Add:"\u6DFB\u52A0","Local Port":"\u672C\u5730\u7AEF\u53E3",setup_server_tip:"\u5982\u679C\u9700\u8981\u66F4\u5FEB\u8FDE\u63A5\u901F\u5EA6\uFF0C\u4F60\u53EF\u4EE5\u9009\u62E9\u81EA\u5EFA\u670D\u52A1\u5668","Too short, at least 6 characters.":"\u592A\u77ED\u4E86\uFF0C\u81F3\u5C116\u4E2A\u5B57\u7B26","The confirmation is not identical.":"\u4E24\u6B21\u8F93\u5165\u4E0D\u5339\u914D",Permissions:"\u6743\u9650",Accept:"\u63A5\u53D7",Dismiss:"\u62D2\u7EDD",Disconnect:"\u65AD\u5F00\u8FDE\u63A5","Allow using keyboard and mouse":"\u5141\u8BB8\u4F7F\u7528\u952E\u76D8\u9F20\u6807","Allow using clipboard":"\u5141\u8BB8\u4F7F\u7528\u526A\u8D34\u677F","Allow hearing sound":"\u5141\u8BB8\u542C\u5230\u58F0\u97F3",Connected:"\u5DF2\u7ECF\u8FDE\u63A5","Direct and encrypted connection":"\u52A0\u5BC6\u76F4\u8FDE","Relayed and encrypted connection":"\u52A0\u5BC6\u4E2D\u7EE7\u8FDE\u63A5","Direct and unencrypted connection":"\u975E\u52A0\u5BC6\u76F4\u8FDE","Relayed and unencrypted connection":"\u975E\u52A0\u5BC6\u4E2D\u7EE7\u8FDE\u63A5","Enter Remote ID":"\u8F93\u5165\u5BF9\u65B9ID","Enter your password":"\u8F93\u5165\u5BC6\u7801","Logging in...":"\u6B63\u5728\u767B\u5F55...","Enable RDP session sharing":"\u5141\u8BB8RDP\u4F1A\u8BDD\u5171\u4EAB","Auto Login":"\u81EA\u52A8\u767B\u5F55\uFF08\u8BBE\u7F6E\u65AD\u5F00\u540E\u9501\u5B9A\u624D\u6709\u6548\uFF09","Enable Direct IP Access":"\u5141\u8BB8IP\u76F4\u63A5\u8BBF\u95EE",Rename:"\u6539\u540D",Space:"\u7A7A\u683C","Create Desktop Shortcut":"\u521B\u5EFA\u684C\u9762\u5FEB\u6377\u65B9\u5F0F","Change Path":"\u6539\u53D8\u8DEF\u5F84","Create Folder":"\u521B\u5EFA\u6587\u4EF6\u5939","Please enter the folder name":"\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0","Fix it":"\u4FEE\u590D",Warning:"\u8B66\u544A","Login screen using Wayland is not supported":"\u4E0D\u652F\u6301\u4F7F\u7528 Wayland \u767B\u5F55\u754C\u9762","Reboot required":"\u91CD\u542F\u540E\u624D\u80FD\u751F\u6548","Unsupported display server ":"\u4E0D\u652F\u6301\u5F53\u524D\u663E\u793A\u670D\u52A1\u5668","x11 expected":"\u8BF7\u5207\u6362\u5230 x11",Port:"\u7AEF\u53E3",Settings:"\u8BBE\u7F6E",Username:" \u7528\u6237\u540D","Invalid port":"\u65E0\u6548\u7AEF\u53E3","Closed manually by the peer":"\u88AB\u5BF9\u65B9\u624B\u52A8\u5173\u95ED","Enable remote configuration modification":"\u5141\u8BB8\u8FDC\u7A0B\u4FEE\u6539\u914D\u7F6E","Run without install":"\u65E0\u5B89\u88C5\u8FD0\u884C","Always connected via relay":"\u5F3A\u5236\u8D70\u4E2D\u7EE7\u8FDE\u63A5","Always connect via relay":"\u5F3A\u5236\u8D70\u4E2D\u7EE7\u8FDE\u63A5",whitelist_tip:"\u53EA\u6709\u767D\u540D\u5355\u91CC\u7684ip\u624D\u80FD\u8BBF\u95EE\u6211",Login:"\u767B\u5F55",Logout:"\u767B\u51FA",Tags:"\u6807\u7B7E","Search ID":"\u67E5\u627EID","Current Wayland display server is not supported":"\u4E0D\u652F\u6301 Wayland \u663E\u793A\u670D\u52A1\u5668",whitelist_sep:"\u53EF\u4EE5\u4F7F\u7528\u9017\u53F7\uFF0C\u5206\u53F7\uFF0C\u7A7A\u683C\u6216\u8005\u6362\u884C\u7B26\u4F5C\u4E3A\u5206\u9694\u7B26","Add ID":"\u589E\u52A0ID","Add Tag":"\u589E\u52A0\u6807\u7B7E","Unselect all tags":"\u53D6\u6D88\u9009\u62E9\u6240\u6709\u6807\u7B7E","Network error":"\u7F51\u7EDC\u9519\u8BEF","Username missed":"\u7528\u6237\u540D\u6CA1\u6709\u586B\u5199","Password missed":"\u5BC6\u7801\u6CA1\u6709\u586B\u5199","Wrong credentials":"\u7528\u6237\u540D\u6216\u8005\u5BC6\u7801\u9519\u8BEF","Edit Tag":"\u4FEE\u6539\u6807\u7B7E","Unremember Password":"\u5FD8\u6389\u5BC6\u7801",Favorites:"\u6536\u85CF","Add to Favorites":"\u52A0\u5165\u5230\u6536\u85CF","Remove from Favorites":"\u4ECE\u6536\u85CF\u4E2D\u5220\u9664",Empty:"\u7A7A\u7A7A\u5982\u4E5F","Invalid folder name":"\u65E0\u6548\u6587\u4EF6\u5939\u540D\u79F0","Socks5 Proxy":"Socks5 \u4EE3\u7406",Hostname:"\u4E3B\u673A\u540D",Discovered:"\u5DF2\u53D1\u73B0",install_daemon_tip:"\u4E3A\u4E86\u5F00\u673A\u542F\u52A8\uFF0C\u8BF7\u5B89\u88C5\u7CFB\u7EDF\u670D\u52A1\u3002","Remote ID":"\u8FDC\u7A0BID",Paste:"\u7C98\u8D34","Are you sure to close the connection?":"\u662F\u5426\u786E\u8BA4\u5173\u95ED\u8FDE\u63A5\uFF1F","Download new version":"\u4E0B\u8F7D\u65B0\u7248\u672C","Touch mode":"\u89E6\u5C4F\u6A21\u5F0F","Reset canvas":"\u91CD\u7F6E\u753B\u5E03"},it:{Status:"Stato","Your Desktop":"Il tuo desktop",desk_tip:"Puoi accedere al tuo desktop usando l'ID e la password riportati qui.",Password:"Password",Ready:"Pronto",connecting_status:"Connessione alla rete RustDesk in corso...","Enable Service":"Abilita servizio","Start Service":"Avvia servizio","Service is not running":"Il servizio non \xE8 in esecuzione",not_ready_status:"Non pronto. Verifica la tua connessione","Control Remote Desktop":"Controlla una scrivania remota","Transfer File":"Trasferisci file",Connect:"Connetti","Recent Sessions":"Sessioni recenti","Address Book":"Rubrica",Confirmation:"Conferma","TCP Tunneling":"Tunnel TCP",Remove:"Rimuovi","Refresh random password":"Nuova password casuale","Set your own password":"Imposta la tua password","Enable Keyboard/Mouse":"Abilita tastiera/mouse","Enable Clipboard":"Abilita appunti","Enable File Transfer":"Abilita trasferimento file","Enable TCP Tunneling":"Abilita tunnel TCP","IP Whitelisting":"IP autorizzati","ID/Relay Server":"Server ID/Relay","Stop service":"Arresta servizio","Change ID":"Cambia ID",Website:"Sito web",About:"Informazioni",Mute:"Silenzia","Audio Input":"Input audio","ID Server":"ID server","Relay Server":"Server relay","API Server":"Server API",invalid_http:"deve iniziare con http:// o https://","Invalid IP":"Indirizzo IP non valido",id_change_tip:"Puoi usare solo i caratteri a-z, A-Z, 0-9 e _ (underscore). Il primo carattere deve essere a-z o A-Z. La lunghezza deve essere fra 6 e 16 caratteri.","Invalid format":"Formato non valido","This function is turned off by the server":"Questa funzione \xE8 disabilitata sul server","Not available":"Non disponibile","Too frequent":"Troppo frequente",Cancel:"Annulla",Skip:"Ignora",Close:"Chiudi",Retry:"Riprova",OK:"OK","Password Required":"Password richiesta","Please enter your password":"Inserisci la tua password","Remember password":"Ricorda password","Wrong Password":"Password errata","Do you want to enter again?":"Vuoi riprovare?","Connection Error":"Errore di connessione",Error:"Errore","Reset by the peer":"Reimpostata dal peer","Connecting...":"Connessione...","Connection in progress. Please wait.":"Connessione in corso. Attendi.","Please try 1 minute later":"Per favore riprova fra 1 minuto","Login Error":"Errore di login",Successful:"Successo","Connected, waiting for image...":"Connesso, in attesa dell'immagine...",Name:"Nome",Modified:"Modificato",Size:"Dimensione","Show Hidden Files":"Mostra file nascosti",Receive:"Ricevi",Send:"Invia","Remote Computer":"Computer remoto","Local Computer":"Computer locale","Confirm Delete":"Conferma cancellazione","Are you sure you want to delete this file?":"Vuoi davvero eliminare questo file?","Do this for all conflicts":"Ricorca questa scelta per tutti i conflitti",Deleting:"Cancellazione di",files:"file",Waiting:"In attesa",Finished:"Terminato","Custom Image Quality":"Qualit\xE0 immagine personalizzata","Privacy mode":"Modalit\xE0 privacy","Block user input":"Blocca l'input dell'utente","Unblock user input":"Sbloccare l'input dell'utente","Adjust Window":"Adatta la finestra",Original:"Originale",Shrink:"Restringi",Stretch:"Allarga","Good image quality":"Buona qualit\xE0 immagine",Balanced:"Bilanciato","Optimize reaction time":"Ottimizza il tempo di reazione",Custom:"Personalizzato","Show remote cursor":"Mostra il cursore remoto","Disable clipboard":"Disabilita appunti","Lock after session end":"Blocca al termine della sessione",Insert:"Inserisci","Insert Lock":"Blocco inserimento",Refresh:"Aggiorna","ID does not exist":"L'ID non esiste","Failed to connect to rendezvous server":"Errore di connessione al server rendezvous","Please try later":"Riprova pi\xF9 tardi","Remote desktop is offline":"Il desktop remoto \xE8 offline","Key mismatch":"La chiave non corrisponde",Timeout:"Timeout","Failed to connect to relay server":"Errore di connessione al server relay","Failed to connect via rendezvous server":"Errore di connessione tramite il server rendezvous","Failed to connect via relay server":"Errore di connessione tramite il server relay","Failed to make direct connection to remote desktop":"Impossibile connettersi direttamente al desktop remoto","Set Password":"Imposta password","OS Password":"Password del sistema operativo",install_tip:"A causa del Controllo Account Utente, RustDesk potrebbe non funzionare correttamente come desktop remoto. Per evitare questo problema, fai click sul tasto qui sotto per installare RustDesk a livello di sistema.","Click to upgrade":"Fai click per aggiornare","Click to download":"Cliquez per scaricare","Click to update":"Fare clic per aggiornare","Configuration Permissions":"Permessi di configurazione",Configure:"Configura",config_acc:`Per controllare il tuo desktop dall'esterno, devi fornire a RustDesk il permesso "Accessibilit\xE0".`,config_screen:`Per controllare il tuo desktop dall'esterno, devi fornire a RustDesk il permesso "Registrazione schermo".`,"Installing ...":"Installazione ...",Install:"Installa",Installation:"Installazione","Installation Path":"Percorso di installazione","Create start menu shortcuts":"Crea i collegamenti nel menu di avvio","Create desktop icon":"Crea un'icona sul desktop",agreement_tip:"Avviando l'installazione, accetti i termini del contratto di licenza.","Accept and Install":"Accetta e installa","End-user license agreement":"Contratto di licenza con l'utente finale","Generating ...":"Generazione ...","Your installation is lower version.":"La tua installazione non \xE8 aggiornata.",not_close_tcp_tip:"Non chiudere questa finestra mentre stai usando il tunnel","Listening ...":"In ascolto ...","Remote Host":"Host remoto","Remote Port":"Porta remota",Action:"Azione",Add:"Aggiungi","Local Port":"Porta locale",setup_server_tip:"Per una connessione pi\xF9 veloce, configura un tuo server","Too short, at least 6 characters.":"Troppo breve, almeno 6 caratteri","The confirmation is not identical.":"La conferma non corrisponde",Permissions:"Permessi",Accept:"Accetta",Dismiss:"Rifiuta",Disconnect:"Disconnetti","Allow using keyboard and mouse":"Consenti l'uso di tastiera e mouse","Allow using clipboard":"Consenti l'uso degli appunti","Allow hearing sound":"Consenti la riproduzione dell'audio",Connected:"Connesso","Direct and encrypted connection":"Connessione diretta e cifrata","Relayed and encrypted connection":"Connessione tramite relay e cifrata","Direct and unencrypted connection":"Connessione diretta e non cifrata","Relayed and unencrypted connection":"Connessione tramite relay e non cifrata","Enter Remote ID":"Inserisci l'ID remoto","Enter your password":"Inserisci la tua password","Logging in...":"Autenticazione...","Enable RDP session sharing":"Abilita la condivisione della sessione RDP","Auto Login":"Login automatico","Enable Direct IP Access":"Abilita l'accesso diretto tramite IP",Rename:"Rinomina",Space:"Spazio","Create Desktop Shortcut":"Crea collegamento sul desktop","Change Path":"Cambia percorso","Create Folder":"Crea cartella","Please enter the folder name":"Inserisci il nome della cartella","Fix it":"Risolvi",Warning:"Avviso","Login screen using Wayland is not supported":"La schermata di login non \xE8 supportata utilizzando Wayland","Reboot required":"Riavvio necessario","Unsupported display server ":"Display server non supportato","x11 expected":"x11 necessario",Port:"Porta",Settings:"Impostazioni",Username:" Nome utente","Invalid port":"Porta non valida","Closed manually by the peer":"Chiuso manualmente dal peer","Enable remote configuration modification":"Abilita la modifica remota della configurazione","Run without install":"Avvia senza installare","Always connected via relay":"Connesso sempre tramite relay","Always connect via relay":"Connetti sempre tramite relay",whitelist_tip:"Solo gli indirizzi IP autorizzati possono connettersi a questo desktop",Login:"Accedi",Logout:"Esci",Tags:"Tag","Search ID":"Cerca ID","Current Wayland display server is not supported":"Questo display server Wayland non \xE8 supportato",whitelist_sep:"Separati da virgola, punto e virgola, spazio o a capo","Add ID":"Aggiungi ID","Add Tag":"Aggiungi tag","Unselect all tags":"Deseleziona tutti i tag","Network error":"Errore di rete","Username missed":"Nome utente dimenticato","Password missed":"Password dimenticata","Wrong credentials":"Credenziali errate","Edit Tag":"Modifica tag","Invalid folder name":"Nome della cartella non valido",Hostname:"Nome host",Discovered:"Scoperto","Remote ID":"ID remoto",Paste:"Impasto","Are you sure to close the connection?":"Sei sicuro di chiudere la connessione?","Download new version":"Scarica nuova versione","Touch mode":"Modalit\xE0 tocco","Reset canvas":"Ripristina tela"},en:{desk_tip:"Your desktop can be accessed with this ID and password.",connecting_status:"Connecting to the RustDesk network...",not_ready_status:"Not ready. Please check your connection",id_change_tip:"Only a-z, A-Z, 0-9 and _ (underscore) characters allowed. The first letter must be a-z, A-Z. Length between 6 and 16.",install_tip:"Due to UAC, RustDesk can not work properly as the remote side in some cases. To avoid UAC, please click the button below to install RustDesk to the system.",config_acc:'In order to control your Desktop remotely, you need to grant RustDesk "Accessibility" permissions.',config_screen:'In order to access your Desktop remotely, you need to grant RustDesk "Screen Recording" permissions.',agreement_tip:"By starting the installation, you accept the license agreement.",not_close_tcp_tip:"Don't close this window while you are using the tunnel",setup_server_tip:"For faster connection, please set up your own server","Auto Login":'Auto Login (Only valid if you set "Lock after session end")',whitelist_tip:"Only whitelisted IP can access me",whitelist_sep:"Seperated by comma, semicolon, spaces or new line","Wrong credentials":"Wrong username or password",invalid_http:"must start with http:// or https://",install_daemon_tip:"For starting on boot, you need to install system service."},fr:{Status:"Statut","Your Desktop":"Votre bureau",desk_tip:"Votre bureau est accessible via l'identifiant et le mot de passe ci-dessous.",Password:"Mot de passe",Ready:"Pr\xEAt",connecting_status:"Connexion au r\xE9seau RustDesk...","Enable Service":"Autoriser le service","Start Service":"D\xE9marrer le service","Service is not running":"Le service ne fonctionne pas",not_ready_status:"Pas pr\xEAt, veuillez v\xE9rifier la connexion r\xE9seau","Control Remote Desktop":"Contr\xF4ler le bureau \xE0 distance","Transfer File":"Transf\xE9rer le fichier",Connect:"Connecter","Recent Sessions":"Sessions r\xE9centes","Address Book":"Carnet d'adresses",Confirmation:"Confirmation","TCP Tunneling":"Tunneling TCP",Remove:"Supprimer","Refresh random password":"Actualiser le mot de passe al\xE9atoire","Set your own password":"D\xE9finir votre propre mot de passe","Enable Keyboard/Mouse":"Activer le contr\xF4le clavier/souris","Enable Clipboard":"Activer la synchronisation du presse-papiers","Enable File Transfer":"Activer le transfert de fichiers","Enable TCP Tunneling":"Activer le tunneling TCP","IP Whitelisting":"Liste blanche IP","ID/Relay Server":"ID/Serveur Relais","Stop service":"Arr\xEAter service","Change ID":"Changer d'ID",Website:"Site Web",About:"Sur",Mute:"Muet","Audio Input":"Entr\xE9e audio","ID Server":"Serveur ID","Relay Server":"Serveur Relais","API Server":"Serveur API",invalid_http:"Doit commencer par http:// ou https://","Invalid IP":"IP invalide",id_change_tip:"Seules les lettres a-z, A-Z, 0-9, _ (trait de soulignement) peuvent \xEAtre utilis\xE9es. La premi\xE8re lettre doit \xEAtre a-z, A-Z. La longueur est comprise entre 6 et 16.","Invalid format":"Format invalide","This function is turned off by the server":"Cette fonction est d\xE9sactiv\xE9e par le serveur","Not available":"Indisponible","Too frequent":"Modifier trop fr\xE9quemment, veuillez r\xE9essayer plus tard",Cancel:"Annuler",Skip:"Ignorer",Close:"Fermer",Retry:"R\xE9essayer",OK:"Confirmer","Password Required":"Mot de passe requis","Please enter your password":"Veuillez saisir votre mot de passe","Remember password":"M\xE9moriser le mot de passe","Wrong Password":"Mauvais mot de passe","Do you want to enter again?":"Voulez-vous participer \xE0 nouveau?","Connection Error":"Erreur de connexion",Error:"Erreur","Reset by the peer":"La connexion a \xE9t\xE9 ferm\xE9e par le pair","Connecting...":"Connexion...","Connection in progress. Please wait.":"Connexion en cours. Veuillez patienter.","Please try 1 minute later":"R\xE9essayez dans une minute","Login Error":"Erreur de connexion",Successful:"Succ\xE8s","Connected, waiting for image...":"Connect\xE9, en attente de transmission d'image...",Name:"Nom du fichier",Modified:"Modifi\xE9",Size:"Taille","Show Hidden Files":"Afficher les fichiers cach\xE9s",Receive:"Accepter",Send:"Envoyer","Remote Computer":"Ordinateur distant","Local Computer":"Ordinateur local","Confirm Delete":"Confirmer la suppression","Are you sure you want to delete this file?":"Voulez-vous vraiment supprimer ce fichier?","Do this for all conflicts":"Appliquer \xE0 d'autres conflits",Deleting:"Suppression",files:"fichier",Waiting:"En attente en attente...",Finished:"Termin\xE9","Custom Image Quality":"D\xE9finir la qualit\xE9 d'image","Privacy mode":"Mode priv\xE9","Block user input":"Bloquer la saisie de l'utilisateur","Unblock user input":"D\xE9bloquer l'entr\xE9e de l'utilisateur","Adjust Window":"Ajuster la fen\xEAtre",Original:"Ratio d'origine",Shrink:"R\xE9tr\xE9ci",Stretch:"\xC9tirer","Good image quality":"Bonne qualit\xE9 d'image",Balanced:"Qualit\xE9 d'image normale","Optimize reaction time":"Optimiser le temps de r\xE9action",Custom:"Qualit\xE9 d'image personnalis\xE9e","Show remote cursor":"Afficher le curseur distant","Disable clipboard":"D\xE9sactiver le presse-papiers","Lock after session end":"Verrouiller l'ordinateur distant apr\xE8s la d\xE9connexion",Insert:"Ins\xE9rer","Insert Lock":"Verrouiller l'ordinateur distant",Refresh:"Rafra\xEEchir l'\xE9cran","ID does not exist":"L'ID n'existe pas","Failed to connect to rendezvous server":"\xC9chec de la connexion au serveur de rendez-vous","Please try later":"Veuillez essayer plus tard","Remote desktop is offline":"Le bureau \xE0 distance est hors ligne","Key mismatch":"Discordance de cl\xE9",Timeout:"Connexion expir\xE9e","Failed to connect to relay server":"\xC9chec de la connexion au serveur relais","Failed to connect via rendezvous server":"\xC9chec de l'\xE9tablissement d'une connexion via le serveur de rendez-vous","Failed to connect via relay server":"Impossible d'\xE9tablir une connexion via le serveur relais","Failed to make direct connection to remote desktop":"Impossible d'\xE9tablir une connexion directe","Set Password":"D\xE9finir le mot de passe","OS Password":"Mot de passe du syst\xE8me d'exploitation",install_tip:"Vous utilisez une version d\xE9sinstall\xE9e. En raison des restrictions UAC, en tant que terminal contr\xF4l\xE9, dans certains cas, il ne sera pas en mesure de contr\xF4ler la souris et le clavier ou d'enregistrer l'\xE9cran. Veuillez cliquer sur le bouton ci-dessous pour installer RustDesk au syst\xE8me pour \xE9viter la question ci-dessus.","Click to upgrade":"Cliquez pour mettre \xE0 niveau","Click to download":"Cliquez pour t\xE9l\xE9charger","Click to update":"Cliquez pour mettre \xE0 jour","Configuration Permissions":"Autorisations de configuration",Configure:"Configurer",config_acc:`Afin de pouvoir contr\xF4ler votre bureau \xE0 distance, veuillez donner l'autorisation"accessibilit\xE9" \xE0 RustDesk.`,config_screen:`Afin de pouvoir acc\xE9der \xE0 votre bureau \xE0 distance, veuillez donner l'autorisation \xE0 RustDesk"enregistrement d'\xE9cran".`,"Installing ...":"Installation ...",Install:"Installer",Installation:"Installation","Installation Path":"Chemin d'installation","Create start menu shortcuts":"Cr\xE9er des raccourcis dans le menu d\xE9marrer","Create desktop icon":"Cr\xE9er une ic\xF4ne sur le bureau",agreement_tip:"D\xE9marrer l'installation signifie accepter le contrat de licence.","Accept and Install":"Accepter et installer","End-user license agreement":"Contrat d'utilisateur","Generating ...":"G\xE9n\xE9ration ...","Your installation is lower version.":"La version que vous avez install\xE9e est inf\xE9rieure \xE0 la version en cours d'ex\xE9cution.",not_close_tcp_tip:"Veuillez ne pas fermer cette fen\xEAtre lors de l'utilisation du tunnel","Listening ...":"En attente de connexion tunnel...","Remote Host":"H\xF4te distant","Remote Port":"Port distant",Action:"Action",Add:"Ajouter","Local Port":"Port local",setup_server_tip:"Si vous avez besoin d'une vitesse de connexion plus rapide, vous pouvez choisir de cr\xE9er votre propre serveur","Too short, at least 6 characters.":"Trop court, au moins 6 caract\xE8res.","The confirmation is not identical.":"Les deux entr\xE9es ne correspondent pas",Permissions:"Autorisations",Accept:"Accepter",Dismiss:"Rejeter",Disconnect:"D\xE9connecter","Allow using keyboard and mouse":"Autoriser l'utilisation du clavier et de la souris","Allow using clipboard":"Autoriser l'utilisation du presse-papiers","Allow hearing sound":"Autoriser l'audition du son",Connected:"Connect\xE9","Direct and encrypted connection":"Connexion directe crypt\xE9e","Relayed and encrypted connection":"Connexion relais crypt\xE9e","Direct and unencrypted connection":"Connexion directe non crypt\xE9e","Relayed and unencrypted connection":"Connexion relais non crypt\xE9e","Enter Remote ID":"Entrez l'ID \xE0 distance","Enter your password":"Entrez votre mot de passe","Logging in...":"Se connecter...","Enable RDP session sharing":"Activer le partage de session RDP","Auto Login":"Connexion automatique (le verrouillage ne sera effectif qu'apr\xE8s la d\xE9connexion du param\xE8tre)","Enable Direct IP Access":"Autoriser l'acc\xE8s direct IP",Rename:"Renommer",Space:"Espace","Create Desktop Shortcut":"Cr\xE9er un raccourci sur le bureau","Change Path":"Changer de chemin","Create Folder":"Cr\xE9er un dossier","Please enter the folder name":"Veuillez saisir le nom du dossier","Fix it":"R\xE9parez-le",Warning:"Avertissement","Login screen using Wayland is not supported":"L'\xE9cran de connexion utilisant Wayland n'est pas pris en charge","Reboot required":"Red\xE9marrage pour prendre effet","Unsupported display server ":"Le serveur d'affichage actuel n'est pas pris en charge","x11 expected":"Veuillez passer \xE0 x11",Port:"Port",Settings:"Param\xE8tres",Username:" Nom d'utilisateur","Invalid port":"Port invalide","Closed manually by the peer":"Ferm\xE9 manuellement par le pair","Enable remote configuration modification":"Autoriser la modification de la configuration \xE0 distance","Run without install":"Ex\xE9cuter sans installer","Always connected via relay":"Forcer la connexion relais","Always connect via relay":"Forcer la connexion relais",whitelist_tip:"Seul l'ip dans la liste blanche peut m'acc\xE9der",Login:"Connexion",Logout:"D\xE9connexion",Tags:"\xC9tiqueter","Search ID":"Identifiant de recherche","Current Wayland display server is not supported":"Le serveur d'affichage Wayland n'est pas pris en charge",whitelist_sep:"Vous pouvez utiliser une virgule, un point-virgule, un espace ou une nouvelle ligne comme s\xE9parateur","Add ID":"Ajouter ID","Add Tag":"Ajouter une balise","Unselect all tags":"D\xE9s\xE9lectionner toutes les balises","Network error":"Erreur r\xE9seau","Username missed":"Nom d'utilisateur manqu\xE9","Password missed":"Mot de passe manqu\xE9","Wrong credentials":"Identifiant ou mot de passe erron\xE9","Edit Tag":"Modifier la balise","Invalid folder name":"Nom de dossier invalide",Hostname:"nom d'h\xF4te",Discovered:"D\xE9couvert","Remote ID":"ID \xE0 distance",Paste:"P\xE2te","Are you sure to close the connection?":"\xCAtes-vous s\xFBr de fermer la connexion?","Download new version":"T\xE9l\xE9charger la nouvelle version","Touch mode":"Mode tactile","Reset canvas":"R\xE9initialiser le canevas"}};function pn(e,r,i){return e=="error"&&r=="Connection Error"&&i.toLowerCase().indexOf("offline")<0&&i.toLowerCase().indexOf("exist")<0&&i.toLowerCase().indexOf("handshake")<0&&i.toLowerCase().indexOf("failed")<0&&i.toLowerCase().indexOf("resolve")<0&&i.toLowerCase().indexOf("mismatch")<0&&i.toLowerCase().indexOf("manually")<0}const fn={VK_A:"a",VK_B:"b",VK_C:"c",VK_D:"d",VK_E:"e",VK_F:"f",VK_G:"g",VK_H:"h",VK_I:"i",VK_J:"j",VK_K:"k",VK_L:"l",VK_M:"m",VK_N:"n",VK_O:"o",VK_P:"p",VK_Q:"q",VK_R:"r",VK_S:"s",VK_T:"t",VK_U:"u",VK_V:"v",VK_W:"w",VK_X:"x",VK_Y:"y",VK_Z:"z",VK_0:"0",VK_1:"1",VK_2:"2",VK_3:"3",VK_4:"4",VK_5:"5",VK_6:"6",VK_7:"7",VK_8:"8",VK_9:"9",VK_COMMA:",",VK_SLASH:"/",VK_SEMICOLON:";",VK_QUOTE:"'",VK_LBRACKET:"[",VK_RBRACKET:"]",VK_BACKSLASH:"\\",VK_MINUS:"-",VK_PLUS:"=",VK_DIVIDE:"Divide",VK_MULTIPLY:"Multiply",VK_SUBTRACT:"Subtract",VK_ADD:"Add",VK_DECIMAL:"Decimal",VK_F1:"F1",VK_F2:"F2",VK_F3:"F3",VK_F4:"F4",VK_F5:"F5",VK_F6:"F6",VK_F7:"F7",VK_F8:"F8",VK_F9:"F9",VK_F10:"F10",VK_F11:"F11",VK_F12:"F12",VK_ENTER:"Return",VK_CANCEL:"Cancel",VK_BACK:"Backspace",VK_TAB:"Tab",VK_CLEAR:"Clear",VK_RETURN:"Return",VK_SHIFT:"Shift",VK_CONTROL:"Control",VK_MENU:"Alt",VK_PAUSE:"Pause",VK_CAPITAL:"CapsLock",VK_KANA:"Kana",VK_HANGUL:"Hangul",VK_JUNJA:"Junja",VK_FINAL:"Final",VK_HANJA:"Hanja",VK_KANJI:"Kanji",VK_ESCAPE:"Escape",VK_CONVERT:"Convert",VK_SPACE:"Space",VK_PRIOR:"PageUp",VK_NEXT:"PageDown",VK_END:"End",VK_HOME:"Home",VK_LEFT:"LeftArrow",VK_UP:"UpArrow",VK_RIGHT:"RightArrow",VK_DOWN:"DownArrow",VK_SELECT:"Select",VK_PRINT:"Print",VK_EXECUTE:"Execute",VK_SNAPSHOT:"Snapshot",VK_INSERT:"Insert",VK_DELETE:"Delete",VK_HELP:"Help",VK_SLEEP:"Sleep",VK_SEPARATOR:"Separator",VK_NUMPAD0:"Numpad0",VK_NUMPAD1:"Numpad1",VK_NUMPAD2:"Numpad2",VK_NUMPAD3:"Numpad3",VK_NUMPAD4:"Numpad4",VK_NUMPAD5:"Numpad5",VK_NUMPAD6:"Numpad6",VK_NUMPAD7:"Numpad7",VK_NUMPAD8:"Numpad8",VK_NUMPAD9:"Numpad9",Apps:"Apps",Meta:"Meta",RAlt:"RAlt",RWin:"RWin",RControl:"RControl",RShift:"RShift",CTRL_ALT_DEL:"CtrlAltDel",LOCK_SCREEN:"LockScreen"},vn="1.1.9";let er;async function Ci(){const e=new Yi;await e.init(),console.log("zstd ready"),er=e}async function Bi(e){const r=1024*1024*64,i=1024*1024;let t=30*e.length;t>r&&(t=r),t<i&&(t=i);try{return er||await Ci(),er.decode(e,t)}catch(n){console.error("decompress failed: "+n);return}}function hn(e,r){const i=e.substring(e.length-2).toLowerCase();let t=Ri.en,n=Ri[i];n||(n=t);let o=n[r];return!o&&i!="en"&&(o=t[r]),o||r}const yn="z".charCodeAt(0),kn="a".charCodeAt(0);function mn(e,r){const i=fn[e]||e;if(i.length==1){const n=i.charCodeAt(0);return!r&&(n>yn||n<kn)?v.fromPartial({unicode:n}):v.fromPartial({chr:n})}const t=ge(e);return t==k.UNRECOGNIZED&&console.error("Unknown control key "+e),v.fromPartial({control_key:t})}async function rr(e){await new Promise(r=>setTimeout(r,e))}const Pi=21116,xi=["rs-sg.rustdesk.com","rs-cn.rustdesk.com","rs-us.rustdesk.com"];let Ii=localStorage.getItem("rendezvous-server")||xi[0];const bi="ws://";class En{constructor(){_(this,"_msgs");_(this,"_ws");_(this,"_interval");_(this,"_id");_(this,"_hash");_(this,"_msgbox");_(this,"_draw");_(this,"_peerInfo");_(this,"_firstFrame");_(this,"_videoDecoder");_(this,"_password");_(this,"_options");_(this,"_videoTestSpeed");this._msgbox=Nn,this._draw=nr,this._msgs=[],this._id="",this._videoTestSpeed=[0,0]}async start(r){try{await this._start(r)}catch(i){this.msgbox("error","Connection Error",i.type=="close"?"Reset by the peer":String(i))}}async _start(r){if(this._options||(this._options=We()[r]||{}),!this._password){const O=this.getOption("password");if(O)try{this._password=Uint8Array.from(JSON.parse("["+O+"]"))}catch(He){console.error(He)}}this._interval=setInterval(()=>{var O;for(;this._msgs.length;)(O=this._ws)==null||O.sendMessage(this._msgs[0]),this._msgs.splice(0,1)},1),this.loadVideoDecoder();const i=Ji(),t=new je(i,!0);this._ws=t,this._id=r,console.log(new Date+": Conntecting to rendezvoous server: "+i+", for "+r),await t.open(),console.log(new Date+": Connected to rendezvoous server");const n=Qe.DEFAULT_CONN,o=Xe.SYMMETRIC,u=q.fromPartial({id:r,licence_key:localStorage.getItem("key")||void 0,conn_type:n,nat_type:o});t.sendRendezvous({punch_hole_request:u});const c=await t.next();t.close(),console.log(new Date+": Got relay response");const l=c.punch_hole_response,p=c.relay_response;if(l){if(l.failure!=U.UNRECOGNIZED)switch(l==null?void 0:l.failure){case U.ID_NOT_EXIST:this.msgbox("error","Error","ID does not exist");break;case U.OFFLINE:this.msgbox("error","Error","Remote desktop is offline");break;case U.LICENSE_MISMATCH:this.msgbox("error","Error","Key mismatch");break;default:(l==null?void 0:l.other_failure)&&this.msgbox("error","Error",l==null?void 0:l.other_failure)}}else p&&await this.connectRelay(p)}async connectRelay(r){const i=r.pk;let t=r.relay_server;t?t=Ti(t,!0):t=Ji(!0);const n=r.uuid;console.log(new Date+": Connecting to relay server: "+t);const o=new je(t,!1);await o.open(),console.log(new Date+": Connected to relay server"),this._ws=o;const u=M.fromPartial({licence_key:localStorage.getItem("key")||void 0,uuid:n});o.sendRendezvous({request_relay:u});const c=await this.secure(i)||!1;D("connection_ready",{secure:c,direct:!1}),await this.msgLoop()}async secure(r){var ar,sr,ur,dr,cr,lr,_r,pr;if(r){const Ge="OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=";try{r=await gi(r,Ge).catch(),(r==null?void 0:r.length)!=32&&(r=void 0)}catch(Ze){console.error(Ze),r=void 0}r||console.error("Handshake failed: invalid public key from rendezvous server")}if(!r){(ar=this._ws)==null||ar.sendMessage({});return}const i=await((sr=this._ws)==null?void 0:sr.next());let t=i==null?void 0:i.signed_id;if(!t){console.error("Handshake failed: invalid message type"),(ur=this._ws)==null||ur.sendMessage({});return}try{t=await gi(t.id,Uint8Array.from(r))}catch(Ge){console.error(Ge),console.error("pk mismatch, fall back to non-secure");const Ze=C.fromPartial({});(dr=this._ws)==null||dr.sendMessage({public_key:Ze});return}t=new TextDecoder().decode(t);const n=t.split("\0"),o=n[0];let u=n[1];if(o!=this._id){console.error("Handshake failed: sign failure"),(cr=this._ws)==null||cr.sendMessage({});return}if(u=Li(u),u.length!=32){console.error("Handshake failed: invalid public box key length from peer"),(lr=this._ws)==null||lr.sendMessage({});return}const[c,l]=Dn(),p=On(),O=Rn(p,u,c),He=C.fromPartial({asymmetric_value:l,symmetric_value:O});return(_r=this._ws)==null||_r.sendMessage({public_key:He}),(pr=this._ws)==null||pr.setSecretKey(p),console.log("secured"),!0}async msgLoop(){var r,i;for(;;){const t=await((r=this._ws)==null?void 0:r.next());if(t==null?void 0:t.hash)this._hash=t==null?void 0:t.hash,this._password||this.msgbox("input-password","Password Required",""),this.login();else if(t==null?void 0:t.test_delay){const n=t==null?void 0:t.test_delay;console.log(n),n.from_client||(i=this._ws)==null||i.sendMessage({test_delay:n})}else if(t==null?void 0:t.login_response){const n=t==null?void 0:t.login_response;n.error?n.error=="Wrong Password"?(this._password=void 0,this.msgbox("re-input-password",n.error,"Do you want to enter again?")):this.msgbox("error","Login Error",n.error):n.peer_info&&this.handlePeerInfo(n.peer_info)}else if(t==null?void 0:t.video_frame)this.handleVideoFrame(t==null?void 0:t.video_frame);else if(t==null?void 0:t.clipboard){const n=t==null?void 0:t.clipboard;if(n.compress){const o=await Bi(n.content);if(!o)continue;n.content=o}D("clipboard",n)}else if(t==null?void 0:t.cursor_data){const n=t==null?void 0:t.cursor_data,o=await Bi(n.colors);if(!o)continue;n.colors=o,D("cursor_data",n)}else if(t==null?void 0:t.cursor_id)D("cursor_id",{id:t==null?void 0:t.cursor_id});else if(t==null?void 0:t.cursor_position)D("cursor_position",t==null?void 0:t.cursor_position);else if(t==null?void 0:t.misc){if(!this.handleMisc(t==null?void 0:t.misc))break}else(t==null?void 0:t.audio_frame)&&bn(t==null?void 0:t.audio_frame.data)}}msgbox(r,i,t){var n;(n=this._msgbox)==null||n.call(this,r,i,t)}draw(r){var i;(i=this._draw)==null||i.call(this,r),nr(r)}close(){var r,i;this._msgs=[],clearInterval(this._interval),(r=this._ws)==null||r.close(),(i=this._videoDecoder)==null||i.close()}refresh(){var i;const r=E.fromPartial({refresh_video:!0});(i=this._ws)==null||i.sendMessage({misc:r})}setMsgbox(r){this._msgbox=r}setDraw(r){this._draw=r}login(r=void 0){var i,t,n;if(r){const o=(i=this._hash)==null?void 0:i.salt;let u=ir([r,o]);this._password=u;const c=(t=this._hash)==null?void 0:t.challenge;u=ir([u,c]),this.msgbox("connecting","Connecting...","Logging in..."),this._sendLoginMessage(u)}else{let o=this._password;if(o){const u=(n=this._hash)==null?void 0:n.challenge;o=ir([o,u])}this._sendLoginMessage(o)}}async reconnect(){this.close(),await this.start(this._id)}_sendLoginMessage(r=void 0){var t;const i=I.fromPartial({username:this._id,my_id:"web",my_name:"web",password:r,option:this.getOptionMessage(),video_ack_required:!0});(t=this._ws)==null||t.sendMessage({login_request:i})}getOptionMessage(){let r=0;const i=f.fromPartial({}),t=this.getImageQualityEnum(this.getImageQuality(),!0),n=R.Yes;return t!=null&&(i.image_quality=t,r+=1),this._options["show-remote-cursor"]&&(i.show_remote_cursor=n,r+=1),this._options["lock-after-session-end"]&&(i.lock_after_session_end=n,r+=1),this._options["privacy-mode"]&&(i.privacy_mode=n,r+=1),this._options["disable-audio"]&&(i.disable_audio=n,r+=1),this._options["disable-clipboard"]&&(i.disable_clipboard=n,r+=1),r>0?i:void 0}sendVideoReceived(){var i;const r=E.fromPartial({video_received:!0});(i=this._ws)==null||i.sendMessage({misc:r})}handleVideoFrame(r){var n;if(this._firstFrame||(this.msgbox("","",""),this._firstFrame=!0),r.vp9s){const o=this._videoDecoder;var i=new Date().getTime(),t=0;const u=(n=r.vp9s)==null?void 0:n.frames.length;r.vp9s.frames.forEach(c=>{o.processFrame(c.data.slice(0).buffer,l=>{if(t++,t==u&&this.sendVideoReceived(),l&&o.frameBuffer&&u==t){this.draw(o.frameBuffer);var p=new Date().getTime()-i;this._videoTestSpeed[1]+=p,this._videoTestSpeed[0]+=1,this._videoTestSpeed[0]>=30&&(console.log("video decoder: "+parseInt(""+this._videoTestSpeed[1]/this._videoTestSpeed[0])),this._videoTestSpeed=[0,0])}})})}}handlePeerInfo(r){var n,o;if(this._peerInfo=r,r.displays.length==0){this.msgbox("error","Remote Error","No Display");return}this.msgbox("success","Successful","Connected, waiting for image..."),D("peer_info",r);const i=this.shouldAutoLogin();i&&this.inputOsPassword(i);const t=(n=this.getOption("info"))==null?void 0:n.username;if(t&&!r.username&&(r.username=t),this.setOption("info",r),this.getRemember()){if((o=this._password)==null?void 0:o.length){const u=this._password.toString();u!=this.getOption("password")&&(this.setOption("password",u),console.log("remember password of "+this._id))}}else this.setOption("password",void 0)}shouldAutoLogin(){const r=this.getOption("lock-after-session-end"),i=!!this.getOption("auto-login"),t=this.getOption("os-password");return t&&r&&i?t:""}handleMisc(r){if(r.audio_format)In(r.audio_format.channels,r.audio_format.sample_rate);else if(r.chat_message)D("chat",r.chat_message.text);else if(r.permission_info){const i=r.permission_info;console.info("Change permission "+i.permission+" -> "+i.enabled);let t;switch(i.permission){case V.Keyboard:t="keyboard";break;case V.Clipboard:t="clipboard";break;case V.Audio:t="audio";break;default:return}D("permission",{[t]:i.enabled})}else if(r.switch_display)this.loadVideoDecoder(),D("switch_display",r.switch_display);else if(r.close_reason)return this.msgbox("error","Connection Error",r.close_reason),this.close(),!1;return!0}getRemember(){return this._options.remember||!1}setRemember(r){this.setOption("remember",r)}getOption(r){return this._options[r]}setOption(r,i){i==null?delete this._options[r]:this._options[r]=i,this._options.tm=new Date().getTime();const t=We();t[this._id]=this._options,localStorage.setItem("peers",JSON.stringify(t))}inputKey(r,i,t,n,o,u,c){var p;const l=mn(r,wn());!l||(n&&(r=="Alt"||r=="RAlt")&&(n=!1),o&&(r=="Control"||r=="RControl")&&(o=!1),u&&(r=="Shift"||r=="RShift")&&(u=!1),c&&(r=="Meta"||r=="RWin")&&(c=!1),l.down=i,l.press=t,l.modifiers=this.getMod(n,o,u,c),(p=this._ws)==null||p.sendMessage({key_event:l}))}ctrlAltDel(){var i,t;const r=v.fromPartial({down:!0});((i=this._peerInfo)==null?void 0:i.platform)=="Windows"?r.control_key=k.CtrlAltDel:(r.control_key=k.Delete,r.modifiers=this.getMod(!0,!0,!1,!1)),(t=this._ws)==null||t.sendMessage({key_event:r})}inputString(r){var t;const i=v.fromPartial({seq:r});(t=this._ws)==null||t.sendMessage({key_event:i})}switchDisplay(r){var n;const i=J.fromPartial({display:r}),t=E.fromPartial({switch_display:i});(n=this._ws)==null||n.sendMessage({misc:t})}async inputOsPassword(r){var t;this.inputMouse(),await rr(50),this.inputMouse(0,3,3),await rr(50),this.inputMouse(1|1<<3),this.inputMouse(2|1<<3),await rr(1200);const i=v.fromPartial({press:!0,seq:r});(t=this._ws)==null||t.sendMessage({key_event:i})}lockScreen(){var i;const r=v.fromPartial({down:!0,control_key:k.LockScreen});(i=this._ws)==null||i.sendMessage({key_event:r})}getMod(r,i,t,n){const o=[];return r&&o.push(k.Alt),i&&o.push(k.Control),t&&o.push(k.Shift),n&&o.push(k.Meta),o}inputMouse(r=0,i=0,t=0,n=!1,o=!1,u=!1,c=!1){var p;const l=b.fromPartial({mask:r,x:i,y:t,modifiers:this.getMod(n,o,u,c)});(p=this._ws)==null||p.sendMessage({mouse_event:l})}toggleOption(r){var u;const i=!this._options[r],t=f.fromPartial({}),n=i?R.Yes:R.No;switch(r){case"show-remote-cursor":t.show_remote_cursor=n;break;case"disable-audio":t.disable_audio=n;break;case"disable-clipboard":t.disable_clipboard=n;break;case"lock-after-session-end":t.lock_after_session_end=n;break;case"privacy-mode":t.privacy_mode=n;break;case"block-input":t.block_input=R.Yes;break;case"unblock-input":t.block_input=R.No;break;default:return}r.indexOf("block-input")<0&&this.setOption(r,i);const o=E.fromPartial({option:t});(u=this._ws)==null||u.sendMessage({misc:o})}getImageQuality(){return this.getOption("image-quality")}getImageQualityEnum(r,i){switch(r){case"low":return L.Low;case"best":return L.Best;case"balanced":return i?void 0:L.Balanced;default:return}}setImageQuality(r){var o;this.setOption("image-quality",r);const i=this.getImageQualityEnum(r,!1);if(i==null)return;const t=f.fromPartial({image_quality:i}),n=E.fromPartial({option:t});(o=this._ws)==null||o.sendMessage({misc:n})}loadVideoDecoder(){var r;(r=this._videoDecoder)==null||r.close(),Oi(i=>{this._videoDecoder=i,console.log("vp9 loaded"),console.log(i)})}}function Sn(){xi.forEach(e=>{const r=new Date().getTime();new je(Ti(e),!0).open().then(()=>{console.log("latency of "+e+": "+(new Date().getTime()-r)),Ii=e,localStorage.setItem("rendezvous-server",e)})})}Sn();function Ji(e=!1){const r=localStorage.getItem("custom-rendezvous-server");return bi+(r||Ii)+":"+(Pi+(e?3:2))}function Ti(e,r=!1){if(e.indexOf(":")>0){const i=e.split(":"),t=parseInt(i[1]);e=i[0]+":"+(t+(r?3:2))}else e+=":"+(Pi+(r?3:2));return bi+e}function ir(e){const r=new Ki.exports.Hash;return e.forEach(i=>(typeof i=="string"&&(i=new TextEncoder().encode(i)),r.update(i))),r.digest()}var qe=void 0,w=[];window.curConn=void 0;window.getRgba=()=>{const e=qe;return qe=void 0,e||null};window.isMobile=()=>/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4));function wn(){return!isMobile()}function Nn(e,r,i){if(!!w&&!(!e||e=="error"&&!i)){i.toLowerCase();var t=pn(e,r,i)?"true":"";w.push({name:"msgbox",type:e,title:r,text:i,hasRetry:t})}}function An(e){var r={};for(const[i,t]of Object.entries(e))!i||(r[i]=t instanceof Uint8Array?"["+t.toString()+"]":JSON.stringify(t));return r}function D(e,r){!w||(r=An(r),r.name=e,w.push(r))}let ze=new Worker("./yuv.js");function nr(e){if(ze)ze.postMessage(e);else{var r=new Date().getTime();yuvCanvas.drawFrame(e),console.log(new Date().getTime()-r),r=new Date().getTime(),pixels||(pixels=new Uint8Array(canvas.width*canvas.height*4)),gl.readPixels(0,0,canvas.width,canvas.height,gl.RGBA,gl.UNSIGNED_BYTE,pixels),console.log(new Date().getTime()-r)}}function Ui(e){window.curConn=e}function tr(){return window.curConn}async function Fn(e){qe=void 0,w=[],setByName("remote_id",e),await curConn.start(e)}function qi(){var e;(e=tr())==null||e.close(),Ui(void 0),qe=void 0,w=void 0}function Mi(){var r;(r=window.curConn)==null||r.close();const e=new En;return Ui(e),e}let N;async function gi(e,r){return N||(await fr.ready,N=fr),typeof r=="string"&&(r=Li(r)),N.crypto_sign_open(e,r)}function Li(e){return N.from_base64(e,N.base64_variants.ORIGINAL)}function Dn(){const e=N.crypto_box_keypair(),r=e.privateKey,i=e.publicKey;return[r,i]}function On(){return N.crypto_secretbox_keygen()}function Rn(e,r,i){const t=Uint8Array.from(Array(24).fill(0));return N.crypto_box_easy(e,t,r,i)}function Vi(e){for(var r=Array(24).fill(0),i=0;i<r.length&&e>0;i++){var t=e&255;r[i]=t,e=(e-t)/256}return Uint8Array.from(r)}function Cn(e,r,i){return N.crypto_secretbox_easy(e,Vi(r),i)}function Bn(e,r,i){return N.crypto_secretbox_open_easy(e,Vi(r),i)}window.setByName=(e,r)=>{switch(e){case"remote_id":localStorage.setItem("remote-id",r);break;case"connect":Mi(),Fn(r);break;case"login":r=JSON.parse(r),curConn.setRemember(r.remember=="true"),curConn.login(r.password);break;case"close":qi();break;case"refresh":curConn.refresh();break;case"reconnect":curConn.reconnect();break;case"toggle_option":curConn.toggleOption(r);break;case"image_quality":curConn.setImageQuality(r);break;case"lock_screen":curConn.lockScreen();break;case"ctrl_alt_del":curConn.ctrlAltDel();break;case"switch_display":curConn.switchDisplay(r);break;case"remove":const i=We();delete i[r],localStorage.setItem("peers",JSON.stringify(i));break;case"input_key":r=JSON.parse(r),curConn.inputKey(r.name,r.down=="true",r.press=="true",r.alt=="true",r.ctrl=="true",r.shift=="true",r.command=="true");break;case"input_string":curConn.inputString(r);break;case"send_mouse":let t=0;switch(r=JSON.parse(r),r.type){case"down":t=1;break;case"up":t=2;break;case"wheel":t=3;break}switch(r.buttons){case"left":t|=1<<3;break;case"right":t|=2<<3;break;case"wheel":t|=4<<3}curConn.inputMouse(t,parseInt(r.x||"0"),parseInt(r.y||"0"),r.alt=="true",r.ctrl=="true",r.shift=="true",r.command=="true");break;case"option":r=JSON.parse(r),localStorage.setItem(r.name,r.value);break;case"peer_option":r=JSON.parse(r),curConn.setOption(r.name,r.value);break;case"input_os_password":curConn.inputOsPassword(r);break}};window.getByName=(e,r)=>{let i=xn(e,r);return typeof i=="string"||i instanceof String?i:i==null||i==null?"":JSON.stringify(i)};function Pn(){const e=[];for(const[r,i]of Object.entries(We())){if(!r)continue;const t=i.tm,n=i.info;!t||!n||e.push([t,r,n])}return e.sort().reverse().map(r=>r.slice(1))}function xn(e,r){switch(e){case"peers":return Pn();case"remote_id":return localStorage.getItem("remote-id");case"remember":return curConn.getRemember();case"event":if(w&&w.length){const i=w[0];return w.splice(0,1),JSON.stringify(i)}break;case"toggle_option":return curConn.getOption(r)||!1;case"option":return localStorage.getItem(r);case"image_quality":return curConn.getImageQuality();case"translate":return r=JSON.parse(r),hn(r.locale,r.text);case"peer_option":return curConn.getOption(r);case"test_if_valid_server":break;case"version":return vn}return""}let or=new Worker("./libopus.js"),zi;function In(e,r){zi=Jn(e,r),or.postMessage({channels:e,sampleRate:r})}function bn(e){or.postMessage(e,[e.buffer])}window.init=async()=>{ze&&(ze.onmessage=e=>{qe=e.data}),or.onmessage=e=>{zi.feed(e.data)},Oi(()=>{}),await Ci(),console.log("init done")};function We(){try{return JSON.parse(localStorage.getItem("peers"))||{}}catch{return{}}}function Jn(e,r){return new Qi({channels:e,sampleRate:r,flushingTime:2e3})}const Wi=document.querySelector("#app");if(Wi){let r=function(i,t,n){!tr()||(i=="input-password"?(document.querySelector("div#status").style.display="none",document.querySelector("div#password").style.display="block"):i?i=="error"?(document.querySelector("div#status").style.display="block",document.querySelector("div#canvas").style.display="none",document.querySelector("div#text").innerHTML='<div style="color: red; font-weight: bold;">'+n+"</div>"):(document.querySelector("div#password").style.display="none",document.querySelector("div#status").style.display="block",document.querySelector("div#text").innerHTML='<div style="font-weight: bold;">'+n+"</div>"):(document.querySelector("div#canvas").style.display="block",document.querySelector("div#password").style.display="none",document.querySelector("div#status").style.display="none"))};Wi.innerHTML=`
<div id="connect" style="text-align: center"><table style="display: inline-block">
<tr><td><span>Host: </span></td><td><input id="host" /></td></tr>
<tr><td><span>Key: </span></td><td><input id="key" /></td></tr>
<tr><td><span>Id: </span></td><td><input id="id" /></td></tr>
<tr><td></td><td><button onclick="connect();">Connect</button></td></tr>
</table></div>
<div id="password" style="display: none;">
<input type="password" id="password" />
<button id="confirm" onclick="confirm()">Confirm</button>
<button id="cancel" onclick="cancel();">Cancel</button>
</div>
<div id="status" style="display: none;">
<div id="text" style="line-height: 2em"></div>
<button id="cancel" onclick="cancel();">Cancel</button>
</div>
<div id="canvas" style="display: none;">
<button id="cancel" onclick="cancel();">Cancel</button>
<canvas id="player"></canvas>
</div>
`;let e;window.init(),document.body.onload=()=>{const i=document.querySelector("#host");i.value=localStorage.getItem("custom-rendezvous-server");const t=document.querySelector("#id");t.value=localStorage.getItem("id");const n=document.querySelector("#key");n.value=localStorage.getItem("key"),e=YUVCanvas.attach(document.getElementById("player"))},window.connect=()=>{const i=document.querySelector("#host");localStorage.setItem("custom-rendezvous-server",i.value);const t=document.querySelector("#id");localStorage.setItem("id",t.value);const n=document.querySelector("#key");localStorage.setItem("key",n.value),(async()=>{const u=Mi();u.setMsgbox(r),u.setDraw(c=>{nr(c),e.drawFrame(c)}),document.querySelector("div#status").style.display="block",document.querySelector("div#connect").style.display="none",document.querySelector("div#text").innerHTML="Connecting ...",await u.start(t.value)})()},window.cancel=()=>{qi(),document.querySelector("div#connect").style.display="block",document.querySelector("div#password").style.display="none",document.querySelector("div#status").style.display="none",document.querySelector("div#canvas").style.display="none"},window.confirm=()=>{const i=document.querySelector("input#password").value;i&&(document.querySelector("div#password").style.display="none",tr().login(i))}}