index.js 459 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063
  1. import {getServerConf} from "./ljw.js?v=7"
  2. import {F as oa, J as Ne, L as je, l as I4, m as r, P as na, s as aa, z as Z4} from "./vendor.js?v=0b990c6e";
  3. import {ids as langIds, lang} from './lang.js?v=7'
  4. var ia = Object.defineProperty;
  5. var ta = (u, e, i) => e in u ? ia(u, e, {enumerable: !0, configurable: !0, writable: !0, value: i}) : u[e] = i;
  6. var d = (u, e, i) => (ta(u, typeof e != "symbol" ? e + "" : e, i), i), ue = (u, e, i) => {
  7. if (!e.has(u)) throw TypeError("Cannot " + i)
  8. };
  9. var h = (u, e, i) => (ue(u, e, "read from private field"), i ? i.call(u) : e.get(u)), pu = (u, e, i) => {
  10. if (e.has(u)) throw TypeError("Cannot add the same private member more than once");
  11. e instanceof WeakSet ? e.add(u) : e.set(u, i)
  12. }, p4 = (u, e, i, o) => (ue(u, e, "write to private field"), o ? o.call(u, i) : e.set(u, i), i), Ie = (u, e, i, o) => ({
  13. set _(a) {
  14. p4(u, e, a, i)
  15. }, get _() {
  16. return h(u, e, o)
  17. }
  18. }), Te = (u, e, i) => (ue(u, e, "access private method"), i);
  19. const ra = function () {
  20. const e = document.createElement("link").relList;
  21. if (e && e.supports && e.supports("modulepreload")) return;
  22. for (const a of document.querySelectorAll('link[rel="modulepreload"]')) o(a);
  23. new MutationObserver(a => {
  24. for (const t of a) if (t.type === "childList") for (const s of t.addedNodes) s.tagName === "LINK" && s.rel === "modulepreload" && o(s)
  25. }).observe(document, {childList: !0, subtree: !0});
  26. function i(a) {
  27. const t = {};
  28. return a.integrity && (t.integrity = a.integrity), a.referrerpolicy && (t.referrerPolicy = a.referrerpolicy), a.crossorigin === "use-credentials" ? t.credentials = "include" : a.crossorigin === "anonymous" ? t.credentials = "omit" : t.credentials = "same-origin", t
  29. }
  30. function o(a) {
  31. if (a.ep) return;
  32. a.ep = !0;
  33. const t = i(a);
  34. fetch(a.href, t)
  35. }
  36. };
  37. ra();
  38. var ae = (u => (u[u.I420 = 0] = "I420", u[u.I444 = 1] = "I444", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(ae || {});
  39. function sa(u) {
  40. switch (u) {
  41. case 0:
  42. case"I420":
  43. return 0;
  44. case 1:
  45. case"I444":
  46. return 1;
  47. case-1:
  48. case"UNRECOGNIZED":
  49. default:
  50. return -1
  51. }
  52. }
  53. function la(u) {
  54. switch (u) {
  55. case 0:
  56. return "I420";
  57. case 1:
  58. return "I444";
  59. case-1:
  60. default:
  61. return "UNRECOGNIZED"
  62. }
  63. }
  64. var C4 = (u => (u[u.Legacy = 0] = "Legacy", u[u.Map = 1] = "Map", u[u.Translate = 2] = "Translate", u[u.Auto = 3] = "Auto", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(C4 || {});
  65. function Ea(u) {
  66. switch (u) {
  67. case 0:
  68. case"Legacy":
  69. return 0;
  70. case 1:
  71. case"Map":
  72. return 1;
  73. case 2:
  74. case"Translate":
  75. return 2;
  76. case 3:
  77. case"Auto":
  78. return 3;
  79. case-1:
  80. case"UNRECOGNIZED":
  81. default:
  82. return -1
  83. }
  84. }
  85. function da(u) {
  86. switch (u) {
  87. case 0:
  88. return "Legacy";
  89. case 1:
  90. return "Map";
  91. case 2:
  92. return "Translate";
  93. case 3:
  94. return "Auto";
  95. case-1:
  96. default:
  97. return "UNRECOGNIZED"
  98. }
  99. }
  100. var j = (u => (u[u.Unknown = 0] = "Unknown", u[u.Alt = 1] = "Alt", u[u.Backspace = 2] = "Backspace", u[u.CapsLock = 3] = "CapsLock", u[u.Control = 4] = "Control", u[u.Delete = 5] = "Delete", u[u.DownArrow = 6] = "DownArrow", u[u.End = 7] = "End", u[u.Escape = 8] = "Escape", u[u.F1 = 9] = "F1", u[u.F10 = 10] = "F10", u[u.F11 = 11] = "F11", u[u.F12 = 12] = "F12", u[u.F2 = 13] = "F2", u[u.F3 = 14] = "F3", u[u.F4 = 15] = "F4", u[u.F5 = 16] = "F5", u[u.F6 = 17] = "F6", u[u.F7 = 18] = "F7", u[u.F8 = 19] = "F8", u[u.F9 = 20] = "F9", u[u.Home = 21] = "Home", u[u.LeftArrow = 22] = "LeftArrow", u[u.Meta = 23] = "Meta", u[u.Option = 24] = "Option", u[u.PageDown = 25] = "PageDown", u[u.PageUp = 26] = "PageUp", u[u.Return = 27] = "Return", u[u.RightArrow = 28] = "RightArrow", u[u.Shift = 29] = "Shift", u[u.Space = 30] = "Space", u[u.Tab = 31] = "Tab", u[u.UpArrow = 32] = "UpArrow", u[u.Numpad0 = 33] = "Numpad0", u[u.Numpad1 = 34] = "Numpad1", u[u.Numpad2 = 35] = "Numpad2", u[u.Numpad3 = 36] = "Numpad3", u[u.Numpad4 = 37] = "Numpad4", u[u.Numpad5 = 38] = "Numpad5", u[u.Numpad6 = 39] = "Numpad6", u[u.Numpad7 = 40] = "Numpad7", u[u.Numpad8 = 41] = "Numpad8", u[u.Numpad9 = 42] = "Numpad9", u[u.Cancel = 43] = "Cancel", u[u.Clear = 44] = "Clear", u[u.Menu = 45] = "Menu", u[u.Pause = 46] = "Pause", u[u.Kana = 47] = "Kana", u[u.Hangul = 48] = "Hangul", u[u.Junja = 49] = "Junja", u[u.Final = 50] = "Final", u[u.Hanja = 51] = "Hanja", u[u.Kanji = 52] = "Kanji", u[u.Convert = 53] = "Convert", u[u.Select = 54] = "Select", u[u.Print = 55] = "Print", u[u.Execute = 56] = "Execute", u[u.Snapshot = 57] = "Snapshot", u[u.Insert = 58] = "Insert", u[u.Help = 59] = "Help", u[u.Sleep = 60] = "Sleep", u[u.Separator = 61] = "Separator", u[u.Scroll = 62] = "Scroll", u[u.NumLock = 63] = "NumLock", u[u.RWin = 64] = "RWin", u[u.Apps = 65] = "Apps", u[u.Multiply = 66] = "Multiply", u[u.Add = 67] = "Add", u[u.Subtract = 68] = "Subtract", u[u.Decimal = 69] = "Decimal", u[u.Divide = 70] = "Divide", u[u.Equals = 71] = "Equals", u[u.NumpadEnter = 72] = "NumpadEnter", u[u.RShift = 73] = "RShift", u[u.RControl = 74] = "RControl", u[u.RAlt = 75] = "RAlt", u[u.VolumeMute = 76] = "VolumeMute", u[u.VolumeUp = 77] = "VolumeUp", u[u.VolumeDown = 78] = "VolumeDown", u[u.Power = 79] = "Power", u[u.CtrlAltDel = 100] = "CtrlAltDel", u[u.LockScreen = 101] = "LockScreen", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(j || {});
  101. function F4(u) {
  102. switch (u) {
  103. case 0:
  104. case"Unknown":
  105. return 0;
  106. case 1:
  107. case"Alt":
  108. return 1;
  109. case 2:
  110. case"Backspace":
  111. return 2;
  112. case 3:
  113. case"CapsLock":
  114. return 3;
  115. case 4:
  116. case"Control":
  117. return 4;
  118. case 5:
  119. case"Delete":
  120. return 5;
  121. case 6:
  122. case"DownArrow":
  123. return 6;
  124. case 7:
  125. case"End":
  126. return 7;
  127. case 8:
  128. case"Escape":
  129. return 8;
  130. case 9:
  131. case"F1":
  132. return 9;
  133. case 10:
  134. case"F10":
  135. return 10;
  136. case 11:
  137. case"F11":
  138. return 11;
  139. case 12:
  140. case"F12":
  141. return 12;
  142. case 13:
  143. case"F2":
  144. return 13;
  145. case 14:
  146. case"F3":
  147. return 14;
  148. case 15:
  149. case"F4":
  150. return 15;
  151. case 16:
  152. case"F5":
  153. return 16;
  154. case 17:
  155. case"F6":
  156. return 17;
  157. case 18:
  158. case"F7":
  159. return 18;
  160. case 19:
  161. case"F8":
  162. return 19;
  163. case 20:
  164. case"F9":
  165. return 20;
  166. case 21:
  167. case"Home":
  168. return 21;
  169. case 22:
  170. case"LeftArrow":
  171. return 22;
  172. case 23:
  173. case"Meta":
  174. return 23;
  175. case 24:
  176. case"Option":
  177. return 24;
  178. case 25:
  179. case"PageDown":
  180. return 25;
  181. case 26:
  182. case"PageUp":
  183. return 26;
  184. case 27:
  185. case"Return":
  186. return 27;
  187. case 28:
  188. case"RightArrow":
  189. return 28;
  190. case 29:
  191. case"Shift":
  192. return 29;
  193. case 30:
  194. case"Space":
  195. return 30;
  196. case 31:
  197. case"Tab":
  198. return 31;
  199. case 32:
  200. case"UpArrow":
  201. return 32;
  202. case 33:
  203. case"Numpad0":
  204. return 33;
  205. case 34:
  206. case"Numpad1":
  207. return 34;
  208. case 35:
  209. case"Numpad2":
  210. return 35;
  211. case 36:
  212. case"Numpad3":
  213. return 36;
  214. case 37:
  215. case"Numpad4":
  216. return 37;
  217. case 38:
  218. case"Numpad5":
  219. return 38;
  220. case 39:
  221. case"Numpad6":
  222. return 39;
  223. case 40:
  224. case"Numpad7":
  225. return 40;
  226. case 41:
  227. case"Numpad8":
  228. return 41;
  229. case 42:
  230. case"Numpad9":
  231. return 42;
  232. case 43:
  233. case"Cancel":
  234. return 43;
  235. case 44:
  236. case"Clear":
  237. return 44;
  238. case 45:
  239. case"Menu":
  240. return 45;
  241. case 46:
  242. case"Pause":
  243. return 46;
  244. case 47:
  245. case"Kana":
  246. return 47;
  247. case 48:
  248. case"Hangul":
  249. return 48;
  250. case 49:
  251. case"Junja":
  252. return 49;
  253. case 50:
  254. case"Final":
  255. return 50;
  256. case 51:
  257. case"Hanja":
  258. return 51;
  259. case 52:
  260. case"Kanji":
  261. return 52;
  262. case 53:
  263. case"Convert":
  264. return 53;
  265. case 54:
  266. case"Select":
  267. return 54;
  268. case 55:
  269. case"Print":
  270. return 55;
  271. case 56:
  272. case"Execute":
  273. return 56;
  274. case 57:
  275. case"Snapshot":
  276. return 57;
  277. case 58:
  278. case"Insert":
  279. return 58;
  280. case 59:
  281. case"Help":
  282. return 59;
  283. case 60:
  284. case"Sleep":
  285. return 60;
  286. case 61:
  287. case"Separator":
  288. return 61;
  289. case 62:
  290. case"Scroll":
  291. return 62;
  292. case 63:
  293. case"NumLock":
  294. return 63;
  295. case 64:
  296. case"RWin":
  297. return 64;
  298. case 65:
  299. case"Apps":
  300. return 65;
  301. case 66:
  302. case"Multiply":
  303. return 66;
  304. case 67:
  305. case"Add":
  306. return 67;
  307. case 68:
  308. case"Subtract":
  309. return 68;
  310. case 69:
  311. case"Decimal":
  312. return 69;
  313. case 70:
  314. case"Divide":
  315. return 70;
  316. case 71:
  317. case"Equals":
  318. return 71;
  319. case 72:
  320. case"NumpadEnter":
  321. return 72;
  322. case 73:
  323. case"RShift":
  324. return 73;
  325. case 74:
  326. case"RControl":
  327. return 74;
  328. case 75:
  329. case"RAlt":
  330. return 75;
  331. case 76:
  332. case"VolumeMute":
  333. return 76;
  334. case 77:
  335. case"VolumeUp":
  336. return 77;
  337. case 78:
  338. case"VolumeDown":
  339. return 78;
  340. case 79:
  341. case"Power":
  342. return 79;
  343. case 100:
  344. case"CtrlAltDel":
  345. return 100;
  346. case 101:
  347. case"LockScreen":
  348. return 101;
  349. case-1:
  350. case"UNRECOGNIZED":
  351. default:
  352. return -1
  353. }
  354. }
  355. function T4(u) {
  356. switch (u) {
  357. case 0:
  358. return "Unknown";
  359. case 1:
  360. return "Alt";
  361. case 2:
  362. return "Backspace";
  363. case 3:
  364. return "CapsLock";
  365. case 4:
  366. return "Control";
  367. case 5:
  368. return "Delete";
  369. case 6:
  370. return "DownArrow";
  371. case 7:
  372. return "End";
  373. case 8:
  374. return "Escape";
  375. case 9:
  376. return "F1";
  377. case 10:
  378. return "F10";
  379. case 11:
  380. return "F11";
  381. case 12:
  382. return "F12";
  383. case 13:
  384. return "F2";
  385. case 14:
  386. return "F3";
  387. case 15:
  388. return "F4";
  389. case 16:
  390. return "F5";
  391. case 17:
  392. return "F6";
  393. case 18:
  394. return "F7";
  395. case 19:
  396. return "F8";
  397. case 20:
  398. return "F9";
  399. case 21:
  400. return "Home";
  401. case 22:
  402. return "LeftArrow";
  403. case 23:
  404. return "Meta";
  405. case 24:
  406. return "Option";
  407. case 25:
  408. return "PageDown";
  409. case 26:
  410. return "PageUp";
  411. case 27:
  412. return "Return";
  413. case 28:
  414. return "RightArrow";
  415. case 29:
  416. return "Shift";
  417. case 30:
  418. return "Space";
  419. case 31:
  420. return "Tab";
  421. case 32:
  422. return "UpArrow";
  423. case 33:
  424. return "Numpad0";
  425. case 34:
  426. return "Numpad1";
  427. case 35:
  428. return "Numpad2";
  429. case 36:
  430. return "Numpad3";
  431. case 37:
  432. return "Numpad4";
  433. case 38:
  434. return "Numpad5";
  435. case 39:
  436. return "Numpad6";
  437. case 40:
  438. return "Numpad7";
  439. case 41:
  440. return "Numpad8";
  441. case 42:
  442. return "Numpad9";
  443. case 43:
  444. return "Cancel";
  445. case 44:
  446. return "Clear";
  447. case 45:
  448. return "Menu";
  449. case 46:
  450. return "Pause";
  451. case 47:
  452. return "Kana";
  453. case 48:
  454. return "Hangul";
  455. case 49:
  456. return "Junja";
  457. case 50:
  458. return "Final";
  459. case 51:
  460. return "Hanja";
  461. case 52:
  462. return "Kanji";
  463. case 53:
  464. return "Convert";
  465. case 54:
  466. return "Select";
  467. case 55:
  468. return "Print";
  469. case 56:
  470. return "Execute";
  471. case 57:
  472. return "Snapshot";
  473. case 58:
  474. return "Insert";
  475. case 59:
  476. return "Help";
  477. case 60:
  478. return "Sleep";
  479. case 61:
  480. return "Separator";
  481. case 62:
  482. return "Scroll";
  483. case 63:
  484. return "NumLock";
  485. case 64:
  486. return "RWin";
  487. case 65:
  488. return "Apps";
  489. case 66:
  490. return "Multiply";
  491. case 67:
  492. return "Add";
  493. case 68:
  494. return "Subtract";
  495. case 69:
  496. return "Decimal";
  497. case 70:
  498. return "Divide";
  499. case 71:
  500. return "Equals";
  501. case 72:
  502. return "NumpadEnter";
  503. case 73:
  504. return "RShift";
  505. case 74:
  506. return "RControl";
  507. case 75:
  508. return "RAlt";
  509. case 76:
  510. return "VolumeMute";
  511. case 77:
  512. return "VolumeUp";
  513. case 78:
  514. return "VolumeDown";
  515. case 79:
  516. return "Power";
  517. case 100:
  518. return "CtrlAltDel";
  519. case 101:
  520. return "LockScreen";
  521. case-1:
  522. default:
  523. return "UNRECOGNIZED"
  524. }
  525. }
  526. var du = (u => (u[u.Text = 0] = "Text", u[u.Rtf = 1] = "Rtf", u[u.Html = 2] = "Html", u[u.ImageRgba = 21] = "ImageRgba", u[u.ImagePng = 22] = "ImagePng", u[u.ImageSvg = 23] = "ImageSvg", u[u.Special = 31] = "Special", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(du || {});
  527. function ca(u) {
  528. switch (u) {
  529. case 0:
  530. case"Text":
  531. return 0;
  532. case 1:
  533. case"Rtf":
  534. return 1;
  535. case 2:
  536. case"Html":
  537. return 2;
  538. case 21:
  539. case"ImageRgba":
  540. return 21;
  541. case 22:
  542. case"ImagePng":
  543. return 22;
  544. case 23:
  545. case"ImageSvg":
  546. return 23;
  547. case 31:
  548. case"Special":
  549. return 31;
  550. case-1:
  551. case"UNRECOGNIZED":
  552. default:
  553. return -1
  554. }
  555. }
  556. function Ca(u) {
  557. switch (u) {
  558. case 0:
  559. return "Text";
  560. case 1:
  561. return "Rtf";
  562. case 2:
  563. return "Html";
  564. case 21:
  565. return "ImageRgba";
  566. case 22:
  567. return "ImagePng";
  568. case 23:
  569. return "ImageSvg";
  570. case 31:
  571. return "Special";
  572. case-1:
  573. default:
  574. return "UNRECOGNIZED"
  575. }
  576. }
  577. var dt = (u => (u[u.Dir = 0] = "Dir", u[u.DirLink = 2] = "DirLink", u[u.DirDrive = 3] = "DirDrive", u[u.File = 4] = "File", u[u.FileLink = 5] = "FileLink", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(dt || {});
  578. function pa(u) {
  579. switch (u) {
  580. case 0:
  581. case"Dir":
  582. return 0;
  583. case 2:
  584. case"DirLink":
  585. return 2;
  586. case 3:
  587. case"DirDrive":
  588. return 3;
  589. case 4:
  590. case"File":
  591. return 4;
  592. case 5:
  593. case"FileLink":
  594. return 5;
  595. case-1:
  596. case"UNRECOGNIZED":
  597. default:
  598. return -1
  599. }
  600. }
  601. function Da(u) {
  602. switch (u) {
  603. case 0:
  604. return "Dir";
  605. case 2:
  606. return "DirLink";
  607. case 3:
  608. return "DirDrive";
  609. case 4:
  610. return "File";
  611. case 5:
  612. return "FileLink";
  613. case-1:
  614. default:
  615. return "UNRECOGNIZED"
  616. }
  617. }
  618. var w4 = (u => (u[u.NotSet = 0] = "NotSet", u[u.Low = 2] = "Low", u[u.Balanced = 3] = "Balanced", u[u.Best = 4] = "Best", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(w4 || {});
  619. function Ba(u) {
  620. switch (u) {
  621. case 0:
  622. case"NotSet":
  623. return 0;
  624. case 2:
  625. case"Low":
  626. return 2;
  627. case 3:
  628. case"Balanced":
  629. return 3;
  630. case 4:
  631. case"Best":
  632. return 4;
  633. case-1:
  634. case"UNRECOGNIZED":
  635. default:
  636. return -1
  637. }
  638. }
  639. function ma(u) {
  640. switch (u) {
  641. case 0:
  642. return "NotSet";
  643. case 2:
  644. return "Low";
  645. case 3:
  646. return "Balanced";
  647. case 4:
  648. return "Best";
  649. case-1:
  650. default:
  651. return "UNRECOGNIZED"
  652. }
  653. }
  654. var t0 = (u => (u[u.Keyboard = 0] = "Keyboard", u[u.Clipboard = 2] = "Clipboard", u[u.Audio = 3] = "Audio", u[u.File = 4] = "File", u[u.Restart = 5] = "Restart", u[u.Recording = 6] = "Recording", u[u.BlockInput = 7] = "BlockInput", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(t0 || {});
  655. function Aa(u) {
  656. switch (u) {
  657. case 0:
  658. case"Keyboard":
  659. return 0;
  660. case 2:
  661. case"Clipboard":
  662. return 2;
  663. case 3:
  664. case"Audio":
  665. return 3;
  666. case 4:
  667. case"File":
  668. return 4;
  669. case 5:
  670. case"Restart":
  671. return 5;
  672. case 6:
  673. case"Recording":
  674. return 6;
  675. case 7:
  676. case"BlockInput":
  677. return 7;
  678. case-1:
  679. case"UNRECOGNIZED":
  680. default:
  681. return -1
  682. }
  683. }
  684. function Fa(u) {
  685. switch (u) {
  686. case 0:
  687. return "Keyboard";
  688. case 2:
  689. return "Clipboard";
  690. case 3:
  691. return "Audio";
  692. case 4:
  693. return "File";
  694. case 5:
  695. return "Restart";
  696. case 6:
  697. return "Recording";
  698. case 7:
  699. return "BlockInput";
  700. case-1:
  701. default:
  702. return "UNRECOGNIZED"
  703. }
  704. }
  705. var Au = (u => (u[u.Auto = 0] = "Auto", u[u.VP9 = 1] = "VP9", u[u.H264 = 2] = "H264", u[u.H265 = 3] = "H265", u[u.VP8 = 4] = "VP8", u[u.AV1 = 5] = "AV1", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(Au || {});
  706. function _a(u) {
  707. switch (u) {
  708. case 0:
  709. case"Auto":
  710. return 0;
  711. case 1:
  712. case"VP9":
  713. return 1;
  714. case 2:
  715. case"H264":
  716. return 2;
  717. case 3:
  718. case"H265":
  719. return 3;
  720. case 4:
  721. case"VP8":
  722. return 4;
  723. case 5:
  724. case"AV1":
  725. return 5;
  726. case-1:
  727. case"UNRECOGNIZED":
  728. default:
  729. return -1
  730. }
  731. }
  732. function va(u) {
  733. switch (u) {
  734. case 0:
  735. return "Auto";
  736. case 1:
  737. return "VP9";
  738. case 2:
  739. return "H264";
  740. case 3:
  741. return "H265";
  742. case 4:
  743. return "VP8";
  744. case 5:
  745. return "AV1";
  746. case-1:
  747. default:
  748. return "UNRECOGNIZED"
  749. }
  750. }
  751. var x = (u => (u[u.NotSet = 0] = "NotSet", u[u.No = 1] = "No", u[u.Yes = 2] = "Yes", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(x || {});
  752. function tu(u) {
  753. switch (u) {
  754. case 0:
  755. case"NotSet":
  756. return 0;
  757. case 1:
  758. case"No":
  759. return 1;
  760. case 2:
  761. case"Yes":
  762. return 2;
  763. case-1:
  764. case"UNRECOGNIZED":
  765. default:
  766. return -1
  767. }
  768. }
  769. function au(u) {
  770. switch (u) {
  771. case 0:
  772. return "NotSet";
  773. case 1:
  774. return "No";
  775. case 2:
  776. return "Yes";
  777. case-1:
  778. default:
  779. return "UNRECOGNIZED"
  780. }
  781. }
  782. var B4 = (u => (u[u.BlkStateUnknown = 0] = "BlkStateUnknown", u[u.BlkOnSucceeded = 2] = "BlkOnSucceeded", u[u.BlkOnFailed = 3] = "BlkOnFailed", u[u.BlkOffSucceeded = 4] = "BlkOffSucceeded", u[u.BlkOffFailed = 5] = "BlkOffFailed", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(B4 || {});
  783. function ka(u) {
  784. switch (u) {
  785. case 0:
  786. case"BlkStateUnknown":
  787. return 0;
  788. case 2:
  789. case"BlkOnSucceeded":
  790. return 2;
  791. case 3:
  792. case"BlkOnFailed":
  793. return 3;
  794. case 4:
  795. case"BlkOffSucceeded":
  796. return 4;
  797. case 5:
  798. case"BlkOffFailed":
  799. return 5;
  800. case-1:
  801. case"UNRECOGNIZED":
  802. default:
  803. return -1
  804. }
  805. }
  806. function ga(u) {
  807. switch (u) {
  808. case 0:
  809. return "BlkStateUnknown";
  810. case 2:
  811. return "BlkOnSucceeded";
  812. case 3:
  813. return "BlkOnFailed";
  814. case 4:
  815. return "BlkOffSucceeded";
  816. case 5:
  817. return "BlkOffFailed";
  818. case-1:
  819. default:
  820. return "UNRECOGNIZED"
  821. }
  822. }
  823. var ou = (u => (u[u.PrvStateUnknown = 0] = "PrvStateUnknown", u[u.PrvOnByOther = 2] = "PrvOnByOther", u[u.PrvNotSupported = 3] = "PrvNotSupported", u[u.PrvOnSucceeded = 4] = "PrvOnSucceeded", u[u.PrvOnFailedDenied = 5] = "PrvOnFailedDenied", u[u.PrvOnFailedPlugin = 6] = "PrvOnFailedPlugin", u[u.PrvOnFailed = 7] = "PrvOnFailed", u[u.PrvOffSucceeded = 8] = "PrvOffSucceeded", u[u.PrvOffByPeer = 9] = "PrvOffByPeer", u[u.PrvOffFailed = 10] = "PrvOffFailed", u[u.PrvOffUnknown = 11] = "PrvOffUnknown", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(ou || {});
  824. function ha(u) {
  825. switch (u) {
  826. case 0:
  827. case"PrvStateUnknown":
  828. return 0;
  829. case 2:
  830. case"PrvOnByOther":
  831. return 2;
  832. case 3:
  833. case"PrvNotSupported":
  834. return 3;
  835. case 4:
  836. case"PrvOnSucceeded":
  837. return 4;
  838. case 5:
  839. case"PrvOnFailedDenied":
  840. return 5;
  841. case 6:
  842. case"PrvOnFailedPlugin":
  843. return 6;
  844. case 7:
  845. case"PrvOnFailed":
  846. return 7;
  847. case 8:
  848. case"PrvOffSucceeded":
  849. return 8;
  850. case 9:
  851. case"PrvOffByPeer":
  852. return 9;
  853. case 10:
  854. case"PrvOffFailed":
  855. return 10;
  856. case 11:
  857. case"PrvOffUnknown":
  858. return 11;
  859. case-1:
  860. case"UNRECOGNIZED":
  861. default:
  862. return -1
  863. }
  864. }
  865. function fa(u) {
  866. switch (u) {
  867. case 0:
  868. return "PrvStateUnknown";
  869. case 2:
  870. return "PrvOnByOther";
  871. case 3:
  872. return "PrvNotSupported";
  873. case 4:
  874. return "PrvOnSucceeded";
  875. case 5:
  876. return "PrvOnFailedDenied";
  877. case 6:
  878. return "PrvOnFailedPlugin";
  879. case 7:
  880. return "PrvOnFailed";
  881. case 8:
  882. return "PrvOffSucceeded";
  883. case 9:
  884. return "PrvOffByPeer";
  885. case 10:
  886. return "PrvOffFailed";
  887. case 11:
  888. return "PrvOffUnknown";
  889. case-1:
  890. default:
  891. return "UNRECOGNIZED"
  892. }
  893. }
  894. function Oe() {
  895. return {data: new Uint8Array(0), key: !1, pts: 0}
  896. }
  897. const a0 = {
  898. encode(u, e = r.Writer.create()) {
  899. return u.data.length !== 0 && e.uint32(10).bytes(u.data), u.key !== !1 && e.uint32(16).bool(u.key), u.pts !== 0 && e.uint32(24).int64(u.pts), e
  900. }, decode(u, e) {
  901. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  902. let o = e === void 0 ? i.len : i.pos + e;
  903. const a = Oe();
  904. for (; i.pos < o;) {
  905. const t = i.uint32();
  906. switch (t >>> 3) {
  907. case 1:
  908. if (t !== 10) break;
  909. a.data = i.bytes();
  910. continue;
  911. case 2:
  912. if (t !== 16) break;
  913. a.key = i.bool();
  914. continue;
  915. case 3:
  916. if (t !== 24) break;
  917. a.pts = V(i.int64());
  918. continue
  919. }
  920. if ((t & 7) === 4 || t === 0) break;
  921. i.skipType(t & 7)
  922. }
  923. return a
  924. }, fromJSON(u) {
  925. return {
  926. data: n(u.data) ? R(u.data) : new Uint8Array(0),
  927. key: n(u.key) ? globalThis.Boolean(u.key) : !1,
  928. pts: n(u.pts) ? globalThis.Number(u.pts) : 0
  929. }
  930. }, toJSON(u) {
  931. const e = {};
  932. return u.data.length !== 0 && (e.data = I(u.data)), u.key !== !1 && (e.key = u.key), u.pts !== 0 && (e.pts = Math.round(u.pts)), e
  933. }, create(u) {
  934. return a0.fromPartial(u != null ? u : {})
  935. }, fromPartial(u) {
  936. var i, o, a;
  937. const e = Oe();
  938. return e.data = (i = u.data) != null ? i : new Uint8Array(0), e.key = (o = u.key) != null ? o : !1, e.pts = (a = u.pts) != null ? a : 0, e
  939. }
  940. };
  941. function Me() {
  942. return {frames: []}
  943. }
  944. const k = {
  945. encode(u, e = r.Writer.create()) {
  946. for (const i of u.frames) a0.encode(i, e.uint32(10).fork()).ldelim();
  947. return e
  948. }, decode(u, e) {
  949. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  950. let o = e === void 0 ? i.len : i.pos + e;
  951. const a = Me();
  952. for (; i.pos < o;) {
  953. const t = i.uint32();
  954. switch (t >>> 3) {
  955. case 1:
  956. if (t !== 10) break;
  957. a.frames.push(a0.decode(i, i.uint32()));
  958. continue
  959. }
  960. if ((t & 7) === 4 || t === 0) break;
  961. i.skipType(t & 7)
  962. }
  963. return a
  964. }, fromJSON(u) {
  965. return {frames: globalThis.Array.isArray(u == null ? void 0 : u.frames) ? u.frames.map(e => a0.fromJSON(e)) : []}
  966. }, toJSON(u) {
  967. var i;
  968. const e = {};
  969. return (i = u.frames) != null && i.length && (e.frames = u.frames.map(o => a0.toJSON(o))), e
  970. }, create(u) {
  971. return k.fromPartial(u != null ? u : {})
  972. }, fromPartial(u) {
  973. var i;
  974. const e = Me();
  975. return e.frames = ((i = u.frames) == null ? void 0 : i.map(o => a0.fromPartial(o))) || [], e
  976. }
  977. };
  978. function Ue() {
  979. return {compress: !1}
  980. }
  981. const o0 = {
  982. encode(u, e = r.Writer.create()) {
  983. return u.compress !== !1 && e.uint32(8).bool(u.compress), e
  984. }, decode(u, e) {
  985. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  986. let o = e === void 0 ? i.len : i.pos + e;
  987. const a = Ue();
  988. for (; i.pos < o;) {
  989. const t = i.uint32();
  990. switch (t >>> 3) {
  991. case 1:
  992. if (t !== 8) break;
  993. a.compress = i.bool();
  994. continue
  995. }
  996. if ((t & 7) === 4 || t === 0) break;
  997. i.skipType(t & 7)
  998. }
  999. return a
  1000. }, fromJSON(u) {
  1001. return {compress: n(u.compress) ? globalThis.Boolean(u.compress) : !1}
  1002. }, toJSON(u) {
  1003. const e = {};
  1004. return u.compress !== !1 && (e.compress = u.compress), e
  1005. }, create(u) {
  1006. return o0.fromPartial(u != null ? u : {})
  1007. }, fromPartial(u) {
  1008. var i;
  1009. const e = Ue();
  1010. return e.compress = (i = u.compress) != null ? i : !1, e
  1011. }
  1012. };
  1013. function Le() {
  1014. return {compress: !1, stride: 0}
  1015. }
  1016. const n0 = {
  1017. encode(u, e = r.Writer.create()) {
  1018. return u.compress !== !1 && e.uint32(8).bool(u.compress), u.stride !== 0 && e.uint32(16).int32(u.stride), e
  1019. }, decode(u, e) {
  1020. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1021. let o = e === void 0 ? i.len : i.pos + e;
  1022. const a = Le();
  1023. for (; i.pos < o;) {
  1024. const t = i.uint32();
  1025. switch (t >>> 3) {
  1026. case 1:
  1027. if (t !== 8) break;
  1028. a.compress = i.bool();
  1029. continue;
  1030. case 2:
  1031. if (t !== 16) break;
  1032. a.stride = i.int32();
  1033. continue
  1034. }
  1035. if ((t & 7) === 4 || t === 0) break;
  1036. i.skipType(t & 7)
  1037. }
  1038. return a
  1039. }, fromJSON(u) {
  1040. return {
  1041. compress: n(u.compress) ? globalThis.Boolean(u.compress) : !1,
  1042. stride: n(u.stride) ? globalThis.Number(u.stride) : 0
  1043. }
  1044. }, toJSON(u) {
  1045. const e = {};
  1046. return u.compress !== !1 && (e.compress = u.compress), u.stride !== 0 && (e.stride = Math.round(u.stride)), e
  1047. }, create(u) {
  1048. return n0.fromPartial(u != null ? u : {})
  1049. }, fromPartial(u) {
  1050. var i, o;
  1051. const e = Le();
  1052. return e.compress = (i = u.compress) != null ? i : !1, e.stride = (o = u.stride) != null ? o : 0, e
  1053. }
  1054. };
  1055. function We() {
  1056. return {
  1057. vp9s: void 0,
  1058. rgb: void 0,
  1059. yuv: void 0,
  1060. h264s: void 0,
  1061. h265s: void 0,
  1062. vp8s: void 0,
  1063. av1s: void 0,
  1064. display: 0
  1065. }
  1066. }
  1067. const r0 = {
  1068. encode(u, e = r.Writer.create()) {
  1069. return u.vp9s !== void 0 && k.encode(u.vp9s, e.uint32(50).fork()).ldelim(), u.rgb !== void 0 && o0.encode(u.rgb, e.uint32(58).fork()).ldelim(), u.yuv !== void 0 && n0.encode(u.yuv, e.uint32(66).fork()).ldelim(), u.h264s !== void 0 && k.encode(u.h264s, e.uint32(82).fork()).ldelim(), u.h265s !== void 0 && k.encode(u.h265s, e.uint32(90).fork()).ldelim(), u.vp8s !== void 0 && k.encode(u.vp8s, e.uint32(98).fork()).ldelim(), u.av1s !== void 0 && k.encode(u.av1s, e.uint32(106).fork()).ldelim(), u.display !== 0 && e.uint32(112).int32(u.display), e
  1070. }, decode(u, e) {
  1071. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1072. let o = e === void 0 ? i.len : i.pos + e;
  1073. const a = We();
  1074. for (; i.pos < o;) {
  1075. const t = i.uint32();
  1076. switch (t >>> 3) {
  1077. case 6:
  1078. if (t !== 50) break;
  1079. a.vp9s = k.decode(i, i.uint32());
  1080. continue;
  1081. case 7:
  1082. if (t !== 58) break;
  1083. a.rgb = o0.decode(i, i.uint32());
  1084. continue;
  1085. case 8:
  1086. if (t !== 66) break;
  1087. a.yuv = n0.decode(i, i.uint32());
  1088. continue;
  1089. case 10:
  1090. if (t !== 82) break;
  1091. a.h264s = k.decode(i, i.uint32());
  1092. continue;
  1093. case 11:
  1094. if (t !== 90) break;
  1095. a.h265s = k.decode(i, i.uint32());
  1096. continue;
  1097. case 12:
  1098. if (t !== 98) break;
  1099. a.vp8s = k.decode(i, i.uint32());
  1100. continue;
  1101. case 13:
  1102. if (t !== 106) break;
  1103. a.av1s = k.decode(i, i.uint32());
  1104. continue;
  1105. case 14:
  1106. if (t !== 112) break;
  1107. a.display = i.int32();
  1108. continue
  1109. }
  1110. if ((t & 7) === 4 || t === 0) break;
  1111. i.skipType(t & 7)
  1112. }
  1113. return a
  1114. }, fromJSON(u) {
  1115. return {
  1116. vp9s: n(u.vp9s) ? k.fromJSON(u.vp9s) : void 0,
  1117. rgb: n(u.rgb) ? o0.fromJSON(u.rgb) : void 0,
  1118. yuv: n(u.yuv) ? n0.fromJSON(u.yuv) : void 0,
  1119. h264s: n(u.h264s) ? k.fromJSON(u.h264s) : void 0,
  1120. h265s: n(u.h265s) ? k.fromJSON(u.h265s) : void 0,
  1121. vp8s: n(u.vp8s) ? k.fromJSON(u.vp8s) : void 0,
  1122. av1s: n(u.av1s) ? k.fromJSON(u.av1s) : void 0,
  1123. display: n(u.display) ? globalThis.Number(u.display) : 0
  1124. }
  1125. }, toJSON(u) {
  1126. const e = {};
  1127. return u.vp9s !== void 0 && (e.vp9s = k.toJSON(u.vp9s)), u.rgb !== void 0 && (e.rgb = o0.toJSON(u.rgb)), u.yuv !== void 0 && (e.yuv = n0.toJSON(u.yuv)), u.h264s !== void 0 && (e.h264s = k.toJSON(u.h264s)), u.h265s !== void 0 && (e.h265s = k.toJSON(u.h265s)), u.vp8s !== void 0 && (e.vp8s = k.toJSON(u.vp8s)), u.av1s !== void 0 && (e.av1s = k.toJSON(u.av1s)), u.display !== 0 && (e.display = Math.round(u.display)), e
  1128. }, create(u) {
  1129. return r0.fromPartial(u != null ? u : {})
  1130. }, fromPartial(u) {
  1131. var i;
  1132. const e = We();
  1133. return e.vp9s = u.vp9s !== void 0 && u.vp9s !== null ? k.fromPartial(u.vp9s) : void 0, e.rgb = u.rgb !== void 0 && u.rgb !== null ? o0.fromPartial(u.rgb) : void 0, e.yuv = u.yuv !== void 0 && u.yuv !== null ? n0.fromPartial(u.yuv) : void 0, e.h264s = u.h264s !== void 0 && u.h264s !== null ? k.fromPartial(u.h264s) : void 0, e.h265s = u.h265s !== void 0 && u.h265s !== null ? k.fromPartial(u.h265s) : void 0, e.vp8s = u.vp8s !== void 0 && u.vp8s !== null ? k.fromPartial(u.vp8s) : void 0, e.av1s = u.av1s !== void 0 && u.av1s !== null ? k.fromPartial(u.av1s) : void 0, e.display = (i = u.display) != null ? i : 0, e
  1134. }
  1135. };
  1136. function Ve() {
  1137. return {id: "", pk: new Uint8Array(0)}
  1138. }
  1139. const oe = {
  1140. encode(u, e = r.Writer.create()) {
  1141. return u.id !== "" && e.uint32(10).string(u.id), u.pk.length !== 0 && e.uint32(18).bytes(u.pk), e
  1142. }, decode(u, e) {
  1143. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1144. let o = e === void 0 ? i.len : i.pos + e;
  1145. const a = Ve();
  1146. for (; i.pos < o;) {
  1147. const t = i.uint32();
  1148. switch (t >>> 3) {
  1149. case 1:
  1150. if (t !== 10) break;
  1151. a.id = i.string();
  1152. continue;
  1153. case 2:
  1154. if (t !== 18) break;
  1155. a.pk = i.bytes();
  1156. continue
  1157. }
  1158. if ((t & 7) === 4 || t === 0) break;
  1159. i.skipType(t & 7)
  1160. }
  1161. return a
  1162. }, fromJSON(u) {
  1163. return {id: n(u.id) ? globalThis.String(u.id) : "", pk: n(u.pk) ? R(u.pk) : new Uint8Array(0)}
  1164. }, toJSON(u) {
  1165. const e = {};
  1166. return u.id !== "" && (e.id = u.id), u.pk.length !== 0 && (e.pk = I(u.pk)), e
  1167. }, create(u) {
  1168. return oe.fromPartial(u != null ? u : {})
  1169. }, fromPartial(u) {
  1170. var i, o;
  1171. const e = Ve();
  1172. return e.id = (i = u.id) != null ? i : "", e.pk = (o = u.pk) != null ? o : new Uint8Array(0), e
  1173. }
  1174. };
  1175. function qe() {
  1176. return {
  1177. x: 0,
  1178. y: 0,
  1179. width: 0,
  1180. height: 0,
  1181. name: "",
  1182. online: !1,
  1183. cursor_embedded: !1,
  1184. original_resolution: void 0,
  1185. scale: 0
  1186. }
  1187. }
  1188. const s0 = {
  1189. encode(u, e = r.Writer.create()) {
  1190. return u.x !== 0 && e.uint32(8).sint32(u.x), u.y !== 0 && e.uint32(16).sint32(u.y), u.width !== 0 && e.uint32(24).int32(u.width), u.height !== 0 && e.uint32(32).int32(u.height), u.name !== "" && e.uint32(42).string(u.name), u.online !== !1 && e.uint32(48).bool(u.online), u.cursor_embedded !== !1 && e.uint32(56).bool(u.cursor_embedded), u.original_resolution !== void 0 && v.encode(u.original_resolution, e.uint32(66).fork()).ldelim(), u.scale !== 0 && e.uint32(73).double(u.scale), e
  1191. }, decode(u, e) {
  1192. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1193. let o = e === void 0 ? i.len : i.pos + e;
  1194. const a = qe();
  1195. for (; i.pos < o;) {
  1196. const t = i.uint32();
  1197. switch (t >>> 3) {
  1198. case 1:
  1199. if (t !== 8) break;
  1200. a.x = i.sint32();
  1201. continue;
  1202. case 2:
  1203. if (t !== 16) break;
  1204. a.y = i.sint32();
  1205. continue;
  1206. case 3:
  1207. if (t !== 24) break;
  1208. a.width = i.int32();
  1209. continue;
  1210. case 4:
  1211. if (t !== 32) break;
  1212. a.height = i.int32();
  1213. continue;
  1214. case 5:
  1215. if (t !== 42) break;
  1216. a.name = i.string();
  1217. continue;
  1218. case 6:
  1219. if (t !== 48) break;
  1220. a.online = i.bool();
  1221. continue;
  1222. case 7:
  1223. if (t !== 56) break;
  1224. a.cursor_embedded = i.bool();
  1225. continue;
  1226. case 8:
  1227. if (t !== 66) break;
  1228. a.original_resolution = v.decode(i, i.uint32());
  1229. continue;
  1230. case 9:
  1231. if (t !== 73) break;
  1232. a.scale = i.double();
  1233. continue
  1234. }
  1235. if ((t & 7) === 4 || t === 0) break;
  1236. i.skipType(t & 7)
  1237. }
  1238. return a
  1239. }, fromJSON(u) {
  1240. return {
  1241. x: n(u.x) ? globalThis.Number(u.x) : 0,
  1242. y: n(u.y) ? globalThis.Number(u.y) : 0,
  1243. width: n(u.width) ? globalThis.Number(u.width) : 0,
  1244. height: n(u.height) ? globalThis.Number(u.height) : 0,
  1245. name: n(u.name) ? globalThis.String(u.name) : "",
  1246. online: n(u.online) ? globalThis.Boolean(u.online) : !1,
  1247. cursor_embedded: n(u.cursor_embedded) ? globalThis.Boolean(u.cursor_embedded) : !1,
  1248. original_resolution: n(u.original_resolution) ? v.fromJSON(u.original_resolution) : void 0,
  1249. scale: n(u.scale) ? globalThis.Number(u.scale) : 0
  1250. }
  1251. }, toJSON(u) {
  1252. const e = {};
  1253. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), u.width !== 0 && (e.width = Math.round(u.width)), u.height !== 0 && (e.height = Math.round(u.height)), u.name !== "" && (e.name = u.name), u.online !== !1 && (e.online = u.online), u.cursor_embedded !== !1 && (e.cursor_embedded = u.cursor_embedded), u.original_resolution !== void 0 && (e.original_resolution = v.toJSON(u.original_resolution)), u.scale !== 0 && (e.scale = u.scale), e
  1254. }, create(u) {
  1255. return s0.fromPartial(u != null ? u : {})
  1256. }, fromPartial(u) {
  1257. var i, o, a, t, s, l, E, c;
  1258. const e = qe();
  1259. return e.x = (i = u.x) != null ? i : 0, e.y = (o = u.y) != null ? o : 0, e.width = (a = u.width) != null ? a : 0, e.height = (t = u.height) != null ? t : 0, e.name = (s = u.name) != null ? s : "", e.online = (l = u.online) != null ? l : !1, e.cursor_embedded = (E = u.cursor_embedded) != null ? E : !1, e.original_resolution = u.original_resolution !== void 0 && u.original_resolution !== null ? v.fromPartial(u.original_resolution) : void 0, e.scale = (c = u.scale) != null ? c : 0, e
  1260. }
  1261. };
  1262. function Ke() {
  1263. return {host: "", port: 0}
  1264. }
  1265. const l0 = {
  1266. encode(u, e = r.Writer.create()) {
  1267. return u.host !== "" && e.uint32(10).string(u.host), u.port !== 0 && e.uint32(16).int32(u.port), e
  1268. }, decode(u, e) {
  1269. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1270. let o = e === void 0 ? i.len : i.pos + e;
  1271. const a = Ke();
  1272. for (; i.pos < o;) {
  1273. const t = i.uint32();
  1274. switch (t >>> 3) {
  1275. case 1:
  1276. if (t !== 10) break;
  1277. a.host = i.string();
  1278. continue;
  1279. case 2:
  1280. if (t !== 16) break;
  1281. a.port = i.int32();
  1282. continue
  1283. }
  1284. if ((t & 7) === 4 || t === 0) break;
  1285. i.skipType(t & 7)
  1286. }
  1287. return a
  1288. }, fromJSON(u) {
  1289. return {host: n(u.host) ? globalThis.String(u.host) : "", port: n(u.port) ? globalThis.Number(u.port) : 0}
  1290. }, toJSON(u) {
  1291. const e = {};
  1292. return u.host !== "" && (e.host = u.host), u.port !== 0 && (e.port = Math.round(u.port)), e
  1293. }, create(u) {
  1294. return l0.fromPartial(u != null ? u : {})
  1295. }, fromPartial(u) {
  1296. var i, o;
  1297. const e = Ke();
  1298. return e.host = (i = u.host) != null ? i : "", e.port = (o = u.port) != null ? o : 0, e
  1299. }
  1300. };
  1301. function He() {
  1302. return {dir: "", show_hidden: !1}
  1303. }
  1304. const Fu = {
  1305. encode(u, e = r.Writer.create()) {
  1306. return u.dir !== "" && e.uint32(10).string(u.dir), u.show_hidden !== !1 && e.uint32(16).bool(u.show_hidden), e
  1307. }, decode(u, e) {
  1308. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1309. let o = e === void 0 ? i.len : i.pos + e;
  1310. const a = He();
  1311. for (; i.pos < o;) {
  1312. const t = i.uint32();
  1313. switch (t >>> 3) {
  1314. case 1:
  1315. if (t !== 10) break;
  1316. a.dir = i.string();
  1317. continue;
  1318. case 2:
  1319. if (t !== 16) break;
  1320. a.show_hidden = i.bool();
  1321. continue
  1322. }
  1323. if ((t & 7) === 4 || t === 0) break;
  1324. i.skipType(t & 7)
  1325. }
  1326. return a
  1327. }, fromJSON(u) {
  1328. return {
  1329. dir: n(u.dir) ? globalThis.String(u.dir) : "",
  1330. show_hidden: n(u.show_hidden) ? globalThis.Boolean(u.show_hidden) : !1
  1331. }
  1332. }, toJSON(u) {
  1333. const e = {};
  1334. return u.dir !== "" && (e.dir = u.dir), u.show_hidden !== !1 && (e.show_hidden = u.show_hidden), e
  1335. }, create(u) {
  1336. return Fu.fromPartial(u != null ? u : {})
  1337. }, fromPartial(u) {
  1338. var i, o;
  1339. const e = He();
  1340. return e.dir = (i = u.dir) != null ? i : "", e.show_hidden = (o = u.show_hidden) != null ? o : !1, e
  1341. }
  1342. };
  1343. function Je() {
  1344. return {username: "", password: ""}
  1345. }
  1346. const E0 = {
  1347. encode(u, e = r.Writer.create()) {
  1348. return u.username !== "" && e.uint32(10).string(u.username), u.password !== "" && e.uint32(18).string(u.password), e
  1349. }, decode(u, e) {
  1350. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1351. let o = e === void 0 ? i.len : i.pos + e;
  1352. const a = Je();
  1353. for (; i.pos < o;) {
  1354. const t = i.uint32();
  1355. switch (t >>> 3) {
  1356. case 1:
  1357. if (t !== 10) break;
  1358. a.username = i.string();
  1359. continue;
  1360. case 2:
  1361. if (t !== 18) break;
  1362. a.password = i.string();
  1363. continue
  1364. }
  1365. if ((t & 7) === 4 || t === 0) break;
  1366. i.skipType(t & 7)
  1367. }
  1368. return a
  1369. }, fromJSON(u) {
  1370. return {
  1371. username: n(u.username) ? globalThis.String(u.username) : "",
  1372. password: n(u.password) ? globalThis.String(u.password) : ""
  1373. }
  1374. }, toJSON(u) {
  1375. const e = {};
  1376. return u.username !== "" && (e.username = u.username), u.password !== "" && (e.password = u.password), e
  1377. }, create(u) {
  1378. return E0.fromPartial(u != null ? u : {})
  1379. }, fromPartial(u) {
  1380. var i, o;
  1381. const e = Je();
  1382. return e.username = (i = u.username) != null ? i : "", e.password = (o = u.password) != null ? o : "", e
  1383. }
  1384. };
  1385. function Ge() {
  1386. return {
  1387. username: "",
  1388. password: new Uint8Array(0),
  1389. my_id: "",
  1390. my_name: "",
  1391. option: void 0,
  1392. file_transfer: void 0,
  1393. port_forward: void 0,
  1394. video_ack_required: !1,
  1395. session_id: 0,
  1396. version: "",
  1397. os_login: void 0,
  1398. my_platform: "",
  1399. hwid: new Uint8Array(0)
  1400. }
  1401. }
  1402. const H = {
  1403. encode(u, e = r.Writer.create()) {
  1404. return u.username !== "" && e.uint32(10).string(u.username), u.password.length !== 0 && e.uint32(18).bytes(u.password), u.my_id !== "" && e.uint32(34).string(u.my_id), u.my_name !== "" && e.uint32(42).string(u.my_name), u.option !== void 0 && z.encode(u.option, e.uint32(50).fork()).ldelim(), u.file_transfer !== void 0 && Fu.encode(u.file_transfer, e.uint32(58).fork()).ldelim(), u.port_forward !== void 0 && l0.encode(u.port_forward, e.uint32(66).fork()).ldelim(), u.video_ack_required !== !1 && e.uint32(72).bool(u.video_ack_required), u.session_id !== 0 && e.uint32(80).uint64(u.session_id), u.version !== "" && e.uint32(90).string(u.version), u.os_login !== void 0 && E0.encode(u.os_login, e.uint32(98).fork()).ldelim(), u.my_platform !== "" && e.uint32(106).string(u.my_platform), u.hwid.length !== 0 && e.uint32(114).bytes(u.hwid), e
  1405. }, decode(u, e) {
  1406. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1407. let o = e === void 0 ? i.len : i.pos + e;
  1408. const a = Ge();
  1409. for (; i.pos < o;) {
  1410. const t = i.uint32();
  1411. switch (t >>> 3) {
  1412. case 1:
  1413. if (t !== 10) break;
  1414. a.username = i.string();
  1415. continue;
  1416. case 2:
  1417. if (t !== 18) break;
  1418. a.password = i.bytes();
  1419. continue;
  1420. case 4:
  1421. if (t !== 34) break;
  1422. a.my_id = i.string();
  1423. continue;
  1424. case 5:
  1425. if (t !== 42) break;
  1426. a.my_name = i.string();
  1427. continue;
  1428. case 6:
  1429. if (t !== 50) break;
  1430. a.option = z.decode(i, i.uint32());
  1431. continue;
  1432. case 7:
  1433. if (t !== 58) break;
  1434. a.file_transfer = Fu.decode(i, i.uint32());
  1435. continue;
  1436. case 8:
  1437. if (t !== 66) break;
  1438. a.port_forward = l0.decode(i, i.uint32());
  1439. continue;
  1440. case 9:
  1441. if (t !== 72) break;
  1442. a.video_ack_required = i.bool();
  1443. continue;
  1444. case 10:
  1445. if (t !== 80) break;
  1446. a.session_id = V(i.uint64());
  1447. continue;
  1448. case 11:
  1449. if (t !== 90) break;
  1450. a.version = i.string();
  1451. continue;
  1452. case 12:
  1453. if (t !== 98) break;
  1454. a.os_login = E0.decode(i, i.uint32());
  1455. continue;
  1456. case 13:
  1457. if (t !== 106) break;
  1458. a.my_platform = i.string();
  1459. continue;
  1460. case 14:
  1461. if (t !== 114) break;
  1462. a.hwid = i.bytes();
  1463. continue
  1464. }
  1465. if ((t & 7) === 4 || t === 0) break;
  1466. i.skipType(t & 7)
  1467. }
  1468. return a
  1469. }, fromJSON(u) {
  1470. return {
  1471. username: n(u.username) ? globalThis.String(u.username) : "",
  1472. password: n(u.password) ? R(u.password) : new Uint8Array(0),
  1473. my_id: n(u.my_id) ? globalThis.String(u.my_id) : "",
  1474. my_name: n(u.my_name) ? globalThis.String(u.my_name) : "",
  1475. option: n(u.option) ? z.fromJSON(u.option) : void 0,
  1476. file_transfer: n(u.file_transfer) ? Fu.fromJSON(u.file_transfer) : void 0,
  1477. port_forward: n(u.port_forward) ? l0.fromJSON(u.port_forward) : void 0,
  1478. video_ack_required: n(u.video_ack_required) ? globalThis.Boolean(u.video_ack_required) : !1,
  1479. session_id: n(u.session_id) ? globalThis.Number(u.session_id) : 0,
  1480. version: n(u.version) ? globalThis.String(u.version) : "",
  1481. os_login: n(u.os_login) ? E0.fromJSON(u.os_login) : void 0,
  1482. my_platform: n(u.my_platform) ? globalThis.String(u.my_platform) : "",
  1483. hwid: n(u.hwid) ? R(u.hwid) : new Uint8Array(0)
  1484. }
  1485. }, toJSON(u) {
  1486. const e = {};
  1487. return u.username !== "" && (e.username = u.username), u.password.length !== 0 && (e.password = I(u.password)), u.my_id !== "" && (e.my_id = u.my_id), u.my_name !== "" && (e.my_name = u.my_name), u.option !== void 0 && (e.option = z.toJSON(u.option)), u.file_transfer !== void 0 && (e.file_transfer = Fu.toJSON(u.file_transfer)), u.port_forward !== void 0 && (e.port_forward = l0.toJSON(u.port_forward)), u.video_ack_required !== !1 && (e.video_ack_required = u.video_ack_required), u.session_id !== 0 && (e.session_id = Math.round(u.session_id)), u.version !== "" && (e.version = u.version), u.os_login !== void 0 && (e.os_login = E0.toJSON(u.os_login)), u.my_platform !== "" && (e.my_platform = u.my_platform), u.hwid.length !== 0 && (e.hwid = I(u.hwid)), e
  1488. }, create(u) {
  1489. return H.fromPartial(u != null ? u : {})
  1490. }, fromPartial(u) {
  1491. var i, o, a, t, s, l, E, c, C;
  1492. const e = Ge();
  1493. return e.username = (i = u.username) != null ? i : "", e.password = (o = u.password) != null ? o : new Uint8Array(0), e.my_id = (a = u.my_id) != null ? a : "", e.my_name = (t = u.my_name) != null ? t : "", e.option = u.option !== void 0 && u.option !== null ? z.fromPartial(u.option) : void 0, e.file_transfer = u.file_transfer !== void 0 && u.file_transfer !== null ? Fu.fromPartial(u.file_transfer) : void 0, e.port_forward = u.port_forward !== void 0 && u.port_forward !== null ? l0.fromPartial(u.port_forward) : void 0, e.video_ack_required = (s = u.video_ack_required) != null ? s : !1, e.session_id = (l = u.session_id) != null ? l : 0, e.version = (E = u.version) != null ? E : "", e.os_login = u.os_login !== void 0 && u.os_login !== null ? E0.fromPartial(u.os_login) : void 0, e.my_platform = (c = u.my_platform) != null ? c : "", e.hwid = (C = u.hwid) != null ? C : new Uint8Array(0), e
  1494. }
  1495. };
  1496. function Ze() {
  1497. return {code: "", hwid: new Uint8Array(0)}
  1498. }
  1499. const _u = {
  1500. encode(u, e = r.Writer.create()) {
  1501. return u.code !== "" && e.uint32(10).string(u.code), u.hwid.length !== 0 && e.uint32(18).bytes(u.hwid), e
  1502. }, decode(u, e) {
  1503. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1504. let o = e === void 0 ? i.len : i.pos + e;
  1505. const a = Ze();
  1506. for (; i.pos < o;) {
  1507. const t = i.uint32();
  1508. switch (t >>> 3) {
  1509. case 1:
  1510. if (t !== 10) break;
  1511. a.code = i.string();
  1512. continue;
  1513. case 2:
  1514. if (t !== 18) break;
  1515. a.hwid = i.bytes();
  1516. continue
  1517. }
  1518. if ((t & 7) === 4 || t === 0) break;
  1519. i.skipType(t & 7)
  1520. }
  1521. return a
  1522. }, fromJSON(u) {
  1523. return {code: n(u.code) ? globalThis.String(u.code) : "", hwid: n(u.hwid) ? R(u.hwid) : new Uint8Array(0)}
  1524. }, toJSON(u) {
  1525. const e = {};
  1526. return u.code !== "" && (e.code = u.code), u.hwid.length !== 0 && (e.hwid = I(u.hwid)), e
  1527. }, create(u) {
  1528. return _u.fromPartial(u != null ? u : {})
  1529. }, fromPartial(u) {
  1530. var i, o;
  1531. const e = Ze();
  1532. return e.code = (i = u.code) != null ? i : "", e.hwid = (o = u.hwid) != null ? o : new Uint8Array(0), e
  1533. }
  1534. };
  1535. function Qe() {
  1536. return {text: ""}
  1537. }
  1538. const vu = {
  1539. encode(u, e = r.Writer.create()) {
  1540. return u.text !== "" && e.uint32(10).string(u.text), e
  1541. }, decode(u, e) {
  1542. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1543. let o = e === void 0 ? i.len : i.pos + e;
  1544. const a = Qe();
  1545. for (; i.pos < o;) {
  1546. const t = i.uint32();
  1547. switch (t >>> 3) {
  1548. case 1:
  1549. if (t !== 10) break;
  1550. a.text = i.string();
  1551. continue
  1552. }
  1553. if ((t & 7) === 4 || t === 0) break;
  1554. i.skipType(t & 7)
  1555. }
  1556. return a
  1557. }, fromJSON(u) {
  1558. return {text: n(u.text) ? globalThis.String(u.text) : ""}
  1559. }, toJSON(u) {
  1560. const e = {};
  1561. return u.text !== "" && (e.text = u.text), e
  1562. }, create(u) {
  1563. return vu.fromPartial(u != null ? u : {})
  1564. }, fromPartial(u) {
  1565. var i;
  1566. const e = Qe();
  1567. return e.text = (i = u.text) != null ? i : "", e
  1568. }
  1569. };
  1570. function Xe() {
  1571. return {privacy_mode: !1}
  1572. }
  1573. const d0 = {
  1574. encode(u, e = r.Writer.create()) {
  1575. return u.privacy_mode !== !1 && e.uint32(8).bool(u.privacy_mode), e
  1576. }, decode(u, e) {
  1577. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1578. let o = e === void 0 ? i.len : i.pos + e;
  1579. const a = Xe();
  1580. for (; i.pos < o;) {
  1581. const t = i.uint32();
  1582. switch (t >>> 3) {
  1583. case 1:
  1584. if (t !== 8) break;
  1585. a.privacy_mode = i.bool();
  1586. continue
  1587. }
  1588. if ((t & 7) === 4 || t === 0) break;
  1589. i.skipType(t & 7)
  1590. }
  1591. return a
  1592. }, fromJSON(u) {
  1593. return {privacy_mode: n(u.privacy_mode) ? globalThis.Boolean(u.privacy_mode) : !1}
  1594. }, toJSON(u) {
  1595. const e = {};
  1596. return u.privacy_mode !== !1 && (e.privacy_mode = u.privacy_mode), e
  1597. }, create(u) {
  1598. return d0.fromPartial(u != null ? u : {})
  1599. }, fromPartial(u) {
  1600. var i;
  1601. const e = Xe();
  1602. return e.privacy_mode = (i = u.privacy_mode) != null ? i : !1, e
  1603. }
  1604. };
  1605. function Ye() {
  1606. return {vp8: !1, vp9: !1, av1: !1, h264: !1, h265: !1}
  1607. }
  1608. const J = {
  1609. encode(u, e = r.Writer.create()) {
  1610. return u.vp8 !== !1 && e.uint32(8).bool(u.vp8), u.vp9 !== !1 && e.uint32(16).bool(u.vp9), u.av1 !== !1 && e.uint32(24).bool(u.av1), u.h264 !== !1 && e.uint32(32).bool(u.h264), u.h265 !== !1 && e.uint32(40).bool(u.h265), e
  1611. }, decode(u, e) {
  1612. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1613. let o = e === void 0 ? i.len : i.pos + e;
  1614. const a = Ye();
  1615. for (; i.pos < o;) {
  1616. const t = i.uint32();
  1617. switch (t >>> 3) {
  1618. case 1:
  1619. if (t !== 8) break;
  1620. a.vp8 = i.bool();
  1621. continue;
  1622. case 2:
  1623. if (t !== 16) break;
  1624. a.vp9 = i.bool();
  1625. continue;
  1626. case 3:
  1627. if (t !== 24) break;
  1628. a.av1 = i.bool();
  1629. continue;
  1630. case 4:
  1631. if (t !== 32) break;
  1632. a.h264 = i.bool();
  1633. continue;
  1634. case 5:
  1635. if (t !== 40) break;
  1636. a.h265 = i.bool();
  1637. continue
  1638. }
  1639. if ((t & 7) === 4 || t === 0) break;
  1640. i.skipType(t & 7)
  1641. }
  1642. return a
  1643. }, fromJSON(u) {
  1644. return {
  1645. vp8: n(u.vp8) ? globalThis.Boolean(u.vp8) : !1,
  1646. vp9: n(u.vp9) ? globalThis.Boolean(u.vp9) : !1,
  1647. av1: n(u.av1) ? globalThis.Boolean(u.av1) : !1,
  1648. h264: n(u.h264) ? globalThis.Boolean(u.h264) : !1,
  1649. h265: n(u.h265) ? globalThis.Boolean(u.h265) : !1
  1650. }
  1651. }, toJSON(u) {
  1652. const e = {};
  1653. return u.vp8 !== !1 && (e.vp8 = u.vp8), u.vp9 !== !1 && (e.vp9 = u.vp9), u.av1 !== !1 && (e.av1 = u.av1), u.h264 !== !1 && (e.h264 = u.h264), u.h265 !== !1 && (e.h265 = u.h265), e
  1654. }, create(u) {
  1655. return J.fromPartial(u != null ? u : {})
  1656. }, fromPartial(u) {
  1657. var i, o, a, t, s;
  1658. const e = Ye();
  1659. return e.vp8 = (i = u.vp8) != null ? i : !1, e.vp9 = (o = u.vp9) != null ? o : !1, e.av1 = (a = u.av1) != null ? a : !1, e.h264 = (t = u.h264) != null ? t : !1, e.h265 = (s = u.h265) != null ? s : !1, e
  1660. }
  1661. };
  1662. function $e() {
  1663. return {h264: !1, h265: !1, vp8: !1, av1: !1, i444: void 0}
  1664. }
  1665. const G = {
  1666. encode(u, e = r.Writer.create()) {
  1667. return u.h264 !== !1 && e.uint32(8).bool(u.h264), u.h265 !== !1 && e.uint32(16).bool(u.h265), u.vp8 !== !1 && e.uint32(24).bool(u.vp8), u.av1 !== !1 && e.uint32(32).bool(u.av1), u.i444 !== void 0 && J.encode(u.i444, e.uint32(42).fork()).ldelim(), e
  1668. }, decode(u, e) {
  1669. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1670. let o = e === void 0 ? i.len : i.pos + e;
  1671. const a = $e();
  1672. for (; i.pos < o;) {
  1673. const t = i.uint32();
  1674. switch (t >>> 3) {
  1675. case 1:
  1676. if (t !== 8) break;
  1677. a.h264 = i.bool();
  1678. continue;
  1679. case 2:
  1680. if (t !== 16) break;
  1681. a.h265 = i.bool();
  1682. continue;
  1683. case 3:
  1684. if (t !== 24) break;
  1685. a.vp8 = i.bool();
  1686. continue;
  1687. case 4:
  1688. if (t !== 32) break;
  1689. a.av1 = i.bool();
  1690. continue;
  1691. case 5:
  1692. if (t !== 42) break;
  1693. a.i444 = J.decode(i, i.uint32());
  1694. continue
  1695. }
  1696. if ((t & 7) === 4 || t === 0) break;
  1697. i.skipType(t & 7)
  1698. }
  1699. return a
  1700. }, fromJSON(u) {
  1701. return {
  1702. h264: n(u.h264) ? globalThis.Boolean(u.h264) : !1,
  1703. h265: n(u.h265) ? globalThis.Boolean(u.h265) : !1,
  1704. vp8: n(u.vp8) ? globalThis.Boolean(u.vp8) : !1,
  1705. av1: n(u.av1) ? globalThis.Boolean(u.av1) : !1,
  1706. i444: n(u.i444) ? J.fromJSON(u.i444) : void 0
  1707. }
  1708. }, toJSON(u) {
  1709. const e = {};
  1710. return u.h264 !== !1 && (e.h264 = u.h264), u.h265 !== !1 && (e.h265 = u.h265), u.vp8 !== !1 && (e.vp8 = u.vp8), u.av1 !== !1 && (e.av1 = u.av1), u.i444 !== void 0 && (e.i444 = J.toJSON(u.i444)), e
  1711. }, create(u) {
  1712. return G.fromPartial(u != null ? u : {})
  1713. }, fromPartial(u) {
  1714. var i, o, a, t;
  1715. const e = $e();
  1716. return e.h264 = (i = u.h264) != null ? i : !1, e.h265 = (o = u.h265) != null ? o : !1, e.vp8 = (a = u.vp8) != null ? a : !1, e.av1 = (t = u.av1) != null ? t : !1, e.i444 = u.i444 !== void 0 && u.i444 !== null ? J.fromPartial(u.i444) : void 0, e
  1717. }
  1718. };
  1719. function u3() {
  1720. return {
  1721. username: "",
  1722. hostname: "",
  1723. platform: "",
  1724. displays: [],
  1725. current_display: 0,
  1726. sas_enabled: !1,
  1727. version: "",
  1728. features: void 0,
  1729. encoding: void 0,
  1730. resolutions: void 0,
  1731. platform_additions: "",
  1732. windows_sessions: void 0
  1733. }
  1734. }
  1735. const Y = {
  1736. encode(u, e = r.Writer.create()) {
  1737. u.username !== "" && e.uint32(10).string(u.username), u.hostname !== "" && e.uint32(18).string(u.hostname), u.platform !== "" && e.uint32(26).string(u.platform);
  1738. for (const i of u.displays) s0.encode(i, e.uint32(34).fork()).ldelim();
  1739. return u.current_display !== 0 && e.uint32(40).int32(u.current_display), u.sas_enabled !== !1 && e.uint32(48).bool(u.sas_enabled), u.version !== "" && e.uint32(58).string(u.version), u.features !== void 0 && d0.encode(u.features, e.uint32(74).fork()).ldelim(), u.encoding !== void 0 && G.encode(u.encoding, e.uint32(82).fork()).ldelim(), u.resolutions !== void 0 && uu.encode(u.resolutions, e.uint32(90).fork()).ldelim(), u.platform_additions !== "" && e.uint32(98).string(u.platform_additions), u.windows_sessions !== void 0 && K0.encode(u.windows_sessions, e.uint32(106).fork()).ldelim(), e
  1740. }, decode(u, e) {
  1741. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1742. let o = e === void 0 ? i.len : i.pos + e;
  1743. const a = u3();
  1744. for (; i.pos < o;) {
  1745. const t = i.uint32();
  1746. switch (t >>> 3) {
  1747. case 1:
  1748. if (t !== 10) break;
  1749. a.username = i.string();
  1750. continue;
  1751. case 2:
  1752. if (t !== 18) break;
  1753. a.hostname = i.string();
  1754. continue;
  1755. case 3:
  1756. if (t !== 26) break;
  1757. a.platform = i.string();
  1758. continue;
  1759. case 4:
  1760. if (t !== 34) break;
  1761. a.displays.push(s0.decode(i, i.uint32()));
  1762. continue;
  1763. case 5:
  1764. if (t !== 40) break;
  1765. a.current_display = i.int32();
  1766. continue;
  1767. case 6:
  1768. if (t !== 48) break;
  1769. a.sas_enabled = i.bool();
  1770. continue;
  1771. case 7:
  1772. if (t !== 58) break;
  1773. a.version = i.string();
  1774. continue;
  1775. case 9:
  1776. if (t !== 74) break;
  1777. a.features = d0.decode(i, i.uint32());
  1778. continue;
  1779. case 10:
  1780. if (t !== 82) break;
  1781. a.encoding = G.decode(i, i.uint32());
  1782. continue;
  1783. case 11:
  1784. if (t !== 90) break;
  1785. a.resolutions = uu.decode(i, i.uint32());
  1786. continue;
  1787. case 12:
  1788. if (t !== 98) break;
  1789. a.platform_additions = i.string();
  1790. continue;
  1791. case 13:
  1792. if (t !== 106) break;
  1793. a.windows_sessions = K0.decode(i, i.uint32());
  1794. continue
  1795. }
  1796. if ((t & 7) === 4 || t === 0) break;
  1797. i.skipType(t & 7)
  1798. }
  1799. return a
  1800. }, fromJSON(u) {
  1801. return {
  1802. username: n(u.username) ? globalThis.String(u.username) : "",
  1803. hostname: n(u.hostname) ? globalThis.String(u.hostname) : "",
  1804. platform: n(u.platform) ? globalThis.String(u.platform) : "",
  1805. displays: globalThis.Array.isArray(u == null ? void 0 : u.displays) ? u.displays.map(e => s0.fromJSON(e)) : [],
  1806. current_display: n(u.current_display) ? globalThis.Number(u.current_display) : 0,
  1807. sas_enabled: n(u.sas_enabled) ? globalThis.Boolean(u.sas_enabled) : !1,
  1808. version: n(u.version) ? globalThis.String(u.version) : "",
  1809. features: n(u.features) ? d0.fromJSON(u.features) : void 0,
  1810. encoding: n(u.encoding) ? G.fromJSON(u.encoding) : void 0,
  1811. resolutions: n(u.resolutions) ? uu.fromJSON(u.resolutions) : void 0,
  1812. platform_additions: n(u.platform_additions) ? globalThis.String(u.platform_additions) : "",
  1813. windows_sessions: n(u.windows_sessions) ? K0.fromJSON(u.windows_sessions) : void 0
  1814. }
  1815. }, toJSON(u) {
  1816. var i;
  1817. const e = {};
  1818. return u.username !== "" && (e.username = u.username), u.hostname !== "" && (e.hostname = u.hostname), u.platform !== "" && (e.platform = u.platform), (i = u.displays) != null && i.length && (e.displays = u.displays.map(o => s0.toJSON(o))), u.current_display !== 0 && (e.current_display = Math.round(u.current_display)), u.sas_enabled !== !1 && (e.sas_enabled = u.sas_enabled), u.version !== "" && (e.version = u.version), u.features !== void 0 && (e.features = d0.toJSON(u.features)), u.encoding !== void 0 && (e.encoding = G.toJSON(u.encoding)), u.resolutions !== void 0 && (e.resolutions = uu.toJSON(u.resolutions)), u.platform_additions !== "" && (e.platform_additions = u.platform_additions), u.windows_sessions !== void 0 && (e.windows_sessions = K0.toJSON(u.windows_sessions)), e
  1819. }, create(u) {
  1820. return Y.fromPartial(u != null ? u : {})
  1821. }, fromPartial(u) {
  1822. var i, o, a, t, s, l, E, c;
  1823. const e = u3();
  1824. return e.username = (i = u.username) != null ? i : "", e.hostname = (o = u.hostname) != null ? o : "", e.platform = (a = u.platform) != null ? a : "", e.displays = ((t = u.displays) == null ? void 0 : t.map(C => s0.fromPartial(C))) || [], e.current_display = (s = u.current_display) != null ? s : 0, e.sas_enabled = (l = u.sas_enabled) != null ? l : !1, e.version = (E = u.version) != null ? E : "", e.features = u.features !== void 0 && u.features !== null ? d0.fromPartial(u.features) : void 0, e.encoding = u.encoding !== void 0 && u.encoding !== null ? G.fromPartial(u.encoding) : void 0, e.resolutions = u.resolutions !== void 0 && u.resolutions !== null ? uu.fromPartial(u.resolutions) : void 0, e.platform_additions = (c = u.platform_additions) != null ? c : "", e.windows_sessions = u.windows_sessions !== void 0 && u.windows_sessions !== null ? K0.fromPartial(u.windows_sessions) : void 0, e
  1825. }
  1826. };
  1827. function e3() {
  1828. return {sid: 0, name: ""}
  1829. }
  1830. const c0 = {
  1831. encode(u, e = r.Writer.create()) {
  1832. return u.sid !== 0 && e.uint32(8).uint32(u.sid), u.name !== "" && e.uint32(18).string(u.name), e
  1833. }, decode(u, e) {
  1834. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1835. let o = e === void 0 ? i.len : i.pos + e;
  1836. const a = e3();
  1837. for (; i.pos < o;) {
  1838. const t = i.uint32();
  1839. switch (t >>> 3) {
  1840. case 1:
  1841. if (t !== 8) break;
  1842. a.sid = i.uint32();
  1843. continue;
  1844. case 2:
  1845. if (t !== 18) break;
  1846. a.name = i.string();
  1847. continue
  1848. }
  1849. if ((t & 7) === 4 || t === 0) break;
  1850. i.skipType(t & 7)
  1851. }
  1852. return a
  1853. }, fromJSON(u) {
  1854. return {sid: n(u.sid) ? globalThis.Number(u.sid) : 0, name: n(u.name) ? globalThis.String(u.name) : ""}
  1855. }, toJSON(u) {
  1856. const e = {};
  1857. return u.sid !== 0 && (e.sid = Math.round(u.sid)), u.name !== "" && (e.name = u.name), e
  1858. }, create(u) {
  1859. return c0.fromPartial(u != null ? u : {})
  1860. }, fromPartial(u) {
  1861. var i, o;
  1862. const e = e3();
  1863. return e.sid = (i = u.sid) != null ? i : 0, e.name = (o = u.name) != null ? o : "", e
  1864. }
  1865. };
  1866. function i3() {
  1867. return {error: void 0, peer_info: void 0, enable_trusted_devices: !1}
  1868. }
  1869. const C0 = {
  1870. encode(u, e = r.Writer.create()) {
  1871. return u.error !== void 0 && e.uint32(10).string(u.error), u.peer_info !== void 0 && Y.encode(u.peer_info, e.uint32(18).fork()).ldelim(), u.enable_trusted_devices !== !1 && e.uint32(24).bool(u.enable_trusted_devices), e
  1872. }, decode(u, e) {
  1873. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1874. let o = e === void 0 ? i.len : i.pos + e;
  1875. const a = i3();
  1876. for (; i.pos < o;) {
  1877. const t = i.uint32();
  1878. switch (t >>> 3) {
  1879. case 1:
  1880. if (t !== 10) break;
  1881. a.error = i.string();
  1882. continue;
  1883. case 2:
  1884. if (t !== 18) break;
  1885. a.peer_info = Y.decode(i, i.uint32());
  1886. continue;
  1887. case 3:
  1888. if (t !== 24) break;
  1889. a.enable_trusted_devices = i.bool();
  1890. continue
  1891. }
  1892. if ((t & 7) === 4 || t === 0) break;
  1893. i.skipType(t & 7)
  1894. }
  1895. return a
  1896. }, fromJSON(u) {
  1897. return {
  1898. error: n(u.error) ? globalThis.String(u.error) : void 0,
  1899. peer_info: n(u.peer_info) ? Y.fromJSON(u.peer_info) : void 0,
  1900. enable_trusted_devices: n(u.enable_trusted_devices) ? globalThis.Boolean(u.enable_trusted_devices) : !1
  1901. }
  1902. }, toJSON(u) {
  1903. const e = {};
  1904. return u.error !== void 0 && (e.error = u.error), u.peer_info !== void 0 && (e.peer_info = Y.toJSON(u.peer_info)), u.enable_trusted_devices !== !1 && (e.enable_trusted_devices = u.enable_trusted_devices), e
  1905. }, create(u) {
  1906. return C0.fromPartial(u != null ? u : {})
  1907. }, fromPartial(u) {
  1908. var i, o;
  1909. const e = i3();
  1910. return e.error = (i = u.error) != null ? i : void 0, e.peer_info = u.peer_info !== void 0 && u.peer_info !== null ? Y.fromPartial(u.peer_info) : void 0, e.enable_trusted_devices = (o = u.enable_trusted_devices) != null ? o : !1, e
  1911. }
  1912. };
  1913. function t3() {
  1914. return {scale: 0}
  1915. }
  1916. const p0 = {
  1917. encode(u, e = r.Writer.create()) {
  1918. return u.scale !== 0 && e.uint32(8).int32(u.scale), e
  1919. }, decode(u, e) {
  1920. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1921. let o = e === void 0 ? i.len : i.pos + e;
  1922. const a = t3();
  1923. for (; i.pos < o;) {
  1924. const t = i.uint32();
  1925. switch (t >>> 3) {
  1926. case 1:
  1927. if (t !== 8) break;
  1928. a.scale = i.int32();
  1929. continue
  1930. }
  1931. if ((t & 7) === 4 || t === 0) break;
  1932. i.skipType(t & 7)
  1933. }
  1934. return a
  1935. }, fromJSON(u) {
  1936. return {scale: n(u.scale) ? globalThis.Number(u.scale) : 0}
  1937. }, toJSON(u) {
  1938. const e = {};
  1939. return u.scale !== 0 && (e.scale = Math.round(u.scale)), e
  1940. }, create(u) {
  1941. return p0.fromPartial(u != null ? u : {})
  1942. }, fromPartial(u) {
  1943. var i;
  1944. const e = t3();
  1945. return e.scale = (i = u.scale) != null ? i : 0, e
  1946. }
  1947. };
  1948. function a3() {
  1949. return {x: 0, y: 0}
  1950. }
  1951. const D0 = {
  1952. encode(u, e = r.Writer.create()) {
  1953. return u.x !== 0 && e.uint32(8).int32(u.x), u.y !== 0 && e.uint32(16).int32(u.y), e
  1954. }, decode(u, e) {
  1955. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1956. let o = e === void 0 ? i.len : i.pos + e;
  1957. const a = a3();
  1958. for (; i.pos < o;) {
  1959. const t = i.uint32();
  1960. switch (t >>> 3) {
  1961. case 1:
  1962. if (t !== 8) break;
  1963. a.x = i.int32();
  1964. continue;
  1965. case 2:
  1966. if (t !== 16) break;
  1967. a.y = i.int32();
  1968. continue
  1969. }
  1970. if ((t & 7) === 4 || t === 0) break;
  1971. i.skipType(t & 7)
  1972. }
  1973. return a
  1974. }, fromJSON(u) {
  1975. return {x: n(u.x) ? globalThis.Number(u.x) : 0, y: n(u.y) ? globalThis.Number(u.y) : 0}
  1976. }, toJSON(u) {
  1977. const e = {};
  1978. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  1979. }, create(u) {
  1980. return D0.fromPartial(u != null ? u : {})
  1981. }, fromPartial(u) {
  1982. var i, o;
  1983. const e = a3();
  1984. return e.x = (i = u.x) != null ? i : 0, e.y = (o = u.y) != null ? o : 0, e
  1985. }
  1986. };
  1987. function o3() {
  1988. return {x: 0, y: 0}
  1989. }
  1990. const B0 = {
  1991. encode(u, e = r.Writer.create()) {
  1992. return u.x !== 0 && e.uint32(8).int32(u.x), u.y !== 0 && e.uint32(16).int32(u.y), e
  1993. }, decode(u, e) {
  1994. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1995. let o = e === void 0 ? i.len : i.pos + e;
  1996. const a = o3();
  1997. for (; i.pos < o;) {
  1998. const t = i.uint32();
  1999. switch (t >>> 3) {
  2000. case 1:
  2001. if (t !== 8) break;
  2002. a.x = i.int32();
  2003. continue;
  2004. case 2:
  2005. if (t !== 16) break;
  2006. a.y = i.int32();
  2007. continue
  2008. }
  2009. if ((t & 7) === 4 || t === 0) break;
  2010. i.skipType(t & 7)
  2011. }
  2012. return a
  2013. }, fromJSON(u) {
  2014. return {x: n(u.x) ? globalThis.Number(u.x) : 0, y: n(u.y) ? globalThis.Number(u.y) : 0}
  2015. }, toJSON(u) {
  2016. const e = {};
  2017. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  2018. }, create(u) {
  2019. return B0.fromPartial(u != null ? u : {})
  2020. }, fromPartial(u) {
  2021. var i, o;
  2022. const e = o3();
  2023. return e.x = (i = u.x) != null ? i : 0, e.y = (o = u.y) != null ? o : 0, e
  2024. }
  2025. };
  2026. function n3() {
  2027. return {x: 0, y: 0}
  2028. }
  2029. const m0 = {
  2030. encode(u, e = r.Writer.create()) {
  2031. return u.x !== 0 && e.uint32(8).int32(u.x), u.y !== 0 && e.uint32(16).int32(u.y), e
  2032. }, decode(u, e) {
  2033. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2034. let o = e === void 0 ? i.len : i.pos + e;
  2035. const a = n3();
  2036. for (; i.pos < o;) {
  2037. const t = i.uint32();
  2038. switch (t >>> 3) {
  2039. case 1:
  2040. if (t !== 8) break;
  2041. a.x = i.int32();
  2042. continue;
  2043. case 2:
  2044. if (t !== 16) break;
  2045. a.y = i.int32();
  2046. continue
  2047. }
  2048. if ((t & 7) === 4 || t === 0) break;
  2049. i.skipType(t & 7)
  2050. }
  2051. return a
  2052. }, fromJSON(u) {
  2053. return {x: n(u.x) ? globalThis.Number(u.x) : 0, y: n(u.y) ? globalThis.Number(u.y) : 0}
  2054. }, toJSON(u) {
  2055. const e = {};
  2056. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  2057. }, create(u) {
  2058. return m0.fromPartial(u != null ? u : {})
  2059. }, fromPartial(u) {
  2060. var i, o;
  2061. const e = n3();
  2062. return e.x = (i = u.x) != null ? i : 0, e.y = (o = u.y) != null ? o : 0, e
  2063. }
  2064. };
  2065. function r3() {
  2066. return {scale_update: void 0, pan_start: void 0, pan_update: void 0, pan_end: void 0}
  2067. }
  2068. const A0 = {
  2069. encode(u, e = r.Writer.create()) {
  2070. return u.scale_update !== void 0 && p0.encode(u.scale_update, e.uint32(10).fork()).ldelim(), u.pan_start !== void 0 && D0.encode(u.pan_start, e.uint32(18).fork()).ldelim(), u.pan_update !== void 0 && B0.encode(u.pan_update, e.uint32(26).fork()).ldelim(), u.pan_end !== void 0 && m0.encode(u.pan_end, e.uint32(34).fork()).ldelim(), e
  2071. }, decode(u, e) {
  2072. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2073. let o = e === void 0 ? i.len : i.pos + e;
  2074. const a = r3();
  2075. for (; i.pos < o;) {
  2076. const t = i.uint32();
  2077. switch (t >>> 3) {
  2078. case 1:
  2079. if (t !== 10) break;
  2080. a.scale_update = p0.decode(i, i.uint32());
  2081. continue;
  2082. case 2:
  2083. if (t !== 18) break;
  2084. a.pan_start = D0.decode(i, i.uint32());
  2085. continue;
  2086. case 3:
  2087. if (t !== 26) break;
  2088. a.pan_update = B0.decode(i, i.uint32());
  2089. continue;
  2090. case 4:
  2091. if (t !== 34) break;
  2092. a.pan_end = m0.decode(i, i.uint32());
  2093. continue
  2094. }
  2095. if ((t & 7) === 4 || t === 0) break;
  2096. i.skipType(t & 7)
  2097. }
  2098. return a
  2099. }, fromJSON(u) {
  2100. return {
  2101. scale_update: n(u.scale_update) ? p0.fromJSON(u.scale_update) : void 0,
  2102. pan_start: n(u.pan_start) ? D0.fromJSON(u.pan_start) : void 0,
  2103. pan_update: n(u.pan_update) ? B0.fromJSON(u.pan_update) : void 0,
  2104. pan_end: n(u.pan_end) ? m0.fromJSON(u.pan_end) : void 0
  2105. }
  2106. }, toJSON(u) {
  2107. const e = {};
  2108. return u.scale_update !== void 0 && (e.scale_update = p0.toJSON(u.scale_update)), u.pan_start !== void 0 && (e.pan_start = D0.toJSON(u.pan_start)), u.pan_update !== void 0 && (e.pan_update = B0.toJSON(u.pan_update)), u.pan_end !== void 0 && (e.pan_end = m0.toJSON(u.pan_end)), e
  2109. }, create(u) {
  2110. return A0.fromPartial(u != null ? u : {})
  2111. }, fromPartial(u) {
  2112. const e = r3();
  2113. return e.scale_update = u.scale_update !== void 0 && u.scale_update !== null ? p0.fromPartial(u.scale_update) : void 0, e.pan_start = u.pan_start !== void 0 && u.pan_start !== null ? D0.fromPartial(u.pan_start) : void 0, e.pan_update = u.pan_update !== void 0 && u.pan_update !== null ? B0.fromPartial(u.pan_update) : void 0, e.pan_end = u.pan_end !== void 0 && u.pan_end !== null ? m0.fromPartial(u.pan_end) : void 0, e
  2114. }
  2115. };
  2116. function s3() {
  2117. return {touch_event: void 0, modifiers: []}
  2118. }
  2119. const F0 = {
  2120. encode(u, e = r.Writer.create()) {
  2121. u.touch_event !== void 0 && A0.encode(u.touch_event, e.uint32(10).fork()).ldelim(), e.uint32(18).fork();
  2122. for (const i of u.modifiers) e.int32(i);
  2123. return e.ldelim(), e
  2124. }, decode(u, e) {
  2125. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2126. let o = e === void 0 ? i.len : i.pos + e;
  2127. const a = s3();
  2128. for (; i.pos < o;) {
  2129. const t = i.uint32();
  2130. switch (t >>> 3) {
  2131. case 1:
  2132. if (t !== 10) break;
  2133. a.touch_event = A0.decode(i, i.uint32());
  2134. continue;
  2135. case 2:
  2136. if (t === 16) {
  2137. a.modifiers.push(i.int32());
  2138. continue
  2139. }
  2140. if (t === 18) {
  2141. const s = i.uint32() + i.pos;
  2142. for (; i.pos < s;) a.modifiers.push(i.int32());
  2143. continue
  2144. }
  2145. break
  2146. }
  2147. if ((t & 7) === 4 || t === 0) break;
  2148. i.skipType(t & 7)
  2149. }
  2150. return a
  2151. }, fromJSON(u) {
  2152. return {
  2153. touch_event: n(u.touch_event) ? A0.fromJSON(u.touch_event) : void 0,
  2154. modifiers: globalThis.Array.isArray(u == null ? void 0 : u.modifiers) ? u.modifiers.map(e => F4(e)) : []
  2155. }
  2156. }, toJSON(u) {
  2157. var i;
  2158. const e = {};
  2159. return u.touch_event !== void 0 && (e.touch_event = A0.toJSON(u.touch_event)), (i = u.modifiers) != null && i.length && (e.modifiers = u.modifiers.map(o => T4(o))), e
  2160. }, create(u) {
  2161. return F0.fromPartial(u != null ? u : {})
  2162. }, fromPartial(u) {
  2163. var i;
  2164. const e = s3();
  2165. return e.touch_event = u.touch_event !== void 0 && u.touch_event !== null ? A0.fromPartial(u.touch_event) : void 0, e.modifiers = ((i = u.modifiers) == null ? void 0 : i.map(o => o)) || [], e
  2166. }
  2167. };
  2168. function l3() {
  2169. return {mask: 0, x: 0, y: 0, modifiers: []}
  2170. }
  2171. const ku = {
  2172. encode(u, e = r.Writer.create()) {
  2173. u.mask !== 0 && e.uint32(8).int32(u.mask), u.x !== 0 && e.uint32(16).sint32(u.x), u.y !== 0 && e.uint32(24).sint32(u.y), e.uint32(34).fork();
  2174. for (const i of u.modifiers) e.int32(i);
  2175. return e.ldelim(), e
  2176. }, decode(u, e) {
  2177. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2178. let o = e === void 0 ? i.len : i.pos + e;
  2179. const a = l3();
  2180. for (; i.pos < o;) {
  2181. const t = i.uint32();
  2182. switch (t >>> 3) {
  2183. case 1:
  2184. if (t !== 8) break;
  2185. a.mask = i.int32();
  2186. continue;
  2187. case 2:
  2188. if (t !== 16) break;
  2189. a.x = i.sint32();
  2190. continue;
  2191. case 3:
  2192. if (t !== 24) break;
  2193. a.y = i.sint32();
  2194. continue;
  2195. case 4:
  2196. if (t === 32) {
  2197. a.modifiers.push(i.int32());
  2198. continue
  2199. }
  2200. if (t === 34) {
  2201. const s = i.uint32() + i.pos;
  2202. for (; i.pos < s;) a.modifiers.push(i.int32());
  2203. continue
  2204. }
  2205. break
  2206. }
  2207. if ((t & 7) === 4 || t === 0) break;
  2208. i.skipType(t & 7)
  2209. }
  2210. return a
  2211. }, fromJSON(u) {
  2212. return {
  2213. mask: n(u.mask) ? globalThis.Number(u.mask) : 0,
  2214. x: n(u.x) ? globalThis.Number(u.x) : 0,
  2215. y: n(u.y) ? globalThis.Number(u.y) : 0,
  2216. modifiers: globalThis.Array.isArray(u == null ? void 0 : u.modifiers) ? u.modifiers.map(e => F4(e)) : []
  2217. }
  2218. }, toJSON(u) {
  2219. var i;
  2220. const e = {};
  2221. return u.mask !== 0 && (e.mask = Math.round(u.mask)), u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), (i = u.modifiers) != null && i.length && (e.modifiers = u.modifiers.map(o => T4(o))), e
  2222. }, create(u) {
  2223. return ku.fromPartial(u != null ? u : {})
  2224. }, fromPartial(u) {
  2225. var i, o, a, t;
  2226. const e = l3();
  2227. return e.mask = (i = u.mask) != null ? i : 0, e.x = (o = u.x) != null ? o : 0, e.y = (a = u.y) != null ? a : 0, e.modifiers = ((t = u.modifiers) == null ? void 0 : t.map(s => s)) || [], e
  2228. }
  2229. };
  2230. function E3() {
  2231. return {
  2232. down: !1,
  2233. press: !1,
  2234. control_key: void 0,
  2235. chr: void 0,
  2236. unicode: void 0,
  2237. seq: void 0,
  2238. win2win_hotkey: void 0,
  2239. modifiers: [],
  2240. mode: 0
  2241. }
  2242. }
  2243. const w = {
  2244. encode(u, e = r.Writer.create()) {
  2245. u.down !== !1 && e.uint32(8).bool(u.down), u.press !== !1 && e.uint32(16).bool(u.press), u.control_key !== void 0 && e.uint32(24).int32(u.control_key), u.chr !== void 0 && e.uint32(32).uint32(u.chr), u.unicode !== void 0 && e.uint32(40).uint32(u.unicode), u.seq !== void 0 && e.uint32(50).string(u.seq), u.win2win_hotkey !== void 0 && e.uint32(56).uint32(u.win2win_hotkey), e.uint32(66).fork();
  2246. for (const i of u.modifiers) e.int32(i);
  2247. return e.ldelim(), u.mode !== 0 && e.uint32(72).int32(u.mode), e
  2248. }, decode(u, e) {
  2249. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2250. let o = e === void 0 ? i.len : i.pos + e;
  2251. const a = E3();
  2252. for (; i.pos < o;) {
  2253. const t = i.uint32();
  2254. switch (t >>> 3) {
  2255. case 1:
  2256. if (t !== 8) break;
  2257. a.down = i.bool();
  2258. continue;
  2259. case 2:
  2260. if (t !== 16) break;
  2261. a.press = i.bool();
  2262. continue;
  2263. case 3:
  2264. if (t !== 24) break;
  2265. a.control_key = i.int32();
  2266. continue;
  2267. case 4:
  2268. if (t !== 32) break;
  2269. a.chr = i.uint32();
  2270. continue;
  2271. case 5:
  2272. if (t !== 40) break;
  2273. a.unicode = i.uint32();
  2274. continue;
  2275. case 6:
  2276. if (t !== 50) break;
  2277. a.seq = i.string();
  2278. continue;
  2279. case 7:
  2280. if (t !== 56) break;
  2281. a.win2win_hotkey = i.uint32();
  2282. continue;
  2283. case 8:
  2284. if (t === 64) {
  2285. a.modifiers.push(i.int32());
  2286. continue
  2287. }
  2288. if (t === 66) {
  2289. const s = i.uint32() + i.pos;
  2290. for (; i.pos < s;) a.modifiers.push(i.int32());
  2291. continue
  2292. }
  2293. break;
  2294. case 9:
  2295. if (t !== 72) break;
  2296. a.mode = i.int32();
  2297. continue
  2298. }
  2299. if ((t & 7) === 4 || t === 0) break;
  2300. i.skipType(t & 7)
  2301. }
  2302. return a
  2303. }, fromJSON(u) {
  2304. return {
  2305. down: n(u.down) ? globalThis.Boolean(u.down) : !1,
  2306. press: n(u.press) ? globalThis.Boolean(u.press) : !1,
  2307. control_key: n(u.control_key) ? F4(u.control_key) : void 0,
  2308. chr: n(u.chr) ? globalThis.Number(u.chr) : void 0,
  2309. unicode: n(u.unicode) ? globalThis.Number(u.unicode) : void 0,
  2310. seq: n(u.seq) ? globalThis.String(u.seq) : void 0,
  2311. win2win_hotkey: n(u.win2win_hotkey) ? globalThis.Number(u.win2win_hotkey) : void 0,
  2312. modifiers: globalThis.Array.isArray(u == null ? void 0 : u.modifiers) ? u.modifiers.map(e => F4(e)) : [],
  2313. mode: n(u.mode) ? Ea(u.mode) : 0
  2314. }
  2315. }, toJSON(u) {
  2316. var i;
  2317. const e = {};
  2318. return u.down !== !1 && (e.down = u.down), u.press !== !1 && (e.press = u.press), u.control_key !== void 0 && (e.control_key = T4(u.control_key)), u.chr !== void 0 && (e.chr = Math.round(u.chr)), u.unicode !== void 0 && (e.unicode = Math.round(u.unicode)), u.seq !== void 0 && (e.seq = u.seq), u.win2win_hotkey !== void 0 && (e.win2win_hotkey = Math.round(u.win2win_hotkey)), (i = u.modifiers) != null && i.length && (e.modifiers = u.modifiers.map(o => T4(o))), u.mode !== 0 && (e.mode = da(u.mode)), e
  2319. }, create(u) {
  2320. return w.fromPartial(u != null ? u : {})
  2321. }, fromPartial(u) {
  2322. var i, o, a, t, s, l, E, c, C;
  2323. const e = E3();
  2324. return e.down = (i = u.down) != null ? i : !1, e.press = (o = u.press) != null ? o : !1, e.control_key = (a = u.control_key) != null ? a : void 0, e.chr = (t = u.chr) != null ? t : void 0, e.unicode = (s = u.unicode) != null ? s : void 0, e.seq = (l = u.seq) != null ? l : void 0, e.win2win_hotkey = (E = u.win2win_hotkey) != null ? E : void 0, e.modifiers = ((c = u.modifiers) == null ? void 0 : c.map(D => D)) || [], e.mode = (C = u.mode) != null ? C : 0, e
  2325. }
  2326. };
  2327. function d3() {
  2328. return {id: 0, hotx: 0, hoty: 0, width: 0, height: 0, colors: new Uint8Array(0)}
  2329. }
  2330. const _0 = {
  2331. encode(u, e = r.Writer.create()) {
  2332. return u.id !== 0 && e.uint32(8).uint64(u.id), u.hotx !== 0 && e.uint32(16).sint32(u.hotx), u.hoty !== 0 && e.uint32(24).sint32(u.hoty), u.width !== 0 && e.uint32(32).int32(u.width), u.height !== 0 && e.uint32(40).int32(u.height), u.colors.length !== 0 && e.uint32(50).bytes(u.colors), e
  2333. }, decode(u, e) {
  2334. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2335. let o = e === void 0 ? i.len : i.pos + e;
  2336. const a = d3();
  2337. for (; i.pos < o;) {
  2338. const t = i.uint32();
  2339. switch (t >>> 3) {
  2340. case 1:
  2341. if (t !== 8) break;
  2342. a.id = V(i.uint64());
  2343. continue;
  2344. case 2:
  2345. if (t !== 16) break;
  2346. a.hotx = i.sint32();
  2347. continue;
  2348. case 3:
  2349. if (t !== 24) break;
  2350. a.hoty = i.sint32();
  2351. continue;
  2352. case 4:
  2353. if (t !== 32) break;
  2354. a.width = i.int32();
  2355. continue;
  2356. case 5:
  2357. if (t !== 40) break;
  2358. a.height = i.int32();
  2359. continue;
  2360. case 6:
  2361. if (t !== 50) break;
  2362. a.colors = i.bytes();
  2363. continue
  2364. }
  2365. if ((t & 7) === 4 || t === 0) break;
  2366. i.skipType(t & 7)
  2367. }
  2368. return a
  2369. }, fromJSON(u) {
  2370. return {
  2371. id: n(u.id) ? globalThis.Number(u.id) : 0,
  2372. hotx: n(u.hotx) ? globalThis.Number(u.hotx) : 0,
  2373. hoty: n(u.hoty) ? globalThis.Number(u.hoty) : 0,
  2374. width: n(u.width) ? globalThis.Number(u.width) : 0,
  2375. height: n(u.height) ? globalThis.Number(u.height) : 0,
  2376. colors: n(u.colors) ? R(u.colors) : new Uint8Array(0)
  2377. }
  2378. }, toJSON(u) {
  2379. const e = {};
  2380. return u.id !== 0 && (e.id = Math.round(u.id)), u.hotx !== 0 && (e.hotx = Math.round(u.hotx)), u.hoty !== 0 && (e.hoty = Math.round(u.hoty)), u.width !== 0 && (e.width = Math.round(u.width)), u.height !== 0 && (e.height = Math.round(u.height)), u.colors.length !== 0 && (e.colors = I(u.colors)), e
  2381. }, create(u) {
  2382. return _0.fromPartial(u != null ? u : {})
  2383. }, fromPartial(u) {
  2384. var i, o, a, t, s, l;
  2385. const e = d3();
  2386. return e.id = (i = u.id) != null ? i : 0, e.hotx = (o = u.hotx) != null ? o : 0, e.hoty = (a = u.hoty) != null ? a : 0, e.width = (t = u.width) != null ? t : 0, e.height = (s = u.height) != null ? s : 0, e.colors = (l = u.colors) != null ? l : new Uint8Array(0), e
  2387. }
  2388. };
  2389. function c3() {
  2390. return {x: 0, y: 0}
  2391. }
  2392. const v0 = {
  2393. encode(u, e = r.Writer.create()) {
  2394. return u.x !== 0 && e.uint32(8).sint32(u.x), u.y !== 0 && e.uint32(16).sint32(u.y), e
  2395. }, decode(u, e) {
  2396. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2397. let o = e === void 0 ? i.len : i.pos + e;
  2398. const a = c3();
  2399. for (; i.pos < o;) {
  2400. const t = i.uint32();
  2401. switch (t >>> 3) {
  2402. case 1:
  2403. if (t !== 8) break;
  2404. a.x = i.sint32();
  2405. continue;
  2406. case 2:
  2407. if (t !== 16) break;
  2408. a.y = i.sint32();
  2409. continue
  2410. }
  2411. if ((t & 7) === 4 || t === 0) break;
  2412. i.skipType(t & 7)
  2413. }
  2414. return a
  2415. }, fromJSON(u) {
  2416. return {x: n(u.x) ? globalThis.Number(u.x) : 0, y: n(u.y) ? globalThis.Number(u.y) : 0}
  2417. }, toJSON(u) {
  2418. const e = {};
  2419. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  2420. }, create(u) {
  2421. return v0.fromPartial(u != null ? u : {})
  2422. }, fromPartial(u) {
  2423. var i, o;
  2424. const e = c3();
  2425. return e.x = (i = u.x) != null ? i : 0, e.y = (o = u.y) != null ? o : 0, e
  2426. }
  2427. };
  2428. function C3() {
  2429. return {salt: "", challenge: ""}
  2430. }
  2431. const k0 = {
  2432. encode(u, e = r.Writer.create()) {
  2433. return u.salt !== "" && e.uint32(10).string(u.salt), u.challenge !== "" && e.uint32(18).string(u.challenge), e
  2434. }, decode(u, e) {
  2435. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2436. let o = e === void 0 ? i.len : i.pos + e;
  2437. const a = C3();
  2438. for (; i.pos < o;) {
  2439. const t = i.uint32();
  2440. switch (t >>> 3) {
  2441. case 1:
  2442. if (t !== 10) break;
  2443. a.salt = i.string();
  2444. continue;
  2445. case 2:
  2446. if (t !== 18) break;
  2447. a.challenge = i.string();
  2448. continue
  2449. }
  2450. if ((t & 7) === 4 || t === 0) break;
  2451. i.skipType(t & 7)
  2452. }
  2453. return a
  2454. }, fromJSON(u) {
  2455. return {
  2456. salt: n(u.salt) ? globalThis.String(u.salt) : "",
  2457. challenge: n(u.challenge) ? globalThis.String(u.challenge) : ""
  2458. }
  2459. }, toJSON(u) {
  2460. const e = {};
  2461. return u.salt !== "" && (e.salt = u.salt), u.challenge !== "" && (e.challenge = u.challenge), e
  2462. }, create(u) {
  2463. return k0.fromPartial(u != null ? u : {})
  2464. }, fromPartial(u) {
  2465. var i, o;
  2466. const e = C3();
  2467. return e.salt = (i = u.salt) != null ? i : "", e.challenge = (o = u.challenge) != null ? o : "", e
  2468. }
  2469. };
  2470. function p3() {
  2471. return {compress: !1, content: new Uint8Array(0), width: 0, height: 0, format: 0, special_name: ""}
  2472. }
  2473. const L = {
  2474. encode(u, e = r.Writer.create()) {
  2475. return u.compress !== !1 && e.uint32(8).bool(u.compress), u.content.length !== 0 && e.uint32(18).bytes(u.content), u.width !== 0 && e.uint32(24).int32(u.width), u.height !== 0 && e.uint32(32).int32(u.height), u.format !== 0 && e.uint32(40).int32(u.format), u.special_name !== "" && e.uint32(50).string(u.special_name), e
  2476. }, decode(u, e) {
  2477. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2478. let o = e === void 0 ? i.len : i.pos + e;
  2479. const a = p3();
  2480. for (; i.pos < o;) {
  2481. const t = i.uint32();
  2482. switch (t >>> 3) {
  2483. case 1:
  2484. if (t !== 8) break;
  2485. a.compress = i.bool();
  2486. continue;
  2487. case 2:
  2488. if (t !== 18) break;
  2489. a.content = i.bytes();
  2490. continue;
  2491. case 3:
  2492. if (t !== 24) break;
  2493. a.width = i.int32();
  2494. continue;
  2495. case 4:
  2496. if (t !== 32) break;
  2497. a.height = i.int32();
  2498. continue;
  2499. case 5:
  2500. if (t !== 40) break;
  2501. a.format = i.int32();
  2502. continue;
  2503. case 6:
  2504. if (t !== 50) break;
  2505. a.special_name = i.string();
  2506. continue
  2507. }
  2508. if ((t & 7) === 4 || t === 0) break;
  2509. i.skipType(t & 7)
  2510. }
  2511. return a
  2512. }, fromJSON(u) {
  2513. return {
  2514. compress: n(u.compress) ? globalThis.Boolean(u.compress) : !1,
  2515. content: n(u.content) ? R(u.content) : new Uint8Array(0),
  2516. width: n(u.width) ? globalThis.Number(u.width) : 0,
  2517. height: n(u.height) ? globalThis.Number(u.height) : 0,
  2518. format: n(u.format) ? ca(u.format) : 0,
  2519. special_name: n(u.special_name) ? globalThis.String(u.special_name) : ""
  2520. }
  2521. }, toJSON(u) {
  2522. const e = {};
  2523. return u.compress !== !1 && (e.compress = u.compress), u.content.length !== 0 && (e.content = I(u.content)), u.width !== 0 && (e.width = Math.round(u.width)), u.height !== 0 && (e.height = Math.round(u.height)), u.format !== 0 && (e.format = Ca(u.format)), u.special_name !== "" && (e.special_name = u.special_name), e
  2524. }, create(u) {
  2525. return L.fromPartial(u != null ? u : {})
  2526. }, fromPartial(u) {
  2527. var i, o, a, t, s, l;
  2528. const e = p3();
  2529. return e.compress = (i = u.compress) != null ? i : !1, e.content = (o = u.content) != null ? o : new Uint8Array(0), e.width = (a = u.width) != null ? a : 0, e.height = (t = u.height) != null ? t : 0, e.format = (s = u.format) != null ? s : 0, e.special_name = (l = u.special_name) != null ? l : "", e
  2530. }
  2531. };
  2532. function D3() {
  2533. return {clipboards: []}
  2534. }
  2535. const gu = {
  2536. encode(u, e = r.Writer.create()) {
  2537. for (const i of u.clipboards) L.encode(i, e.uint32(10).fork()).ldelim();
  2538. return e
  2539. }, decode(u, e) {
  2540. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2541. let o = e === void 0 ? i.len : i.pos + e;
  2542. const a = D3();
  2543. for (; i.pos < o;) {
  2544. const t = i.uint32();
  2545. switch (t >>> 3) {
  2546. case 1:
  2547. if (t !== 10) break;
  2548. a.clipboards.push(L.decode(i, i.uint32()));
  2549. continue
  2550. }
  2551. if ((t & 7) === 4 || t === 0) break;
  2552. i.skipType(t & 7)
  2553. }
  2554. return a
  2555. }, fromJSON(u) {
  2556. return {clipboards: globalThis.Array.isArray(u == null ? void 0 : u.clipboards) ? u.clipboards.map(e => L.fromJSON(e)) : []}
  2557. }, toJSON(u) {
  2558. var i;
  2559. const e = {};
  2560. return (i = u.clipboards) != null && i.length && (e.clipboards = u.clipboards.map(o => L.toJSON(o))), e
  2561. }, create(u) {
  2562. return gu.fromPartial(u != null ? u : {})
  2563. }, fromPartial(u) {
  2564. var i;
  2565. const e = D3();
  2566. return e.clipboards = ((i = u.clipboards) == null ? void 0 : i.map(o => L.fromPartial(o))) || [], e
  2567. }
  2568. };
  2569. function B3() {
  2570. return {entry_type: 0, name: "", is_hidden: !1, size: 0, modified_time: 0}
  2571. }
  2572. const W = {
  2573. encode(u, e = r.Writer.create()) {
  2574. return u.entry_type !== 0 && e.uint32(8).int32(u.entry_type), u.name !== "" && e.uint32(18).string(u.name), u.is_hidden !== !1 && e.uint32(24).bool(u.is_hidden), u.size !== 0 && e.uint32(32).uint64(u.size), u.modified_time !== 0 && e.uint32(40).uint64(u.modified_time), e
  2575. }, decode(u, e) {
  2576. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2577. let o = e === void 0 ? i.len : i.pos + e;
  2578. const a = B3();
  2579. for (; i.pos < o;) {
  2580. const t = i.uint32();
  2581. switch (t >>> 3) {
  2582. case 1:
  2583. if (t !== 8) break;
  2584. a.entry_type = i.int32();
  2585. continue;
  2586. case 2:
  2587. if (t !== 18) break;
  2588. a.name = i.string();
  2589. continue;
  2590. case 3:
  2591. if (t !== 24) break;
  2592. a.is_hidden = i.bool();
  2593. continue;
  2594. case 4:
  2595. if (t !== 32) break;
  2596. a.size = V(i.uint64());
  2597. continue;
  2598. case 5:
  2599. if (t !== 40) break;
  2600. a.modified_time = V(i.uint64());
  2601. continue
  2602. }
  2603. if ((t & 7) === 4 || t === 0) break;
  2604. i.skipType(t & 7)
  2605. }
  2606. return a
  2607. }, fromJSON(u) {
  2608. return {
  2609. entry_type: n(u.entry_type) ? pa(u.entry_type) : 0,
  2610. name: n(u.name) ? globalThis.String(u.name) : "",
  2611. is_hidden: n(u.is_hidden) ? globalThis.Boolean(u.is_hidden) : !1,
  2612. size: n(u.size) ? globalThis.Number(u.size) : 0,
  2613. modified_time: n(u.modified_time) ? globalThis.Number(u.modified_time) : 0
  2614. }
  2615. }, toJSON(u) {
  2616. const e = {};
  2617. return u.entry_type !== 0 && (e.entry_type = Da(u.entry_type)), u.name !== "" && (e.name = u.name), u.is_hidden !== !1 && (e.is_hidden = u.is_hidden), u.size !== 0 && (e.size = Math.round(u.size)), u.modified_time !== 0 && (e.modified_time = Math.round(u.modified_time)), e
  2618. }, create(u) {
  2619. return W.fromPartial(u != null ? u : {})
  2620. }, fromPartial(u) {
  2621. var i, o, a, t, s;
  2622. const e = B3();
  2623. return e.entry_type = (i = u.entry_type) != null ? i : 0, e.name = (o = u.name) != null ? o : "", e.is_hidden = (a = u.is_hidden) != null ? a : !1, e.size = (t = u.size) != null ? t : 0, e.modified_time = (s = u.modified_time) != null ? s : 0, e
  2624. }
  2625. };
  2626. function m3() {
  2627. return {id: 0, path: "", entries: []}
  2628. }
  2629. const $ = {
  2630. encode(u, e = r.Writer.create()) {
  2631. u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path);
  2632. for (const i of u.entries) W.encode(i, e.uint32(26).fork()).ldelim();
  2633. return e
  2634. }, decode(u, e) {
  2635. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2636. let o = e === void 0 ? i.len : i.pos + e;
  2637. const a = m3();
  2638. for (; i.pos < o;) {
  2639. const t = i.uint32();
  2640. switch (t >>> 3) {
  2641. case 1:
  2642. if (t !== 8) break;
  2643. a.id = i.int32();
  2644. continue;
  2645. case 2:
  2646. if (t !== 18) break;
  2647. a.path = i.string();
  2648. continue;
  2649. case 3:
  2650. if (t !== 26) break;
  2651. a.entries.push(W.decode(i, i.uint32()));
  2652. continue
  2653. }
  2654. if ((t & 7) === 4 || t === 0) break;
  2655. i.skipType(t & 7)
  2656. }
  2657. return a
  2658. }, fromJSON(u) {
  2659. return {
  2660. id: n(u.id) ? globalThis.Number(u.id) : 0,
  2661. path: n(u.path) ? globalThis.String(u.path) : "",
  2662. entries: globalThis.Array.isArray(u == null ? void 0 : u.entries) ? u.entries.map(e => W.fromJSON(e)) : []
  2663. }
  2664. }, toJSON(u) {
  2665. var i;
  2666. const e = {};
  2667. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), (i = u.entries) != null && i.length && (e.entries = u.entries.map(o => W.toJSON(o))), e
  2668. }, create(u) {
  2669. return $.fromPartial(u != null ? u : {})
  2670. }, fromPartial(u) {
  2671. var i, o, a;
  2672. const e = m3();
  2673. return e.id = (i = u.id) != null ? i : 0, e.path = (o = u.path) != null ? o : "", e.entries = ((a = u.entries) == null ? void 0 : a.map(t => W.fromPartial(t))) || [], e
  2674. }
  2675. };
  2676. function A3() {
  2677. return {path: "", include_hidden: !1}
  2678. }
  2679. const hu = {
  2680. encode(u, e = r.Writer.create()) {
  2681. return u.path !== "" && e.uint32(10).string(u.path), u.include_hidden !== !1 && e.uint32(16).bool(u.include_hidden), e
  2682. }, decode(u, e) {
  2683. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2684. let o = e === void 0 ? i.len : i.pos + e;
  2685. const a = A3();
  2686. for (; i.pos < o;) {
  2687. const t = i.uint32();
  2688. switch (t >>> 3) {
  2689. case 1:
  2690. if (t !== 10) break;
  2691. a.path = i.string();
  2692. continue;
  2693. case 2:
  2694. if (t !== 16) break;
  2695. a.include_hidden = i.bool();
  2696. continue
  2697. }
  2698. if ((t & 7) === 4 || t === 0) break;
  2699. i.skipType(t & 7)
  2700. }
  2701. return a
  2702. }, fromJSON(u) {
  2703. return {
  2704. path: n(u.path) ? globalThis.String(u.path) : "",
  2705. include_hidden: n(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1
  2706. }
  2707. }, toJSON(u) {
  2708. const e = {};
  2709. return u.path !== "" && (e.path = u.path), u.include_hidden !== !1 && (e.include_hidden = u.include_hidden), e
  2710. }, create(u) {
  2711. return hu.fromPartial(u != null ? u : {})
  2712. }, fromPartial(u) {
  2713. var i, o;
  2714. const e = A3();
  2715. return e.path = (i = u.path) != null ? i : "", e.include_hidden = (o = u.include_hidden) != null ? o : !1, e
  2716. }
  2717. };
  2718. function F3() {
  2719. return {path: "", include_hidden: !1}
  2720. }
  2721. const fu = {
  2722. encode(u, e = r.Writer.create()) {
  2723. return u.path !== "" && e.uint32(10).string(u.path), u.include_hidden !== !1 && e.uint32(16).bool(u.include_hidden), e
  2724. }, decode(u, e) {
  2725. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2726. let o = e === void 0 ? i.len : i.pos + e;
  2727. const a = F3();
  2728. for (; i.pos < o;) {
  2729. const t = i.uint32();
  2730. switch (t >>> 3) {
  2731. case 1:
  2732. if (t !== 10) break;
  2733. a.path = i.string();
  2734. continue;
  2735. case 2:
  2736. if (t !== 16) break;
  2737. a.include_hidden = i.bool();
  2738. continue
  2739. }
  2740. if ((t & 7) === 4 || t === 0) break;
  2741. i.skipType(t & 7)
  2742. }
  2743. return a
  2744. }, fromJSON(u) {
  2745. return {
  2746. path: n(u.path) ? globalThis.String(u.path) : "",
  2747. include_hidden: n(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1
  2748. }
  2749. }, toJSON(u) {
  2750. const e = {};
  2751. return u.path !== "" && (e.path = u.path), u.include_hidden !== !1 && (e.include_hidden = u.include_hidden), e
  2752. }, create(u) {
  2753. return fu.fromPartial(u != null ? u : {})
  2754. }, fromPartial(u) {
  2755. var i, o;
  2756. const e = F3();
  2757. return e.path = (i = u.path) != null ? i : "", e.include_hidden = (o = u.include_hidden) != null ? o : !1, e
  2758. }
  2759. };
  2760. function _3() {
  2761. return {path: "", empty_dirs: []}
  2762. }
  2763. const g0 = {
  2764. encode(u, e = r.Writer.create()) {
  2765. u.path !== "" && e.uint32(10).string(u.path);
  2766. for (const i of u.empty_dirs) $.encode(i, e.uint32(18).fork()).ldelim();
  2767. return e
  2768. }, decode(u, e) {
  2769. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2770. let o = e === void 0 ? i.len : i.pos + e;
  2771. const a = _3();
  2772. for (; i.pos < o;) {
  2773. const t = i.uint32();
  2774. switch (t >>> 3) {
  2775. case 1:
  2776. if (t !== 10) break;
  2777. a.path = i.string();
  2778. continue;
  2779. case 2:
  2780. if (t !== 18) break;
  2781. a.empty_dirs.push($.decode(i, i.uint32()));
  2782. continue
  2783. }
  2784. if ((t & 7) === 4 || t === 0) break;
  2785. i.skipType(t & 7)
  2786. }
  2787. return a
  2788. }, fromJSON(u) {
  2789. return {
  2790. path: n(u.path) ? globalThis.String(u.path) : "",
  2791. empty_dirs: globalThis.Array.isArray(u == null ? void 0 : u.empty_dirs) ? u.empty_dirs.map(e => $.fromJSON(e)) : []
  2792. }
  2793. }, toJSON(u) {
  2794. var i;
  2795. const e = {};
  2796. return u.path !== "" && (e.path = u.path), (i = u.empty_dirs) != null && i.length && (e.empty_dirs = u.empty_dirs.map(o => $.toJSON(o))), e
  2797. }, create(u) {
  2798. return g0.fromPartial(u != null ? u : {})
  2799. }, fromPartial(u) {
  2800. var i, o;
  2801. const e = _3();
  2802. return e.path = (i = u.path) != null ? i : "", e.empty_dirs = ((o = u.empty_dirs) == null ? void 0 : o.map(a => $.fromPartial(a))) || [], e
  2803. }
  2804. };
  2805. function v3() {
  2806. return {id: 0, path: "", include_hidden: !1}
  2807. }
  2808. const xu = {
  2809. encode(u, e = r.Writer.create()) {
  2810. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), u.include_hidden !== !1 && e.uint32(24).bool(u.include_hidden), e
  2811. }, decode(u, e) {
  2812. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2813. let o = e === void 0 ? i.len : i.pos + e;
  2814. const a = v3();
  2815. for (; i.pos < o;) {
  2816. const t = i.uint32();
  2817. switch (t >>> 3) {
  2818. case 1:
  2819. if (t !== 8) break;
  2820. a.id = i.int32();
  2821. continue;
  2822. case 2:
  2823. if (t !== 18) break;
  2824. a.path = i.string();
  2825. continue;
  2826. case 3:
  2827. if (t !== 24) break;
  2828. a.include_hidden = i.bool();
  2829. continue
  2830. }
  2831. if ((t & 7) === 4 || t === 0) break;
  2832. i.skipType(t & 7)
  2833. }
  2834. return a
  2835. }, fromJSON(u) {
  2836. return {
  2837. id: n(u.id) ? globalThis.Number(u.id) : 0,
  2838. path: n(u.path) ? globalThis.String(u.path) : "",
  2839. include_hidden: n(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1
  2840. }
  2841. }, toJSON(u) {
  2842. const e = {};
  2843. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), u.include_hidden !== !1 && (e.include_hidden = u.include_hidden), e
  2844. }, create(u) {
  2845. return xu.fromPartial(u != null ? u : {})
  2846. }, fromPartial(u) {
  2847. var i, o, a;
  2848. const e = v3();
  2849. return e.id = (i = u.id) != null ? i : 0, e.path = (o = u.path) != null ? o : "", e.include_hidden = (a = u.include_hidden) != null ? a : !1, e
  2850. }
  2851. };
  2852. function k3() {
  2853. return {id: 0, path: "", new_name: ""}
  2854. }
  2855. const yu = {
  2856. encode(u, e = r.Writer.create()) {
  2857. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), u.new_name !== "" && e.uint32(26).string(u.new_name), e
  2858. }, decode(u, e) {
  2859. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2860. let o = e === void 0 ? i.len : i.pos + e;
  2861. const a = k3();
  2862. for (; i.pos < o;) {
  2863. const t = i.uint32();
  2864. switch (t >>> 3) {
  2865. case 1:
  2866. if (t !== 8) break;
  2867. a.id = i.int32();
  2868. continue;
  2869. case 2:
  2870. if (t !== 18) break;
  2871. a.path = i.string();
  2872. continue;
  2873. case 3:
  2874. if (t !== 26) break;
  2875. a.new_name = i.string();
  2876. continue
  2877. }
  2878. if ((t & 7) === 4 || t === 0) break;
  2879. i.skipType(t & 7)
  2880. }
  2881. return a
  2882. }, fromJSON(u) {
  2883. return {
  2884. id: n(u.id) ? globalThis.Number(u.id) : 0,
  2885. path: n(u.path) ? globalThis.String(u.path) : "",
  2886. new_name: n(u.new_name) ? globalThis.String(u.new_name) : ""
  2887. }
  2888. }, toJSON(u) {
  2889. const e = {};
  2890. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), u.new_name !== "" && (e.new_name = u.new_name), e
  2891. }, create(u) {
  2892. return yu.fromPartial(u != null ? u : {})
  2893. }, fromPartial(u) {
  2894. var i, o, a;
  2895. const e = k3();
  2896. return e.id = (i = u.id) != null ? i : 0, e.path = (o = u.path) != null ? o : "", e.new_name = (a = u.new_name) != null ? a : "", e
  2897. }
  2898. };
  2899. function g3() {
  2900. return {
  2901. read_dir: void 0,
  2902. send: void 0,
  2903. receive: void 0,
  2904. create: void 0,
  2905. remove_dir: void 0,
  2906. remove_file: void 0,
  2907. all_files: void 0,
  2908. cancel: void 0,
  2909. send_confirm: void 0,
  2910. rename: void 0,
  2911. read_empty_dirs: void 0
  2912. }
  2913. }
  2914. const P = {
  2915. encode(u, e = r.Writer.create()) {
  2916. return u.read_dir !== void 0 && hu.encode(u.read_dir, e.uint32(10).fork()).ldelim(), u.send !== void 0 && Pu.encode(u.send, e.uint32(18).fork()).ldelim(), u.receive !== void 0 && Iu.encode(u.receive, e.uint32(26).fork()).ldelim(), u.create !== void 0 && Nu.encode(u.create, e.uint32(34).fork()).ldelim(), u.remove_dir !== void 0 && Tu.encode(u.remove_dir, e.uint32(42).fork()).ldelim(), u.remove_file !== void 0 && ju.encode(u.remove_file, e.uint32(50).fork()).ldelim(), u.all_files !== void 0 && xu.encode(u.all_files, e.uint32(58).fork()).ldelim(), u.cancel !== void 0 && bu.encode(u.cancel, e.uint32(66).fork()).ldelim(), u.send_confirm !== void 0 && cu.encode(u.send_confirm, e.uint32(74).fork()).ldelim(), u.rename !== void 0 && yu.encode(u.rename, e.uint32(82).fork()).ldelim(), u.read_empty_dirs !== void 0 && fu.encode(u.read_empty_dirs, e.uint32(90).fork()).ldelim(), e
  2917. }, decode(u, e) {
  2918. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2919. let o = e === void 0 ? i.len : i.pos + e;
  2920. const a = g3();
  2921. for (; i.pos < o;) {
  2922. const t = i.uint32();
  2923. switch (t >>> 3) {
  2924. case 1:
  2925. if (t !== 10) break;
  2926. a.read_dir = hu.decode(i, i.uint32());
  2927. continue;
  2928. case 2:
  2929. if (t !== 18) break;
  2930. a.send = Pu.decode(i, i.uint32());
  2931. continue;
  2932. case 3:
  2933. if (t !== 26) break;
  2934. a.receive = Iu.decode(i, i.uint32());
  2935. continue;
  2936. case 4:
  2937. if (t !== 34) break;
  2938. a.create = Nu.decode(i, i.uint32());
  2939. continue;
  2940. case 5:
  2941. if (t !== 42) break;
  2942. a.remove_dir = Tu.decode(i, i.uint32());
  2943. continue;
  2944. case 6:
  2945. if (t !== 50) break;
  2946. a.remove_file = ju.decode(i, i.uint32());
  2947. continue;
  2948. case 7:
  2949. if (t !== 58) break;
  2950. a.all_files = xu.decode(i, i.uint32());
  2951. continue;
  2952. case 8:
  2953. if (t !== 66) break;
  2954. a.cancel = bu.decode(i, i.uint32());
  2955. continue;
  2956. case 9:
  2957. if (t !== 74) break;
  2958. a.send_confirm = cu.decode(i, i.uint32());
  2959. continue;
  2960. case 10:
  2961. if (t !== 82) break;
  2962. a.rename = yu.decode(i, i.uint32());
  2963. continue;
  2964. case 11:
  2965. if (t !== 90) break;
  2966. a.read_empty_dirs = fu.decode(i, i.uint32());
  2967. continue
  2968. }
  2969. if ((t & 7) === 4 || t === 0) break;
  2970. i.skipType(t & 7)
  2971. }
  2972. return a
  2973. }, fromJSON(u) {
  2974. return {
  2975. read_dir: n(u.read_dir) ? hu.fromJSON(u.read_dir) : void 0,
  2976. send: n(u.send) ? Pu.fromJSON(u.send) : void 0,
  2977. receive: n(u.receive) ? Iu.fromJSON(u.receive) : void 0,
  2978. create: n(u.create) ? Nu.fromJSON(u.create) : void 0,
  2979. remove_dir: n(u.remove_dir) ? Tu.fromJSON(u.remove_dir) : void 0,
  2980. remove_file: n(u.remove_file) ? ju.fromJSON(u.remove_file) : void 0,
  2981. all_files: n(u.all_files) ? xu.fromJSON(u.all_files) : void 0,
  2982. cancel: n(u.cancel) ? bu.fromJSON(u.cancel) : void 0,
  2983. send_confirm: n(u.send_confirm) ? cu.fromJSON(u.send_confirm) : void 0,
  2984. rename: n(u.rename) ? yu.fromJSON(u.rename) : void 0,
  2985. read_empty_dirs: n(u.read_empty_dirs) ? fu.fromJSON(u.read_empty_dirs) : void 0
  2986. }
  2987. }, toJSON(u) {
  2988. const e = {};
  2989. return u.read_dir !== void 0 && (e.read_dir = hu.toJSON(u.read_dir)), u.send !== void 0 && (e.send = Pu.toJSON(u.send)), u.receive !== void 0 && (e.receive = Iu.toJSON(u.receive)), u.create !== void 0 && (e.create = Nu.toJSON(u.create)), u.remove_dir !== void 0 && (e.remove_dir = Tu.toJSON(u.remove_dir)), u.remove_file !== void 0 && (e.remove_file = ju.toJSON(u.remove_file)), u.all_files !== void 0 && (e.all_files = xu.toJSON(u.all_files)), u.cancel !== void 0 && (e.cancel = bu.toJSON(u.cancel)), u.send_confirm !== void 0 && (e.send_confirm = cu.toJSON(u.send_confirm)), u.rename !== void 0 && (e.rename = yu.toJSON(u.rename)), u.read_empty_dirs !== void 0 && (e.read_empty_dirs = fu.toJSON(u.read_empty_dirs)), e
  2990. }, create(u) {
  2991. return P.fromPartial(u != null ? u : {})
  2992. }, fromPartial(u) {
  2993. const e = g3();
  2994. return e.read_dir = u.read_dir !== void 0 && u.read_dir !== null ? hu.fromPartial(u.read_dir) : void 0, e.send = u.send !== void 0 && u.send !== null ? Pu.fromPartial(u.send) : void 0, e.receive = u.receive !== void 0 && u.receive !== null ? Iu.fromPartial(u.receive) : void 0, e.create = u.create !== void 0 && u.create !== null ? Nu.fromPartial(u.create) : void 0, e.remove_dir = u.remove_dir !== void 0 && u.remove_dir !== null ? Tu.fromPartial(u.remove_dir) : void 0, e.remove_file = u.remove_file !== void 0 && u.remove_file !== null ? ju.fromPartial(u.remove_file) : void 0, e.all_files = u.all_files !== void 0 && u.all_files !== null ? xu.fromPartial(u.all_files) : void 0, e.cancel = u.cancel !== void 0 && u.cancel !== null ? bu.fromPartial(u.cancel) : void 0, e.send_confirm = u.send_confirm !== void 0 && u.send_confirm !== null ? cu.fromPartial(u.send_confirm) : void 0, e.rename = u.rename !== void 0 && u.rename !== null ? yu.fromPartial(u.rename) : void 0, e.read_empty_dirs = u.read_empty_dirs !== void 0 && u.read_empty_dirs !== null ? fu.fromPartial(u.read_empty_dirs) : void 0, e
  2995. }
  2996. };
  2997. function h3() {
  2998. return {id: 0}
  2999. }
  3000. const bu = {
  3001. encode(u, e = r.Writer.create()) {
  3002. return u.id !== 0 && e.uint32(8).int32(u.id), e
  3003. }, decode(u, e) {
  3004. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3005. let o = e === void 0 ? i.len : i.pos + e;
  3006. const a = h3();
  3007. for (; i.pos < o;) {
  3008. const t = i.uint32();
  3009. switch (t >>> 3) {
  3010. case 1:
  3011. if (t !== 8) break;
  3012. a.id = i.int32();
  3013. continue
  3014. }
  3015. if ((t & 7) === 4 || t === 0) break;
  3016. i.skipType(t & 7)
  3017. }
  3018. return a
  3019. }, fromJSON(u) {
  3020. return {id: n(u.id) ? globalThis.Number(u.id) : 0}
  3021. }, toJSON(u) {
  3022. const e = {};
  3023. return u.id !== 0 && (e.id = Math.round(u.id)), e
  3024. }, create(u) {
  3025. return bu.fromPartial(u != null ? u : {})
  3026. }, fromPartial(u) {
  3027. var i;
  3028. const e = h3();
  3029. return e.id = (i = u.id) != null ? i : 0, e
  3030. }
  3031. };
  3032. function f3() {
  3033. return {dir: void 0, block: void 0, error: void 0, done: void 0, digest: void 0, empty_dirs: void 0}
  3034. }
  3035. const nu = {
  3036. encode(u, e = r.Writer.create()) {
  3037. return u.dir !== void 0 && $.encode(u.dir, e.uint32(10).fork()).ldelim(), u.block !== void 0 && Su.encode(u.block, e.uint32(18).fork()).ldelim(), u.error !== void 0 && zu.encode(u.error, e.uint32(26).fork()).ldelim(), u.done !== void 0 && Ru.encode(u.done, e.uint32(34).fork()).ldelim(), u.digest !== void 0 && wu.encode(u.digest, e.uint32(42).fork()).ldelim(), u.empty_dirs !== void 0 && g0.encode(u.empty_dirs, e.uint32(50).fork()).ldelim(), e
  3038. }, decode(u, e) {
  3039. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3040. let o = e === void 0 ? i.len : i.pos + e;
  3041. const a = f3();
  3042. for (; i.pos < o;) {
  3043. const t = i.uint32();
  3044. switch (t >>> 3) {
  3045. case 1:
  3046. if (t !== 10) break;
  3047. a.dir = $.decode(i, i.uint32());
  3048. continue;
  3049. case 2:
  3050. if (t !== 18) break;
  3051. a.block = Su.decode(i, i.uint32());
  3052. continue;
  3053. case 3:
  3054. if (t !== 26) break;
  3055. a.error = zu.decode(i, i.uint32());
  3056. continue;
  3057. case 4:
  3058. if (t !== 34) break;
  3059. a.done = Ru.decode(i, i.uint32());
  3060. continue;
  3061. case 5:
  3062. if (t !== 42) break;
  3063. a.digest = wu.decode(i, i.uint32());
  3064. continue;
  3065. case 6:
  3066. if (t !== 50) break;
  3067. a.empty_dirs = g0.decode(i, i.uint32());
  3068. continue
  3069. }
  3070. if ((t & 7) === 4 || t === 0) break;
  3071. i.skipType(t & 7)
  3072. }
  3073. return a
  3074. }, fromJSON(u) {
  3075. return {
  3076. dir: n(u.dir) ? $.fromJSON(u.dir) : void 0,
  3077. block: n(u.block) ? Su.fromJSON(u.block) : void 0,
  3078. error: n(u.error) ? zu.fromJSON(u.error) : void 0,
  3079. done: n(u.done) ? Ru.fromJSON(u.done) : void 0,
  3080. digest: n(u.digest) ? wu.fromJSON(u.digest) : void 0,
  3081. empty_dirs: n(u.empty_dirs) ? g0.fromJSON(u.empty_dirs) : void 0
  3082. }
  3083. }, toJSON(u) {
  3084. const e = {};
  3085. return u.dir !== void 0 && (e.dir = $.toJSON(u.dir)), u.block !== void 0 && (e.block = Su.toJSON(u.block)), u.error !== void 0 && (e.error = zu.toJSON(u.error)), u.done !== void 0 && (e.done = Ru.toJSON(u.done)), u.digest !== void 0 && (e.digest = wu.toJSON(u.digest)), u.empty_dirs !== void 0 && (e.empty_dirs = g0.toJSON(u.empty_dirs)), e
  3086. }, create(u) {
  3087. return nu.fromPartial(u != null ? u : {})
  3088. }, fromPartial(u) {
  3089. const e = f3();
  3090. return e.dir = u.dir !== void 0 && u.dir !== null ? $.fromPartial(u.dir) : void 0, e.block = u.block !== void 0 && u.block !== null ? Su.fromPartial(u.block) : void 0, e.error = u.error !== void 0 && u.error !== null ? zu.fromPartial(u.error) : void 0, e.done = u.done !== void 0 && u.done !== null ? Ru.fromPartial(u.done) : void 0, e.digest = u.digest !== void 0 && u.digest !== null ? wu.fromPartial(u.digest) : void 0, e.empty_dirs = u.empty_dirs !== void 0 && u.empty_dirs !== null ? g0.fromPartial(u.empty_dirs) : void 0, e
  3091. }
  3092. };
  3093. function x3() {
  3094. return {id: 0, file_num: 0, last_modified: 0, file_size: 0, is_upload: !1, is_identical: !1}
  3095. }
  3096. const wu = {
  3097. encode(u, e = r.Writer.create()) {
  3098. return u.id !== 0 && e.uint32(8).int32(u.id), u.file_num !== 0 && e.uint32(16).sint32(u.file_num), u.last_modified !== 0 && e.uint32(24).uint64(u.last_modified), u.file_size !== 0 && e.uint32(32).uint64(u.file_size), u.is_upload !== !1 && e.uint32(40).bool(u.is_upload), u.is_identical !== !1 && e.uint32(48).bool(u.is_identical), e
  3099. }, decode(u, e) {
  3100. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3101. let o = e === void 0 ? i.len : i.pos + e;
  3102. const a = x3();
  3103. for (; i.pos < o;) {
  3104. const t = i.uint32();
  3105. switch (t >>> 3) {
  3106. case 1:
  3107. if (t !== 8) break;
  3108. a.id = i.int32();
  3109. continue;
  3110. case 2:
  3111. if (t !== 16) break;
  3112. a.file_num = i.sint32();
  3113. continue;
  3114. case 3:
  3115. if (t !== 24) break;
  3116. a.last_modified = V(i.uint64());
  3117. continue;
  3118. case 4:
  3119. if (t !== 32) break;
  3120. a.file_size = V(i.uint64());
  3121. continue;
  3122. case 5:
  3123. if (t !== 40) break;
  3124. a.is_upload = i.bool();
  3125. continue;
  3126. case 6:
  3127. if (t !== 48) break;
  3128. a.is_identical = i.bool();
  3129. continue
  3130. }
  3131. if ((t & 7) === 4 || t === 0) break;
  3132. i.skipType(t & 7)
  3133. }
  3134. return a
  3135. }, fromJSON(u) {
  3136. return {
  3137. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3138. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3139. last_modified: n(u.last_modified) ? globalThis.Number(u.last_modified) : 0,
  3140. file_size: n(u.file_size) ? globalThis.Number(u.file_size) : 0,
  3141. is_upload: n(u.is_upload) ? globalThis.Boolean(u.is_upload) : !1,
  3142. is_identical: n(u.is_identical) ? globalThis.Boolean(u.is_identical) : !1
  3143. }
  3144. }, toJSON(u) {
  3145. const e = {};
  3146. return u.id !== 0 && (e.id = Math.round(u.id)), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), u.last_modified !== 0 && (e.last_modified = Math.round(u.last_modified)), u.file_size !== 0 && (e.file_size = Math.round(u.file_size)), u.is_upload !== !1 && (e.is_upload = u.is_upload), u.is_identical !== !1 && (e.is_identical = u.is_identical), e
  3147. }, create(u) {
  3148. return wu.fromPartial(u != null ? u : {})
  3149. }, fromPartial(u) {
  3150. var i, o, a, t, s, l;
  3151. const e = x3();
  3152. return e.id = (i = u.id) != null ? i : 0, e.file_num = (o = u.file_num) != null ? o : 0, e.last_modified = (a = u.last_modified) != null ? a : 0, e.file_size = (t = u.file_size) != null ? t : 0, e.is_upload = (s = u.is_upload) != null ? s : !1, e.is_identical = (l = u.is_identical) != null ? l : !1, e
  3153. }
  3154. };
  3155. function y3() {
  3156. return {id: 0, file_num: 0, data: new Uint8Array(0), compressed: !1, blk_id: 0}
  3157. }
  3158. const Su = {
  3159. encode(u, e = r.Writer.create()) {
  3160. return u.id !== 0 && e.uint32(8).int32(u.id), u.file_num !== 0 && e.uint32(16).sint32(u.file_num), u.data.length !== 0 && e.uint32(26).bytes(u.data), u.compressed !== !1 && e.uint32(32).bool(u.compressed), u.blk_id !== 0 && e.uint32(40).uint32(u.blk_id), e
  3161. }, decode(u, e) {
  3162. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3163. let o = e === void 0 ? i.len : i.pos + e;
  3164. const a = y3();
  3165. for (; i.pos < o;) {
  3166. const t = i.uint32();
  3167. switch (t >>> 3) {
  3168. case 1:
  3169. if (t !== 8) break;
  3170. a.id = i.int32();
  3171. continue;
  3172. case 2:
  3173. if (t !== 16) break;
  3174. a.file_num = i.sint32();
  3175. continue;
  3176. case 3:
  3177. if (t !== 26) break;
  3178. a.data = i.bytes();
  3179. continue;
  3180. case 4:
  3181. if (t !== 32) break;
  3182. a.compressed = i.bool();
  3183. continue;
  3184. case 5:
  3185. if (t !== 40) break;
  3186. a.blk_id = i.uint32();
  3187. continue
  3188. }
  3189. if ((t & 7) === 4 || t === 0) break;
  3190. i.skipType(t & 7)
  3191. }
  3192. return a
  3193. }, fromJSON(u) {
  3194. return {
  3195. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3196. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3197. data: n(u.data) ? R(u.data) : new Uint8Array(0),
  3198. compressed: n(u.compressed) ? globalThis.Boolean(u.compressed) : !1,
  3199. blk_id: n(u.blk_id) ? globalThis.Number(u.blk_id) : 0
  3200. }
  3201. }, toJSON(u) {
  3202. const e = {};
  3203. return u.id !== 0 && (e.id = Math.round(u.id)), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), u.data.length !== 0 && (e.data = I(u.data)), u.compressed !== !1 && (e.compressed = u.compressed), u.blk_id !== 0 && (e.blk_id = Math.round(u.blk_id)), e
  3204. }, create(u) {
  3205. return Su.fromPartial(u != null ? u : {})
  3206. }, fromPartial(u) {
  3207. var i, o, a, t, s;
  3208. const e = y3();
  3209. return e.id = (i = u.id) != null ? i : 0, e.file_num = (o = u.file_num) != null ? o : 0, e.data = (a = u.data) != null ? a : new Uint8Array(0), e.compressed = (t = u.compressed) != null ? t : !1, e.blk_id = (s = u.blk_id) != null ? s : 0, e
  3210. }
  3211. };
  3212. function b3() {
  3213. return {id: 0, error: "", file_num: 0}
  3214. }
  3215. const zu = {
  3216. encode(u, e = r.Writer.create()) {
  3217. return u.id !== 0 && e.uint32(8).int32(u.id), u.error !== "" && e.uint32(18).string(u.error), u.file_num !== 0 && e.uint32(24).sint32(u.file_num), e
  3218. }, decode(u, e) {
  3219. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3220. let o = e === void 0 ? i.len : i.pos + e;
  3221. const a = b3();
  3222. for (; i.pos < o;) {
  3223. const t = i.uint32();
  3224. switch (t >>> 3) {
  3225. case 1:
  3226. if (t !== 8) break;
  3227. a.id = i.int32();
  3228. continue;
  3229. case 2:
  3230. if (t !== 18) break;
  3231. a.error = i.string();
  3232. continue;
  3233. case 3:
  3234. if (t !== 24) break;
  3235. a.file_num = i.sint32();
  3236. continue
  3237. }
  3238. if ((t & 7) === 4 || t === 0) break;
  3239. i.skipType(t & 7)
  3240. }
  3241. return a
  3242. }, fromJSON(u) {
  3243. return {
  3244. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3245. error: n(u.error) ? globalThis.String(u.error) : "",
  3246. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0
  3247. }
  3248. }, toJSON(u) {
  3249. const e = {};
  3250. return u.id !== 0 && (e.id = Math.round(u.id)), u.error !== "" && (e.error = u.error), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), e
  3251. }, create(u) {
  3252. return zu.fromPartial(u != null ? u : {})
  3253. }, fromPartial(u) {
  3254. var i, o, a;
  3255. const e = b3();
  3256. return e.id = (i = u.id) != null ? i : 0, e.error = (o = u.error) != null ? o : "", e.file_num = (a = u.file_num) != null ? a : 0, e
  3257. }
  3258. };
  3259. function w3() {
  3260. return {id: 0, path: "", include_hidden: !1, file_num: 0}
  3261. }
  3262. const Pu = {
  3263. encode(u, e = r.Writer.create()) {
  3264. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), u.include_hidden !== !1 && e.uint32(24).bool(u.include_hidden), u.file_num !== 0 && e.uint32(32).int32(u.file_num), e
  3265. }, decode(u, e) {
  3266. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3267. let o = e === void 0 ? i.len : i.pos + e;
  3268. const a = w3();
  3269. for (; i.pos < o;) {
  3270. const t = i.uint32();
  3271. switch (t >>> 3) {
  3272. case 1:
  3273. if (t !== 8) break;
  3274. a.id = i.int32();
  3275. continue;
  3276. case 2:
  3277. if (t !== 18) break;
  3278. a.path = i.string();
  3279. continue;
  3280. case 3:
  3281. if (t !== 24) break;
  3282. a.include_hidden = i.bool();
  3283. continue;
  3284. case 4:
  3285. if (t !== 32) break;
  3286. a.file_num = i.int32();
  3287. continue
  3288. }
  3289. if ((t & 7) === 4 || t === 0) break;
  3290. i.skipType(t & 7)
  3291. }
  3292. return a
  3293. }, fromJSON(u) {
  3294. return {
  3295. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3296. path: n(u.path) ? globalThis.String(u.path) : "",
  3297. include_hidden: n(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1,
  3298. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0
  3299. }
  3300. }, toJSON(u) {
  3301. const e = {};
  3302. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), u.include_hidden !== !1 && (e.include_hidden = u.include_hidden), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), e
  3303. }, create(u) {
  3304. return Pu.fromPartial(u != null ? u : {})
  3305. }, fromPartial(u) {
  3306. var i, o, a, t;
  3307. const e = w3();
  3308. return e.id = (i = u.id) != null ? i : 0, e.path = (o = u.path) != null ? o : "", e.include_hidden = (a = u.include_hidden) != null ? a : !1, e.file_num = (t = u.file_num) != null ? t : 0, e
  3309. }
  3310. };
  3311. function S3() {
  3312. return {id: 0, file_num: 0, skip: void 0, offset_blk: void 0}
  3313. }
  3314. const cu = {
  3315. encode(u, e = r.Writer.create()) {
  3316. return u.id !== 0 && e.uint32(8).int32(u.id), u.file_num !== 0 && e.uint32(16).sint32(u.file_num), u.skip !== void 0 && e.uint32(24).bool(u.skip), u.offset_blk !== void 0 && e.uint32(32).uint32(u.offset_blk), e
  3317. }, decode(u, e) {
  3318. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3319. let o = e === void 0 ? i.len : i.pos + e;
  3320. const a = S3();
  3321. for (; i.pos < o;) {
  3322. const t = i.uint32();
  3323. switch (t >>> 3) {
  3324. case 1:
  3325. if (t !== 8) break;
  3326. a.id = i.int32();
  3327. continue;
  3328. case 2:
  3329. if (t !== 16) break;
  3330. a.file_num = i.sint32();
  3331. continue;
  3332. case 3:
  3333. if (t !== 24) break;
  3334. a.skip = i.bool();
  3335. continue;
  3336. case 4:
  3337. if (t !== 32) break;
  3338. a.offset_blk = i.uint32();
  3339. continue
  3340. }
  3341. if ((t & 7) === 4 || t === 0) break;
  3342. i.skipType(t & 7)
  3343. }
  3344. return a
  3345. }, fromJSON(u) {
  3346. return {
  3347. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3348. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3349. skip: n(u.skip) ? globalThis.Boolean(u.skip) : void 0,
  3350. offset_blk: n(u.offset_blk) ? globalThis.Number(u.offset_blk) : void 0
  3351. }
  3352. }, toJSON(u) {
  3353. const e = {};
  3354. return u.id !== 0 && (e.id = Math.round(u.id)), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), u.skip !== void 0 && (e.skip = u.skip), u.offset_blk !== void 0 && (e.offset_blk = Math.round(u.offset_blk)), e
  3355. }, create(u) {
  3356. return cu.fromPartial(u != null ? u : {})
  3357. }, fromPartial(u) {
  3358. var i, o, a, t;
  3359. const e = S3();
  3360. return e.id = (i = u.id) != null ? i : 0, e.file_num = (o = u.file_num) != null ? o : 0, e.skip = (a = u.skip) != null ? a : void 0, e.offset_blk = (t = u.offset_blk) != null ? t : void 0, e
  3361. }
  3362. };
  3363. function z3() {
  3364. return {id: 0, file_num: 0}
  3365. }
  3366. const Ru = {
  3367. encode(u, e = r.Writer.create()) {
  3368. return u.id !== 0 && e.uint32(8).int32(u.id), u.file_num !== 0 && e.uint32(16).sint32(u.file_num), e
  3369. }, decode(u, e) {
  3370. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3371. let o = e === void 0 ? i.len : i.pos + e;
  3372. const a = z3();
  3373. for (; i.pos < o;) {
  3374. const t = i.uint32();
  3375. switch (t >>> 3) {
  3376. case 1:
  3377. if (t !== 8) break;
  3378. a.id = i.int32();
  3379. continue;
  3380. case 2:
  3381. if (t !== 16) break;
  3382. a.file_num = i.sint32();
  3383. continue
  3384. }
  3385. if ((t & 7) === 4 || t === 0) break;
  3386. i.skipType(t & 7)
  3387. }
  3388. return a
  3389. }, fromJSON(u) {
  3390. return {id: n(u.id) ? globalThis.Number(u.id) : 0, file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0}
  3391. }, toJSON(u) {
  3392. const e = {};
  3393. return u.id !== 0 && (e.id = Math.round(u.id)), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), e
  3394. }, create(u) {
  3395. return Ru.fromPartial(u != null ? u : {})
  3396. }, fromPartial(u) {
  3397. var i, o;
  3398. const e = z3();
  3399. return e.id = (i = u.id) != null ? i : 0, e.file_num = (o = u.file_num) != null ? o : 0, e
  3400. }
  3401. };
  3402. function P3() {
  3403. return {id: 0, path: "", files: [], file_num: 0, total_size: 0}
  3404. }
  3405. const Iu = {
  3406. encode(u, e = r.Writer.create()) {
  3407. u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path);
  3408. for (const i of u.files) W.encode(i, e.uint32(26).fork()).ldelim();
  3409. return u.file_num !== 0 && e.uint32(32).int32(u.file_num), u.total_size !== 0 && e.uint32(40).uint64(u.total_size), e
  3410. }, decode(u, e) {
  3411. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3412. let o = e === void 0 ? i.len : i.pos + e;
  3413. const a = P3();
  3414. for (; i.pos < o;) {
  3415. const t = i.uint32();
  3416. switch (t >>> 3) {
  3417. case 1:
  3418. if (t !== 8) break;
  3419. a.id = i.int32();
  3420. continue;
  3421. case 2:
  3422. if (t !== 18) break;
  3423. a.path = i.string();
  3424. continue;
  3425. case 3:
  3426. if (t !== 26) break;
  3427. a.files.push(W.decode(i, i.uint32()));
  3428. continue;
  3429. case 4:
  3430. if (t !== 32) break;
  3431. a.file_num = i.int32();
  3432. continue;
  3433. case 5:
  3434. if (t !== 40) break;
  3435. a.total_size = V(i.uint64());
  3436. continue
  3437. }
  3438. if ((t & 7) === 4 || t === 0) break;
  3439. i.skipType(t & 7)
  3440. }
  3441. return a
  3442. }, fromJSON(u) {
  3443. return {
  3444. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3445. path: n(u.path) ? globalThis.String(u.path) : "",
  3446. files: globalThis.Array.isArray(u == null ? void 0 : u.files) ? u.files.map(e => W.fromJSON(e)) : [],
  3447. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3448. total_size: n(u.total_size) ? globalThis.Number(u.total_size) : 0
  3449. }
  3450. }, toJSON(u) {
  3451. var i;
  3452. const e = {};
  3453. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), (i = u.files) != null && i.length && (e.files = u.files.map(o => W.toJSON(o))), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), u.total_size !== 0 && (e.total_size = Math.round(u.total_size)), e
  3454. }, create(u) {
  3455. return Iu.fromPartial(u != null ? u : {})
  3456. }, fromPartial(u) {
  3457. var i, o, a, t, s;
  3458. const e = P3();
  3459. return e.id = (i = u.id) != null ? i : 0, e.path = (o = u.path) != null ? o : "", e.files = ((a = u.files) == null ? void 0 : a.map(l => W.fromPartial(l))) || [], e.file_num = (t = u.file_num) != null ? t : 0, e.total_size = (s = u.total_size) != null ? s : 0, e
  3460. }
  3461. };
  3462. function R3() {
  3463. return {id: 0, path: "", recursive: !1}
  3464. }
  3465. const Tu = {
  3466. encode(u, e = r.Writer.create()) {
  3467. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), u.recursive !== !1 && e.uint32(24).bool(u.recursive), e
  3468. }, decode(u, e) {
  3469. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3470. let o = e === void 0 ? i.len : i.pos + e;
  3471. const a = R3();
  3472. for (; i.pos < o;) {
  3473. const t = i.uint32();
  3474. switch (t >>> 3) {
  3475. case 1:
  3476. if (t !== 8) break;
  3477. a.id = i.int32();
  3478. continue;
  3479. case 2:
  3480. if (t !== 18) break;
  3481. a.path = i.string();
  3482. continue;
  3483. case 3:
  3484. if (t !== 24) break;
  3485. a.recursive = i.bool();
  3486. continue
  3487. }
  3488. if ((t & 7) === 4 || t === 0) break;
  3489. i.skipType(t & 7)
  3490. }
  3491. return a
  3492. }, fromJSON(u) {
  3493. return {
  3494. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3495. path: n(u.path) ? globalThis.String(u.path) : "",
  3496. recursive: n(u.recursive) ? globalThis.Boolean(u.recursive) : !1
  3497. }
  3498. }, toJSON(u) {
  3499. const e = {};
  3500. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), u.recursive !== !1 && (e.recursive = u.recursive), e
  3501. }, create(u) {
  3502. return Tu.fromPartial(u != null ? u : {})
  3503. }, fromPartial(u) {
  3504. var i, o, a;
  3505. const e = R3();
  3506. return e.id = (i = u.id) != null ? i : 0, e.path = (o = u.path) != null ? o : "", e.recursive = (a = u.recursive) != null ? a : !1, e
  3507. }
  3508. };
  3509. function I3() {
  3510. return {id: 0, path: "", file_num: 0}
  3511. }
  3512. const ju = {
  3513. encode(u, e = r.Writer.create()) {
  3514. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), u.file_num !== 0 && e.uint32(24).sint32(u.file_num), e
  3515. }, decode(u, e) {
  3516. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3517. let o = e === void 0 ? i.len : i.pos + e;
  3518. const a = I3();
  3519. for (; i.pos < o;) {
  3520. const t = i.uint32();
  3521. switch (t >>> 3) {
  3522. case 1:
  3523. if (t !== 8) break;
  3524. a.id = i.int32();
  3525. continue;
  3526. case 2:
  3527. if (t !== 18) break;
  3528. a.path = i.string();
  3529. continue;
  3530. case 3:
  3531. if (t !== 24) break;
  3532. a.file_num = i.sint32();
  3533. continue
  3534. }
  3535. if ((t & 7) === 4 || t === 0) break;
  3536. i.skipType(t & 7)
  3537. }
  3538. return a
  3539. }, fromJSON(u) {
  3540. return {
  3541. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3542. path: n(u.path) ? globalThis.String(u.path) : "",
  3543. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0
  3544. }
  3545. }, toJSON(u) {
  3546. const e = {};
  3547. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), e
  3548. }, create(u) {
  3549. return ju.fromPartial(u != null ? u : {})
  3550. }, fromPartial(u) {
  3551. var i, o, a;
  3552. const e = I3();
  3553. return e.id = (i = u.id) != null ? i : 0, e.path = (o = u.path) != null ? o : "", e.file_num = (a = u.file_num) != null ? a : 0, e
  3554. }
  3555. };
  3556. function T3() {
  3557. return {id: 0, path: ""}
  3558. }
  3559. const Nu = {
  3560. encode(u, e = r.Writer.create()) {
  3561. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), e
  3562. }, decode(u, e) {
  3563. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3564. let o = e === void 0 ? i.len : i.pos + e;
  3565. const a = T3();
  3566. for (; i.pos < o;) {
  3567. const t = i.uint32();
  3568. switch (t >>> 3) {
  3569. case 1:
  3570. if (t !== 8) break;
  3571. a.id = i.int32();
  3572. continue;
  3573. case 2:
  3574. if (t !== 18) break;
  3575. a.path = i.string();
  3576. continue
  3577. }
  3578. if ((t & 7) === 4 || t === 0) break;
  3579. i.skipType(t & 7)
  3580. }
  3581. return a
  3582. }, fromJSON(u) {
  3583. return {id: n(u.id) ? globalThis.Number(u.id) : 0, path: n(u.path) ? globalThis.String(u.path) : ""}
  3584. }, toJSON(u) {
  3585. const e = {};
  3586. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), e
  3587. }, create(u) {
  3588. return Nu.fromPartial(u != null ? u : {})
  3589. }, fromPartial(u) {
  3590. var i, o;
  3591. const e = T3();
  3592. return e.id = (i = u.id) != null ? i : 0, e.path = (o = u.path) != null ? o : "", e
  3593. }
  3594. };
  3595. function j3() {
  3596. return {}
  3597. }
  3598. const h0 = {
  3599. encode(u, e = r.Writer.create()) {
  3600. return e
  3601. }, decode(u, e) {
  3602. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3603. let o = e === void 0 ? i.len : i.pos + e;
  3604. const a = j3();
  3605. for (; i.pos < o;) {
  3606. const t = i.uint32();
  3607. if ((t & 7) === 4 || t === 0) break;
  3608. i.skipType(t & 7)
  3609. }
  3610. return a
  3611. }, fromJSON(u) {
  3612. return {}
  3613. }, toJSON(u) {
  3614. return {}
  3615. }, create(u) {
  3616. return h0.fromPartial(u != null ? u : {})
  3617. }, fromPartial(u) {
  3618. return j3()
  3619. }
  3620. };
  3621. function N3() {
  3622. return {id: 0, format: ""}
  3623. }
  3624. const f0 = {
  3625. encode(u, e = r.Writer.create()) {
  3626. return u.id !== 0 && e.uint32(16).int32(u.id), u.format !== "" && e.uint32(26).string(u.format), e
  3627. }, decode(u, e) {
  3628. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3629. let o = e === void 0 ? i.len : i.pos + e;
  3630. const a = N3();
  3631. for (; i.pos < o;) {
  3632. const t = i.uint32();
  3633. switch (t >>> 3) {
  3634. case 2:
  3635. if (t !== 16) break;
  3636. a.id = i.int32();
  3637. continue;
  3638. case 3:
  3639. if (t !== 26) break;
  3640. a.format = i.string();
  3641. continue
  3642. }
  3643. if ((t & 7) === 4 || t === 0) break;
  3644. i.skipType(t & 7)
  3645. }
  3646. return a
  3647. }, fromJSON(u) {
  3648. return {id: n(u.id) ? globalThis.Number(u.id) : 0, format: n(u.format) ? globalThis.String(u.format) : ""}
  3649. }, toJSON(u) {
  3650. const e = {};
  3651. return u.id !== 0 && (e.id = Math.round(u.id)), u.format !== "" && (e.format = u.format), e
  3652. }, create(u) {
  3653. return f0.fromPartial(u != null ? u : {})
  3654. }, fromPartial(u) {
  3655. var i, o;
  3656. const e = N3();
  3657. return e.id = (i = u.id) != null ? i : 0, e.format = (o = u.format) != null ? o : "", e
  3658. }
  3659. };
  3660. function O3() {
  3661. return {formats: []}
  3662. }
  3663. const x0 = {
  3664. encode(u, e = r.Writer.create()) {
  3665. for (const i of u.formats) f0.encode(i, e.uint32(18).fork()).ldelim();
  3666. return e
  3667. }, decode(u, e) {
  3668. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3669. let o = e === void 0 ? i.len : i.pos + e;
  3670. const a = O3();
  3671. for (; i.pos < o;) {
  3672. const t = i.uint32();
  3673. switch (t >>> 3) {
  3674. case 2:
  3675. if (t !== 18) break;
  3676. a.formats.push(f0.decode(i, i.uint32()));
  3677. continue
  3678. }
  3679. if ((t & 7) === 4 || t === 0) break;
  3680. i.skipType(t & 7)
  3681. }
  3682. return a
  3683. }, fromJSON(u) {
  3684. return {formats: globalThis.Array.isArray(u == null ? void 0 : u.formats) ? u.formats.map(e => f0.fromJSON(e)) : []}
  3685. }, toJSON(u) {
  3686. var i;
  3687. const e = {};
  3688. return (i = u.formats) != null && i.length && (e.formats = u.formats.map(o => f0.toJSON(o))), e
  3689. }, create(u) {
  3690. return x0.fromPartial(u != null ? u : {})
  3691. }, fromPartial(u) {
  3692. var i;
  3693. const e = O3();
  3694. return e.formats = ((i = u.formats) == null ? void 0 : i.map(o => f0.fromPartial(o))) || [], e
  3695. }
  3696. };
  3697. function M3() {
  3698. return {msg_flags: 0}
  3699. }
  3700. const y0 = {
  3701. encode(u, e = r.Writer.create()) {
  3702. return u.msg_flags !== 0 && e.uint32(16).int32(u.msg_flags), e
  3703. }, decode(u, e) {
  3704. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3705. let o = e === void 0 ? i.len : i.pos + e;
  3706. const a = M3();
  3707. for (; i.pos < o;) {
  3708. const t = i.uint32();
  3709. switch (t >>> 3) {
  3710. case 2:
  3711. if (t !== 16) break;
  3712. a.msg_flags = i.int32();
  3713. continue
  3714. }
  3715. if ((t & 7) === 4 || t === 0) break;
  3716. i.skipType(t & 7)
  3717. }
  3718. return a
  3719. }, fromJSON(u) {
  3720. return {msg_flags: n(u.msg_flags) ? globalThis.Number(u.msg_flags) : 0}
  3721. }, toJSON(u) {
  3722. const e = {};
  3723. return u.msg_flags !== 0 && (e.msg_flags = Math.round(u.msg_flags)), e
  3724. }, create(u) {
  3725. return y0.fromPartial(u != null ? u : {})
  3726. }, fromPartial(u) {
  3727. var i;
  3728. const e = M3();
  3729. return e.msg_flags = (i = u.msg_flags) != null ? i : 0, e
  3730. }
  3731. };
  3732. function U3() {
  3733. return {requested_format_id: 0}
  3734. }
  3735. const b0 = {
  3736. encode(u, e = r.Writer.create()) {
  3737. return u.requested_format_id !== 0 && e.uint32(16).int32(u.requested_format_id), e
  3738. }, decode(u, e) {
  3739. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3740. let o = e === void 0 ? i.len : i.pos + e;
  3741. const a = U3();
  3742. for (; i.pos < o;) {
  3743. const t = i.uint32();
  3744. switch (t >>> 3) {
  3745. case 2:
  3746. if (t !== 16) break;
  3747. a.requested_format_id = i.int32();
  3748. continue
  3749. }
  3750. if ((t & 7) === 4 || t === 0) break;
  3751. i.skipType(t & 7)
  3752. }
  3753. return a
  3754. }, fromJSON(u) {
  3755. return {requested_format_id: n(u.requested_format_id) ? globalThis.Number(u.requested_format_id) : 0}
  3756. }, toJSON(u) {
  3757. const e = {};
  3758. return u.requested_format_id !== 0 && (e.requested_format_id = Math.round(u.requested_format_id)), e
  3759. }, create(u) {
  3760. return b0.fromPartial(u != null ? u : {})
  3761. }, fromPartial(u) {
  3762. var i;
  3763. const e = U3();
  3764. return e.requested_format_id = (i = u.requested_format_id) != null ? i : 0, e
  3765. }
  3766. };
  3767. function L3() {
  3768. return {msg_flags: 0, format_data: new Uint8Array(0)}
  3769. }
  3770. const w0 = {
  3771. encode(u, e = r.Writer.create()) {
  3772. return u.msg_flags !== 0 && e.uint32(16).int32(u.msg_flags), u.format_data.length !== 0 && e.uint32(26).bytes(u.format_data), e
  3773. }, decode(u, e) {
  3774. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3775. let o = e === void 0 ? i.len : i.pos + e;
  3776. const a = L3();
  3777. for (; i.pos < o;) {
  3778. const t = i.uint32();
  3779. switch (t >>> 3) {
  3780. case 2:
  3781. if (t !== 16) break;
  3782. a.msg_flags = i.int32();
  3783. continue;
  3784. case 3:
  3785. if (t !== 26) break;
  3786. a.format_data = i.bytes();
  3787. continue
  3788. }
  3789. if ((t & 7) === 4 || t === 0) break;
  3790. i.skipType(t & 7)
  3791. }
  3792. return a
  3793. }, fromJSON(u) {
  3794. return {
  3795. msg_flags: n(u.msg_flags) ? globalThis.Number(u.msg_flags) : 0,
  3796. format_data: n(u.format_data) ? R(u.format_data) : new Uint8Array(0)
  3797. }
  3798. }, toJSON(u) {
  3799. const e = {};
  3800. return u.msg_flags !== 0 && (e.msg_flags = Math.round(u.msg_flags)), u.format_data.length !== 0 && (e.format_data = I(u.format_data)), e
  3801. }, create(u) {
  3802. return w0.fromPartial(u != null ? u : {})
  3803. }, fromPartial(u) {
  3804. var i, o;
  3805. const e = L3();
  3806. return e.msg_flags = (i = u.msg_flags) != null ? i : 0, e.format_data = (o = u.format_data) != null ? o : new Uint8Array(0), e
  3807. }
  3808. };
  3809. function W3() {
  3810. return {
  3811. stream_id: 0,
  3812. list_index: 0,
  3813. dw_flags: 0,
  3814. n_position_low: 0,
  3815. n_position_high: 0,
  3816. cb_requested: 0,
  3817. have_clip_data_id: !1,
  3818. clip_data_id: 0
  3819. }
  3820. }
  3821. const S0 = {
  3822. encode(u, e = r.Writer.create()) {
  3823. return u.stream_id !== 0 && e.uint32(16).int32(u.stream_id), u.list_index !== 0 && e.uint32(24).int32(u.list_index), u.dw_flags !== 0 && e.uint32(32).int32(u.dw_flags), u.n_position_low !== 0 && e.uint32(40).int32(u.n_position_low), u.n_position_high !== 0 && e.uint32(48).int32(u.n_position_high), u.cb_requested !== 0 && e.uint32(56).int32(u.cb_requested), u.have_clip_data_id !== !1 && e.uint32(64).bool(u.have_clip_data_id), u.clip_data_id !== 0 && e.uint32(72).int32(u.clip_data_id), e
  3824. }, decode(u, e) {
  3825. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3826. let o = e === void 0 ? i.len : i.pos + e;
  3827. const a = W3();
  3828. for (; i.pos < o;) {
  3829. const t = i.uint32();
  3830. switch (t >>> 3) {
  3831. case 2:
  3832. if (t !== 16) break;
  3833. a.stream_id = i.int32();
  3834. continue;
  3835. case 3:
  3836. if (t !== 24) break;
  3837. a.list_index = i.int32();
  3838. continue;
  3839. case 4:
  3840. if (t !== 32) break;
  3841. a.dw_flags = i.int32();
  3842. continue;
  3843. case 5:
  3844. if (t !== 40) break;
  3845. a.n_position_low = i.int32();
  3846. continue;
  3847. case 6:
  3848. if (t !== 48) break;
  3849. a.n_position_high = i.int32();
  3850. continue;
  3851. case 7:
  3852. if (t !== 56) break;
  3853. a.cb_requested = i.int32();
  3854. continue;
  3855. case 8:
  3856. if (t !== 64) break;
  3857. a.have_clip_data_id = i.bool();
  3858. continue;
  3859. case 9:
  3860. if (t !== 72) break;
  3861. a.clip_data_id = i.int32();
  3862. continue
  3863. }
  3864. if ((t & 7) === 4 || t === 0) break;
  3865. i.skipType(t & 7)
  3866. }
  3867. return a
  3868. }, fromJSON(u) {
  3869. return {
  3870. stream_id: n(u.stream_id) ? globalThis.Number(u.stream_id) : 0,
  3871. list_index: n(u.list_index) ? globalThis.Number(u.list_index) : 0,
  3872. dw_flags: n(u.dw_flags) ? globalThis.Number(u.dw_flags) : 0,
  3873. n_position_low: n(u.n_position_low) ? globalThis.Number(u.n_position_low) : 0,
  3874. n_position_high: n(u.n_position_high) ? globalThis.Number(u.n_position_high) : 0,
  3875. cb_requested: n(u.cb_requested) ? globalThis.Number(u.cb_requested) : 0,
  3876. have_clip_data_id: n(u.have_clip_data_id) ? globalThis.Boolean(u.have_clip_data_id) : !1,
  3877. clip_data_id: n(u.clip_data_id) ? globalThis.Number(u.clip_data_id) : 0
  3878. }
  3879. }, toJSON(u) {
  3880. const e = {};
  3881. return u.stream_id !== 0 && (e.stream_id = Math.round(u.stream_id)), u.list_index !== 0 && (e.list_index = Math.round(u.list_index)), u.dw_flags !== 0 && (e.dw_flags = Math.round(u.dw_flags)), u.n_position_low !== 0 && (e.n_position_low = Math.round(u.n_position_low)), u.n_position_high !== 0 && (e.n_position_high = Math.round(u.n_position_high)), u.cb_requested !== 0 && (e.cb_requested = Math.round(u.cb_requested)), u.have_clip_data_id !== !1 && (e.have_clip_data_id = u.have_clip_data_id), u.clip_data_id !== 0 && (e.clip_data_id = Math.round(u.clip_data_id)), e
  3882. }, create(u) {
  3883. return S0.fromPartial(u != null ? u : {})
  3884. }, fromPartial(u) {
  3885. var i, o, a, t, s, l, E, c;
  3886. const e = W3();
  3887. return e.stream_id = (i = u.stream_id) != null ? i : 0, e.list_index = (o = u.list_index) != null ? o : 0, e.dw_flags = (a = u.dw_flags) != null ? a : 0, e.n_position_low = (t = u.n_position_low) != null ? t : 0, e.n_position_high = (s = u.n_position_high) != null ? s : 0, e.cb_requested = (l = u.cb_requested) != null ? l : 0, e.have_clip_data_id = (E = u.have_clip_data_id) != null ? E : !1, e.clip_data_id = (c = u.clip_data_id) != null ? c : 0, e
  3888. }
  3889. };
  3890. function V3() {
  3891. return {msg_flags: 0, stream_id: 0, requested_data: new Uint8Array(0)}
  3892. }
  3893. const z0 = {
  3894. encode(u, e = r.Writer.create()) {
  3895. return u.msg_flags !== 0 && e.uint32(24).int32(u.msg_flags), u.stream_id !== 0 && e.uint32(32).int32(u.stream_id), u.requested_data.length !== 0 && e.uint32(42).bytes(u.requested_data), e
  3896. }, decode(u, e) {
  3897. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3898. let o = e === void 0 ? i.len : i.pos + e;
  3899. const a = V3();
  3900. for (; i.pos < o;) {
  3901. const t = i.uint32();
  3902. switch (t >>> 3) {
  3903. case 3:
  3904. if (t !== 24) break;
  3905. a.msg_flags = i.int32();
  3906. continue;
  3907. case 4:
  3908. if (t !== 32) break;
  3909. a.stream_id = i.int32();
  3910. continue;
  3911. case 5:
  3912. if (t !== 42) break;
  3913. a.requested_data = i.bytes();
  3914. continue
  3915. }
  3916. if ((t & 7) === 4 || t === 0) break;
  3917. i.skipType(t & 7)
  3918. }
  3919. return a
  3920. }, fromJSON(u) {
  3921. return {
  3922. msg_flags: n(u.msg_flags) ? globalThis.Number(u.msg_flags) : 0,
  3923. stream_id: n(u.stream_id) ? globalThis.Number(u.stream_id) : 0,
  3924. requested_data: n(u.requested_data) ? R(u.requested_data) : new Uint8Array(0)
  3925. }
  3926. }, toJSON(u) {
  3927. const e = {};
  3928. return u.msg_flags !== 0 && (e.msg_flags = Math.round(u.msg_flags)), u.stream_id !== 0 && (e.stream_id = Math.round(u.stream_id)), u.requested_data.length !== 0 && (e.requested_data = I(u.requested_data)), e
  3929. }, create(u) {
  3930. return z0.fromPartial(u != null ? u : {})
  3931. }, fromPartial(u) {
  3932. var i, o, a;
  3933. const e = V3();
  3934. return e.msg_flags = (i = u.msg_flags) != null ? i : 0, e.stream_id = (o = u.stream_id) != null ? o : 0, e.requested_data = (a = u.requested_data) != null ? a : new Uint8Array(0), e
  3935. }
  3936. };
  3937. function q3() {
  3938. return {
  3939. ready: void 0,
  3940. format_list: void 0,
  3941. format_list_response: void 0,
  3942. format_data_request: void 0,
  3943. format_data_response: void 0,
  3944. file_contents_request: void 0,
  3945. file_contents_response: void 0
  3946. }
  3947. }
  3948. const P0 = {
  3949. encode(u, e = r.Writer.create()) {
  3950. return u.ready !== void 0 && h0.encode(u.ready, e.uint32(10).fork()).ldelim(), u.format_list !== void 0 && x0.encode(u.format_list, e.uint32(18).fork()).ldelim(), u.format_list_response !== void 0 && y0.encode(u.format_list_response, e.uint32(26).fork()).ldelim(), u.format_data_request !== void 0 && b0.encode(u.format_data_request, e.uint32(34).fork()).ldelim(), u.format_data_response !== void 0 && w0.encode(u.format_data_response, e.uint32(42).fork()).ldelim(), u.file_contents_request !== void 0 && S0.encode(u.file_contents_request, e.uint32(50).fork()).ldelim(), u.file_contents_response !== void 0 && z0.encode(u.file_contents_response, e.uint32(58).fork()).ldelim(), e
  3951. }, decode(u, e) {
  3952. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3953. let o = e === void 0 ? i.len : i.pos + e;
  3954. const a = q3();
  3955. for (; i.pos < o;) {
  3956. const t = i.uint32();
  3957. switch (t >>> 3) {
  3958. case 1:
  3959. if (t !== 10) break;
  3960. a.ready = h0.decode(i, i.uint32());
  3961. continue;
  3962. case 2:
  3963. if (t !== 18) break;
  3964. a.format_list = x0.decode(i, i.uint32());
  3965. continue;
  3966. case 3:
  3967. if (t !== 26) break;
  3968. a.format_list_response = y0.decode(i, i.uint32());
  3969. continue;
  3970. case 4:
  3971. if (t !== 34) break;
  3972. a.format_data_request = b0.decode(i, i.uint32());
  3973. continue;
  3974. case 5:
  3975. if (t !== 42) break;
  3976. a.format_data_response = w0.decode(i, i.uint32());
  3977. continue;
  3978. case 6:
  3979. if (t !== 50) break;
  3980. a.file_contents_request = S0.decode(i, i.uint32());
  3981. continue;
  3982. case 7:
  3983. if (t !== 58) break;
  3984. a.file_contents_response = z0.decode(i, i.uint32());
  3985. continue
  3986. }
  3987. if ((t & 7) === 4 || t === 0) break;
  3988. i.skipType(t & 7)
  3989. }
  3990. return a
  3991. }, fromJSON(u) {
  3992. return {
  3993. ready: n(u.ready) ? h0.fromJSON(u.ready) : void 0,
  3994. format_list: n(u.format_list) ? x0.fromJSON(u.format_list) : void 0,
  3995. format_list_response: n(u.format_list_response) ? y0.fromJSON(u.format_list_response) : void 0,
  3996. format_data_request: n(u.format_data_request) ? b0.fromJSON(u.format_data_request) : void 0,
  3997. format_data_response: n(u.format_data_response) ? w0.fromJSON(u.format_data_response) : void 0,
  3998. file_contents_request: n(u.file_contents_request) ? S0.fromJSON(u.file_contents_request) : void 0,
  3999. file_contents_response: n(u.file_contents_response) ? z0.fromJSON(u.file_contents_response) : void 0
  4000. }
  4001. }, toJSON(u) {
  4002. const e = {};
  4003. return u.ready !== void 0 && (e.ready = h0.toJSON(u.ready)), u.format_list !== void 0 && (e.format_list = x0.toJSON(u.format_list)), u.format_list_response !== void 0 && (e.format_list_response = y0.toJSON(u.format_list_response)), u.format_data_request !== void 0 && (e.format_data_request = b0.toJSON(u.format_data_request)), u.format_data_response !== void 0 && (e.format_data_response = w0.toJSON(u.format_data_response)), u.file_contents_request !== void 0 && (e.file_contents_request = S0.toJSON(u.file_contents_request)), u.file_contents_response !== void 0 && (e.file_contents_response = z0.toJSON(u.file_contents_response)), e
  4004. }, create(u) {
  4005. return P0.fromPartial(u != null ? u : {})
  4006. }, fromPartial(u) {
  4007. const e = q3();
  4008. return e.ready = u.ready !== void 0 && u.ready !== null ? h0.fromPartial(u.ready) : void 0, e.format_list = u.format_list !== void 0 && u.format_list !== null ? x0.fromPartial(u.format_list) : void 0, e.format_list_response = u.format_list_response !== void 0 && u.format_list_response !== null ? y0.fromPartial(u.format_list_response) : void 0, e.format_data_request = u.format_data_request !== void 0 && u.format_data_request !== null ? b0.fromPartial(u.format_data_request) : void 0, e.format_data_response = u.format_data_response !== void 0 && u.format_data_response !== null ? w0.fromPartial(u.format_data_response) : void 0, e.file_contents_request = u.file_contents_request !== void 0 && u.file_contents_request !== null ? S0.fromPartial(u.file_contents_request) : void 0, e.file_contents_response = u.file_contents_response !== void 0 && u.file_contents_response !== null ? z0.fromPartial(u.file_contents_response) : void 0, e
  4009. }
  4010. };
  4011. function K3() {
  4012. return {width: 0, height: 0}
  4013. }
  4014. const v = {
  4015. encode(u, e = r.Writer.create()) {
  4016. return u.width !== 0 && e.uint32(8).int32(u.width), u.height !== 0 && e.uint32(16).int32(u.height), e
  4017. }, decode(u, e) {
  4018. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4019. let o = e === void 0 ? i.len : i.pos + e;
  4020. const a = K3();
  4021. for (; i.pos < o;) {
  4022. const t = i.uint32();
  4023. switch (t >>> 3) {
  4024. case 1:
  4025. if (t !== 8) break;
  4026. a.width = i.int32();
  4027. continue;
  4028. case 2:
  4029. if (t !== 16) break;
  4030. a.height = i.int32();
  4031. continue
  4032. }
  4033. if ((t & 7) === 4 || t === 0) break;
  4034. i.skipType(t & 7)
  4035. }
  4036. return a
  4037. }, fromJSON(u) {
  4038. return {
  4039. width: n(u.width) ? globalThis.Number(u.width) : 0,
  4040. height: n(u.height) ? globalThis.Number(u.height) : 0
  4041. }
  4042. }, toJSON(u) {
  4043. const e = {};
  4044. return u.width !== 0 && (e.width = Math.round(u.width)), u.height !== 0 && (e.height = Math.round(u.height)), e
  4045. }, create(u) {
  4046. return v.fromPartial(u != null ? u : {})
  4047. }, fromPartial(u) {
  4048. var i, o;
  4049. const e = K3();
  4050. return e.width = (i = u.width) != null ? i : 0, e.height = (o = u.height) != null ? o : 0, e
  4051. }
  4052. };
  4053. function H3() {
  4054. return {display: 0, resolution: void 0}
  4055. }
  4056. const Ou = {
  4057. encode(u, e = r.Writer.create()) {
  4058. return u.display !== 0 && e.uint32(8).int32(u.display), u.resolution !== void 0 && v.encode(u.resolution, e.uint32(18).fork()).ldelim(), e
  4059. }, decode(u, e) {
  4060. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4061. let o = e === void 0 ? i.len : i.pos + e;
  4062. const a = H3();
  4063. for (; i.pos < o;) {
  4064. const t = i.uint32();
  4065. switch (t >>> 3) {
  4066. case 1:
  4067. if (t !== 8) break;
  4068. a.display = i.int32();
  4069. continue;
  4070. case 2:
  4071. if (t !== 18) break;
  4072. a.resolution = v.decode(i, i.uint32());
  4073. continue
  4074. }
  4075. if ((t & 7) === 4 || t === 0) break;
  4076. i.skipType(t & 7)
  4077. }
  4078. return a
  4079. }, fromJSON(u) {
  4080. return {
  4081. display: n(u.display) ? globalThis.Number(u.display) : 0,
  4082. resolution: n(u.resolution) ? v.fromJSON(u.resolution) : void 0
  4083. }
  4084. }, toJSON(u) {
  4085. const e = {};
  4086. return u.display !== 0 && (e.display = Math.round(u.display)), u.resolution !== void 0 && (e.resolution = v.toJSON(u.resolution)), e
  4087. }, create(u) {
  4088. return Ou.fromPartial(u != null ? u : {})
  4089. }, fromPartial(u) {
  4090. var i;
  4091. const e = H3();
  4092. return e.display = (i = u.display) != null ? i : 0, e.resolution = u.resolution !== void 0 && u.resolution !== null ? v.fromPartial(u.resolution) : void 0, e
  4093. }
  4094. };
  4095. function J3() {
  4096. return {resolutions: []}
  4097. }
  4098. const uu = {
  4099. encode(u, e = r.Writer.create()) {
  4100. for (const i of u.resolutions) v.encode(i, e.uint32(10).fork()).ldelim();
  4101. return e
  4102. }, decode(u, e) {
  4103. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4104. let o = e === void 0 ? i.len : i.pos + e;
  4105. const a = J3();
  4106. for (; i.pos < o;) {
  4107. const t = i.uint32();
  4108. switch (t >>> 3) {
  4109. case 1:
  4110. if (t !== 10) break;
  4111. a.resolutions.push(v.decode(i, i.uint32()));
  4112. continue
  4113. }
  4114. if ((t & 7) === 4 || t === 0) break;
  4115. i.skipType(t & 7)
  4116. }
  4117. return a
  4118. }, fromJSON(u) {
  4119. return {resolutions: globalThis.Array.isArray(u == null ? void 0 : u.resolutions) ? u.resolutions.map(e => v.fromJSON(e)) : []}
  4120. }, toJSON(u) {
  4121. var i;
  4122. const e = {};
  4123. return (i = u.resolutions) != null && i.length && (e.resolutions = u.resolutions.map(o => v.toJSON(o))), e
  4124. }, create(u) {
  4125. return uu.fromPartial(u != null ? u : {})
  4126. }, fromPartial(u) {
  4127. var i;
  4128. const e = J3();
  4129. return e.resolutions = ((i = u.resolutions) == null ? void 0 : i.map(o => v.fromPartial(o))) || [], e
  4130. }
  4131. };
  4132. function G3() {
  4133. return {
  4134. display: 0,
  4135. x: 0,
  4136. y: 0,
  4137. width: 0,
  4138. height: 0,
  4139. cursor_embedded: !1,
  4140. resolutions: void 0,
  4141. original_resolution: void 0
  4142. }
  4143. }
  4144. const Mu = {
  4145. encode(u, e = r.Writer.create()) {
  4146. return u.display !== 0 && e.uint32(8).int32(u.display), u.x !== 0 && e.uint32(16).sint32(u.x), u.y !== 0 && e.uint32(24).sint32(u.y), u.width !== 0 && e.uint32(32).int32(u.width), u.height !== 0 && e.uint32(40).int32(u.height), u.cursor_embedded !== !1 && e.uint32(48).bool(u.cursor_embedded), u.resolutions !== void 0 && uu.encode(u.resolutions, e.uint32(58).fork()).ldelim(), u.original_resolution !== void 0 && v.encode(u.original_resolution, e.uint32(66).fork()).ldelim(), e
  4147. }, decode(u, e) {
  4148. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4149. let o = e === void 0 ? i.len : i.pos + e;
  4150. const a = G3();
  4151. for (; i.pos < o;) {
  4152. const t = i.uint32();
  4153. switch (t >>> 3) {
  4154. case 1:
  4155. if (t !== 8) break;
  4156. a.display = i.int32();
  4157. continue;
  4158. case 2:
  4159. if (t !== 16) break;
  4160. a.x = i.sint32();
  4161. continue;
  4162. case 3:
  4163. if (t !== 24) break;
  4164. a.y = i.sint32();
  4165. continue;
  4166. case 4:
  4167. if (t !== 32) break;
  4168. a.width = i.int32();
  4169. continue;
  4170. case 5:
  4171. if (t !== 40) break;
  4172. a.height = i.int32();
  4173. continue;
  4174. case 6:
  4175. if (t !== 48) break;
  4176. a.cursor_embedded = i.bool();
  4177. continue;
  4178. case 7:
  4179. if (t !== 58) break;
  4180. a.resolutions = uu.decode(i, i.uint32());
  4181. continue;
  4182. case 8:
  4183. if (t !== 66) break;
  4184. a.original_resolution = v.decode(i, i.uint32());
  4185. continue
  4186. }
  4187. if ((t & 7) === 4 || t === 0) break;
  4188. i.skipType(t & 7)
  4189. }
  4190. return a
  4191. }, fromJSON(u) {
  4192. return {
  4193. display: n(u.display) ? globalThis.Number(u.display) : 0,
  4194. x: n(u.x) ? globalThis.Number(u.x) : 0,
  4195. y: n(u.y) ? globalThis.Number(u.y) : 0,
  4196. width: n(u.width) ? globalThis.Number(u.width) : 0,
  4197. height: n(u.height) ? globalThis.Number(u.height) : 0,
  4198. cursor_embedded: n(u.cursor_embedded) ? globalThis.Boolean(u.cursor_embedded) : !1,
  4199. resolutions: n(u.resolutions) ? uu.fromJSON(u.resolutions) : void 0,
  4200. original_resolution: n(u.original_resolution) ? v.fromJSON(u.original_resolution) : void 0
  4201. }
  4202. }, toJSON(u) {
  4203. const e = {};
  4204. return u.display !== 0 && (e.display = Math.round(u.display)), u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), u.width !== 0 && (e.width = Math.round(u.width)), u.height !== 0 && (e.height = Math.round(u.height)), u.cursor_embedded !== !1 && (e.cursor_embedded = u.cursor_embedded), u.resolutions !== void 0 && (e.resolutions = uu.toJSON(u.resolutions)), u.original_resolution !== void 0 && (e.original_resolution = v.toJSON(u.original_resolution)), e
  4205. }, create(u) {
  4206. return Mu.fromPartial(u != null ? u : {})
  4207. }, fromPartial(u) {
  4208. var i, o, a, t, s, l;
  4209. const e = G3();
  4210. return e.display = (i = u.display) != null ? i : 0, e.x = (o = u.x) != null ? o : 0, e.y = (a = u.y) != null ? a : 0, e.width = (t = u.width) != null ? t : 0, e.height = (s = u.height) != null ? s : 0, e.cursor_embedded = (l = u.cursor_embedded) != null ? l : !1, e.resolutions = u.resolutions !== void 0 && u.resolutions !== null ? uu.fromPartial(u.resolutions) : void 0, e.original_resolution = u.original_resolution !== void 0 && u.original_resolution !== null ? v.fromPartial(u.original_resolution) : void 0, e
  4211. }
  4212. };
  4213. function Z3() {
  4214. return {add: [], sub: [], set: []}
  4215. }
  4216. const Uu = {
  4217. encode(u, e = r.Writer.create()) {
  4218. e.uint32(10).fork();
  4219. for (const i of u.add) e.int32(i);
  4220. e.ldelim(), e.uint32(18).fork();
  4221. for (const i of u.sub) e.int32(i);
  4222. e.ldelim(), e.uint32(26).fork();
  4223. for (const i of u.set) e.int32(i);
  4224. return e.ldelim(), e
  4225. }, decode(u, e) {
  4226. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4227. let o = e === void 0 ? i.len : i.pos + e;
  4228. const a = Z3();
  4229. for (; i.pos < o;) {
  4230. const t = i.uint32();
  4231. switch (t >>> 3) {
  4232. case 1:
  4233. if (t === 8) {
  4234. a.add.push(i.int32());
  4235. continue
  4236. }
  4237. if (t === 10) {
  4238. const s = i.uint32() + i.pos;
  4239. for (; i.pos < s;) a.add.push(i.int32());
  4240. continue
  4241. }
  4242. break;
  4243. case 2:
  4244. if (t === 16) {
  4245. a.sub.push(i.int32());
  4246. continue
  4247. }
  4248. if (t === 18) {
  4249. const s = i.uint32() + i.pos;
  4250. for (; i.pos < s;) a.sub.push(i.int32());
  4251. continue
  4252. }
  4253. break;
  4254. case 3:
  4255. if (t === 24) {
  4256. a.set.push(i.int32());
  4257. continue
  4258. }
  4259. if (t === 26) {
  4260. const s = i.uint32() + i.pos;
  4261. for (; i.pos < s;) a.set.push(i.int32());
  4262. continue
  4263. }
  4264. break
  4265. }
  4266. if ((t & 7) === 4 || t === 0) break;
  4267. i.skipType(t & 7)
  4268. }
  4269. return a
  4270. }, fromJSON(u) {
  4271. return {
  4272. add: globalThis.Array.isArray(u == null ? void 0 : u.add) ? u.add.map(e => globalThis.Number(e)) : [],
  4273. sub: globalThis.Array.isArray(u == null ? void 0 : u.sub) ? u.sub.map(e => globalThis.Number(e)) : [],
  4274. set: globalThis.Array.isArray(u == null ? void 0 : u.set) ? u.set.map(e => globalThis.Number(e)) : []
  4275. }
  4276. }, toJSON(u) {
  4277. var i, o, a;
  4278. const e = {};
  4279. return (i = u.add) != null && i.length && (e.add = u.add.map(t => Math.round(t))), (o = u.sub) != null && o.length && (e.sub = u.sub.map(t => Math.round(t))), (a = u.set) != null && a.length && (e.set = u.set.map(t => Math.round(t))), e
  4280. }, create(u) {
  4281. return Uu.fromPartial(u != null ? u : {})
  4282. }, fromPartial(u) {
  4283. var i, o, a;
  4284. const e = Z3();
  4285. return e.add = ((i = u.add) == null ? void 0 : i.map(t => t)) || [], e.sub = ((o = u.sub) == null ? void 0 : o.map(t => t)) || [], e.set = ((a = u.set) == null ? void 0 : a.map(t => t)) || [], e
  4286. }
  4287. };
  4288. function Q3() {
  4289. return {display: 0, on: !1}
  4290. }
  4291. const Lu = {
  4292. encode(u, e = r.Writer.create()) {
  4293. return u.display !== 0 && e.uint32(8).int32(u.display), u.on !== !1 && e.uint32(16).bool(u.on), e
  4294. }, decode(u, e) {
  4295. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4296. let o = e === void 0 ? i.len : i.pos + e;
  4297. const a = Q3();
  4298. for (; i.pos < o;) {
  4299. const t = i.uint32();
  4300. switch (t >>> 3) {
  4301. case 1:
  4302. if (t !== 8) break;
  4303. a.display = i.int32();
  4304. continue;
  4305. case 2:
  4306. if (t !== 16) break;
  4307. a.on = i.bool();
  4308. continue
  4309. }
  4310. if ((t & 7) === 4 || t === 0) break;
  4311. i.skipType(t & 7)
  4312. }
  4313. return a
  4314. }, fromJSON(u) {
  4315. return {display: n(u.display) ? globalThis.Number(u.display) : 0, on: n(u.on) ? globalThis.Boolean(u.on) : !1}
  4316. }, toJSON(u) {
  4317. const e = {};
  4318. return u.display !== 0 && (e.display = Math.round(u.display)), u.on !== !1 && (e.on = u.on), e
  4319. }, create(u) {
  4320. return Lu.fromPartial(u != null ? u : {})
  4321. }, fromPartial(u) {
  4322. var i, o;
  4323. const e = Q3();
  4324. return e.display = (i = u.display) != null ? i : 0, e.on = (o = u.on) != null ? o : !1, e
  4325. }
  4326. };
  4327. function X3() {
  4328. return {impl_key: "", on: !1}
  4329. }
  4330. const Wu = {
  4331. encode(u, e = r.Writer.create()) {
  4332. return u.impl_key !== "" && e.uint32(10).string(u.impl_key), u.on !== !1 && e.uint32(16).bool(u.on), e
  4333. }, decode(u, e) {
  4334. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4335. let o = e === void 0 ? i.len : i.pos + e;
  4336. const a = X3();
  4337. for (; i.pos < o;) {
  4338. const t = i.uint32();
  4339. switch (t >>> 3) {
  4340. case 1:
  4341. if (t !== 10) break;
  4342. a.impl_key = i.string();
  4343. continue;
  4344. case 2:
  4345. if (t !== 16) break;
  4346. a.on = i.bool();
  4347. continue
  4348. }
  4349. if ((t & 7) === 4 || t === 0) break;
  4350. i.skipType(t & 7)
  4351. }
  4352. return a
  4353. }, fromJSON(u) {
  4354. return {
  4355. impl_key: n(u.impl_key) ? globalThis.String(u.impl_key) : "",
  4356. on: n(u.on) ? globalThis.Boolean(u.on) : !1
  4357. }
  4358. }, toJSON(u) {
  4359. const e = {};
  4360. return u.impl_key !== "" && (e.impl_key = u.impl_key), u.on !== !1 && (e.on = u.on), e
  4361. }, create(u) {
  4362. return Wu.fromPartial(u != null ? u : {})
  4363. }, fromPartial(u) {
  4364. var i, o;
  4365. const e = X3();
  4366. return e.impl_key = (i = u.impl_key) != null ? i : "", e.on = (o = u.on) != null ? o : !1, e
  4367. }
  4368. };
  4369. function Y3() {
  4370. return {permission: 0, enabled: !1}
  4371. }
  4372. const R0 = {
  4373. encode(u, e = r.Writer.create()) {
  4374. return u.permission !== 0 && e.uint32(8).int32(u.permission), u.enabled !== !1 && e.uint32(16).bool(u.enabled), e
  4375. }, decode(u, e) {
  4376. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4377. let o = e === void 0 ? i.len : i.pos + e;
  4378. const a = Y3();
  4379. for (; i.pos < o;) {
  4380. const t = i.uint32();
  4381. switch (t >>> 3) {
  4382. case 1:
  4383. if (t !== 8) break;
  4384. a.permission = i.int32();
  4385. continue;
  4386. case 2:
  4387. if (t !== 16) break;
  4388. a.enabled = i.bool();
  4389. continue
  4390. }
  4391. if ((t & 7) === 4 || t === 0) break;
  4392. i.skipType(t & 7)
  4393. }
  4394. return a
  4395. }, fromJSON(u) {
  4396. return {
  4397. permission: n(u.permission) ? Aa(u.permission) : 0,
  4398. enabled: n(u.enabled) ? globalThis.Boolean(u.enabled) : !1
  4399. }
  4400. }, toJSON(u) {
  4401. const e = {};
  4402. return u.permission !== 0 && (e.permission = Fa(u.permission)), u.enabled !== !1 && (e.enabled = u.enabled), e
  4403. }, create(u) {
  4404. return R0.fromPartial(u != null ? u : {})
  4405. }, fromPartial(u) {
  4406. var i, o;
  4407. const e = Y3();
  4408. return e.permission = (i = u.permission) != null ? i : 0, e.enabled = (o = u.enabled) != null ? o : !1, e
  4409. }
  4410. };
  4411. function $3() {
  4412. return {
  4413. ability_vp9: 0,
  4414. ability_h264: 0,
  4415. ability_h265: 0,
  4416. prefer: 0,
  4417. ability_vp8: 0,
  4418. ability_av1: 0,
  4419. i444: void 0,
  4420. prefer_chroma: 0
  4421. }
  4422. }
  4423. const Vu = {
  4424. encode(u, e = r.Writer.create()) {
  4425. return u.ability_vp9 !== 0 && e.uint32(8).int32(u.ability_vp9), u.ability_h264 !== 0 && e.uint32(16).int32(u.ability_h264), u.ability_h265 !== 0 && e.uint32(24).int32(u.ability_h265), u.prefer !== 0 && e.uint32(32).int32(u.prefer), u.ability_vp8 !== 0 && e.uint32(40).int32(u.ability_vp8), u.ability_av1 !== 0 && e.uint32(48).int32(u.ability_av1), u.i444 !== void 0 && J.encode(u.i444, e.uint32(58).fork()).ldelim(), u.prefer_chroma !== 0 && e.uint32(64).int32(u.prefer_chroma), e
  4426. }, decode(u, e) {
  4427. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4428. let o = e === void 0 ? i.len : i.pos + e;
  4429. const a = $3();
  4430. for (; i.pos < o;) {
  4431. const t = i.uint32();
  4432. switch (t >>> 3) {
  4433. case 1:
  4434. if (t !== 8) break;
  4435. a.ability_vp9 = i.int32();
  4436. continue;
  4437. case 2:
  4438. if (t !== 16) break;
  4439. a.ability_h264 = i.int32();
  4440. continue;
  4441. case 3:
  4442. if (t !== 24) break;
  4443. a.ability_h265 = i.int32();
  4444. continue;
  4445. case 4:
  4446. if (t !== 32) break;
  4447. a.prefer = i.int32();
  4448. continue;
  4449. case 5:
  4450. if (t !== 40) break;
  4451. a.ability_vp8 = i.int32();
  4452. continue;
  4453. case 6:
  4454. if (t !== 48) break;
  4455. a.ability_av1 = i.int32();
  4456. continue;
  4457. case 7:
  4458. if (t !== 58) break;
  4459. a.i444 = J.decode(i, i.uint32());
  4460. continue;
  4461. case 8:
  4462. if (t !== 64) break;
  4463. a.prefer_chroma = i.int32();
  4464. continue
  4465. }
  4466. if ((t & 7) === 4 || t === 0) break;
  4467. i.skipType(t & 7)
  4468. }
  4469. return a
  4470. }, fromJSON(u) {
  4471. return {
  4472. ability_vp9: n(u.ability_vp9) ? globalThis.Number(u.ability_vp9) : 0,
  4473. ability_h264: n(u.ability_h264) ? globalThis.Number(u.ability_h264) : 0,
  4474. ability_h265: n(u.ability_h265) ? globalThis.Number(u.ability_h265) : 0,
  4475. prefer: n(u.prefer) ? _a(u.prefer) : 0,
  4476. ability_vp8: n(u.ability_vp8) ? globalThis.Number(u.ability_vp8) : 0,
  4477. ability_av1: n(u.ability_av1) ? globalThis.Number(u.ability_av1) : 0,
  4478. i444: n(u.i444) ? J.fromJSON(u.i444) : void 0,
  4479. prefer_chroma: n(u.prefer_chroma) ? sa(u.prefer_chroma) : 0
  4480. }
  4481. }, toJSON(u) {
  4482. const e = {};
  4483. return u.ability_vp9 !== 0 && (e.ability_vp9 = Math.round(u.ability_vp9)), u.ability_h264 !== 0 && (e.ability_h264 = Math.round(u.ability_h264)), u.ability_h265 !== 0 && (e.ability_h265 = Math.round(u.ability_h265)), u.prefer !== 0 && (e.prefer = va(u.prefer)), u.ability_vp8 !== 0 && (e.ability_vp8 = Math.round(u.ability_vp8)), u.ability_av1 !== 0 && (e.ability_av1 = Math.round(u.ability_av1)), u.i444 !== void 0 && (e.i444 = J.toJSON(u.i444)), u.prefer_chroma !== 0 && (e.prefer_chroma = la(u.prefer_chroma)), e
  4484. }, create(u) {
  4485. return Vu.fromPartial(u != null ? u : {})
  4486. }, fromPartial(u) {
  4487. var i, o, a, t, s, l, E;
  4488. const e = $3();
  4489. return e.ability_vp9 = (i = u.ability_vp9) != null ? i : 0, e.ability_h264 = (o = u.ability_h264) != null ? o : 0, e.ability_h265 = (a = u.ability_h265) != null ? a : 0, e.prefer = (t = u.prefer) != null ? t : 0, e.ability_vp8 = (s = u.ability_vp8) != null ? s : 0, e.ability_av1 = (l = u.ability_av1) != null ? l : 0, e.i444 = u.i444 !== void 0 && u.i444 !== null ? J.fromPartial(u.i444) : void 0, e.prefer_chroma = (E = u.prefer_chroma) != null ? E : 0, e
  4490. }
  4491. };
  4492. function ui() {
  4493. return {
  4494. image_quality: 0,
  4495. lock_after_session_end: 0,
  4496. show_remote_cursor: 0,
  4497. privacy_mode: 0,
  4498. block_input: 0,
  4499. custom_image_quality: 0,
  4500. disable_audio: 0,
  4501. disable_clipboard: 0,
  4502. enable_file_transfer: 0,
  4503. supported_decoding: void 0,
  4504. custom_fps: 0,
  4505. disable_keyboard: 0,
  4506. follow_remote_cursor: 0,
  4507. follow_remote_window: 0
  4508. }
  4509. }
  4510. const z = {
  4511. encode(u, e = r.Writer.create()) {
  4512. return u.image_quality !== 0 && e.uint32(8).int32(u.image_quality), u.lock_after_session_end !== 0 && e.uint32(16).int32(u.lock_after_session_end), u.show_remote_cursor !== 0 && e.uint32(24).int32(u.show_remote_cursor), u.privacy_mode !== 0 && e.uint32(32).int32(u.privacy_mode), u.block_input !== 0 && e.uint32(40).int32(u.block_input), u.custom_image_quality !== 0 && e.uint32(48).int32(u.custom_image_quality), u.disable_audio !== 0 && e.uint32(56).int32(u.disable_audio), u.disable_clipboard !== 0 && e.uint32(64).int32(u.disable_clipboard), u.enable_file_transfer !== 0 && e.uint32(72).int32(u.enable_file_transfer), u.supported_decoding !== void 0 && Vu.encode(u.supported_decoding, e.uint32(82).fork()).ldelim(), u.custom_fps !== 0 && e.uint32(88).int32(u.custom_fps), u.disable_keyboard !== 0 && e.uint32(96).int32(u.disable_keyboard), u.follow_remote_cursor !== 0 && e.uint32(120).int32(u.follow_remote_cursor), u.follow_remote_window !== 0 && e.uint32(128).int32(u.follow_remote_window), e
  4513. }, decode(u, e) {
  4514. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4515. let o = e === void 0 ? i.len : i.pos + e;
  4516. const a = ui();
  4517. for (; i.pos < o;) {
  4518. const t = i.uint32();
  4519. switch (t >>> 3) {
  4520. case 1:
  4521. if (t !== 8) break;
  4522. a.image_quality = i.int32();
  4523. continue;
  4524. case 2:
  4525. if (t !== 16) break;
  4526. a.lock_after_session_end = i.int32();
  4527. continue;
  4528. case 3:
  4529. if (t !== 24) break;
  4530. a.show_remote_cursor = i.int32();
  4531. continue;
  4532. case 4:
  4533. if (t !== 32) break;
  4534. a.privacy_mode = i.int32();
  4535. continue;
  4536. case 5:
  4537. if (t !== 40) break;
  4538. a.block_input = i.int32();
  4539. continue;
  4540. case 6:
  4541. if (t !== 48) break;
  4542. a.custom_image_quality = i.int32();
  4543. continue;
  4544. case 7:
  4545. if (t !== 56) break;
  4546. a.disable_audio = i.int32();
  4547. continue;
  4548. case 8:
  4549. if (t !== 64) break;
  4550. a.disable_clipboard = i.int32();
  4551. continue;
  4552. case 9:
  4553. if (t !== 72) break;
  4554. a.enable_file_transfer = i.int32();
  4555. continue;
  4556. case 10:
  4557. if (t !== 82) break;
  4558. a.supported_decoding = Vu.decode(i, i.uint32());
  4559. continue;
  4560. case 11:
  4561. if (t !== 88) break;
  4562. a.custom_fps = i.int32();
  4563. continue;
  4564. case 12:
  4565. if (t !== 96) break;
  4566. a.disable_keyboard = i.int32();
  4567. continue;
  4568. case 15:
  4569. if (t !== 120) break;
  4570. a.follow_remote_cursor = i.int32();
  4571. continue;
  4572. case 16:
  4573. if (t !== 128) break;
  4574. a.follow_remote_window = i.int32();
  4575. continue
  4576. }
  4577. if ((t & 7) === 4 || t === 0) break;
  4578. i.skipType(t & 7)
  4579. }
  4580. return a
  4581. }, fromJSON(u) {
  4582. return {
  4583. image_quality: n(u.image_quality) ? Ba(u.image_quality) : 0,
  4584. lock_after_session_end: n(u.lock_after_session_end) ? tu(u.lock_after_session_end) : 0,
  4585. show_remote_cursor: n(u.show_remote_cursor) ? tu(u.show_remote_cursor) : 0,
  4586. privacy_mode: n(u.privacy_mode) ? tu(u.privacy_mode) : 0,
  4587. block_input: n(u.block_input) ? tu(u.block_input) : 0,
  4588. custom_image_quality: n(u.custom_image_quality) ? globalThis.Number(u.custom_image_quality) : 0,
  4589. disable_audio: n(u.disable_audio) ? tu(u.disable_audio) : 0,
  4590. disable_clipboard: n(u.disable_clipboard) ? tu(u.disable_clipboard) : 0,
  4591. enable_file_transfer: n(u.enable_file_transfer) ? tu(u.enable_file_transfer) : 0,
  4592. supported_decoding: n(u.supported_decoding) ? Vu.fromJSON(u.supported_decoding) : void 0,
  4593. custom_fps: n(u.custom_fps) ? globalThis.Number(u.custom_fps) : 0,
  4594. disable_keyboard: n(u.disable_keyboard) ? tu(u.disable_keyboard) : 0,
  4595. follow_remote_cursor: n(u.follow_remote_cursor) ? tu(u.follow_remote_cursor) : 0,
  4596. follow_remote_window: n(u.follow_remote_window) ? tu(u.follow_remote_window) : 0
  4597. }
  4598. }, toJSON(u) {
  4599. const e = {};
  4600. return u.image_quality !== 0 && (e.image_quality = ma(u.image_quality)), u.lock_after_session_end !== 0 && (e.lock_after_session_end = au(u.lock_after_session_end)), u.show_remote_cursor !== 0 && (e.show_remote_cursor = au(u.show_remote_cursor)), u.privacy_mode !== 0 && (e.privacy_mode = au(u.privacy_mode)), u.block_input !== 0 && (e.block_input = au(u.block_input)), u.custom_image_quality !== 0 && (e.custom_image_quality = Math.round(u.custom_image_quality)), u.disable_audio !== 0 && (e.disable_audio = au(u.disable_audio)), u.disable_clipboard !== 0 && (e.disable_clipboard = au(u.disable_clipboard)), u.enable_file_transfer !== 0 && (e.enable_file_transfer = au(u.enable_file_transfer)), u.supported_decoding !== void 0 && (e.supported_decoding = Vu.toJSON(u.supported_decoding)), u.custom_fps !== 0 && (e.custom_fps = Math.round(u.custom_fps)), u.disable_keyboard !== 0 && (e.disable_keyboard = au(u.disable_keyboard)), u.follow_remote_cursor !== 0 && (e.follow_remote_cursor = au(u.follow_remote_cursor)), u.follow_remote_window !== 0 && (e.follow_remote_window = au(u.follow_remote_window)), e
  4601. }, create(u) {
  4602. return z.fromPartial(u != null ? u : {})
  4603. }, fromPartial(u) {
  4604. var i, o, a, t, s, l, E, c, C, D, B, F, y;
  4605. const e = ui();
  4606. return e.image_quality = (i = u.image_quality) != null ? i : 0, e.lock_after_session_end = (o = u.lock_after_session_end) != null ? o : 0, e.show_remote_cursor = (a = u.show_remote_cursor) != null ? a : 0, e.privacy_mode = (t = u.privacy_mode) != null ? t : 0, e.block_input = (s = u.block_input) != null ? s : 0, e.custom_image_quality = (l = u.custom_image_quality) != null ? l : 0, e.disable_audio = (E = u.disable_audio) != null ? E : 0, e.disable_clipboard = (c = u.disable_clipboard) != null ? c : 0, e.enable_file_transfer = (C = u.enable_file_transfer) != null ? C : 0, e.supported_decoding = u.supported_decoding !== void 0 && u.supported_decoding !== null ? Vu.fromPartial(u.supported_decoding) : void 0, e.custom_fps = (D = u.custom_fps) != null ? D : 0, e.disable_keyboard = (B = u.disable_keyboard) != null ? B : 0, e.follow_remote_cursor = (F = u.follow_remote_cursor) != null ? F : 0, e.follow_remote_window = (y = u.follow_remote_window) != null ? y : 0, e
  4607. }
  4608. };
  4609. function ei() {
  4610. return {time: 0, from_client: !1, last_delay: 0, target_bitrate: 0}
  4611. }
  4612. const I0 = {
  4613. encode(u, e = r.Writer.create()) {
  4614. return u.time !== 0 && e.uint32(8).int64(u.time), u.from_client !== !1 && e.uint32(16).bool(u.from_client), u.last_delay !== 0 && e.uint32(24).uint32(u.last_delay), u.target_bitrate !== 0 && e.uint32(32).uint32(u.target_bitrate), e
  4615. }, decode(u, e) {
  4616. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4617. let o = e === void 0 ? i.len : i.pos + e;
  4618. const a = ei();
  4619. for (; i.pos < o;) {
  4620. const t = i.uint32();
  4621. switch (t >>> 3) {
  4622. case 1:
  4623. if (t !== 8) break;
  4624. a.time = V(i.int64());
  4625. continue;
  4626. case 2:
  4627. if (t !== 16) break;
  4628. a.from_client = i.bool();
  4629. continue;
  4630. case 3:
  4631. if (t !== 24) break;
  4632. a.last_delay = i.uint32();
  4633. continue;
  4634. case 4:
  4635. if (t !== 32) break;
  4636. a.target_bitrate = i.uint32();
  4637. continue
  4638. }
  4639. if ((t & 7) === 4 || t === 0) break;
  4640. i.skipType(t & 7)
  4641. }
  4642. return a
  4643. }, fromJSON(u) {
  4644. return {
  4645. time: n(u.time) ? globalThis.Number(u.time) : 0,
  4646. from_client: n(u.from_client) ? globalThis.Boolean(u.from_client) : !1,
  4647. last_delay: n(u.last_delay) ? globalThis.Number(u.last_delay) : 0,
  4648. target_bitrate: n(u.target_bitrate) ? globalThis.Number(u.target_bitrate) : 0
  4649. }
  4650. }, toJSON(u) {
  4651. const e = {};
  4652. return u.time !== 0 && (e.time = Math.round(u.time)), u.from_client !== !1 && (e.from_client = u.from_client), u.last_delay !== 0 && (e.last_delay = Math.round(u.last_delay)), u.target_bitrate !== 0 && (e.target_bitrate = Math.round(u.target_bitrate)), e
  4653. }, create(u) {
  4654. return I0.fromPartial(u != null ? u : {})
  4655. }, fromPartial(u) {
  4656. var i, o, a, t;
  4657. const e = ei();
  4658. return e.time = (i = u.time) != null ? i : 0, e.from_client = (o = u.from_client) != null ? o : !1, e.last_delay = (a = u.last_delay) != null ? a : 0, e.target_bitrate = (t = u.target_bitrate) != null ? t : 0, e
  4659. }
  4660. };
  4661. function ii() {
  4662. return {asymmetric_value: new Uint8Array(0), symmetric_value: new Uint8Array(0)}
  4663. }
  4664. const K = {
  4665. encode(u, e = r.Writer.create()) {
  4666. return u.asymmetric_value.length !== 0 && e.uint32(10).bytes(u.asymmetric_value), u.symmetric_value.length !== 0 && e.uint32(18).bytes(u.symmetric_value), e
  4667. }, decode(u, e) {
  4668. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4669. let o = e === void 0 ? i.len : i.pos + e;
  4670. const a = ii();
  4671. for (; i.pos < o;) {
  4672. const t = i.uint32();
  4673. switch (t >>> 3) {
  4674. case 1:
  4675. if (t !== 10) break;
  4676. a.asymmetric_value = i.bytes();
  4677. continue;
  4678. case 2:
  4679. if (t !== 18) break;
  4680. a.symmetric_value = i.bytes();
  4681. continue
  4682. }
  4683. if ((t & 7) === 4 || t === 0) break;
  4684. i.skipType(t & 7)
  4685. }
  4686. return a
  4687. }, fromJSON(u) {
  4688. return {
  4689. asymmetric_value: n(u.asymmetric_value) ? R(u.asymmetric_value) : new Uint8Array(0),
  4690. symmetric_value: n(u.symmetric_value) ? R(u.symmetric_value) : new Uint8Array(0)
  4691. }
  4692. }, toJSON(u) {
  4693. const e = {};
  4694. return u.asymmetric_value.length !== 0 && (e.asymmetric_value = I(u.asymmetric_value)), u.symmetric_value.length !== 0 && (e.symmetric_value = I(u.symmetric_value)), e
  4695. }, create(u) {
  4696. return K.fromPartial(u != null ? u : {})
  4697. }, fromPartial(u) {
  4698. var i, o;
  4699. const e = ii();
  4700. return e.asymmetric_value = (i = u.asymmetric_value) != null ? i : new Uint8Array(0), e.symmetric_value = (o = u.symmetric_value) != null ? o : new Uint8Array(0), e
  4701. }
  4702. };
  4703. function ti() {
  4704. return {id: new Uint8Array(0)}
  4705. }
  4706. const T0 = {
  4707. encode(u, e = r.Writer.create()) {
  4708. return u.id.length !== 0 && e.uint32(10).bytes(u.id), e
  4709. }, decode(u, e) {
  4710. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4711. let o = e === void 0 ? i.len : i.pos + e;
  4712. const a = ti();
  4713. for (; i.pos < o;) {
  4714. const t = i.uint32();
  4715. switch (t >>> 3) {
  4716. case 1:
  4717. if (t !== 10) break;
  4718. a.id = i.bytes();
  4719. continue
  4720. }
  4721. if ((t & 7) === 4 || t === 0) break;
  4722. i.skipType(t & 7)
  4723. }
  4724. return a
  4725. }, fromJSON(u) {
  4726. return {id: n(u.id) ? R(u.id) : new Uint8Array(0)}
  4727. }, toJSON(u) {
  4728. const e = {};
  4729. return u.id.length !== 0 && (e.id = I(u.id)), e
  4730. }, create(u) {
  4731. return T0.fromPartial(u != null ? u : {})
  4732. }, fromPartial(u) {
  4733. var i;
  4734. const e = ti();
  4735. return e.id = (i = u.id) != null ? i : new Uint8Array(0), e
  4736. }
  4737. };
  4738. function ai() {
  4739. return {sample_rate: 0, channels: 0}
  4740. }
  4741. const j0 = {
  4742. encode(u, e = r.Writer.create()) {
  4743. return u.sample_rate !== 0 && e.uint32(8).uint32(u.sample_rate), u.channels !== 0 && e.uint32(16).uint32(u.channels), e
  4744. }, decode(u, e) {
  4745. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4746. let o = e === void 0 ? i.len : i.pos + e;
  4747. const a = ai();
  4748. for (; i.pos < o;) {
  4749. const t = i.uint32();
  4750. switch (t >>> 3) {
  4751. case 1:
  4752. if (t !== 8) break;
  4753. a.sample_rate = i.uint32();
  4754. continue;
  4755. case 2:
  4756. if (t !== 16) break;
  4757. a.channels = i.uint32();
  4758. continue
  4759. }
  4760. if ((t & 7) === 4 || t === 0) break;
  4761. i.skipType(t & 7)
  4762. }
  4763. return a
  4764. }, fromJSON(u) {
  4765. return {
  4766. sample_rate: n(u.sample_rate) ? globalThis.Number(u.sample_rate) : 0,
  4767. channels: n(u.channels) ? globalThis.Number(u.channels) : 0
  4768. }
  4769. }, toJSON(u) {
  4770. const e = {};
  4771. return u.sample_rate !== 0 && (e.sample_rate = Math.round(u.sample_rate)), u.channels !== 0 && (e.channels = Math.round(u.channels)), e
  4772. }, create(u) {
  4773. return j0.fromPartial(u != null ? u : {})
  4774. }, fromPartial(u) {
  4775. var i, o;
  4776. const e = ai();
  4777. return e.sample_rate = (i = u.sample_rate) != null ? i : 0, e.channels = (o = u.channels) != null ? o : 0, e
  4778. }
  4779. };
  4780. function oi() {
  4781. return {data: new Uint8Array(0)}
  4782. }
  4783. const N0 = {
  4784. encode(u, e = r.Writer.create()) {
  4785. return u.data.length !== 0 && e.uint32(10).bytes(u.data), e
  4786. }, decode(u, e) {
  4787. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4788. let o = e === void 0 ? i.len : i.pos + e;
  4789. const a = oi();
  4790. for (; i.pos < o;) {
  4791. const t = i.uint32();
  4792. switch (t >>> 3) {
  4793. case 1:
  4794. if (t !== 10) break;
  4795. a.data = i.bytes();
  4796. continue
  4797. }
  4798. if ((t & 7) === 4 || t === 0) break;
  4799. i.skipType(t & 7)
  4800. }
  4801. return a
  4802. }, fromJSON(u) {
  4803. return {data: n(u.data) ? R(u.data) : new Uint8Array(0)}
  4804. }, toJSON(u) {
  4805. const e = {};
  4806. return u.data.length !== 0 && (e.data = I(u.data)), e
  4807. }, create(u) {
  4808. return N0.fromPartial(u != null ? u : {})
  4809. }, fromPartial(u) {
  4810. var i;
  4811. const e = oi();
  4812. return e.data = (i = u.data) != null ? i : new Uint8Array(0), e
  4813. }
  4814. };
  4815. function ni() {
  4816. return {msgtype: "", title: "", text: "", link: ""}
  4817. }
  4818. const O0 = {
  4819. encode(u, e = r.Writer.create()) {
  4820. return u.msgtype !== "" && e.uint32(10).string(u.msgtype), u.title !== "" && e.uint32(18).string(u.title), u.text !== "" && e.uint32(26).string(u.text), u.link !== "" && e.uint32(34).string(u.link), e
  4821. }, decode(u, e) {
  4822. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4823. let o = e === void 0 ? i.len : i.pos + e;
  4824. const a = ni();
  4825. for (; i.pos < o;) {
  4826. const t = i.uint32();
  4827. switch (t >>> 3) {
  4828. case 1:
  4829. if (t !== 10) break;
  4830. a.msgtype = i.string();
  4831. continue;
  4832. case 2:
  4833. if (t !== 18) break;
  4834. a.title = i.string();
  4835. continue;
  4836. case 3:
  4837. if (t !== 26) break;
  4838. a.text = i.string();
  4839. continue;
  4840. case 4:
  4841. if (t !== 34) break;
  4842. a.link = i.string();
  4843. continue
  4844. }
  4845. if ((t & 7) === 4 || t === 0) break;
  4846. i.skipType(t & 7)
  4847. }
  4848. return a
  4849. }, fromJSON(u) {
  4850. return {
  4851. msgtype: n(u.msgtype) ? globalThis.String(u.msgtype) : "",
  4852. title: n(u.title) ? globalThis.String(u.title) : "",
  4853. text: n(u.text) ? globalThis.String(u.text) : "",
  4854. link: n(u.link) ? globalThis.String(u.link) : ""
  4855. }
  4856. }, toJSON(u) {
  4857. const e = {};
  4858. return u.msgtype !== "" && (e.msgtype = u.msgtype), u.title !== "" && (e.title = u.title), u.text !== "" && (e.text = u.text), u.link !== "" && (e.link = u.link), e
  4859. }, create(u) {
  4860. return O0.fromPartial(u != null ? u : {})
  4861. }, fromPartial(u) {
  4862. var i, o, a, t;
  4863. const e = ni();
  4864. return e.msgtype = (i = u.msgtype) != null ? i : "", e.title = (o = u.title) != null ? o : "", e.text = (a = u.text) != null ? a : "", e.link = (t = u.link) != null ? t : "", e
  4865. }
  4866. };
  4867. function ri() {
  4868. return {privacy_mode_state: void 0, block_input_state: void 0, details: "", impl_key: ""}
  4869. }
  4870. const M0 = {
  4871. encode(u, e = r.Writer.create()) {
  4872. return u.privacy_mode_state !== void 0 && e.uint32(8).int32(u.privacy_mode_state), u.block_input_state !== void 0 && e.uint32(16).int32(u.block_input_state), u.details !== "" && e.uint32(26).string(u.details), u.impl_key !== "" && e.uint32(34).string(u.impl_key), e
  4873. }, decode(u, e) {
  4874. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4875. let o = e === void 0 ? i.len : i.pos + e;
  4876. const a = ri();
  4877. for (; i.pos < o;) {
  4878. const t = i.uint32();
  4879. switch (t >>> 3) {
  4880. case 1:
  4881. if (t !== 8) break;
  4882. a.privacy_mode_state = i.int32();
  4883. continue;
  4884. case 2:
  4885. if (t !== 16) break;
  4886. a.block_input_state = i.int32();
  4887. continue;
  4888. case 3:
  4889. if (t !== 26) break;
  4890. a.details = i.string();
  4891. continue;
  4892. case 4:
  4893. if (t !== 34) break;
  4894. a.impl_key = i.string();
  4895. continue
  4896. }
  4897. if ((t & 7) === 4 || t === 0) break;
  4898. i.skipType(t & 7)
  4899. }
  4900. return a
  4901. }, fromJSON(u) {
  4902. return {
  4903. privacy_mode_state: n(u.privacy_mode_state) ? ha(u.privacy_mode_state) : void 0,
  4904. block_input_state: n(u.block_input_state) ? ka(u.block_input_state) : void 0,
  4905. details: n(u.details) ? globalThis.String(u.details) : "",
  4906. impl_key: n(u.impl_key) ? globalThis.String(u.impl_key) : ""
  4907. }
  4908. }, toJSON(u) {
  4909. const e = {};
  4910. return u.privacy_mode_state !== void 0 && (e.privacy_mode_state = fa(u.privacy_mode_state)), u.block_input_state !== void 0 && (e.block_input_state = ga(u.block_input_state)), u.details !== "" && (e.details = u.details), u.impl_key !== "" && (e.impl_key = u.impl_key), e
  4911. }, create(u) {
  4912. return M0.fromPartial(u != null ? u : {})
  4913. }, fromPartial(u) {
  4914. var i, o, a, t;
  4915. const e = ri();
  4916. return e.privacy_mode_state = (i = u.privacy_mode_state) != null ? i : void 0, e.block_input_state = (o = u.block_input_state) != null ? o : void 0, e.details = (a = u.details) != null ? a : "", e.impl_key = (t = u.impl_key) != null ? t : "", e
  4917. }
  4918. };
  4919. function si() {
  4920. return {username: "", password: ""}
  4921. }
  4922. const qu = {
  4923. encode(u, e = r.Writer.create()) {
  4924. return u.username !== "" && e.uint32(10).string(u.username), u.password !== "" && e.uint32(18).string(u.password), e
  4925. }, decode(u, e) {
  4926. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4927. let o = e === void 0 ? i.len : i.pos + e;
  4928. const a = si();
  4929. for (; i.pos < o;) {
  4930. const t = i.uint32();
  4931. switch (t >>> 3) {
  4932. case 1:
  4933. if (t !== 10) break;
  4934. a.username = i.string();
  4935. continue;
  4936. case 2:
  4937. if (t !== 18) break;
  4938. a.password = i.string();
  4939. continue
  4940. }
  4941. if ((t & 7) === 4 || t === 0) break;
  4942. i.skipType(t & 7)
  4943. }
  4944. return a
  4945. }, fromJSON(u) {
  4946. return {
  4947. username: n(u.username) ? globalThis.String(u.username) : "",
  4948. password: n(u.password) ? globalThis.String(u.password) : ""
  4949. }
  4950. }, toJSON(u) {
  4951. const e = {};
  4952. return u.username !== "" && (e.username = u.username), u.password !== "" && (e.password = u.password), e
  4953. }, create(u) {
  4954. return qu.fromPartial(u != null ? u : {})
  4955. }, fromPartial(u) {
  4956. var i, o;
  4957. const e = si();
  4958. return e.username = (i = u.username) != null ? i : "", e.password = (o = u.password) != null ? o : "", e
  4959. }
  4960. };
  4961. function li() {
  4962. return {direct: void 0, logon: void 0}
  4963. }
  4964. const Du = {
  4965. encode(u, e = r.Writer.create()) {
  4966. return u.direct !== void 0 && e.uint32(8).bool(u.direct), u.logon !== void 0 && qu.encode(u.logon, e.uint32(18).fork()).ldelim(), e
  4967. }, decode(u, e) {
  4968. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4969. let o = e === void 0 ? i.len : i.pos + e;
  4970. const a = li();
  4971. for (; i.pos < o;) {
  4972. const t = i.uint32();
  4973. switch (t >>> 3) {
  4974. case 1:
  4975. if (t !== 8) break;
  4976. a.direct = i.bool();
  4977. continue;
  4978. case 2:
  4979. if (t !== 18) break;
  4980. a.logon = qu.decode(i, i.uint32());
  4981. continue
  4982. }
  4983. if ((t & 7) === 4 || t === 0) break;
  4984. i.skipType(t & 7)
  4985. }
  4986. return a
  4987. }, fromJSON(u) {
  4988. return {
  4989. direct: n(u.direct) ? globalThis.Boolean(u.direct) : void 0,
  4990. logon: n(u.logon) ? qu.fromJSON(u.logon) : void 0
  4991. }
  4992. }, toJSON(u) {
  4993. const e = {};
  4994. return u.direct !== void 0 && (e.direct = u.direct), u.logon !== void 0 && (e.logon = qu.toJSON(u.logon)), e
  4995. }, create(u) {
  4996. return Du.fromPartial(u != null ? u : {})
  4997. }, fromPartial(u) {
  4998. var i;
  4999. const e = li();
  5000. return e.direct = (i = u.direct) != null ? i : void 0, e.logon = u.logon !== void 0 && u.logon !== null ? qu.fromPartial(u.logon) : void 0, e
  5001. }
  5002. };
  5003. function Ei() {
  5004. return {uuid: new Uint8Array(0)}
  5005. }
  5006. const U0 = {
  5007. encode(u, e = r.Writer.create()) {
  5008. return u.uuid.length !== 0 && e.uint32(10).bytes(u.uuid), e
  5009. }, decode(u, e) {
  5010. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5011. let o = e === void 0 ? i.len : i.pos + e;
  5012. const a = Ei();
  5013. for (; i.pos < o;) {
  5014. const t = i.uint32();
  5015. switch (t >>> 3) {
  5016. case 1:
  5017. if (t !== 10) break;
  5018. a.uuid = i.bytes();
  5019. continue
  5020. }
  5021. if ((t & 7) === 4 || t === 0) break;
  5022. i.skipType(t & 7)
  5023. }
  5024. return a
  5025. }, fromJSON(u) {
  5026. return {uuid: n(u.uuid) ? R(u.uuid) : new Uint8Array(0)}
  5027. }, toJSON(u) {
  5028. const e = {};
  5029. return u.uuid.length !== 0 && (e.uuid = I(u.uuid)), e
  5030. }, create(u) {
  5031. return U0.fromPartial(u != null ? u : {})
  5032. }, fromPartial(u) {
  5033. var i;
  5034. const e = Ei();
  5035. return e.uuid = (i = u.uuid) != null ? i : new Uint8Array(0), e
  5036. }
  5037. };
  5038. function di() {
  5039. return {uuid: new Uint8Array(0), lr: void 0}
  5040. }
  5041. const L0 = {
  5042. encode(u, e = r.Writer.create()) {
  5043. return u.uuid.length !== 0 && e.uint32(10).bytes(u.uuid), u.lr !== void 0 && H.encode(u.lr, e.uint32(18).fork()).ldelim(), e
  5044. }, decode(u, e) {
  5045. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5046. let o = e === void 0 ? i.len : i.pos + e;
  5047. const a = di();
  5048. for (; i.pos < o;) {
  5049. const t = i.uint32();
  5050. switch (t >>> 3) {
  5051. case 1:
  5052. if (t !== 10) break;
  5053. a.uuid = i.bytes();
  5054. continue;
  5055. case 2:
  5056. if (t !== 18) break;
  5057. a.lr = H.decode(i, i.uint32());
  5058. continue
  5059. }
  5060. if ((t & 7) === 4 || t === 0) break;
  5061. i.skipType(t & 7)
  5062. }
  5063. return a
  5064. }, fromJSON(u) {
  5065. return {uuid: n(u.uuid) ? R(u.uuid) : new Uint8Array(0), lr: n(u.lr) ? H.fromJSON(u.lr) : void 0}
  5066. }, toJSON(u) {
  5067. const e = {};
  5068. return u.uuid.length !== 0 && (e.uuid = I(u.uuid)), u.lr !== void 0 && (e.lr = H.toJSON(u.lr)), e
  5069. }, create(u) {
  5070. return L0.fromPartial(u != null ? u : {})
  5071. }, fromPartial(u) {
  5072. var i;
  5073. const e = di();
  5074. return e.uuid = (i = u.uuid) != null ? i : new Uint8Array(0), e.lr = u.lr !== void 0 && u.lr !== null ? H.fromPartial(u.lr) : void 0, e
  5075. }
  5076. };
  5077. function ci() {
  5078. return {}
  5079. }
  5080. const W0 = {
  5081. encode(u, e = r.Writer.create()) {
  5082. return e
  5083. }, decode(u, e) {
  5084. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5085. let o = e === void 0 ? i.len : i.pos + e;
  5086. const a = ci();
  5087. for (; i.pos < o;) {
  5088. const t = i.uint32();
  5089. if ((t & 7) === 4 || t === 0) break;
  5090. i.skipType(t & 7)
  5091. }
  5092. return a
  5093. }, fromJSON(u) {
  5094. return {}
  5095. }, toJSON(u) {
  5096. return {}
  5097. }, create(u) {
  5098. return W0.fromPartial(u != null ? u : {})
  5099. }, fromPartial(u) {
  5100. return ci()
  5101. }
  5102. };
  5103. function Ci() {
  5104. return {id: "", content: new Uint8Array(0)}
  5105. }
  5106. const V0 = {
  5107. encode(u, e = r.Writer.create()) {
  5108. return u.id !== "" && e.uint32(10).string(u.id), u.content.length !== 0 && e.uint32(18).bytes(u.content), e
  5109. }, decode(u, e) {
  5110. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5111. let o = e === void 0 ? i.len : i.pos + e;
  5112. const a = Ci();
  5113. for (; i.pos < o;) {
  5114. const t = i.uint32();
  5115. switch (t >>> 3) {
  5116. case 1:
  5117. if (t !== 10) break;
  5118. a.id = i.string();
  5119. continue;
  5120. case 2:
  5121. if (t !== 18) break;
  5122. a.content = i.bytes();
  5123. continue
  5124. }
  5125. if ((t & 7) === 4 || t === 0) break;
  5126. i.skipType(t & 7)
  5127. }
  5128. return a
  5129. }, fromJSON(u) {
  5130. return {id: n(u.id) ? globalThis.String(u.id) : "", content: n(u.content) ? R(u.content) : new Uint8Array(0)}
  5131. }, toJSON(u) {
  5132. const e = {};
  5133. return u.id !== "" && (e.id = u.id), u.content.length !== 0 && (e.content = I(u.content)), e
  5134. }, create(u) {
  5135. return V0.fromPartial(u != null ? u : {})
  5136. }, fromPartial(u) {
  5137. var i, o;
  5138. const e = Ci();
  5139. return e.id = (i = u.id) != null ? i : "", e.content = (o = u.content) != null ? o : new Uint8Array(0), e
  5140. }
  5141. };
  5142. function pi() {
  5143. return {id: "", name: "", msg: ""}
  5144. }
  5145. const q0 = {
  5146. encode(u, e = r.Writer.create()) {
  5147. return u.id !== "" && e.uint32(10).string(u.id), u.name !== "" && e.uint32(18).string(u.name), u.msg !== "" && e.uint32(26).string(u.msg), e
  5148. }, decode(u, e) {
  5149. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5150. let o = e === void 0 ? i.len : i.pos + e;
  5151. const a = pi();
  5152. for (; i.pos < o;) {
  5153. const t = i.uint32();
  5154. switch (t >>> 3) {
  5155. case 1:
  5156. if (t !== 10) break;
  5157. a.id = i.string();
  5158. continue;
  5159. case 2:
  5160. if (t !== 18) break;
  5161. a.name = i.string();
  5162. continue;
  5163. case 3:
  5164. if (t !== 26) break;
  5165. a.msg = i.string();
  5166. continue
  5167. }
  5168. if ((t & 7) === 4 || t === 0) break;
  5169. i.skipType(t & 7)
  5170. }
  5171. return a
  5172. }, fromJSON(u) {
  5173. return {
  5174. id: n(u.id) ? globalThis.String(u.id) : "",
  5175. name: n(u.name) ? globalThis.String(u.name) : "",
  5176. msg: n(u.msg) ? globalThis.String(u.msg) : ""
  5177. }
  5178. }, toJSON(u) {
  5179. const e = {};
  5180. return u.id !== "" && (e.id = u.id), u.name !== "" && (e.name = u.name), u.msg !== "" && (e.msg = u.msg), e
  5181. }, create(u) {
  5182. return q0.fromPartial(u != null ? u : {})
  5183. }, fromPartial(u) {
  5184. var i, o, a;
  5185. const e = pi();
  5186. return e.id = (i = u.id) != null ? i : "", e.name = (o = u.name) != null ? o : "", e.msg = (a = u.msg) != null ? a : "", e
  5187. }
  5188. };
  5189. function Di() {
  5190. return {sessions: [], current_sid: 0}
  5191. }
  5192. const K0 = {
  5193. encode(u, e = r.Writer.create()) {
  5194. for (const i of u.sessions) c0.encode(i, e.uint32(10).fork()).ldelim();
  5195. return u.current_sid !== 0 && e.uint32(16).uint32(u.current_sid), e
  5196. }, decode(u, e) {
  5197. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5198. let o = e === void 0 ? i.len : i.pos + e;
  5199. const a = Di();
  5200. for (; i.pos < o;) {
  5201. const t = i.uint32();
  5202. switch (t >>> 3) {
  5203. case 1:
  5204. if (t !== 10) break;
  5205. a.sessions.push(c0.decode(i, i.uint32()));
  5206. continue;
  5207. case 2:
  5208. if (t !== 16) break;
  5209. a.current_sid = i.uint32();
  5210. continue
  5211. }
  5212. if ((t & 7) === 4 || t === 0) break;
  5213. i.skipType(t & 7)
  5214. }
  5215. return a
  5216. }, fromJSON(u) {
  5217. return {
  5218. sessions: globalThis.Array.isArray(u == null ? void 0 : u.sessions) ? u.sessions.map(e => c0.fromJSON(e)) : [],
  5219. current_sid: n(u.current_sid) ? globalThis.Number(u.current_sid) : 0
  5220. }
  5221. }, toJSON(u) {
  5222. var i;
  5223. const e = {};
  5224. return (i = u.sessions) != null && i.length && (e.sessions = u.sessions.map(o => c0.toJSON(o))), u.current_sid !== 0 && (e.current_sid = Math.round(u.current_sid)), e
  5225. }, create(u) {
  5226. return K0.fromPartial(u != null ? u : {})
  5227. }, fromPartial(u) {
  5228. var i, o;
  5229. const e = Di();
  5230. return e.sessions = ((i = u.sessions) == null ? void 0 : i.map(a => c0.fromPartial(a))) || [], e.current_sid = (o = u.current_sid) != null ? o : 0, e
  5231. }
  5232. };
  5233. function Bi() {
  5234. return {switch_display: 0}
  5235. }
  5236. const H0 = {
  5237. encode(u, e = r.Writer.create()) {
  5238. return u.switch_display !== 0 && e.uint32(8).int32(u.switch_display), e
  5239. }, decode(u, e) {
  5240. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5241. let o = e === void 0 ? i.len : i.pos + e;
  5242. const a = Bi();
  5243. for (; i.pos < o;) {
  5244. const t = i.uint32();
  5245. switch (t >>> 3) {
  5246. case 1:
  5247. if (t !== 8) break;
  5248. a.switch_display = i.int32();
  5249. continue
  5250. }
  5251. if ((t & 7) === 4 || t === 0) break;
  5252. i.skipType(t & 7)
  5253. }
  5254. return a
  5255. }, fromJSON(u) {
  5256. return {switch_display: n(u.switch_display) ? globalThis.Number(u.switch_display) : 0}
  5257. }, toJSON(u) {
  5258. const e = {};
  5259. return u.switch_display !== 0 && (e.switch_display = Math.round(u.switch_display)), e
  5260. }, create(u) {
  5261. return H0.fromPartial(u != null ? u : {})
  5262. }, fromPartial(u) {
  5263. var i;
  5264. const e = Bi();
  5265. return e.switch_display = (i = u.switch_display) != null ? i : 0, e
  5266. }
  5267. };
  5268. function mi() {
  5269. return {
  5270. chat_message: void 0,
  5271. switch_display: void 0,
  5272. permission_info: void 0,
  5273. option: void 0,
  5274. audio_format: void 0,
  5275. close_reason: void 0,
  5276. refresh_video: void 0,
  5277. video_received: void 0,
  5278. back_notification: void 0,
  5279. restart_remote_device: void 0,
  5280. uac: void 0,
  5281. foreground_window_elevated: void 0,
  5282. stop_service: void 0,
  5283. elevation_request: void 0,
  5284. elevation_response: void 0,
  5285. portable_service_running: void 0,
  5286. switch_sides_request: void 0,
  5287. switch_back: void 0,
  5288. change_resolution: void 0,
  5289. plugin_request: void 0,
  5290. plugin_failure: void 0,
  5291. full_speed_fps: void 0,
  5292. auto_adjust_fps: void 0,
  5293. client_record_status: void 0,
  5294. capture_displays: void 0,
  5295. refresh_video_display: void 0,
  5296. toggle_virtual_display: void 0,
  5297. toggle_privacy_mode: void 0,
  5298. supported_encoding: void 0,
  5299. selected_sid: void 0,
  5300. change_display_resolution: void 0,
  5301. message_query: void 0,
  5302. follow_current_display: void 0
  5303. }
  5304. }
  5305. const f = {
  5306. encode(u, e = r.Writer.create()) {
  5307. return u.chat_message !== void 0 && vu.encode(u.chat_message, e.uint32(34).fork()).ldelim(), u.switch_display !== void 0 && Mu.encode(u.switch_display, e.uint32(42).fork()).ldelim(), u.permission_info !== void 0 && R0.encode(u.permission_info, e.uint32(50).fork()).ldelim(), u.option !== void 0 && z.encode(u.option, e.uint32(58).fork()).ldelim(), u.audio_format !== void 0 && j0.encode(u.audio_format, e.uint32(66).fork()).ldelim(), u.close_reason !== void 0 && e.uint32(74).string(u.close_reason), u.refresh_video !== void 0 && e.uint32(80).bool(u.refresh_video), u.video_received !== void 0 && e.uint32(96).bool(u.video_received), u.back_notification !== void 0 && M0.encode(u.back_notification, e.uint32(106).fork()).ldelim(), u.restart_remote_device !== void 0 && e.uint32(112).bool(u.restart_remote_device), u.uac !== void 0 && e.uint32(120).bool(u.uac), u.foreground_window_elevated !== void 0 && e.uint32(128).bool(u.foreground_window_elevated), u.stop_service !== void 0 && e.uint32(136).bool(u.stop_service), u.elevation_request !== void 0 && Du.encode(u.elevation_request, e.uint32(146).fork()).ldelim(), u.elevation_response !== void 0 && e.uint32(154).string(u.elevation_response), u.portable_service_running !== void 0 && e.uint32(160).bool(u.portable_service_running), u.switch_sides_request !== void 0 && U0.encode(u.switch_sides_request, e.uint32(170).fork()).ldelim(), u.switch_back !== void 0 && W0.encode(u.switch_back, e.uint32(178).fork()).ldelim(), u.change_resolution !== void 0 && v.encode(u.change_resolution, e.uint32(194).fork()).ldelim(), u.plugin_request !== void 0 && V0.encode(u.plugin_request, e.uint32(202).fork()).ldelim(), u.plugin_failure !== void 0 && q0.encode(u.plugin_failure, e.uint32(210).fork()).ldelim(), u.full_speed_fps !== void 0 && e.uint32(216).uint32(u.full_speed_fps), u.auto_adjust_fps !== void 0 && e.uint32(224).uint32(u.auto_adjust_fps), u.client_record_status !== void 0 && e.uint32(232).bool(u.client_record_status), u.capture_displays !== void 0 && Uu.encode(u.capture_displays, e.uint32(242).fork()).ldelim(), u.refresh_video_display !== void 0 && e.uint32(248).int32(u.refresh_video_display), u.toggle_virtual_display !== void 0 && Lu.encode(u.toggle_virtual_display, e.uint32(258).fork()).ldelim(), u.toggle_privacy_mode !== void 0 && Wu.encode(u.toggle_privacy_mode, e.uint32(266).fork()).ldelim(), u.supported_encoding !== void 0 && G.encode(u.supported_encoding, e.uint32(274).fork()).ldelim(), u.selected_sid !== void 0 && e.uint32(280).uint32(u.selected_sid), u.change_display_resolution !== void 0 && Ou.encode(u.change_display_resolution, e.uint32(290).fork()).ldelim(), u.message_query !== void 0 && H0.encode(u.message_query, e.uint32(298).fork()).ldelim(), u.follow_current_display !== void 0 && e.uint32(304).int32(u.follow_current_display), e
  5308. }, decode(u, e) {
  5309. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5310. let o = e === void 0 ? i.len : i.pos + e;
  5311. const a = mi();
  5312. for (; i.pos < o;) {
  5313. const t = i.uint32();
  5314. switch (t >>> 3) {
  5315. case 4:
  5316. if (t !== 34) break;
  5317. a.chat_message = vu.decode(i, i.uint32());
  5318. continue;
  5319. case 5:
  5320. if (t !== 42) break;
  5321. a.switch_display = Mu.decode(i, i.uint32());
  5322. continue;
  5323. case 6:
  5324. if (t !== 50) break;
  5325. a.permission_info = R0.decode(i, i.uint32());
  5326. continue;
  5327. case 7:
  5328. if (t !== 58) break;
  5329. a.option = z.decode(i, i.uint32());
  5330. continue;
  5331. case 8:
  5332. if (t !== 66) break;
  5333. a.audio_format = j0.decode(i, i.uint32());
  5334. continue;
  5335. case 9:
  5336. if (t !== 74) break;
  5337. a.close_reason = i.string();
  5338. continue;
  5339. case 10:
  5340. if (t !== 80) break;
  5341. a.refresh_video = i.bool();
  5342. continue;
  5343. case 12:
  5344. if (t !== 96) break;
  5345. a.video_received = i.bool();
  5346. continue;
  5347. case 13:
  5348. if (t !== 106) break;
  5349. a.back_notification = M0.decode(i, i.uint32());
  5350. continue;
  5351. case 14:
  5352. if (t !== 112) break;
  5353. a.restart_remote_device = i.bool();
  5354. continue;
  5355. case 15:
  5356. if (t !== 120) break;
  5357. a.uac = i.bool();
  5358. continue;
  5359. case 16:
  5360. if (t !== 128) break;
  5361. a.foreground_window_elevated = i.bool();
  5362. continue;
  5363. case 17:
  5364. if (t !== 136) break;
  5365. a.stop_service = i.bool();
  5366. continue;
  5367. case 18:
  5368. if (t !== 146) break;
  5369. a.elevation_request = Du.decode(i, i.uint32());
  5370. continue;
  5371. case 19:
  5372. if (t !== 154) break;
  5373. a.elevation_response = i.string();
  5374. continue;
  5375. case 20:
  5376. if (t !== 160) break;
  5377. a.portable_service_running = i.bool();
  5378. continue;
  5379. case 21:
  5380. if (t !== 170) break;
  5381. a.switch_sides_request = U0.decode(i, i.uint32());
  5382. continue;
  5383. case 22:
  5384. if (t !== 178) break;
  5385. a.switch_back = W0.decode(i, i.uint32());
  5386. continue;
  5387. case 24:
  5388. if (t !== 194) break;
  5389. a.change_resolution = v.decode(i, i.uint32());
  5390. continue;
  5391. case 25:
  5392. if (t !== 202) break;
  5393. a.plugin_request = V0.decode(i, i.uint32());
  5394. continue;
  5395. case 26:
  5396. if (t !== 210) break;
  5397. a.plugin_failure = q0.decode(i, i.uint32());
  5398. continue;
  5399. case 27:
  5400. if (t !== 216) break;
  5401. a.full_speed_fps = i.uint32();
  5402. continue;
  5403. case 28:
  5404. if (t !== 224) break;
  5405. a.auto_adjust_fps = i.uint32();
  5406. continue;
  5407. case 29:
  5408. if (t !== 232) break;
  5409. a.client_record_status = i.bool();
  5410. continue;
  5411. case 30:
  5412. if (t !== 242) break;
  5413. a.capture_displays = Uu.decode(i, i.uint32());
  5414. continue;
  5415. case 31:
  5416. if (t !== 248) break;
  5417. a.refresh_video_display = i.int32();
  5418. continue;
  5419. case 32:
  5420. if (t !== 258) break;
  5421. a.toggle_virtual_display = Lu.decode(i, i.uint32());
  5422. continue;
  5423. case 33:
  5424. if (t !== 266) break;
  5425. a.toggle_privacy_mode = Wu.decode(i, i.uint32());
  5426. continue;
  5427. case 34:
  5428. if (t !== 274) break;
  5429. a.supported_encoding = G.decode(i, i.uint32());
  5430. continue;
  5431. case 35:
  5432. if (t !== 280) break;
  5433. a.selected_sid = i.uint32();
  5434. continue;
  5435. case 36:
  5436. if (t !== 290) break;
  5437. a.change_display_resolution = Ou.decode(i, i.uint32());
  5438. continue;
  5439. case 37:
  5440. if (t !== 298) break;
  5441. a.message_query = H0.decode(i, i.uint32());
  5442. continue;
  5443. case 38:
  5444. if (t !== 304) break;
  5445. a.follow_current_display = i.int32();
  5446. continue
  5447. }
  5448. if ((t & 7) === 4 || t === 0) break;
  5449. i.skipType(t & 7)
  5450. }
  5451. return a
  5452. }, fromJSON(u) {
  5453. return {
  5454. chat_message: n(u.chat_message) ? vu.fromJSON(u.chat_message) : void 0,
  5455. switch_display: n(u.switch_display) ? Mu.fromJSON(u.switch_display) : void 0,
  5456. permission_info: n(u.permission_info) ? R0.fromJSON(u.permission_info) : void 0,
  5457. option: n(u.option) ? z.fromJSON(u.option) : void 0,
  5458. audio_format: n(u.audio_format) ? j0.fromJSON(u.audio_format) : void 0,
  5459. close_reason: n(u.close_reason) ? globalThis.String(u.close_reason) : void 0,
  5460. refresh_video: n(u.refresh_video) ? globalThis.Boolean(u.refresh_video) : void 0,
  5461. video_received: n(u.video_received) ? globalThis.Boolean(u.video_received) : void 0,
  5462. back_notification: n(u.back_notification) ? M0.fromJSON(u.back_notification) : void 0,
  5463. restart_remote_device: n(u.restart_remote_device) ? globalThis.Boolean(u.restart_remote_device) : void 0,
  5464. uac: n(u.uac) ? globalThis.Boolean(u.uac) : void 0,
  5465. foreground_window_elevated: n(u.foreground_window_elevated) ? globalThis.Boolean(u.foreground_window_elevated) : void 0,
  5466. stop_service: n(u.stop_service) ? globalThis.Boolean(u.stop_service) : void 0,
  5467. elevation_request: n(u.elevation_request) ? Du.fromJSON(u.elevation_request) : void 0,
  5468. elevation_response: n(u.elevation_response) ? globalThis.String(u.elevation_response) : void 0,
  5469. portable_service_running: n(u.portable_service_running) ? globalThis.Boolean(u.portable_service_running) : void 0,
  5470. switch_sides_request: n(u.switch_sides_request) ? U0.fromJSON(u.switch_sides_request) : void 0,
  5471. switch_back: n(u.switch_back) ? W0.fromJSON(u.switch_back) : void 0,
  5472. change_resolution: n(u.change_resolution) ? v.fromJSON(u.change_resolution) : void 0,
  5473. plugin_request: n(u.plugin_request) ? V0.fromJSON(u.plugin_request) : void 0,
  5474. plugin_failure: n(u.plugin_failure) ? q0.fromJSON(u.plugin_failure) : void 0,
  5475. full_speed_fps: n(u.full_speed_fps) ? globalThis.Number(u.full_speed_fps) : void 0,
  5476. auto_adjust_fps: n(u.auto_adjust_fps) ? globalThis.Number(u.auto_adjust_fps) : void 0,
  5477. client_record_status: n(u.client_record_status) ? globalThis.Boolean(u.client_record_status) : void 0,
  5478. capture_displays: n(u.capture_displays) ? Uu.fromJSON(u.capture_displays) : void 0,
  5479. refresh_video_display: n(u.refresh_video_display) ? globalThis.Number(u.refresh_video_display) : void 0,
  5480. toggle_virtual_display: n(u.toggle_virtual_display) ? Lu.fromJSON(u.toggle_virtual_display) : void 0,
  5481. toggle_privacy_mode: n(u.toggle_privacy_mode) ? Wu.fromJSON(u.toggle_privacy_mode) : void 0,
  5482. supported_encoding: n(u.supported_encoding) ? G.fromJSON(u.supported_encoding) : void 0,
  5483. selected_sid: n(u.selected_sid) ? globalThis.Number(u.selected_sid) : void 0,
  5484. change_display_resolution: n(u.change_display_resolution) ? Ou.fromJSON(u.change_display_resolution) : void 0,
  5485. message_query: n(u.message_query) ? H0.fromJSON(u.message_query) : void 0,
  5486. follow_current_display: n(u.follow_current_display) ? globalThis.Number(u.follow_current_display) : void 0
  5487. }
  5488. }, toJSON(u) {
  5489. const e = {};
  5490. return u.chat_message !== void 0 && (e.chat_message = vu.toJSON(u.chat_message)), u.switch_display !== void 0 && (e.switch_display = Mu.toJSON(u.switch_display)), u.permission_info !== void 0 && (e.permission_info = R0.toJSON(u.permission_info)), u.option !== void 0 && (e.option = z.toJSON(u.option)), u.audio_format !== void 0 && (e.audio_format = j0.toJSON(u.audio_format)), u.close_reason !== void 0 && (e.close_reason = u.close_reason), u.refresh_video !== void 0 && (e.refresh_video = u.refresh_video), u.video_received !== void 0 && (e.video_received = u.video_received), u.back_notification !== void 0 && (e.back_notification = M0.toJSON(u.back_notification)), u.restart_remote_device !== void 0 && (e.restart_remote_device = u.restart_remote_device), u.uac !== void 0 && (e.uac = u.uac), u.foreground_window_elevated !== void 0 && (e.foreground_window_elevated = u.foreground_window_elevated), u.stop_service !== void 0 && (e.stop_service = u.stop_service), u.elevation_request !== void 0 && (e.elevation_request = Du.toJSON(u.elevation_request)), u.elevation_response !== void 0 && (e.elevation_response = u.elevation_response), u.portable_service_running !== void 0 && (e.portable_service_running = u.portable_service_running), u.switch_sides_request !== void 0 && (e.switch_sides_request = U0.toJSON(u.switch_sides_request)), u.switch_back !== void 0 && (e.switch_back = W0.toJSON(u.switch_back)), u.change_resolution !== void 0 && (e.change_resolution = v.toJSON(u.change_resolution)), u.plugin_request !== void 0 && (e.plugin_request = V0.toJSON(u.plugin_request)), u.plugin_failure !== void 0 && (e.plugin_failure = q0.toJSON(u.plugin_failure)), u.full_speed_fps !== void 0 && (e.full_speed_fps = Math.round(u.full_speed_fps)), u.auto_adjust_fps !== void 0 && (e.auto_adjust_fps = Math.round(u.auto_adjust_fps)), u.client_record_status !== void 0 && (e.client_record_status = u.client_record_status), u.capture_displays !== void 0 && (e.capture_displays = Uu.toJSON(u.capture_displays)), u.refresh_video_display !== void 0 && (e.refresh_video_display = Math.round(u.refresh_video_display)), u.toggle_virtual_display !== void 0 && (e.toggle_virtual_display = Lu.toJSON(u.toggle_virtual_display)), u.toggle_privacy_mode !== void 0 && (e.toggle_privacy_mode = Wu.toJSON(u.toggle_privacy_mode)), u.supported_encoding !== void 0 && (e.supported_encoding = G.toJSON(u.supported_encoding)), u.selected_sid !== void 0 && (e.selected_sid = Math.round(u.selected_sid)), u.change_display_resolution !== void 0 && (e.change_display_resolution = Ou.toJSON(u.change_display_resolution)), u.message_query !== void 0 && (e.message_query = H0.toJSON(u.message_query)), u.follow_current_display !== void 0 && (e.follow_current_display = Math.round(u.follow_current_display)), e
  5491. }, create(u) {
  5492. return f.fromPartial(u != null ? u : {})
  5493. }, fromPartial(u) {
  5494. var i, o, a, t, s, l, E, c, C, D, B, F, y, S, g;
  5495. const e = mi();
  5496. return e.chat_message = u.chat_message !== void 0 && u.chat_message !== null ? vu.fromPartial(u.chat_message) : void 0, e.switch_display = u.switch_display !== void 0 && u.switch_display !== null ? Mu.fromPartial(u.switch_display) : void 0, e.permission_info = u.permission_info !== void 0 && u.permission_info !== null ? R0.fromPartial(u.permission_info) : void 0, e.option = u.option !== void 0 && u.option !== null ? z.fromPartial(u.option) : void 0, e.audio_format = u.audio_format !== void 0 && u.audio_format !== null ? j0.fromPartial(u.audio_format) : void 0, e.close_reason = (i = u.close_reason) != null ? i : void 0, e.refresh_video = (o = u.refresh_video) != null ? o : void 0, e.video_received = (a = u.video_received) != null ? a : void 0, e.back_notification = u.back_notification !== void 0 && u.back_notification !== null ? M0.fromPartial(u.back_notification) : void 0, e.restart_remote_device = (t = u.restart_remote_device) != null ? t : void 0, e.uac = (s = u.uac) != null ? s : void 0, e.foreground_window_elevated = (l = u.foreground_window_elevated) != null ? l : void 0, e.stop_service = (E = u.stop_service) != null ? E : void 0, e.elevation_request = u.elevation_request !== void 0 && u.elevation_request !== null ? Du.fromPartial(u.elevation_request) : void 0, e.elevation_response = (c = u.elevation_response) != null ? c : void 0, e.portable_service_running = (C = u.portable_service_running) != null ? C : void 0, e.switch_sides_request = u.switch_sides_request !== void 0 && u.switch_sides_request !== null ? U0.fromPartial(u.switch_sides_request) : void 0, e.switch_back = u.switch_back !== void 0 && u.switch_back !== null ? W0.fromPartial(u.switch_back) : void 0, e.change_resolution = u.change_resolution !== void 0 && u.change_resolution !== null ? v.fromPartial(u.change_resolution) : void 0, e.plugin_request = u.plugin_request !== void 0 && u.plugin_request !== null ? V0.fromPartial(u.plugin_request) : void 0, e.plugin_failure = u.plugin_failure !== void 0 && u.plugin_failure !== null ? q0.fromPartial(u.plugin_failure) : void 0, e.full_speed_fps = (D = u.full_speed_fps) != null ? D : void 0, e.auto_adjust_fps = (B = u.auto_adjust_fps) != null ? B : void 0, e.client_record_status = (F = u.client_record_status) != null ? F : void 0, e.capture_displays = u.capture_displays !== void 0 && u.capture_displays !== null ? Uu.fromPartial(u.capture_displays) : void 0, e.refresh_video_display = (y = u.refresh_video_display) != null ? y : void 0, e.toggle_virtual_display = u.toggle_virtual_display !== void 0 && u.toggle_virtual_display !== null ? Lu.fromPartial(u.toggle_virtual_display) : void 0, e.toggle_privacy_mode = u.toggle_privacy_mode !== void 0 && u.toggle_privacy_mode !== null ? Wu.fromPartial(u.toggle_privacy_mode) : void 0, e.supported_encoding = u.supported_encoding !== void 0 && u.supported_encoding !== null ? G.fromPartial(u.supported_encoding) : void 0, e.selected_sid = (S = u.selected_sid) != null ? S : void 0, e.change_display_resolution = u.change_display_resolution !== void 0 && u.change_display_resolution !== null ? Ou.fromPartial(u.change_display_resolution) : void 0, e.message_query = u.message_query !== void 0 && u.message_query !== null ? H0.fromPartial(u.message_query) : void 0, e.follow_current_display = (g = u.follow_current_display) != null ? g : void 0, e
  5497. }
  5498. };
  5499. function Ai() {
  5500. return {req_timestamp: 0, is_connect: !1}
  5501. }
  5502. const J0 = {
  5503. encode(u, e = r.Writer.create()) {
  5504. return u.req_timestamp !== 0 && e.uint32(8).int64(u.req_timestamp), u.is_connect !== !1 && e.uint32(16).bool(u.is_connect), e
  5505. }, decode(u, e) {
  5506. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5507. let o = e === void 0 ? i.len : i.pos + e;
  5508. const a = Ai();
  5509. for (; i.pos < o;) {
  5510. const t = i.uint32();
  5511. switch (t >>> 3) {
  5512. case 1:
  5513. if (t !== 8) break;
  5514. a.req_timestamp = V(i.int64());
  5515. continue;
  5516. case 2:
  5517. if (t !== 16) break;
  5518. a.is_connect = i.bool();
  5519. continue
  5520. }
  5521. if ((t & 7) === 4 || t === 0) break;
  5522. i.skipType(t & 7)
  5523. }
  5524. return a
  5525. }, fromJSON(u) {
  5526. return {
  5527. req_timestamp: n(u.req_timestamp) ? globalThis.Number(u.req_timestamp) : 0,
  5528. is_connect: n(u.is_connect) ? globalThis.Boolean(u.is_connect) : !1
  5529. }
  5530. }, toJSON(u) {
  5531. const e = {};
  5532. return u.req_timestamp !== 0 && (e.req_timestamp = Math.round(u.req_timestamp)), u.is_connect !== !1 && (e.is_connect = u.is_connect), e
  5533. }, create(u) {
  5534. return J0.fromPartial(u != null ? u : {})
  5535. }, fromPartial(u) {
  5536. var i, o;
  5537. const e = Ai();
  5538. return e.req_timestamp = (i = u.req_timestamp) != null ? i : 0, e.is_connect = (o = u.is_connect) != null ? o : !1, e
  5539. }
  5540. };
  5541. function Fi() {
  5542. return {accepted: !1, req_timestamp: 0, ack_timestamp: 0}
  5543. }
  5544. const G0 = {
  5545. encode(u, e = r.Writer.create()) {
  5546. return u.accepted !== !1 && e.uint32(8).bool(u.accepted), u.req_timestamp !== 0 && e.uint32(16).int64(u.req_timestamp), u.ack_timestamp !== 0 && e.uint32(24).int64(u.ack_timestamp), e
  5547. }, decode(u, e) {
  5548. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5549. let o = e === void 0 ? i.len : i.pos + e;
  5550. const a = Fi();
  5551. for (; i.pos < o;) {
  5552. const t = i.uint32();
  5553. switch (t >>> 3) {
  5554. case 1:
  5555. if (t !== 8) break;
  5556. a.accepted = i.bool();
  5557. continue;
  5558. case 2:
  5559. if (t !== 16) break;
  5560. a.req_timestamp = V(i.int64());
  5561. continue;
  5562. case 3:
  5563. if (t !== 24) break;
  5564. a.ack_timestamp = V(i.int64());
  5565. continue
  5566. }
  5567. if ((t & 7) === 4 || t === 0) break;
  5568. i.skipType(t & 7)
  5569. }
  5570. return a
  5571. }, fromJSON(u) {
  5572. return {
  5573. accepted: n(u.accepted) ? globalThis.Boolean(u.accepted) : !1,
  5574. req_timestamp: n(u.req_timestamp) ? globalThis.Number(u.req_timestamp) : 0,
  5575. ack_timestamp: n(u.ack_timestamp) ? globalThis.Number(u.ack_timestamp) : 0
  5576. }
  5577. }, toJSON(u) {
  5578. const e = {};
  5579. return u.accepted !== !1 && (e.accepted = u.accepted), u.req_timestamp !== 0 && (e.req_timestamp = Math.round(u.req_timestamp)), u.ack_timestamp !== 0 && (e.ack_timestamp = Math.round(u.ack_timestamp)), e
  5580. }, create(u) {
  5581. return G0.fromPartial(u != null ? u : {})
  5582. }, fromPartial(u) {
  5583. var i, o, a;
  5584. const e = Fi();
  5585. return e.accepted = (i = u.accepted) != null ? i : !1, e.req_timestamp = (o = u.req_timestamp) != null ? o : 0, e.ack_timestamp = (a = u.ack_timestamp) != null ? a : 0, e
  5586. }
  5587. };
  5588. function _i() {
  5589. return {
  5590. signed_id: void 0,
  5591. public_key: void 0,
  5592. test_delay: void 0,
  5593. video_frame: void 0,
  5594. login_request: void 0,
  5595. login_response: void 0,
  5596. hash: void 0,
  5597. mouse_event: void 0,
  5598. audio_frame: void 0,
  5599. cursor_data: void 0,
  5600. cursor_position: void 0,
  5601. cursor_id: void 0,
  5602. key_event: void 0,
  5603. clipboard: void 0,
  5604. file_action: void 0,
  5605. file_response: void 0,
  5606. misc: void 0,
  5607. cliprdr: void 0,
  5608. message_box: void 0,
  5609. switch_sides_response: void 0,
  5610. voice_call_request: void 0,
  5611. voice_call_response: void 0,
  5612. peer_info: void 0,
  5613. pointer_device_event: void 0,
  5614. auth_2fa: void 0,
  5615. multi_clipboards: void 0
  5616. }
  5617. }
  5618. const iu = {
  5619. encode(u, e = r.Writer.create()) {
  5620. return u.signed_id !== void 0 && T0.encode(u.signed_id, e.uint32(26).fork()).ldelim(), u.public_key !== void 0 && K.encode(u.public_key, e.uint32(34).fork()).ldelim(), u.test_delay !== void 0 && I0.encode(u.test_delay, e.uint32(42).fork()).ldelim(), u.video_frame !== void 0 && r0.encode(u.video_frame, e.uint32(50).fork()).ldelim(), u.login_request !== void 0 && H.encode(u.login_request, e.uint32(58).fork()).ldelim(), u.login_response !== void 0 && C0.encode(u.login_response, e.uint32(66).fork()).ldelim(), u.hash !== void 0 && k0.encode(u.hash, e.uint32(74).fork()).ldelim(), u.mouse_event !== void 0 && ku.encode(u.mouse_event, e.uint32(82).fork()).ldelim(), u.audio_frame !== void 0 && N0.encode(u.audio_frame, e.uint32(90).fork()).ldelim(), u.cursor_data !== void 0 && _0.encode(u.cursor_data, e.uint32(98).fork()).ldelim(), u.cursor_position !== void 0 && v0.encode(u.cursor_position, e.uint32(106).fork()).ldelim(), u.cursor_id !== void 0 && e.uint32(112).uint64(u.cursor_id), u.key_event !== void 0 && w.encode(u.key_event, e.uint32(122).fork()).ldelim(), u.clipboard !== void 0 && L.encode(u.clipboard, e.uint32(130).fork()).ldelim(), u.file_action !== void 0 && P.encode(u.file_action, e.uint32(138).fork()).ldelim(), u.file_response !== void 0 && nu.encode(u.file_response, e.uint32(146).fork()).ldelim(), u.misc !== void 0 && f.encode(u.misc, e.uint32(154).fork()).ldelim(), u.cliprdr !== void 0 && P0.encode(u.cliprdr, e.uint32(162).fork()).ldelim(), u.message_box !== void 0 && O0.encode(u.message_box, e.uint32(170).fork()).ldelim(), u.switch_sides_response !== void 0 && L0.encode(u.switch_sides_response, e.uint32(178).fork()).ldelim(), u.voice_call_request !== void 0 && J0.encode(u.voice_call_request, e.uint32(186).fork()).ldelim(), u.voice_call_response !== void 0 && G0.encode(u.voice_call_response, e.uint32(194).fork()).ldelim(), u.peer_info !== void 0 && Y.encode(u.peer_info, e.uint32(202).fork()).ldelim(), u.pointer_device_event !== void 0 && F0.encode(u.pointer_device_event, e.uint32(210).fork()).ldelim(), u.auth_2fa !== void 0 && _u.encode(u.auth_2fa, e.uint32(218).fork()).ldelim(), u.multi_clipboards !== void 0 && gu.encode(u.multi_clipboards, e.uint32(226).fork()).ldelim(), e
  5621. }, decode(u, e) {
  5622. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5623. let o = e === void 0 ? i.len : i.pos + e;
  5624. const a = _i();
  5625. for (; i.pos < o;) {
  5626. const t = i.uint32();
  5627. switch (t >>> 3) {
  5628. case 3:
  5629. if (t !== 26) break;
  5630. a.signed_id = T0.decode(i, i.uint32());
  5631. continue;
  5632. case 4:
  5633. if (t !== 34) break;
  5634. a.public_key = K.decode(i, i.uint32());
  5635. continue;
  5636. case 5:
  5637. if (t !== 42) break;
  5638. a.test_delay = I0.decode(i, i.uint32());
  5639. continue;
  5640. case 6:
  5641. if (t !== 50) break;
  5642. a.video_frame = r0.decode(i, i.uint32());
  5643. continue;
  5644. case 7:
  5645. if (t !== 58) break;
  5646. a.login_request = H.decode(i, i.uint32());
  5647. continue;
  5648. case 8:
  5649. if (t !== 66) break;
  5650. a.login_response = C0.decode(i, i.uint32());
  5651. continue;
  5652. case 9:
  5653. if (t !== 74) break;
  5654. a.hash = k0.decode(i, i.uint32());
  5655. continue;
  5656. case 10:
  5657. if (t !== 82) break;
  5658. a.mouse_event = ku.decode(i, i.uint32());
  5659. continue;
  5660. case 11:
  5661. if (t !== 90) break;
  5662. a.audio_frame = N0.decode(i, i.uint32());
  5663. continue;
  5664. case 12:
  5665. if (t !== 98) break;
  5666. a.cursor_data = _0.decode(i, i.uint32());
  5667. continue;
  5668. case 13:
  5669. if (t !== 106) break;
  5670. a.cursor_position = v0.decode(i, i.uint32());
  5671. continue;
  5672. case 14:
  5673. if (t !== 112) break;
  5674. a.cursor_id = V(i.uint64());
  5675. continue;
  5676. case 15:
  5677. if (t !== 122) break;
  5678. a.key_event = w.decode(i, i.uint32());
  5679. continue;
  5680. case 16:
  5681. if (t !== 130) break;
  5682. a.clipboard = L.decode(i, i.uint32());
  5683. continue;
  5684. case 17:
  5685. if (t !== 138) break;
  5686. a.file_action = P.decode(i, i.uint32());
  5687. continue;
  5688. case 18:
  5689. if (t !== 146) break;
  5690. a.file_response = nu.decode(i, i.uint32());
  5691. continue;
  5692. case 19:
  5693. if (t !== 154) break;
  5694. a.misc = f.decode(i, i.uint32());
  5695. continue;
  5696. case 20:
  5697. if (t !== 162) break;
  5698. a.cliprdr = P0.decode(i, i.uint32());
  5699. continue;
  5700. case 21:
  5701. if (t !== 170) break;
  5702. a.message_box = O0.decode(i, i.uint32());
  5703. continue;
  5704. case 22:
  5705. if (t !== 178) break;
  5706. a.switch_sides_response = L0.decode(i, i.uint32());
  5707. continue;
  5708. case 23:
  5709. if (t !== 186) break;
  5710. a.voice_call_request = J0.decode(i, i.uint32());
  5711. continue;
  5712. case 24:
  5713. if (t !== 194) break;
  5714. a.voice_call_response = G0.decode(i, i.uint32());
  5715. continue;
  5716. case 25:
  5717. if (t !== 202) break;
  5718. a.peer_info = Y.decode(i, i.uint32());
  5719. continue;
  5720. case 26:
  5721. if (t !== 210) break;
  5722. a.pointer_device_event = F0.decode(i, i.uint32());
  5723. continue;
  5724. case 27:
  5725. if (t !== 218) break;
  5726. a.auth_2fa = _u.decode(i, i.uint32());
  5727. continue;
  5728. case 28:
  5729. if (t !== 226) break;
  5730. a.multi_clipboards = gu.decode(i, i.uint32());
  5731. continue
  5732. }
  5733. if ((t & 7) === 4 || t === 0) break;
  5734. i.skipType(t & 7)
  5735. }
  5736. return a
  5737. }, fromJSON(u) {
  5738. return {
  5739. signed_id: n(u.signed_id) ? T0.fromJSON(u.signed_id) : void 0,
  5740. public_key: n(u.public_key) ? K.fromJSON(u.public_key) : void 0,
  5741. test_delay: n(u.test_delay) ? I0.fromJSON(u.test_delay) : void 0,
  5742. video_frame: n(u.video_frame) ? r0.fromJSON(u.video_frame) : void 0,
  5743. login_request: n(u.login_request) ? H.fromJSON(u.login_request) : void 0,
  5744. login_response: n(u.login_response) ? C0.fromJSON(u.login_response) : void 0,
  5745. hash: n(u.hash) ? k0.fromJSON(u.hash) : void 0,
  5746. mouse_event: n(u.mouse_event) ? ku.fromJSON(u.mouse_event) : void 0,
  5747. audio_frame: n(u.audio_frame) ? N0.fromJSON(u.audio_frame) : void 0,
  5748. cursor_data: n(u.cursor_data) ? _0.fromJSON(u.cursor_data) : void 0,
  5749. cursor_position: n(u.cursor_position) ? v0.fromJSON(u.cursor_position) : void 0,
  5750. cursor_id: n(u.cursor_id) ? globalThis.Number(u.cursor_id) : void 0,
  5751. key_event: n(u.key_event) ? w.fromJSON(u.key_event) : void 0,
  5752. clipboard: n(u.clipboard) ? L.fromJSON(u.clipboard) : void 0,
  5753. file_action: n(u.file_action) ? P.fromJSON(u.file_action) : void 0,
  5754. file_response: n(u.file_response) ? nu.fromJSON(u.file_response) : void 0,
  5755. misc: n(u.misc) ? f.fromJSON(u.misc) : void 0,
  5756. cliprdr: n(u.cliprdr) ? P0.fromJSON(u.cliprdr) : void 0,
  5757. message_box: n(u.message_box) ? O0.fromJSON(u.message_box) : void 0,
  5758. switch_sides_response: n(u.switch_sides_response) ? L0.fromJSON(u.switch_sides_response) : void 0,
  5759. voice_call_request: n(u.voice_call_request) ? J0.fromJSON(u.voice_call_request) : void 0,
  5760. voice_call_response: n(u.voice_call_response) ? G0.fromJSON(u.voice_call_response) : void 0,
  5761. peer_info: n(u.peer_info) ? Y.fromJSON(u.peer_info) : void 0,
  5762. pointer_device_event: n(u.pointer_device_event) ? F0.fromJSON(u.pointer_device_event) : void 0,
  5763. auth_2fa: n(u.auth_2fa) ? _u.fromJSON(u.auth_2fa) : void 0,
  5764. multi_clipboards: n(u.multi_clipboards) ? gu.fromJSON(u.multi_clipboards) : void 0
  5765. }
  5766. }, toJSON(u) {
  5767. const e = {};
  5768. return u.signed_id !== void 0 && (e.signed_id = T0.toJSON(u.signed_id)), u.public_key !== void 0 && (e.public_key = K.toJSON(u.public_key)), u.test_delay !== void 0 && (e.test_delay = I0.toJSON(u.test_delay)), u.video_frame !== void 0 && (e.video_frame = r0.toJSON(u.video_frame)), u.login_request !== void 0 && (e.login_request = H.toJSON(u.login_request)), u.login_response !== void 0 && (e.login_response = C0.toJSON(u.login_response)), u.hash !== void 0 && (e.hash = k0.toJSON(u.hash)), u.mouse_event !== void 0 && (e.mouse_event = ku.toJSON(u.mouse_event)), u.audio_frame !== void 0 && (e.audio_frame = N0.toJSON(u.audio_frame)), u.cursor_data !== void 0 && (e.cursor_data = _0.toJSON(u.cursor_data)), u.cursor_position !== void 0 && (e.cursor_position = v0.toJSON(u.cursor_position)), u.cursor_id !== void 0 && (e.cursor_id = Math.round(u.cursor_id)), u.key_event !== void 0 && (e.key_event = w.toJSON(u.key_event)), u.clipboard !== void 0 && (e.clipboard = L.toJSON(u.clipboard)), u.file_action !== void 0 && (e.file_action = P.toJSON(u.file_action)), u.file_response !== void 0 && (e.file_response = nu.toJSON(u.file_response)), u.misc !== void 0 && (e.misc = f.toJSON(u.misc)), u.cliprdr !== void 0 && (e.cliprdr = P0.toJSON(u.cliprdr)), u.message_box !== void 0 && (e.message_box = O0.toJSON(u.message_box)), u.switch_sides_response !== void 0 && (e.switch_sides_response = L0.toJSON(u.switch_sides_response)), u.voice_call_request !== void 0 && (e.voice_call_request = J0.toJSON(u.voice_call_request)), u.voice_call_response !== void 0 && (e.voice_call_response = G0.toJSON(u.voice_call_response)), u.peer_info !== void 0 && (e.peer_info = Y.toJSON(u.peer_info)), u.pointer_device_event !== void 0 && (e.pointer_device_event = F0.toJSON(u.pointer_device_event)), u.auth_2fa !== void 0 && (e.auth_2fa = _u.toJSON(u.auth_2fa)), u.multi_clipboards !== void 0 && (e.multi_clipboards = gu.toJSON(u.multi_clipboards)), e
  5769. }, create(u) {
  5770. return iu.fromPartial(u != null ? u : {})
  5771. }, fromPartial(u) {
  5772. var i;
  5773. const e = _i();
  5774. return e.signed_id = u.signed_id !== void 0 && u.signed_id !== null ? T0.fromPartial(u.signed_id) : void 0, e.public_key = u.public_key !== void 0 && u.public_key !== null ? K.fromPartial(u.public_key) : void 0, e.test_delay = u.test_delay !== void 0 && u.test_delay !== null ? I0.fromPartial(u.test_delay) : void 0, e.video_frame = u.video_frame !== void 0 && u.video_frame !== null ? r0.fromPartial(u.video_frame) : void 0, e.login_request = u.login_request !== void 0 && u.login_request !== null ? H.fromPartial(u.login_request) : void 0, e.login_response = u.login_response !== void 0 && u.login_response !== null ? C0.fromPartial(u.login_response) : void 0, e.hash = u.hash !== void 0 && u.hash !== null ? k0.fromPartial(u.hash) : void 0, e.mouse_event = u.mouse_event !== void 0 && u.mouse_event !== null ? ku.fromPartial(u.mouse_event) : void 0, e.audio_frame = u.audio_frame !== void 0 && u.audio_frame !== null ? N0.fromPartial(u.audio_frame) : void 0, e.cursor_data = u.cursor_data !== void 0 && u.cursor_data !== null ? _0.fromPartial(u.cursor_data) : void 0, e.cursor_position = u.cursor_position !== void 0 && u.cursor_position !== null ? v0.fromPartial(u.cursor_position) : void 0, e.cursor_id = (i = u.cursor_id) != null ? i : void 0, e.key_event = u.key_event !== void 0 && u.key_event !== null ? w.fromPartial(u.key_event) : void 0, e.clipboard = u.clipboard !== void 0 && u.clipboard !== null ? L.fromPartial(u.clipboard) : void 0, e.file_action = u.file_action !== void 0 && u.file_action !== null ? P.fromPartial(u.file_action) : void 0, e.file_response = u.file_response !== void 0 && u.file_response !== null ? nu.fromPartial(u.file_response) : void 0, e.misc = u.misc !== void 0 && u.misc !== null ? f.fromPartial(u.misc) : void 0, e.cliprdr = u.cliprdr !== void 0 && u.cliprdr !== null ? P0.fromPartial(u.cliprdr) : void 0, e.message_box = u.message_box !== void 0 && u.message_box !== null ? O0.fromPartial(u.message_box) : void 0, e.switch_sides_response = u.switch_sides_response !== void 0 && u.switch_sides_response !== null ? L0.fromPartial(u.switch_sides_response) : void 0, e.voice_call_request = u.voice_call_request !== void 0 && u.voice_call_request !== null ? J0.fromPartial(u.voice_call_request) : void 0, e.voice_call_response = u.voice_call_response !== void 0 && u.voice_call_response !== null ? G0.fromPartial(u.voice_call_response) : void 0, e.peer_info = u.peer_info !== void 0 && u.peer_info !== null ? Y.fromPartial(u.peer_info) : void 0, e.pointer_device_event = u.pointer_device_event !== void 0 && u.pointer_device_event !== null ? F0.fromPartial(u.pointer_device_event) : void 0, e.auth_2fa = u.auth_2fa !== void 0 && u.auth_2fa !== null ? _u.fromPartial(u.auth_2fa) : void 0, e.multi_clipboards = u.multi_clipboards !== void 0 && u.multi_clipboards !== null ? gu.fromPartial(u.multi_clipboards) : void 0, e
  5775. }
  5776. };
  5777. function R(u) {
  5778. if (globalThis.Buffer) return Uint8Array.from(globalThis.Buffer.from(u, "base64"));
  5779. {
  5780. const e = globalThis.atob(u), i = new Uint8Array(e.length);
  5781. for (let o = 0; o < e.length; ++o) i[o] = e.charCodeAt(o);
  5782. return i
  5783. }
  5784. }
  5785. function I(u) {
  5786. if (globalThis.Buffer) return globalThis.Buffer.from(u).toString("base64");
  5787. {
  5788. const e = [];
  5789. return u.forEach(i => {
  5790. e.push(globalThis.String.fromCharCode(i))
  5791. }), globalThis.btoa(e.join(""))
  5792. }
  5793. }
  5794. function V(u) {
  5795. if (u.gt(globalThis.Number.MAX_SAFE_INTEGER)) throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
  5796. if (u.lt(globalThis.Number.MIN_SAFE_INTEGER)) throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
  5797. return u.toNumber()
  5798. }
  5799. r.util.Long !== je && (r.util.Long = je, r.configure());
  5800. function n(u) {
  5801. return u != null
  5802. }
  5803. var ne = (u => (u[u.DEFAULT_CONN = 0] = "DEFAULT_CONN", u[u.FILE_TRANSFER = 1] = "FILE_TRANSFER", u[u.PORT_FORWARD = 2] = "PORT_FORWARD", u[u.RDP = 3] = "RDP", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(ne || {});
  5804. function ct(u) {
  5805. switch (u) {
  5806. case 0:
  5807. case"DEFAULT_CONN":
  5808. return 0;
  5809. case 1:
  5810. case"FILE_TRANSFER":
  5811. return 1;
  5812. case 2:
  5813. case"PORT_FORWARD":
  5814. return 2;
  5815. case 3:
  5816. case"RDP":
  5817. return 3;
  5818. case-1:
  5819. case"UNRECOGNIZED":
  5820. default:
  5821. return -1
  5822. }
  5823. }
  5824. function Ct(u) {
  5825. switch (u) {
  5826. case 0:
  5827. return "DEFAULT_CONN";
  5828. case 1:
  5829. return "FILE_TRANSFER";
  5830. case 2:
  5831. return "PORT_FORWARD";
  5832. case 3:
  5833. return "RDP";
  5834. case-1:
  5835. default:
  5836. return "UNRECOGNIZED"
  5837. }
  5838. }
  5839. var pt = (u => (u[u.UNKNOWN_NAT = 0] = "UNKNOWN_NAT", u[u.ASYMMETRIC = 1] = "ASYMMETRIC", u[u.SYMMETRIC = 2] = "SYMMETRIC", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(pt || {});
  5840. function Q4(u) {
  5841. switch (u) {
  5842. case 0:
  5843. case"UNKNOWN_NAT":
  5844. return 0;
  5845. case 1:
  5846. case"ASYMMETRIC":
  5847. return 1;
  5848. case 2:
  5849. case"SYMMETRIC":
  5850. return 2;
  5851. case-1:
  5852. case"UNRECOGNIZED":
  5853. default:
  5854. return -1
  5855. }
  5856. }
  5857. function X4(u) {
  5858. switch (u) {
  5859. case 0:
  5860. return "UNKNOWN_NAT";
  5861. case 1:
  5862. return "ASYMMETRIC";
  5863. case 2:
  5864. return "SYMMETRIC";
  5865. case-1:
  5866. default:
  5867. return "UNRECOGNIZED"
  5868. }
  5869. }
  5870. function xa(u) {
  5871. switch (u) {
  5872. case 0:
  5873. case"OK":
  5874. return 0;
  5875. case 2:
  5876. case"UUID_MISMATCH":
  5877. return 2;
  5878. case 3:
  5879. case"ID_EXISTS":
  5880. return 3;
  5881. case 4:
  5882. case"TOO_FREQUENT":
  5883. return 4;
  5884. case 5:
  5885. case"INVALID_ID_FORMAT":
  5886. return 5;
  5887. case 6:
  5888. case"NOT_SUPPORT":
  5889. return 6;
  5890. case 7:
  5891. case"SERVER_ERROR":
  5892. return 7;
  5893. case-1:
  5894. case"UNRECOGNIZED":
  5895. default:
  5896. return -1
  5897. }
  5898. }
  5899. function ya(u) {
  5900. switch (u) {
  5901. case 0:
  5902. return "OK";
  5903. case 2:
  5904. return "UUID_MISMATCH";
  5905. case 3:
  5906. return "ID_EXISTS";
  5907. case 4:
  5908. return "TOO_FREQUENT";
  5909. case 5:
  5910. return "INVALID_ID_FORMAT";
  5911. case 6:
  5912. return "NOT_SUPPORT";
  5913. case 7:
  5914. return "SERVER_ERROR";
  5915. case-1:
  5916. default:
  5917. return "UNRECOGNIZED"
  5918. }
  5919. }
  5920. var Z0 = (u => (u[u.ID_NOT_EXIST = 0] = "ID_NOT_EXIST", u[u.OFFLINE = 2] = "OFFLINE", u[u.LICENSE_MISMATCH = 3] = "LICENSE_MISMATCH", u[u.LICENSE_OVERUSE = 4] = "LICENSE_OVERUSE", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(Z0 || {});
  5921. function ba(u) {
  5922. switch (u) {
  5923. case 0:
  5924. case"ID_NOT_EXIST":
  5925. return 0;
  5926. case 2:
  5927. case"OFFLINE":
  5928. return 2;
  5929. case 3:
  5930. case"LICENSE_MISMATCH":
  5931. return 3;
  5932. case 4:
  5933. case"LICENSE_OVERUSE":
  5934. return 4;
  5935. case-1:
  5936. case"UNRECOGNIZED":
  5937. default:
  5938. return -1
  5939. }
  5940. }
  5941. function wa(u) {
  5942. switch (u) {
  5943. case 0:
  5944. return "ID_NOT_EXIST";
  5945. case 2:
  5946. return "OFFLINE";
  5947. case 3:
  5948. return "LICENSE_MISMATCH";
  5949. case 4:
  5950. return "LICENSE_OVERUSE";
  5951. case-1:
  5952. default:
  5953. return "UNRECOGNIZED"
  5954. }
  5955. }
  5956. function vi() {
  5957. return {id: "", serial: 0}
  5958. }
  5959. const Q0 = {
  5960. encode(u, e = r.Writer.create()) {
  5961. return u.id !== "" && e.uint32(10).string(u.id), u.serial !== 0 && e.uint32(16).int32(u.serial), e
  5962. }, decode(u, e) {
  5963. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5964. let o = e === void 0 ? i.len : i.pos + e;
  5965. const a = vi();
  5966. for (; i.pos < o;) {
  5967. const t = i.uint32();
  5968. switch (t >>> 3) {
  5969. case 1:
  5970. if (t !== 10) break;
  5971. a.id = i.string();
  5972. continue;
  5973. case 2:
  5974. if (t !== 16) break;
  5975. a.serial = i.int32();
  5976. continue
  5977. }
  5978. if ((t & 7) === 4 || t === 0) break;
  5979. i.skipType(t & 7)
  5980. }
  5981. return a
  5982. }, fromJSON(u) {
  5983. return {id: p(u.id) ? globalThis.String(u.id) : "", serial: p(u.serial) ? globalThis.Number(u.serial) : 0}
  5984. }, toJSON(u) {
  5985. const e = {};
  5986. return u.id !== "" && (e.id = u.id), u.serial !== 0 && (e.serial = Math.round(u.serial)), e
  5987. }, create(u) {
  5988. return Q0.fromPartial(u != null ? u : {})
  5989. }, fromPartial(u) {
  5990. var i, o;
  5991. const e = vi();
  5992. return e.id = (i = u.id) != null ? i : "", e.serial = (o = u.serial) != null ? o : 0, e
  5993. }
  5994. };
  5995. function ki() {
  5996. return {request_pk: !1}
  5997. }
  5998. const X0 = {
  5999. encode(u, e = r.Writer.create()) {
  6000. return u.request_pk !== !1 && e.uint32(16).bool(u.request_pk), e
  6001. }, decode(u, e) {
  6002. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6003. let o = e === void 0 ? i.len : i.pos + e;
  6004. const a = ki();
  6005. for (; i.pos < o;) {
  6006. const t = i.uint32();
  6007. switch (t >>> 3) {
  6008. case 2:
  6009. if (t !== 16) break;
  6010. a.request_pk = i.bool();
  6011. continue
  6012. }
  6013. if ((t & 7) === 4 || t === 0) break;
  6014. i.skipType(t & 7)
  6015. }
  6016. return a
  6017. }, fromJSON(u) {
  6018. return {request_pk: p(u.request_pk) ? globalThis.Boolean(u.request_pk) : !1}
  6019. }, toJSON(u) {
  6020. const e = {};
  6021. return u.request_pk !== !1 && (e.request_pk = u.request_pk), e
  6022. }, create(u) {
  6023. return X0.fromPartial(u != null ? u : {})
  6024. }, fromPartial(u) {
  6025. var i;
  6026. const e = ki();
  6027. return e.request_pk = (i = u.request_pk) != null ? i : !1, e
  6028. }
  6029. };
  6030. function gi() {
  6031. return {id: "", nat_type: 0, licence_key: "", conn_type: 0, token: "", version: ""}
  6032. }
  6033. const Ku = {
  6034. encode(u, e = r.Writer.create()) {
  6035. return u.id !== "" && e.uint32(10).string(u.id), u.nat_type !== 0 && e.uint32(16).int32(u.nat_type), u.licence_key !== "" && e.uint32(26).string(u.licence_key), u.conn_type !== 0 && e.uint32(32).int32(u.conn_type), u.token !== "" && e.uint32(42).string(u.token), u.version !== "" && e.uint32(50).string(u.version), e
  6036. }, decode(u, e) {
  6037. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6038. let o = e === void 0 ? i.len : i.pos + e;
  6039. const a = gi();
  6040. for (; i.pos < o;) {
  6041. const t = i.uint32();
  6042. switch (t >>> 3) {
  6043. case 1:
  6044. if (t !== 10) break;
  6045. a.id = i.string();
  6046. continue;
  6047. case 2:
  6048. if (t !== 16) break;
  6049. a.nat_type = i.int32();
  6050. continue;
  6051. case 3:
  6052. if (t !== 26) break;
  6053. a.licence_key = i.string();
  6054. continue;
  6055. case 4:
  6056. if (t !== 32) break;
  6057. a.conn_type = i.int32();
  6058. continue;
  6059. case 5:
  6060. if (t !== 42) break;
  6061. a.token = i.string();
  6062. continue;
  6063. case 6:
  6064. if (t !== 50) break;
  6065. a.version = i.string();
  6066. continue
  6067. }
  6068. if ((t & 7) === 4 || t === 0) break;
  6069. i.skipType(t & 7)
  6070. }
  6071. return a
  6072. }, fromJSON(u) {
  6073. return {
  6074. id: p(u.id) ? globalThis.String(u.id) : "",
  6075. nat_type: p(u.nat_type) ? Q4(u.nat_type) : 0,
  6076. licence_key: p(u.licence_key) ? globalThis.String(u.licence_key) : "",
  6077. conn_type: p(u.conn_type) ? ct(u.conn_type) : 0,
  6078. token: p(u.token) ? globalThis.String(u.token) : "",
  6079. version: p(u.version) ? globalThis.String(u.version) : ""
  6080. }
  6081. }, toJSON(u) {
  6082. const e = {};
  6083. return u.id !== "" && (e.id = u.id), u.nat_type !== 0 && (e.nat_type = X4(u.nat_type)), u.licence_key !== "" && (e.licence_key = u.licence_key), u.conn_type !== 0 && (e.conn_type = Ct(u.conn_type)), u.token !== "" && (e.token = u.token), u.version !== "" && (e.version = u.version), e
  6084. }, create(u) {
  6085. return Ku.fromPartial(u != null ? u : {})
  6086. }, fromPartial(u) {
  6087. var i, o, a, t, s, l;
  6088. const e = gi();
  6089. return e.id = (i = u.id) != null ? i : "", e.nat_type = (o = u.nat_type) != null ? o : 0, e.licence_key = (a = u.licence_key) != null ? a : "", e.conn_type = (t = u.conn_type) != null ? t : 0, e.token = (s = u.token) != null ? s : "", e.version = (l = u.version) != null ? l : "", e
  6090. }
  6091. };
  6092. function hi() {
  6093. return {socket_addr: new Uint8Array(0), relay_server: "", nat_type: 0}
  6094. }
  6095. const Y0 = {
  6096. encode(u, e = r.Writer.create()) {
  6097. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.relay_server !== "" && e.uint32(18).string(u.relay_server), u.nat_type !== 0 && e.uint32(24).int32(u.nat_type), e
  6098. }, decode(u, e) {
  6099. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6100. let o = e === void 0 ? i.len : i.pos + e;
  6101. const a = hi();
  6102. for (; i.pos < o;) {
  6103. const t = i.uint32();
  6104. switch (t >>> 3) {
  6105. case 1:
  6106. if (t !== 10) break;
  6107. a.socket_addr = i.bytes();
  6108. continue;
  6109. case 2:
  6110. if (t !== 18) break;
  6111. a.relay_server = i.string();
  6112. continue;
  6113. case 3:
  6114. if (t !== 24) break;
  6115. a.nat_type = i.int32();
  6116. continue
  6117. }
  6118. if ((t & 7) === 4 || t === 0) break;
  6119. i.skipType(t & 7)
  6120. }
  6121. return a
  6122. }, fromJSON(u) {
  6123. return {
  6124. socket_addr: p(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6125. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6126. nat_type: p(u.nat_type) ? Q4(u.nat_type) : 0
  6127. }
  6128. }, toJSON(u) {
  6129. const e = {};
  6130. return u.socket_addr.length !== 0 && (e.socket_addr = M(u.socket_addr)), u.relay_server !== "" && (e.relay_server = u.relay_server), u.nat_type !== 0 && (e.nat_type = X4(u.nat_type)), e
  6131. }, create(u) {
  6132. return Y0.fromPartial(u != null ? u : {})
  6133. }, fromPartial(u) {
  6134. var i, o, a;
  6135. const e = hi();
  6136. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.relay_server = (o = u.relay_server) != null ? o : "", e.nat_type = (a = u.nat_type) != null ? a : 0, e
  6137. }
  6138. };
  6139. function fi() {
  6140. return {serial: 0}
  6141. }
  6142. const $0 = {
  6143. encode(u, e = r.Writer.create()) {
  6144. return u.serial !== 0 && e.uint32(8).int32(u.serial), e
  6145. }, decode(u, e) {
  6146. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6147. let o = e === void 0 ? i.len : i.pos + e;
  6148. const a = fi();
  6149. for (; i.pos < o;) {
  6150. const t = i.uint32();
  6151. switch (t >>> 3) {
  6152. case 1:
  6153. if (t !== 8) break;
  6154. a.serial = i.int32();
  6155. continue
  6156. }
  6157. if ((t & 7) === 4 || t === 0) break;
  6158. i.skipType(t & 7)
  6159. }
  6160. return a
  6161. }, fromJSON(u) {
  6162. return {serial: p(u.serial) ? globalThis.Number(u.serial) : 0}
  6163. }, toJSON(u) {
  6164. const e = {};
  6165. return u.serial !== 0 && (e.serial = Math.round(u.serial)), e
  6166. }, create(u) {
  6167. return $0.fromPartial(u != null ? u : {})
  6168. }, fromPartial(u) {
  6169. var i;
  6170. const e = fi();
  6171. return e.serial = (i = u.serial) != null ? i : 0, e
  6172. }
  6173. };
  6174. function xi() {
  6175. return {port: 0, cu: void 0}
  6176. }
  6177. const u4 = {
  6178. encode(u, e = r.Writer.create()) {
  6179. return u.port !== 0 && e.uint32(8).int32(u.port), u.cu !== void 0 && eu.encode(u.cu, e.uint32(18).fork()).ldelim(), e
  6180. }, decode(u, e) {
  6181. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6182. let o = e === void 0 ? i.len : i.pos + e;
  6183. const a = xi();
  6184. for (; i.pos < o;) {
  6185. const t = i.uint32();
  6186. switch (t >>> 3) {
  6187. case 1:
  6188. if (t !== 8) break;
  6189. a.port = i.int32();
  6190. continue;
  6191. case 2:
  6192. if (t !== 18) break;
  6193. a.cu = eu.decode(i, i.uint32());
  6194. continue
  6195. }
  6196. if ((t & 7) === 4 || t === 0) break;
  6197. i.skipType(t & 7)
  6198. }
  6199. return a
  6200. }, fromJSON(u) {
  6201. return {port: p(u.port) ? globalThis.Number(u.port) : 0, cu: p(u.cu) ? eu.fromJSON(u.cu) : void 0}
  6202. }, toJSON(u) {
  6203. const e = {};
  6204. return u.port !== 0 && (e.port = Math.round(u.port)), u.cu !== void 0 && (e.cu = eu.toJSON(u.cu)), e
  6205. }, create(u) {
  6206. return u4.fromPartial(u != null ? u : {})
  6207. }, fromPartial(u) {
  6208. var i;
  6209. const e = xi();
  6210. return e.port = (i = u.port) != null ? i : 0, e.cu = u.cu !== void 0 && u.cu !== null ? eu.fromPartial(u.cu) : void 0, e
  6211. }
  6212. };
  6213. function yi() {
  6214. return {socket_addr: new Uint8Array(0), id: "", relay_server: "", nat_type: 0, version: ""}
  6215. }
  6216. const e4 = {
  6217. encode(u, e = r.Writer.create()) {
  6218. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.id !== "" && e.uint32(18).string(u.id), u.relay_server !== "" && e.uint32(26).string(u.relay_server), u.nat_type !== 0 && e.uint32(32).int32(u.nat_type), u.version !== "" && e.uint32(42).string(u.version), e
  6219. }, decode(u, e) {
  6220. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6221. let o = e === void 0 ? i.len : i.pos + e;
  6222. const a = yi();
  6223. for (; i.pos < o;) {
  6224. const t = i.uint32();
  6225. switch (t >>> 3) {
  6226. case 1:
  6227. if (t !== 10) break;
  6228. a.socket_addr = i.bytes();
  6229. continue;
  6230. case 2:
  6231. if (t !== 18) break;
  6232. a.id = i.string();
  6233. continue;
  6234. case 3:
  6235. if (t !== 26) break;
  6236. a.relay_server = i.string();
  6237. continue;
  6238. case 4:
  6239. if (t !== 32) break;
  6240. a.nat_type = i.int32();
  6241. continue;
  6242. case 5:
  6243. if (t !== 42) break;
  6244. a.version = i.string();
  6245. continue
  6246. }
  6247. if ((t & 7) === 4 || t === 0) break;
  6248. i.skipType(t & 7)
  6249. }
  6250. return a
  6251. }, fromJSON(u) {
  6252. return {
  6253. socket_addr: p(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6254. id: p(u.id) ? globalThis.String(u.id) : "",
  6255. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6256. nat_type: p(u.nat_type) ? Q4(u.nat_type) : 0,
  6257. version: p(u.version) ? globalThis.String(u.version) : ""
  6258. }
  6259. }, toJSON(u) {
  6260. const e = {};
  6261. return u.socket_addr.length !== 0 && (e.socket_addr = M(u.socket_addr)), u.id !== "" && (e.id = u.id), u.relay_server !== "" && (e.relay_server = u.relay_server), u.nat_type !== 0 && (e.nat_type = X4(u.nat_type)), u.version !== "" && (e.version = u.version), e
  6262. }, create(u) {
  6263. return e4.fromPartial(u != null ? u : {})
  6264. }, fromPartial(u) {
  6265. var i, o, a, t, s;
  6266. const e = yi();
  6267. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.id = (o = u.id) != null ? o : "", e.relay_server = (a = u.relay_server) != null ? a : "", e.nat_type = (t = u.nat_type) != null ? t : 0, e.version = (s = u.version) != null ? s : "", e
  6268. }
  6269. };
  6270. function bi() {
  6271. return {id: "", uuid: new Uint8Array(0), pk: new Uint8Array(0), old_id: ""}
  6272. }
  6273. const i4 = {
  6274. encode(u, e = r.Writer.create()) {
  6275. return u.id !== "" && e.uint32(10).string(u.id), u.uuid.length !== 0 && e.uint32(18).bytes(u.uuid), u.pk.length !== 0 && e.uint32(26).bytes(u.pk), u.old_id !== "" && e.uint32(34).string(u.old_id), e
  6276. }, decode(u, e) {
  6277. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6278. let o = e === void 0 ? i.len : i.pos + e;
  6279. const a = bi();
  6280. for (; i.pos < o;) {
  6281. const t = i.uint32();
  6282. switch (t >>> 3) {
  6283. case 1:
  6284. if (t !== 10) break;
  6285. a.id = i.string();
  6286. continue;
  6287. case 2:
  6288. if (t !== 18) break;
  6289. a.uuid = i.bytes();
  6290. continue;
  6291. case 3:
  6292. if (t !== 26) break;
  6293. a.pk = i.bytes();
  6294. continue;
  6295. case 4:
  6296. if (t !== 34) break;
  6297. a.old_id = i.string();
  6298. continue
  6299. }
  6300. if ((t & 7) === 4 || t === 0) break;
  6301. i.skipType(t & 7)
  6302. }
  6303. return a
  6304. }, fromJSON(u) {
  6305. return {
  6306. id: p(u.id) ? globalThis.String(u.id) : "",
  6307. uuid: p(u.uuid) ? O(u.uuid) : new Uint8Array(0),
  6308. pk: p(u.pk) ? O(u.pk) : new Uint8Array(0),
  6309. old_id: p(u.old_id) ? globalThis.String(u.old_id) : ""
  6310. }
  6311. }, toJSON(u) {
  6312. const e = {};
  6313. return u.id !== "" && (e.id = u.id), u.uuid.length !== 0 && (e.uuid = M(u.uuid)), u.pk.length !== 0 && (e.pk = M(u.pk)), u.old_id !== "" && (e.old_id = u.old_id), e
  6314. }, create(u) {
  6315. return i4.fromPartial(u != null ? u : {})
  6316. }, fromPartial(u) {
  6317. var i, o, a, t;
  6318. const e = bi();
  6319. return e.id = (i = u.id) != null ? i : "", e.uuid = (o = u.uuid) != null ? o : new Uint8Array(0), e.pk = (a = u.pk) != null ? a : new Uint8Array(0), e.old_id = (t = u.old_id) != null ? t : "", e
  6320. }
  6321. };
  6322. function wi() {
  6323. return {result: 0, keep_alive: 0}
  6324. }
  6325. const t4 = {
  6326. encode(u, e = r.Writer.create()) {
  6327. return u.result !== 0 && e.uint32(8).int32(u.result), u.keep_alive !== 0 && e.uint32(16).int32(u.keep_alive), e
  6328. }, decode(u, e) {
  6329. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6330. let o = e === void 0 ? i.len : i.pos + e;
  6331. const a = wi();
  6332. for (; i.pos < o;) {
  6333. const t = i.uint32();
  6334. switch (t >>> 3) {
  6335. case 1:
  6336. if (t !== 8) break;
  6337. a.result = i.int32();
  6338. continue;
  6339. case 2:
  6340. if (t !== 16) break;
  6341. a.keep_alive = i.int32();
  6342. continue
  6343. }
  6344. if ((t & 7) === 4 || t === 0) break;
  6345. i.skipType(t & 7)
  6346. }
  6347. return a
  6348. }, fromJSON(u) {
  6349. return {
  6350. result: p(u.result) ? xa(u.result) : 0,
  6351. keep_alive: p(u.keep_alive) ? globalThis.Number(u.keep_alive) : 0
  6352. }
  6353. }, toJSON(u) {
  6354. const e = {};
  6355. return u.result !== 0 && (e.result = ya(u.result)), u.keep_alive !== 0 && (e.keep_alive = Math.round(u.keep_alive)), e
  6356. }, create(u) {
  6357. return t4.fromPartial(u != null ? u : {})
  6358. }, fromPartial(u) {
  6359. var i, o;
  6360. const e = wi();
  6361. return e.result = (i = u.result) != null ? i : 0, e.keep_alive = (o = u.keep_alive) != null ? o : 0, e
  6362. }
  6363. };
  6364. function Si() {
  6365. return {
  6366. socket_addr: new Uint8Array(0),
  6367. pk: new Uint8Array(0),
  6368. failure: 0,
  6369. relay_server: "",
  6370. nat_type: void 0,
  6371. is_local: void 0,
  6372. other_failure: "",
  6373. feedback: 0
  6374. }
  6375. }
  6376. const a4 = {
  6377. encode(u, e = r.Writer.create()) {
  6378. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.pk.length !== 0 && e.uint32(18).bytes(u.pk), u.failure !== 0 && e.uint32(24).int32(u.failure), u.relay_server !== "" && e.uint32(34).string(u.relay_server), u.nat_type !== void 0 && e.uint32(40).int32(u.nat_type), u.is_local !== void 0 && e.uint32(48).bool(u.is_local), u.other_failure !== "" && e.uint32(58).string(u.other_failure), u.feedback !== 0 && e.uint32(64).int32(u.feedback), e
  6379. }, decode(u, e) {
  6380. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6381. let o = e === void 0 ? i.len : i.pos + e;
  6382. const a = Si();
  6383. for (; i.pos < o;) {
  6384. const t = i.uint32();
  6385. switch (t >>> 3) {
  6386. case 1:
  6387. if (t !== 10) break;
  6388. a.socket_addr = i.bytes();
  6389. continue;
  6390. case 2:
  6391. if (t !== 18) break;
  6392. a.pk = i.bytes();
  6393. continue;
  6394. case 3:
  6395. if (t !== 24) break;
  6396. a.failure = i.int32();
  6397. continue;
  6398. case 4:
  6399. if (t !== 34) break;
  6400. a.relay_server = i.string();
  6401. continue;
  6402. case 5:
  6403. if (t !== 40) break;
  6404. a.nat_type = i.int32();
  6405. continue;
  6406. case 6:
  6407. if (t !== 48) break;
  6408. a.is_local = i.bool();
  6409. continue;
  6410. case 7:
  6411. if (t !== 58) break;
  6412. a.other_failure = i.string();
  6413. continue;
  6414. case 8:
  6415. if (t !== 64) break;
  6416. a.feedback = i.int32();
  6417. continue
  6418. }
  6419. if ((t & 7) === 4 || t === 0) break;
  6420. i.skipType(t & 7)
  6421. }
  6422. return a
  6423. }, fromJSON(u) {
  6424. return {
  6425. socket_addr: p(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6426. pk: p(u.pk) ? O(u.pk) : new Uint8Array(0),
  6427. failure: p(u.failure) ? ba(u.failure) : 0,
  6428. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6429. nat_type: p(u.nat_type) ? Q4(u.nat_type) : void 0,
  6430. is_local: p(u.is_local) ? globalThis.Boolean(u.is_local) : void 0,
  6431. other_failure: p(u.other_failure) ? globalThis.String(u.other_failure) : "",
  6432. feedback: p(u.feedback) ? globalThis.Number(u.feedback) : 0
  6433. }
  6434. }, toJSON(u) {
  6435. const e = {};
  6436. return u.socket_addr.length !== 0 && (e.socket_addr = M(u.socket_addr)), u.pk.length !== 0 && (e.pk = M(u.pk)), u.failure !== 0 && (e.failure = wa(u.failure)), u.relay_server !== "" && (e.relay_server = u.relay_server), u.nat_type !== void 0 && (e.nat_type = X4(u.nat_type)), u.is_local !== void 0 && (e.is_local = u.is_local), u.other_failure !== "" && (e.other_failure = u.other_failure), u.feedback !== 0 && (e.feedback = Math.round(u.feedback)), e
  6437. }, create(u) {
  6438. return a4.fromPartial(u != null ? u : {})
  6439. }, fromPartial(u) {
  6440. var i, o, a, t, s, l, E, c;
  6441. const e = Si();
  6442. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.pk = (o = u.pk) != null ? o : new Uint8Array(0), e.failure = (a = u.failure) != null ? a : 0, e.relay_server = (t = u.relay_server) != null ? t : "", e.nat_type = (s = u.nat_type) != null ? s : void 0, e.is_local = (l = u.is_local) != null ? l : void 0, e.other_failure = (E = u.other_failure) != null ? E : "", e.feedback = (c = u.feedback) != null ? c : 0, e
  6443. }
  6444. };
  6445. function zi() {
  6446. return {serial: 0, rendezvous_servers: []}
  6447. }
  6448. const eu = {
  6449. encode(u, e = r.Writer.create()) {
  6450. u.serial !== 0 && e.uint32(8).int32(u.serial);
  6451. for (const i of u.rendezvous_servers) e.uint32(18).string(i);
  6452. return e
  6453. }, decode(u, e) {
  6454. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6455. let o = e === void 0 ? i.len : i.pos + e;
  6456. const a = zi();
  6457. for (; i.pos < o;) {
  6458. const t = i.uint32();
  6459. switch (t >>> 3) {
  6460. case 1:
  6461. if (t !== 8) break;
  6462. a.serial = i.int32();
  6463. continue;
  6464. case 2:
  6465. if (t !== 18) break;
  6466. a.rendezvous_servers.push(i.string());
  6467. continue
  6468. }
  6469. if ((t & 7) === 4 || t === 0) break;
  6470. i.skipType(t & 7)
  6471. }
  6472. return a
  6473. }, fromJSON(u) {
  6474. return {
  6475. serial: p(u.serial) ? globalThis.Number(u.serial) : 0,
  6476. rendezvous_servers: globalThis.Array.isArray(u == null ? void 0 : u.rendezvous_servers) ? u.rendezvous_servers.map(e => globalThis.String(e)) : []
  6477. }
  6478. }, toJSON(u) {
  6479. var i;
  6480. const e = {};
  6481. return u.serial !== 0 && (e.serial = Math.round(u.serial)), (i = u.rendezvous_servers) != null && i.length && (e.rendezvous_servers = u.rendezvous_servers), e
  6482. }, create(u) {
  6483. return eu.fromPartial(u != null ? u : {})
  6484. }, fromPartial(u) {
  6485. var i, o;
  6486. const e = zi();
  6487. return e.serial = (i = u.serial) != null ? i : 0, e.rendezvous_servers = ((o = u.rendezvous_servers) == null ? void 0 : o.map(a => a)) || [], e
  6488. }
  6489. };
  6490. function Pi() {
  6491. return {
  6492. id: "",
  6493. uuid: "",
  6494. socket_addr: new Uint8Array(0),
  6495. relay_server: "",
  6496. secure: !1,
  6497. licence_key: "",
  6498. conn_type: 0,
  6499. token: ""
  6500. }
  6501. }
  6502. const Hu = {
  6503. encode(u, e = r.Writer.create()) {
  6504. return u.id !== "" && e.uint32(10).string(u.id), u.uuid !== "" && e.uint32(18).string(u.uuid), u.socket_addr.length !== 0 && e.uint32(26).bytes(u.socket_addr), u.relay_server !== "" && e.uint32(34).string(u.relay_server), u.secure !== !1 && e.uint32(40).bool(u.secure), u.licence_key !== "" && e.uint32(50).string(u.licence_key), u.conn_type !== 0 && e.uint32(56).int32(u.conn_type), u.token !== "" && e.uint32(66).string(u.token), e
  6505. }, decode(u, e) {
  6506. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6507. let o = e === void 0 ? i.len : i.pos + e;
  6508. const a = Pi();
  6509. for (; i.pos < o;) {
  6510. const t = i.uint32();
  6511. switch (t >>> 3) {
  6512. case 1:
  6513. if (t !== 10) break;
  6514. a.id = i.string();
  6515. continue;
  6516. case 2:
  6517. if (t !== 18) break;
  6518. a.uuid = i.string();
  6519. continue;
  6520. case 3:
  6521. if (t !== 26) break;
  6522. a.socket_addr = i.bytes();
  6523. continue;
  6524. case 4:
  6525. if (t !== 34) break;
  6526. a.relay_server = i.string();
  6527. continue;
  6528. case 5:
  6529. if (t !== 40) break;
  6530. a.secure = i.bool();
  6531. continue;
  6532. case 6:
  6533. if (t !== 50) break;
  6534. a.licence_key = i.string();
  6535. continue;
  6536. case 7:
  6537. if (t !== 56) break;
  6538. a.conn_type = i.int32();
  6539. continue;
  6540. case 8:
  6541. if (t !== 66) break;
  6542. a.token = i.string();
  6543. continue
  6544. }
  6545. if ((t & 7) === 4 || t === 0) break;
  6546. i.skipType(t & 7)
  6547. }
  6548. return a
  6549. }, fromJSON(u) {
  6550. return {
  6551. id: p(u.id) ? globalThis.String(u.id) : "",
  6552. uuid: p(u.uuid) ? globalThis.String(u.uuid) : "",
  6553. socket_addr: p(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6554. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6555. secure: p(u.secure) ? globalThis.Boolean(u.secure) : !1,
  6556. licence_key: p(u.licence_key) ? globalThis.String(u.licence_key) : "",
  6557. conn_type: p(u.conn_type) ? ct(u.conn_type) : 0,
  6558. token: p(u.token) ? globalThis.String(u.token) : ""
  6559. }
  6560. }, toJSON(u) {
  6561. const e = {};
  6562. return u.id !== "" && (e.id = u.id), u.uuid !== "" && (e.uuid = u.uuid), u.socket_addr.length !== 0 && (e.socket_addr = M(u.socket_addr)), u.relay_server !== "" && (e.relay_server = u.relay_server), u.secure !== !1 && (e.secure = u.secure), u.licence_key !== "" && (e.licence_key = u.licence_key), u.conn_type !== 0 && (e.conn_type = Ct(u.conn_type)), u.token !== "" && (e.token = u.token), e
  6563. }, create(u) {
  6564. return Hu.fromPartial(u != null ? u : {})
  6565. }, fromPartial(u) {
  6566. var i, o, a, t, s, l, E, c;
  6567. const e = Pi();
  6568. return e.id = (i = u.id) != null ? i : "", e.uuid = (o = u.uuid) != null ? o : "", e.socket_addr = (a = u.socket_addr) != null ? a : new Uint8Array(0), e.relay_server = (t = u.relay_server) != null ? t : "", e.secure = (s = u.secure) != null ? s : !1, e.licence_key = (l = u.licence_key) != null ? l : "", e.conn_type = (E = u.conn_type) != null ? E : 0, e.token = (c = u.token) != null ? c : "", e
  6569. }
  6570. };
  6571. function Ri() {
  6572. return {
  6573. socket_addr: new Uint8Array(0),
  6574. uuid: "",
  6575. relay_server: "",
  6576. id: void 0,
  6577. pk: void 0,
  6578. refuse_reason: "",
  6579. version: "",
  6580. feedback: 0
  6581. }
  6582. }
  6583. const o4 = {
  6584. encode(u, e = r.Writer.create()) {
  6585. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.uuid !== "" && e.uint32(18).string(u.uuid), u.relay_server !== "" && e.uint32(26).string(u.relay_server), u.id !== void 0 && e.uint32(34).string(u.id), u.pk !== void 0 && e.uint32(42).bytes(u.pk), u.refuse_reason !== "" && e.uint32(50).string(u.refuse_reason), u.version !== "" && e.uint32(58).string(u.version), u.feedback !== 0 && e.uint32(72).int32(u.feedback), e
  6586. }, decode(u, e) {
  6587. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6588. let o = e === void 0 ? i.len : i.pos + e;
  6589. const a = Ri();
  6590. for (; i.pos < o;) {
  6591. const t = i.uint32();
  6592. switch (t >>> 3) {
  6593. case 1:
  6594. if (t !== 10) break;
  6595. a.socket_addr = i.bytes();
  6596. continue;
  6597. case 2:
  6598. if (t !== 18) break;
  6599. a.uuid = i.string();
  6600. continue;
  6601. case 3:
  6602. if (t !== 26) break;
  6603. a.relay_server = i.string();
  6604. continue;
  6605. case 4:
  6606. if (t !== 34) break;
  6607. a.id = i.string();
  6608. continue;
  6609. case 5:
  6610. if (t !== 42) break;
  6611. a.pk = i.bytes();
  6612. continue;
  6613. case 6:
  6614. if (t !== 50) break;
  6615. a.refuse_reason = i.string();
  6616. continue;
  6617. case 7:
  6618. if (t !== 58) break;
  6619. a.version = i.string();
  6620. continue;
  6621. case 9:
  6622. if (t !== 72) break;
  6623. a.feedback = i.int32();
  6624. continue
  6625. }
  6626. if ((t & 7) === 4 || t === 0) break;
  6627. i.skipType(t & 7)
  6628. }
  6629. return a
  6630. }, fromJSON(u) {
  6631. return {
  6632. socket_addr: p(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6633. uuid: p(u.uuid) ? globalThis.String(u.uuid) : "",
  6634. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6635. id: p(u.id) ? globalThis.String(u.id) : void 0,
  6636. pk: p(u.pk) ? O(u.pk) : void 0,
  6637. refuse_reason: p(u.refuse_reason) ? globalThis.String(u.refuse_reason) : "",
  6638. version: p(u.version) ? globalThis.String(u.version) : "",
  6639. feedback: p(u.feedback) ? globalThis.Number(u.feedback) : 0
  6640. }
  6641. }, toJSON(u) {
  6642. const e = {};
  6643. return u.socket_addr.length !== 0 && (e.socket_addr = M(u.socket_addr)), u.uuid !== "" && (e.uuid = u.uuid), u.relay_server !== "" && (e.relay_server = u.relay_server), u.id !== void 0 && (e.id = u.id), u.pk !== void 0 && (e.pk = M(u.pk)), u.refuse_reason !== "" && (e.refuse_reason = u.refuse_reason), u.version !== "" && (e.version = u.version), u.feedback !== 0 && (e.feedback = Math.round(u.feedback)), e
  6644. }, create(u) {
  6645. return o4.fromPartial(u != null ? u : {})
  6646. }, fromPartial(u) {
  6647. var i, o, a, t, s, l, E, c;
  6648. const e = Ri();
  6649. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.uuid = (o = u.uuid) != null ? o : "", e.relay_server = (a = u.relay_server) != null ? a : "", e.id = (t = u.id) != null ? t : void 0, e.pk = (s = u.pk) != null ? s : void 0, e.refuse_reason = (l = u.refuse_reason) != null ? l : "", e.version = (E = u.version) != null ? E : "", e.feedback = (c = u.feedback) != null ? c : 0, e
  6650. }
  6651. };
  6652. function Ii() {
  6653. return {url: ""}
  6654. }
  6655. const n4 = {
  6656. encode(u, e = r.Writer.create()) {
  6657. return u.url !== "" && e.uint32(10).string(u.url), e
  6658. }, decode(u, e) {
  6659. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6660. let o = e === void 0 ? i.len : i.pos + e;
  6661. const a = Ii();
  6662. for (; i.pos < o;) {
  6663. const t = i.uint32();
  6664. switch (t >>> 3) {
  6665. case 1:
  6666. if (t !== 10) break;
  6667. a.url = i.string();
  6668. continue
  6669. }
  6670. if ((t & 7) === 4 || t === 0) break;
  6671. i.skipType(t & 7)
  6672. }
  6673. return a
  6674. }, fromJSON(u) {
  6675. return {url: p(u.url) ? globalThis.String(u.url) : ""}
  6676. }, toJSON(u) {
  6677. const e = {};
  6678. return u.url !== "" && (e.url = u.url), e
  6679. }, create(u) {
  6680. return n4.fromPartial(u != null ? u : {})
  6681. }, fromPartial(u) {
  6682. var i;
  6683. const e = Ii();
  6684. return e.url = (i = u.url) != null ? i : "", e
  6685. }
  6686. };
  6687. function Ti() {
  6688. return {socket_addr: new Uint8Array(0), relay_server: ""}
  6689. }
  6690. const r4 = {
  6691. encode(u, e = r.Writer.create()) {
  6692. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.relay_server !== "" && e.uint32(18).string(u.relay_server), e
  6693. }, decode(u, e) {
  6694. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6695. let o = e === void 0 ? i.len : i.pos + e;
  6696. const a = Ti();
  6697. for (; i.pos < o;) {
  6698. const t = i.uint32();
  6699. switch (t >>> 3) {
  6700. case 1:
  6701. if (t !== 10) break;
  6702. a.socket_addr = i.bytes();
  6703. continue;
  6704. case 2:
  6705. if (t !== 18) break;
  6706. a.relay_server = i.string();
  6707. continue
  6708. }
  6709. if ((t & 7) === 4 || t === 0) break;
  6710. i.skipType(t & 7)
  6711. }
  6712. return a
  6713. }, fromJSON(u) {
  6714. return {
  6715. socket_addr: p(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6716. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : ""
  6717. }
  6718. }, toJSON(u) {
  6719. const e = {};
  6720. return u.socket_addr.length !== 0 && (e.socket_addr = M(u.socket_addr)), u.relay_server !== "" && (e.relay_server = u.relay_server), e
  6721. }, create(u) {
  6722. return r4.fromPartial(u != null ? u : {})
  6723. }, fromPartial(u) {
  6724. var i, o;
  6725. const e = Ti();
  6726. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.relay_server = (o = u.relay_server) != null ? o : "", e
  6727. }
  6728. };
  6729. function ji() {
  6730. return {socket_addr: new Uint8Array(0), local_addr: new Uint8Array(0), relay_server: "", id: "", version: ""}
  6731. }
  6732. const s4 = {
  6733. encode(u, e = r.Writer.create()) {
  6734. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.local_addr.length !== 0 && e.uint32(18).bytes(u.local_addr), u.relay_server !== "" && e.uint32(26).string(u.relay_server), u.id !== "" && e.uint32(34).string(u.id), u.version !== "" && e.uint32(42).string(u.version), e
  6735. }, decode(u, e) {
  6736. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6737. let o = e === void 0 ? i.len : i.pos + e;
  6738. const a = ji();
  6739. for (; i.pos < o;) {
  6740. const t = i.uint32();
  6741. switch (t >>> 3) {
  6742. case 1:
  6743. if (t !== 10) break;
  6744. a.socket_addr = i.bytes();
  6745. continue;
  6746. case 2:
  6747. if (t !== 18) break;
  6748. a.local_addr = i.bytes();
  6749. continue;
  6750. case 3:
  6751. if (t !== 26) break;
  6752. a.relay_server = i.string();
  6753. continue;
  6754. case 4:
  6755. if (t !== 34) break;
  6756. a.id = i.string();
  6757. continue;
  6758. case 5:
  6759. if (t !== 42) break;
  6760. a.version = i.string();
  6761. continue
  6762. }
  6763. if ((t & 7) === 4 || t === 0) break;
  6764. i.skipType(t & 7)
  6765. }
  6766. return a
  6767. }, fromJSON(u) {
  6768. return {
  6769. socket_addr: p(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6770. local_addr: p(u.local_addr) ? O(u.local_addr) : new Uint8Array(0),
  6771. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6772. id: p(u.id) ? globalThis.String(u.id) : "",
  6773. version: p(u.version) ? globalThis.String(u.version) : ""
  6774. }
  6775. }, toJSON(u) {
  6776. const e = {};
  6777. return u.socket_addr.length !== 0 && (e.socket_addr = M(u.socket_addr)), u.local_addr.length !== 0 && (e.local_addr = M(u.local_addr)), u.relay_server !== "" && (e.relay_server = u.relay_server), u.id !== "" && (e.id = u.id), u.version !== "" && (e.version = u.version), e
  6778. }, create(u) {
  6779. return s4.fromPartial(u != null ? u : {})
  6780. }, fromPartial(u) {
  6781. var i, o, a, t, s;
  6782. const e = ji();
  6783. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.local_addr = (o = u.local_addr) != null ? o : new Uint8Array(0), e.relay_server = (a = u.relay_server) != null ? a : "", e.id = (t = u.id) != null ? t : "", e.version = (s = u.version) != null ? s : "", e
  6784. }
  6785. };
  6786. function Ni() {
  6787. return {cmd: "", mac: "", id: "", username: "", hostname: "", platform: "", misc: ""}
  6788. }
  6789. const l4 = {
  6790. encode(u, e = r.Writer.create()) {
  6791. return u.cmd !== "" && e.uint32(10).string(u.cmd), u.mac !== "" && e.uint32(18).string(u.mac), u.id !== "" && e.uint32(26).string(u.id), u.username !== "" && e.uint32(34).string(u.username), u.hostname !== "" && e.uint32(42).string(u.hostname), u.platform !== "" && e.uint32(50).string(u.platform), u.misc !== "" && e.uint32(58).string(u.misc), e
  6792. }, decode(u, e) {
  6793. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6794. let o = e === void 0 ? i.len : i.pos + e;
  6795. const a = Ni();
  6796. for (; i.pos < o;) {
  6797. const t = i.uint32();
  6798. switch (t >>> 3) {
  6799. case 1:
  6800. if (t !== 10) break;
  6801. a.cmd = i.string();
  6802. continue;
  6803. case 2:
  6804. if (t !== 18) break;
  6805. a.mac = i.string();
  6806. continue;
  6807. case 3:
  6808. if (t !== 26) break;
  6809. a.id = i.string();
  6810. continue;
  6811. case 4:
  6812. if (t !== 34) break;
  6813. a.username = i.string();
  6814. continue;
  6815. case 5:
  6816. if (t !== 42) break;
  6817. a.hostname = i.string();
  6818. continue;
  6819. case 6:
  6820. if (t !== 50) break;
  6821. a.platform = i.string();
  6822. continue;
  6823. case 7:
  6824. if (t !== 58) break;
  6825. a.misc = i.string();
  6826. continue
  6827. }
  6828. if ((t & 7) === 4 || t === 0) break;
  6829. i.skipType(t & 7)
  6830. }
  6831. return a
  6832. }, fromJSON(u) {
  6833. return {
  6834. cmd: p(u.cmd) ? globalThis.String(u.cmd) : "",
  6835. mac: p(u.mac) ? globalThis.String(u.mac) : "",
  6836. id: p(u.id) ? globalThis.String(u.id) : "",
  6837. username: p(u.username) ? globalThis.String(u.username) : "",
  6838. hostname: p(u.hostname) ? globalThis.String(u.hostname) : "",
  6839. platform: p(u.platform) ? globalThis.String(u.platform) : "",
  6840. misc: p(u.misc) ? globalThis.String(u.misc) : ""
  6841. }
  6842. }, toJSON(u) {
  6843. const e = {};
  6844. return u.cmd !== "" && (e.cmd = u.cmd), u.mac !== "" && (e.mac = u.mac), u.id !== "" && (e.id = u.id), u.username !== "" && (e.username = u.username), u.hostname !== "" && (e.hostname = u.hostname), u.platform !== "" && (e.platform = u.platform), u.misc !== "" && (e.misc = u.misc), e
  6845. }, create(u) {
  6846. return l4.fromPartial(u != null ? u : {})
  6847. }, fromPartial(u) {
  6848. var i, o, a, t, s, l, E;
  6849. const e = Ni();
  6850. return e.cmd = (i = u.cmd) != null ? i : "", e.mac = (o = u.mac) != null ? o : "", e.id = (a = u.id) != null ? a : "", e.username = (t = u.username) != null ? t : "", e.hostname = (s = u.hostname) != null ? s : "", e.platform = (l = u.platform) != null ? l : "", e.misc = (E = u.misc) != null ? E : "", e
  6851. }
  6852. };
  6853. function Oi() {
  6854. return {id: "", peers: []}
  6855. }
  6856. const Ju = {
  6857. encode(u, e = r.Writer.create()) {
  6858. u.id !== "" && e.uint32(10).string(u.id);
  6859. for (const i of u.peers) e.uint32(18).string(i);
  6860. return e
  6861. }, decode(u, e) {
  6862. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6863. let o = e === void 0 ? i.len : i.pos + e;
  6864. const a = Oi();
  6865. for (; i.pos < o;) {
  6866. const t = i.uint32();
  6867. switch (t >>> 3) {
  6868. case 1:
  6869. if (t !== 10) break;
  6870. a.id = i.string();
  6871. continue;
  6872. case 2:
  6873. if (t !== 18) break;
  6874. a.peers.push(i.string());
  6875. continue
  6876. }
  6877. if ((t & 7) === 4 || t === 0) break;
  6878. i.skipType(t & 7)
  6879. }
  6880. return a
  6881. }, fromJSON(u) {
  6882. return {
  6883. id: p(u.id) ? globalThis.String(u.id) : "",
  6884. peers: globalThis.Array.isArray(u == null ? void 0 : u.peers) ? u.peers.map(e => globalThis.String(e)) : []
  6885. }
  6886. }, toJSON(u) {
  6887. var i;
  6888. const e = {};
  6889. return u.id !== "" && (e.id = u.id), (i = u.peers) != null && i.length && (e.peers = u.peers), e
  6890. }, create(u) {
  6891. return Ju.fromPartial(u != null ? u : {})
  6892. }, fromPartial(u) {
  6893. var i, o;
  6894. const e = Oi();
  6895. return e.id = (i = u.id) != null ? i : "", e.peers = ((o = u.peers) == null ? void 0 : o.map(a => a)) || [], e
  6896. }
  6897. };
  6898. function Mi() {
  6899. return {states: new Uint8Array(0)}
  6900. }
  6901. const E4 = {
  6902. encode(u, e = r.Writer.create()) {
  6903. return u.states.length !== 0 && e.uint32(10).bytes(u.states), e
  6904. }, decode(u, e) {
  6905. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6906. let o = e === void 0 ? i.len : i.pos + e;
  6907. const a = Mi();
  6908. for (; i.pos < o;) {
  6909. const t = i.uint32();
  6910. switch (t >>> 3) {
  6911. case 1:
  6912. if (t !== 10) break;
  6913. a.states = i.bytes();
  6914. continue
  6915. }
  6916. if ((t & 7) === 4 || t === 0) break;
  6917. i.skipType(t & 7)
  6918. }
  6919. return a
  6920. }, fromJSON(u) {
  6921. return {states: p(u.states) ? O(u.states) : new Uint8Array(0)}
  6922. }, toJSON(u) {
  6923. const e = {};
  6924. return u.states.length !== 0 && (e.states = M(u.states)), e
  6925. }, create(u) {
  6926. return E4.fromPartial(u != null ? u : {})
  6927. }, fromPartial(u) {
  6928. var i;
  6929. const e = Mi();
  6930. return e.states = (i = u.states) != null ? i : new Uint8Array(0), e
  6931. }
  6932. };
  6933. function Ui() {
  6934. return {keys: []}
  6935. }
  6936. const d4 = {
  6937. encode(u, e = r.Writer.create()) {
  6938. for (const i of u.keys) e.uint32(10).bytes(i);
  6939. return e
  6940. }, decode(u, e) {
  6941. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6942. let o = e === void 0 ? i.len : i.pos + e;
  6943. const a = Ui();
  6944. for (; i.pos < o;) {
  6945. const t = i.uint32();
  6946. switch (t >>> 3) {
  6947. case 1:
  6948. if (t !== 10) break;
  6949. a.keys.push(i.bytes());
  6950. continue
  6951. }
  6952. if ((t & 7) === 4 || t === 0) break;
  6953. i.skipType(t & 7)
  6954. }
  6955. return a
  6956. }, fromJSON(u) {
  6957. return {keys: globalThis.Array.isArray(u == null ? void 0 : u.keys) ? u.keys.map(e => O(e)) : []}
  6958. }, toJSON(u) {
  6959. var i;
  6960. const e = {};
  6961. return (i = u.keys) != null && i.length && (e.keys = u.keys.map(o => M(o))), e
  6962. }, create(u) {
  6963. return d4.fromPartial(u != null ? u : {})
  6964. }, fromPartial(u) {
  6965. var i;
  6966. const e = Ui();
  6967. return e.keys = ((i = u.keys) == null ? void 0 : i.map(o => o)) || [], e
  6968. }
  6969. };
  6970. function Li() {
  6971. return {token: ""}
  6972. }
  6973. const Gu = {
  6974. encode(u, e = r.Writer.create()) {
  6975. return u.token !== "" && e.uint32(10).string(u.token), e
  6976. }, decode(u, e) {
  6977. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6978. let o = e === void 0 ? i.len : i.pos + e;
  6979. const a = Li();
  6980. for (; i.pos < o;) {
  6981. const t = i.uint32();
  6982. switch (t >>> 3) {
  6983. case 1:
  6984. if (t !== 10) break;
  6985. a.token = i.string();
  6986. continue
  6987. }
  6988. if ((t & 7) === 4 || t === 0) break;
  6989. i.skipType(t & 7)
  6990. }
  6991. return a
  6992. }, fromJSON(u) {
  6993. return {token: p(u.token) ? globalThis.String(u.token) : ""}
  6994. }, toJSON(u) {
  6995. const e = {};
  6996. return u.token !== "" && (e.token = u.token), e
  6997. }, create(u) {
  6998. return Gu.fromPartial(u != null ? u : {})
  6999. }, fromPartial(u) {
  7000. var i;
  7001. const e = Li();
  7002. return e.token = (i = u.token) != null ? i : "", e
  7003. }
  7004. };
  7005. function Wi() {
  7006. return {
  7007. register_peer: void 0,
  7008. register_peer_response: void 0,
  7009. punch_hole_request: void 0,
  7010. punch_hole: void 0,
  7011. punch_hole_sent: void 0,
  7012. punch_hole_response: void 0,
  7013. fetch_local_addr: void 0,
  7014. local_addr: void 0,
  7015. configure_update: void 0,
  7016. register_pk: void 0,
  7017. register_pk_response: void 0,
  7018. software_update: void 0,
  7019. request_relay: void 0,
  7020. relay_response: void 0,
  7021. test_nat_request: void 0,
  7022. test_nat_response: void 0,
  7023. peer_discovery: void 0,
  7024. online_request: void 0,
  7025. online_response: void 0,
  7026. key_exchange: void 0,
  7027. hc: void 0
  7028. }
  7029. }
  7030. const S4 = {
  7031. encode(u, e = r.Writer.create()) {
  7032. return u.register_peer !== void 0 && Q0.encode(u.register_peer, e.uint32(50).fork()).ldelim(), u.register_peer_response !== void 0 && X0.encode(u.register_peer_response, e.uint32(58).fork()).ldelim(), u.punch_hole_request !== void 0 && Ku.encode(u.punch_hole_request, e.uint32(66).fork()).ldelim(), u.punch_hole !== void 0 && Y0.encode(u.punch_hole, e.uint32(74).fork()).ldelim(), u.punch_hole_sent !== void 0 && e4.encode(u.punch_hole_sent, e.uint32(82).fork()).ldelim(), u.punch_hole_response !== void 0 && a4.encode(u.punch_hole_response, e.uint32(90).fork()).ldelim(), u.fetch_local_addr !== void 0 && r4.encode(u.fetch_local_addr, e.uint32(98).fork()).ldelim(), u.local_addr !== void 0 && s4.encode(u.local_addr, e.uint32(106).fork()).ldelim(), u.configure_update !== void 0 && eu.encode(u.configure_update, e.uint32(114).fork()).ldelim(), u.register_pk !== void 0 && i4.encode(u.register_pk, e.uint32(122).fork()).ldelim(), u.register_pk_response !== void 0 && t4.encode(u.register_pk_response, e.uint32(130).fork()).ldelim(), u.software_update !== void 0 && n4.encode(u.software_update, e.uint32(138).fork()).ldelim(), u.request_relay !== void 0 && Hu.encode(u.request_relay, e.uint32(146).fork()).ldelim(), u.relay_response !== void 0 && o4.encode(u.relay_response, e.uint32(154).fork()).ldelim(), u.test_nat_request !== void 0 && $0.encode(u.test_nat_request, e.uint32(162).fork()).ldelim(), u.test_nat_response !== void 0 && u4.encode(u.test_nat_response, e.uint32(170).fork()).ldelim(), u.peer_discovery !== void 0 && l4.encode(u.peer_discovery, e.uint32(178).fork()).ldelim(), u.online_request !== void 0 && Ju.encode(u.online_request, e.uint32(186).fork()).ldelim(), u.online_response !== void 0 && E4.encode(u.online_response, e.uint32(194).fork()).ldelim(), u.key_exchange !== void 0 && d4.encode(u.key_exchange, e.uint32(202).fork()).ldelim(), u.hc !== void 0 && Gu.encode(u.hc, e.uint32(210).fork()).ldelim(), e
  7033. }, decode(u, e) {
  7034. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7035. let o = e === void 0 ? i.len : i.pos + e;
  7036. const a = Wi();
  7037. for (; i.pos < o;) {
  7038. const t = i.uint32();
  7039. switch (t >>> 3) {
  7040. case 6:
  7041. if (t !== 50) break;
  7042. a.register_peer = Q0.decode(i, i.uint32());
  7043. continue;
  7044. case 7:
  7045. if (t !== 58) break;
  7046. a.register_peer_response = X0.decode(i, i.uint32());
  7047. continue;
  7048. case 8:
  7049. if (t !== 66) break;
  7050. a.punch_hole_request = Ku.decode(i, i.uint32());
  7051. continue;
  7052. case 9:
  7053. if (t !== 74) break;
  7054. a.punch_hole = Y0.decode(i, i.uint32());
  7055. continue;
  7056. case 10:
  7057. if (t !== 82) break;
  7058. a.punch_hole_sent = e4.decode(i, i.uint32());
  7059. continue;
  7060. case 11:
  7061. if (t !== 90) break;
  7062. a.punch_hole_response = a4.decode(i, i.uint32());
  7063. continue;
  7064. case 12:
  7065. if (t !== 98) break;
  7066. a.fetch_local_addr = r4.decode(i, i.uint32());
  7067. continue;
  7068. case 13:
  7069. if (t !== 106) break;
  7070. a.local_addr = s4.decode(i, i.uint32());
  7071. continue;
  7072. case 14:
  7073. if (t !== 114) break;
  7074. a.configure_update = eu.decode(i, i.uint32());
  7075. continue;
  7076. case 15:
  7077. if (t !== 122) break;
  7078. a.register_pk = i4.decode(i, i.uint32());
  7079. continue;
  7080. case 16:
  7081. if (t !== 130) break;
  7082. a.register_pk_response = t4.decode(i, i.uint32());
  7083. continue;
  7084. case 17:
  7085. if (t !== 138) break;
  7086. a.software_update = n4.decode(i, i.uint32());
  7087. continue;
  7088. case 18:
  7089. if (t !== 146) break;
  7090. a.request_relay = Hu.decode(i, i.uint32());
  7091. continue;
  7092. case 19:
  7093. if (t !== 154) break;
  7094. a.relay_response = o4.decode(i, i.uint32());
  7095. continue;
  7096. case 20:
  7097. if (t !== 162) break;
  7098. a.test_nat_request = $0.decode(i, i.uint32());
  7099. continue;
  7100. case 21:
  7101. if (t !== 170) break;
  7102. a.test_nat_response = u4.decode(i, i.uint32());
  7103. continue;
  7104. case 22:
  7105. if (t !== 178) break;
  7106. a.peer_discovery = l4.decode(i, i.uint32());
  7107. continue;
  7108. case 23:
  7109. if (t !== 186) break;
  7110. a.online_request = Ju.decode(i, i.uint32());
  7111. continue;
  7112. case 24:
  7113. if (t !== 194) break;
  7114. a.online_response = E4.decode(i, i.uint32());
  7115. continue;
  7116. case 25:
  7117. if (t !== 202) break;
  7118. a.key_exchange = d4.decode(i, i.uint32());
  7119. continue;
  7120. case 26:
  7121. if (t !== 210) break;
  7122. a.hc = Gu.decode(i, i.uint32());
  7123. continue
  7124. }
  7125. if ((t & 7) === 4 || t === 0) break;
  7126. i.skipType(t & 7)
  7127. }
  7128. return a
  7129. }, fromJSON(u) {
  7130. return {
  7131. register_peer: p(u.register_peer) ? Q0.fromJSON(u.register_peer) : void 0,
  7132. register_peer_response: p(u.register_peer_response) ? X0.fromJSON(u.register_peer_response) : void 0,
  7133. punch_hole_request: p(u.punch_hole_request) ? Ku.fromJSON(u.punch_hole_request) : void 0,
  7134. punch_hole: p(u.punch_hole) ? Y0.fromJSON(u.punch_hole) : void 0,
  7135. punch_hole_sent: p(u.punch_hole_sent) ? e4.fromJSON(u.punch_hole_sent) : void 0,
  7136. punch_hole_response: p(u.punch_hole_response) ? a4.fromJSON(u.punch_hole_response) : void 0,
  7137. fetch_local_addr: p(u.fetch_local_addr) ? r4.fromJSON(u.fetch_local_addr) : void 0,
  7138. local_addr: p(u.local_addr) ? s4.fromJSON(u.local_addr) : void 0,
  7139. configure_update: p(u.configure_update) ? eu.fromJSON(u.configure_update) : void 0,
  7140. register_pk: p(u.register_pk) ? i4.fromJSON(u.register_pk) : void 0,
  7141. register_pk_response: p(u.register_pk_response) ? t4.fromJSON(u.register_pk_response) : void 0,
  7142. software_update: p(u.software_update) ? n4.fromJSON(u.software_update) : void 0,
  7143. request_relay: p(u.request_relay) ? Hu.fromJSON(u.request_relay) : void 0,
  7144. relay_response: p(u.relay_response) ? o4.fromJSON(u.relay_response) : void 0,
  7145. test_nat_request: p(u.test_nat_request) ? $0.fromJSON(u.test_nat_request) : void 0,
  7146. test_nat_response: p(u.test_nat_response) ? u4.fromJSON(u.test_nat_response) : void 0,
  7147. peer_discovery: p(u.peer_discovery) ? l4.fromJSON(u.peer_discovery) : void 0,
  7148. online_request: p(u.online_request) ? Ju.fromJSON(u.online_request) : void 0,
  7149. online_response: p(u.online_response) ? E4.fromJSON(u.online_response) : void 0,
  7150. key_exchange: p(u.key_exchange) ? d4.fromJSON(u.key_exchange) : void 0,
  7151. hc: p(u.hc) ? Gu.fromJSON(u.hc) : void 0
  7152. }
  7153. }, toJSON(u) {
  7154. const e = {};
  7155. return u.register_peer !== void 0 && (e.register_peer = Q0.toJSON(u.register_peer)), u.register_peer_response !== void 0 && (e.register_peer_response = X0.toJSON(u.register_peer_response)), u.punch_hole_request !== void 0 && (e.punch_hole_request = Ku.toJSON(u.punch_hole_request)), u.punch_hole !== void 0 && (e.punch_hole = Y0.toJSON(u.punch_hole)), u.punch_hole_sent !== void 0 && (e.punch_hole_sent = e4.toJSON(u.punch_hole_sent)), u.punch_hole_response !== void 0 && (e.punch_hole_response = a4.toJSON(u.punch_hole_response)), u.fetch_local_addr !== void 0 && (e.fetch_local_addr = r4.toJSON(u.fetch_local_addr)), u.local_addr !== void 0 && (e.local_addr = s4.toJSON(u.local_addr)), u.configure_update !== void 0 && (e.configure_update = eu.toJSON(u.configure_update)), u.register_pk !== void 0 && (e.register_pk = i4.toJSON(u.register_pk)), u.register_pk_response !== void 0 && (e.register_pk_response = t4.toJSON(u.register_pk_response)), u.software_update !== void 0 && (e.software_update = n4.toJSON(u.software_update)), u.request_relay !== void 0 && (e.request_relay = Hu.toJSON(u.request_relay)), u.relay_response !== void 0 && (e.relay_response = o4.toJSON(u.relay_response)), u.test_nat_request !== void 0 && (e.test_nat_request = $0.toJSON(u.test_nat_request)), u.test_nat_response !== void 0 && (e.test_nat_response = u4.toJSON(u.test_nat_response)), u.peer_discovery !== void 0 && (e.peer_discovery = l4.toJSON(u.peer_discovery)), u.online_request !== void 0 && (e.online_request = Ju.toJSON(u.online_request)), u.online_response !== void 0 && (e.online_response = E4.toJSON(u.online_response)), u.key_exchange !== void 0 && (e.key_exchange = d4.toJSON(u.key_exchange)), u.hc !== void 0 && (e.hc = Gu.toJSON(u.hc)), e
  7156. }, create(u) {
  7157. return S4.fromPartial(u != null ? u : {})
  7158. }, fromPartial(u) {
  7159. const e = Wi();
  7160. return e.register_peer = u.register_peer !== void 0 && u.register_peer !== null ? Q0.fromPartial(u.register_peer) : void 0, e.register_peer_response = u.register_peer_response !== void 0 && u.register_peer_response !== null ? X0.fromPartial(u.register_peer_response) : void 0, e.punch_hole_request = u.punch_hole_request !== void 0 && u.punch_hole_request !== null ? Ku.fromPartial(u.punch_hole_request) : void 0, e.punch_hole = u.punch_hole !== void 0 && u.punch_hole !== null ? Y0.fromPartial(u.punch_hole) : void 0, e.punch_hole_sent = u.punch_hole_sent !== void 0 && u.punch_hole_sent !== null ? e4.fromPartial(u.punch_hole_sent) : void 0, e.punch_hole_response = u.punch_hole_response !== void 0 && u.punch_hole_response !== null ? a4.fromPartial(u.punch_hole_response) : void 0, e.fetch_local_addr = u.fetch_local_addr !== void 0 && u.fetch_local_addr !== null ? r4.fromPartial(u.fetch_local_addr) : void 0, e.local_addr = u.local_addr !== void 0 && u.local_addr !== null ? s4.fromPartial(u.local_addr) : void 0, e.configure_update = u.configure_update !== void 0 && u.configure_update !== null ? eu.fromPartial(u.configure_update) : void 0, e.register_pk = u.register_pk !== void 0 && u.register_pk !== null ? i4.fromPartial(u.register_pk) : void 0, e.register_pk_response = u.register_pk_response !== void 0 && u.register_pk_response !== null ? t4.fromPartial(u.register_pk_response) : void 0, e.software_update = u.software_update !== void 0 && u.software_update !== null ? n4.fromPartial(u.software_update) : void 0, e.request_relay = u.request_relay !== void 0 && u.request_relay !== null ? Hu.fromPartial(u.request_relay) : void 0, e.relay_response = u.relay_response !== void 0 && u.relay_response !== null ? o4.fromPartial(u.relay_response) : void 0, e.test_nat_request = u.test_nat_request !== void 0 && u.test_nat_request !== null ? $0.fromPartial(u.test_nat_request) : void 0, e.test_nat_response = u.test_nat_response !== void 0 && u.test_nat_response !== null ? u4.fromPartial(u.test_nat_response) : void 0, e.peer_discovery = u.peer_discovery !== void 0 && u.peer_discovery !== null ? l4.fromPartial(u.peer_discovery) : void 0, e.online_request = u.online_request !== void 0 && u.online_request !== null ? Ju.fromPartial(u.online_request) : void 0, e.online_response = u.online_response !== void 0 && u.online_response !== null ? E4.fromPartial(u.online_response) : void 0, e.key_exchange = u.key_exchange !== void 0 && u.key_exchange !== null ? d4.fromPartial(u.key_exchange) : void 0, e.hc = u.hc !== void 0 && u.hc !== null ? Gu.fromPartial(u.hc) : void 0, e
  7161. }
  7162. };
  7163. function O(u) {
  7164. if (globalThis.Buffer) return Uint8Array.from(globalThis.Buffer.from(u, "base64"));
  7165. {
  7166. const e = globalThis.atob(u), i = new Uint8Array(e.length);
  7167. for (let o = 0; o < e.length; ++o) i[o] = e.charCodeAt(o);
  7168. return i
  7169. }
  7170. }
  7171. function M(u) {
  7172. if (globalThis.Buffer) return globalThis.Buffer.from(u).toString("base64");
  7173. {
  7174. const e = [];
  7175. return u.forEach(i => {
  7176. e.push(globalThis.String.fromCharCode(i))
  7177. }), globalThis.btoa(e.join(""))
  7178. }
  7179. }
  7180. function p(u) {
  7181. return u != null
  7182. }
  7183. class j4 {
  7184. constructor(e, i = !0, o = "") {
  7185. d(this, "_websocket");
  7186. d(this, "_eventHandlers");
  7187. d(this, "_buf");
  7188. d(this, "_status");
  7189. d(this, "_latency");
  7190. d(this, "_secretKey");
  7191. d(this, "_uri");
  7192. d(this, "_isRendezvous");
  7193. d(this, "_recvDataCount");
  7194. d(this, "_tag");
  7195. d(this, "_isProcessing");
  7196. this._eventHandlers = {
  7197. message: void 0,
  7198. open: void 0,
  7199. close: void 0,
  7200. error: void 0,
  7201. status_change: void 0
  7202. }, this._uri = e, this._status = "", this._buf = [], this._websocket = new WebSocket(e), this._websocket.onmessage = this._recv_message.bind(this), this._websocket.binaryType = "arraybuffer", this._latency = new Date().getTime(), this._isRendezvous = i, this._recvDataCount = 0, this._tag = o, this._isProcessing = !1
  7203. }
  7204. resetRecvDataCount() {
  7205. this._recvDataCount = 0
  7206. }
  7207. getRecvDataCount() {
  7208. return this._recvDataCount
  7209. }
  7210. latency() {
  7211. return this._latency
  7212. }
  7213. setSecretKey(e) {
  7214. this._secretKey = [e, 0, 0]
  7215. }
  7216. sendMessage(e) {
  7217. let i = iu.encode(iu.fromPartial(e)).finish(), o = this._secretKey;
  7218. o && (o[1] += 1, i = st(i, o[1], o[0])), this._websocket.send(i)
  7219. }
  7220. sendRendezvous(e) {
  7221. this._websocket.send(S4.encode(S4.fromPartial(e)).finish())
  7222. }
  7223. sendBytes(e) {
  7224. let i = this._secretKey;
  7225. i && (i[1] += 1, e = st(e, i[1], i[0])), this._websocket.send(e)
  7226. }
  7227. parseMessage(e) {
  7228. return iu.decode(e)
  7229. }
  7230. parseRendezvous(e) {
  7231. return S4.decode(e)
  7232. }
  7233. off(e) {
  7234. this._eventHandlers[e] = void 0
  7235. }
  7236. on(e, i) {
  7237. this._eventHandlers[e] = i
  7238. }
  7239. setStatus(e) {
  7240. this._status = e, this._eventHandlers.status_change && this._eventHandlers.status_change(e)
  7241. }
  7242. async open(e = 12e3) {
  7243. return new Promise((i, o) => {
  7244. setTimeout(() => {
  7245. this._status != "open" && o(this._status || "Timeout")
  7246. }, e), this._websocket.onopen = () => {
  7247. var a;
  7248. this._latency = new Date().getTime() - this._latency, this.setStatus("open"), console.debug(">> WebSock.onopen " + this._tag), (a = this._websocket) != null && a.protocol && console.info("Server " + this._tag + " choose sub-protocol: " + this._websocket.protocol), this._eventHandlers.open && this._eventHandlers.open(), console.info("WebSock.onopen " + this._tag), i(this)
  7249. }, this._websocket.onclose = a => {
  7250. this._status == "open", this.setStatus(a), this._tag == "query onlines" ? console.info("WebSock.onclose " + this._tag) : a.code == 1e3 ? console.info("WebSock.onclose " + this._tag + ": " + a.reason) : (console.error("WebSock.onclose: " + this._tag), console.error(a)), this._eventHandlers.close && this._eventHandlers.close(a), o("Reset by the peer")
  7251. }, this._websocket.onerror = a => {
  7252. if (!this._status) {
  7253. o("Failed to connect to " + (this._isRendezvous ? "rendezvous" : "relay") + " server, " + this._uri);
  7254. return
  7255. }
  7256. this.setStatus(a), console.error("WebSock.onerror: " + this._tag), console.error(a), this._eventHandlers.error && this._eventHandlers.error(a)
  7257. }
  7258. })
  7259. }
  7260. async next(e = 12e3) {
  7261. let i = this._eventHandlers.message;
  7262. this.off("message");
  7263. try {
  7264. let o = await this._next(e);
  7265. return this.on("message", i), o
  7266. } catch (o) {
  7267. throw this.on("message", i), o
  7268. }
  7269. }
  7270. async _next(e = 12e3) {
  7271. const i = (o, a, t) => {
  7272. if (this._buf.length) o(this._buf[0]), this._buf.splice(0, 1); else {
  7273. if (this._status != "open") {
  7274. a(this._status);
  7275. return
  7276. }
  7277. new Date().getTime() > t + e ? a("Timeout") : setTimeout(() => i(o, a, t), 1)
  7278. }
  7279. };
  7280. return new Promise((o, a) => {
  7281. i(o, a, new Date().getTime())
  7282. })
  7283. }
  7284. close() {
  7285. this.setStatus(""), this._websocket && ((this._websocket.readyState === WebSocket.OPEN || this._websocket.readyState === WebSocket.CONNECTING) && (console.info("Closing WebSocket(" + this._tag + ") connection"), this._websocket.close(1e3, "Normal closure")), this._websocket.onmessage = () => {
  7286. })
  7287. }
  7288. _recv_message(e) {
  7289. if (e.data instanceof window.ArrayBuffer) {
  7290. let i = new Uint8Array(e.data);
  7291. this._recvDataCount += i.length;
  7292. const o = this._secretKey;
  7293. o && (o[2] += 1, i = jn(i, o[2], o[0]));
  7294. let a;
  7295. i.length == 0 ? a = new Uint8Array : a = this._isRendezvous ? this.parseRendezvous(i) : this.parseMessage(i), this._buf.push(a), this._eventHandlers.message && (this._isProcessing || this.processQueue())
  7296. }
  7297. }
  7298. async processQueue() {
  7299. this._isProcessing = !0;
  7300. try {
  7301. for (; this._buf.length > 0 && this._eventHandlers.message;) {
  7302. const e = this._buf.shift();
  7303. await this._eventHandlers.message(e)
  7304. }
  7305. } catch (e) {
  7306. console.log("Error in processQueue: " + e)
  7307. }
  7308. this._isProcessing = !1
  7309. }
  7310. }
  7311. let mu = null;
  7312. const Vi = ".";
  7313. var X, Bu, $u, J4, Eu, G4, Dt, g4;
  7314. class Sa {
  7315. constructor() {
  7316. pu(this, G4);
  7317. pu(this, X, null);
  7318. pu(this, Bu, {});
  7319. pu(this, $u, {});
  7320. pu(this, J4, 0);
  7321. pu(this, Eu, []);
  7322. pu(this, g4, async (e, i) => {
  7323. const o = await (await fetch(e)).arrayBuffer(), a = new Blob([o], {type: i});
  7324. return URL.createObjectURL(a)
  7325. })
  7326. }
  7327. async load() {
  7328. if (!h(this, X)) {
  7329. p4(this, X, new Worker("./ffmpeg.js?v=dddac33a", {type: "module"})), Te(this, G4, Dt).call(this);
  7330. const e = await h(this, g4).call(this, `${Vi}/ffmpeg-core.js?v=16fa4bb1`, "text/javascript"),
  7331. i = await h(this, g4).call(this, `${Vi}/ffmpeg-core.wasm?v=241ebe18`, "application/wasm");
  7332. return this.send({type: "LOAD", data: {coreURL: e, wasmURL: i}})
  7333. }
  7334. }
  7335. async decode(e, i) {
  7336. let o = [i];
  7337. var a = null;
  7338. return h(this, Eu).length > 0 && (a = h(this, Eu).pop(), o.push(a)), this.send({
  7339. type: "DECODE",
  7340. data: {codec: e, data: i, arrayBuffer: a}
  7341. }, o)
  7342. }
  7343. async send({type: e, data: i}, o) {
  7344. return h(this, X) ? new Promise((a, t) => {
  7345. const s = Ie(this, J4)._++;
  7346. h(this, Bu)[s] = a, h(this, $u)[s] = t, h(this, X).postMessage({id: s, type: e, data: i}, o)
  7347. }) : Promise.reject("FFmpeg not loaded")
  7348. }
  7349. close() {
  7350. h(this, X) && (this.send({type: "CLOSE", data: {}}), h(this, X).terminate(), p4(this, X, null))
  7351. }
  7352. }
  7353. X = new WeakMap, Bu = new WeakMap, $u = new WeakMap, J4 = new WeakMap, Eu = new WeakMap, G4 = new WeakSet, Dt = function () {
  7354. h(this, X).onmessage = ({data: {id: e, type: i, data: o}}) => {
  7355. i == "LOAD" ? (console.log("FFmpeg loaded"), h(this, Bu)[e](o)) : i == "DECODE" ? (h(this, Eu).push(o.data.data), h(this, Eu).length > 8 && h(this, Eu).shift(), h(this, Bu)[e](o)) : i == "CLOSE" ? (p4(this, Eu, []), h(this, Bu)[e](o)) : i == "ERROR" ? h(this, $u)[e](o) : h(this, $u)[e](o), delete h(this, Bu)[e], delete h(this, $u)[e]
  7356. }
  7357. }, g4 = new WeakMap;
  7358. async function za() {
  7359. try {
  7360. return mu = new Sa, mu ? mu.load() : Promise.reject("Failed to create FFmpeg instance")
  7361. } catch (u) {
  7362. return console.log("Failed to load FFmpeg", u), Promise.reject("Failed to load FFmpeg")
  7363. }
  7364. }
  7365. async function Pa(u, e) {
  7366. return mu ? mu.decode(u, e) : Promise.reject("FFmpeg is uninitialized")
  7367. }
  7368. async function Ra() {
  7369. mu && (mu.close(), mu = null)
  7370. }
  7371. const Ia = "Desktop session not ready", Ta = "Desktop xsession failed", ja = "Desktop session another user login",
  7372. Na = "Desktop xorg not found", Oa = "Desktop none", Ma = "Desktop session not ready, password empty",
  7373. Ua = "Desktop session not ready, password wrong", La = "Empty Password", Wa = "Wrong Password",
  7374. Va = "Wrong 2FA Code", qi = "2FA Required", qa = "No Password Access", Ka = "Wayland login screen is not supported",
  7375. Ha = "x11 expected", Bt = "https://rustdesk.com/docs/en/manual/linux/#x11-required",
  7376. Ja = "https://rustdesk.com/docs/en/", Ga = Bt,
  7377. Za = "https://github.com/rustdesk/rustdesk/wiki/Headless-Linux-Support",
  7378. Ki = {"rustdesk docs home": Ja, "rustdesk docs x11-required": Ga, "rustdesk x11 headless": Za},
  7379. Hi = "Input source 1", Qa = "map", Ji = "translate", Xa = "ShiftLeft", Ya = "ShiftRight", m4 = "ControlLeft",
  7380. mt = "ControlRight", pe = "AltLeft", At = "AltRight", Ft = "MetaLeft", _t = "MetaRight", Y4 = "Windows",
  7381. De = "Linux", Be = "Mac OS", vt = "Android", $a = "iOS", uo = "web", eo = "ISO", io = 1, to = 2, Gi = 3, Zi = 4,
  7382. x4 = 1, y4 = 2, ao = 4, oo = 8, no = 16, ee = "public", Qi = "OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=",
  7383. ro = 1e3, so = 6e4, re = lang, lo = langIds;
  7384. function Eo(u, e, i, o) {
  7385. return u == "error" && e == "Connection Error" && ((i.indexOf("10054") < 0 || i.indexOf("104") < 0) && o || 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 && i.toLowerCase().indexOf("not allowed") < 0)
  7386. }
  7387. const co = {
  7388. VK_A: "a",
  7389. VK_B: "b",
  7390. VK_C: "c",
  7391. VK_D: "d",
  7392. VK_E: "e",
  7393. VK_F: "f",
  7394. VK_G: "g",
  7395. VK_H: "h",
  7396. VK_I: "i",
  7397. VK_J: "j",
  7398. VK_K: "k",
  7399. VK_L: "l",
  7400. VK_M: "m",
  7401. VK_N: "n",
  7402. VK_O: "o",
  7403. VK_P: "p",
  7404. VK_Q: "q",
  7405. VK_R: "r",
  7406. VK_S: "s",
  7407. VK_T: "t",
  7408. VK_U: "u",
  7409. VK_V: "v",
  7410. VK_W: "w",
  7411. VK_X: "x",
  7412. VK_Y: "y",
  7413. VK_Z: "z",
  7414. VK_0: "0",
  7415. VK_1: "1",
  7416. VK_2: "2",
  7417. VK_3: "3",
  7418. VK_4: "4",
  7419. VK_5: "5",
  7420. VK_6: "6",
  7421. VK_7: "7",
  7422. VK_8: "8",
  7423. VK_9: "9",
  7424. VK_COMMA: ",",
  7425. VK_SLASH: "/",
  7426. VK_SEMICOLON: ";",
  7427. VK_QUOTE: "'",
  7428. VK_LBRACKET: "[",
  7429. VK_RBRACKET: "]",
  7430. VK_BACKSLASH: "\\",
  7431. VK_MINUS: "-",
  7432. VK_PLUS: "=",
  7433. VK_DIVIDE: "Divide",
  7434. VK_MULTIPLY: "Multiply",
  7435. VK_SUBTRACT: "Subtract",
  7436. VK_ADD: "Add",
  7437. VK_DECIMAL: "Decimal",
  7438. VK_F1: "F1",
  7439. VK_F2: "F2",
  7440. VK_F3: "F3",
  7441. VK_F4: "F4",
  7442. VK_F5: "F5",
  7443. VK_F6: "F6",
  7444. VK_F7: "F7",
  7445. VK_F8: "F8",
  7446. VK_F9: "F9",
  7447. VK_F10: "F10",
  7448. VK_F11: "F11",
  7449. VK_F12: "F12",
  7450. VK_ENTER: "Return",
  7451. VK_CANCEL: "Cancel",
  7452. VK_BACK: "Backspace",
  7453. VK_TAB: "Tab",
  7454. VK_CLEAR: "Clear",
  7455. VK_RETURN: "Return",
  7456. VK_SHIFT: "Shift",
  7457. VK_CONTROL: "Control",
  7458. VK_MENU: "Alt",
  7459. VK_PAUSE: "Pause",
  7460. VK_CAPITAL: "CapsLock",
  7461. VK_KANA: "Kana",
  7462. VK_HANGUL: "Hangul",
  7463. VK_JUNJA: "Junja",
  7464. VK_FINAL: "Final",
  7465. VK_HANJA: "Hanja",
  7466. VK_KANJI: "Kanji",
  7467. VK_ESCAPE: "Escape",
  7468. VK_CONVERT: "Convert",
  7469. VK_SPACE: "Space",
  7470. VK_PRIOR: "PageUp",
  7471. VK_NEXT: "PageDown",
  7472. VK_END: "End",
  7473. VK_HOME: "Home",
  7474. VK_LEFT: "LeftArrow",
  7475. VK_UP: "UpArrow",
  7476. VK_RIGHT: "RightArrow",
  7477. VK_DOWN: "DownArrow",
  7478. VK_SELECT: "Select",
  7479. VK_PRINT: "Print",
  7480. VK_EXECUTE: "Execute",
  7481. VK_SNAPSHOT: "Snapshot",
  7482. VK_SCROLL: "Scroll",
  7483. VK_INSERT: "Insert",
  7484. VK_DELETE: "Delete",
  7485. VK_HELP: "Help",
  7486. VK_SLEEP: "Sleep",
  7487. VK_SEPARATOR: "Separator",
  7488. VK_NUMPAD0: "Numpad0",
  7489. VK_NUMPAD1: "Numpad1",
  7490. VK_NUMPAD2: "Numpad2",
  7491. VK_NUMPAD3: "Numpad3",
  7492. VK_NUMPAD4: "Numpad4",
  7493. VK_NUMPAD5: "Numpad5",
  7494. VK_NUMPAD6: "Numpad6",
  7495. VK_NUMPAD7: "Numpad7",
  7496. VK_NUMPAD8: "Numpad8",
  7497. VK_NUMPAD9: "Numpad9",
  7498. Apps: "Apps",
  7499. Meta: "Meta",
  7500. RAlt: "RAlt",
  7501. RWin: "RWin",
  7502. RControl: "RControl",
  7503. RShift: "RShift",
  7504. CTRL_ALT_DEL: "CtrlAltDel",
  7505. LOCK_SCREEN: "LockScreen"
  7506. }, se = "1.3.5", Co = "2024-12-06 18:29";
  7507. class A {
  7508. static setItem(e, i) {
  7509. localStorage.setItem(this.prefix + e, i)
  7510. }
  7511. static getItem(e) {
  7512. return localStorage.getItem(this.prefix + e)
  7513. }
  7514. static removeItem(e) {
  7515. localStorage.removeItem(this.prefix + e)
  7516. }
  7517. static clear() {
  7518. for (let e = localStorage.length - 1; e >= 0; e--) {
  7519. const i = localStorage.key(e);
  7520. i && i.startsWith(this.prefix) && localStorage.removeItem(i)
  7521. }
  7522. }
  7523. }
  7524. d(A, "prefix", "wc-");
  7525. class N {
  7526. static async init() {
  7527. if (!this.db) return new Promise((e, i) => {
  7528. const o = indexedDB.open(this.dbName, 1);
  7529. o.onupgradeneeded = a => {
  7530. const t = a.target.result;
  7531. t.objectStoreNames.contains(this.storeName) || t.createObjectStore(this.storeName)
  7532. }, o.onsuccess = async a => {
  7533. this.db = a.target.result;
  7534. try {
  7535. await this.loadCache(), e()
  7536. } catch (t) {
  7537. i(t)
  7538. }
  7539. }, o.onerror = a => {
  7540. i(a.target.error)
  7541. }
  7542. })
  7543. }
  7544. static async loadCache() {
  7545. return new Promise((e, i) => {
  7546. const a = this.db.transaction([this.storeName], "readonly").objectStore(this.storeName), t = a.getAllKeys();
  7547. t.onsuccess = s => {
  7548. const E = s.target.result.map(c => new Promise((C, D) => {
  7549. const B = a.get(c);
  7550. B.onsuccess = F => {
  7551. this.cache[c] = F.target.result, C()
  7552. }, B.onerror = F => {
  7553. D(F.target.error)
  7554. }
  7555. }));
  7556. Promise.all(E).then(() => e()).catch(i)
  7557. }, t.onerror = s => {
  7558. i(s.target.error)
  7559. }
  7560. })
  7561. }
  7562. static setItem(e, i) {
  7563. this.cache[this.prefix + e] = i;
  7564. const t = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).put(i, this.prefix + e);
  7565. t.onerror = s => {
  7566. console.error("IndexedDB setItem error:", s.target.error)
  7567. }
  7568. }
  7569. static getItem(e) {
  7570. var i;
  7571. return (i = this.cache[this.prefix + e]) != null ? i : null
  7572. }
  7573. static removeItem(e) {
  7574. delete this.cache[this.prefix + e];
  7575. const a = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).delete(this.prefix + e);
  7576. a.onerror = t => {
  7577. console.error("IndexedDB removeItem error:", t.target.error)
  7578. }
  7579. }
  7580. static clear() {
  7581. this.cache = {};
  7582. const o = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).clear();
  7583. o.onerror = a => {
  7584. console.error("IndexedDB clear error:", a.target.error)
  7585. }
  7586. }
  7587. }
  7588. d(N, "dbName", "wc-database"), d(N, "storeName", "wc-store"), d(N, "prefix", "wc-"), d(N, "db", null), d(N, "cache", {});
  7589. const Cu = () => {
  7590. try {
  7591. return JSON.parse(N.getItem("peers")) || {}
  7592. } catch {
  7593. return {}
  7594. }
  7595. }, me = u => {
  7596. N.setItem("peers", JSON.stringify(u))
  7597. }, po = u => {
  7598. const e = Cu();
  7599. delete e[u], me(e)
  7600. }, le = u => Cu()[u], Do = (u, e) => {
  7601. const i = Cu();
  7602. i[u] = e, me(i)
  7603. }, Bo = (u, e) => {
  7604. var o;
  7605. return (o = le(u)[e]) != null ? o : u0(e)
  7606. }, kt = (u, e, i) => {
  7607. const o = Cu(), a = o[u] || {};
  7608. i == null ? delete a[e] : a[e] = i, a.tm = new Date().getTime(), o[u] = a, me(o)
  7609. }, Ae = u => A.getItem(`option:local:${u}`), gt = (u, e) => {
  7610. A.setItem(`option:local:${u}`, e)
  7611. }, mo = u => A.getItem(`option:flutter:local:${u}`), Ao = (u, e) => {
  7612. A.setItem(`option:flutter:local:${u}`, e)
  7613. }, ht = async u => {
  7614. const e = Jt(), i = Xu.publicKey, o = $4(0), a = e.from_string(u), t = await $t(a),
  7615. s = e.crypto_secretbox_easy(t, o, i);
  7616. return Z(s)
  7617. }, ft = async u => {
  7618. const e = Jt(), i = Xu.publicKey, o = c4(u), a = e.crypto_secretbox_open_easy(o, $4(0), i), t = await ua(a);
  7619. return e.to_string(t)
  7620. }, Fo = async u => {
  7621. let e = await ht(u);
  7622. N.setItem("ab", e)
  7623. }, xt = async () => {
  7624. try {
  7625. let u = N.getItem("ab");
  7626. if (u) return JSON.parse(await ft(u))
  7627. } catch (u) {
  7628. console.error("loadAb error", u)
  7629. }
  7630. return {access_token: "", ab_entries: []}
  7631. }, _o = () => {
  7632. N.removeItem("ab")
  7633. }, vo = async u => {
  7634. let e = await ht(u);
  7635. N.setItem("group", e)
  7636. }, ko = async () => {
  7637. try {
  7638. let u = N.getItem("group");
  7639. if (u) return JSON.parse(await ft(u))
  7640. } catch (u) {
  7641. console.error("loadGroup error", u)
  7642. }
  7643. return {access_token: "", users: [], peers: []}
  7644. }, go = () => {
  7645. N.removeItem("group")
  7646. }, ho = u => u.name == "My address book" || u.name == "Legacy address book";
  7647. var yt = bt();
  7648. function fo() {
  7649. yt = bt()
  7650. }
  7651. function xo(u, e) {
  7652. const i = yt || u.substring(u.length - 2).toLowerCase();
  7653. let o = re.en, a = re[i];
  7654. a || (a = o);
  7655. let t = a[e];
  7656. return !t && i != "en" && (t = o[e]), t || e
  7657. }
  7658. const yo = "z".charCodeAt(0), bo = "a".charCodeAt(0);
  7659. function wo(u, e) {
  7660. const i = co[u] || u;
  7661. if (i.length == 1) {
  7662. const a = i.charCodeAt(0);
  7663. return !e && (a > yo || a < bo) ? w.fromPartial({unicode: a}) : w.fromPartial({chr: a})
  7664. }
  7665. const o = F4(i);
  7666. return o == j.UNRECOGNIZED && console.error("Unknown control key " + i), w.fromPartial({control_key: o})
  7667. }
  7668. async function ie(u) {
  7669. await new Promise(e => setTimeout(e, u))
  7670. }
  7671. function bt() {
  7672. let u = A.getItem("option:local:lang");
  7673. if (u && (u.includes("-") && (u = u.split("-")[1]), u.includes("_") && (u = u.split("_")[1]), re.hasOwnProperty(u))) return u;
  7674. try {
  7675. const e = window.location.search;
  7676. return new URLSearchParams(e).get("lang") || ""
  7677. } catch {
  7678. return ""
  7679. }
  7680. }
  7681. var Xu = {privateKey: new Uint8Array([]), publicKey: new Uint8Array([])};
  7682. async function So() {
  7683. try {
  7684. const u = "app-data";
  7685. try {
  7686. const i = A.getItem(u);
  7687. if (i) {
  7688. const o = JSON.parse(i);
  7689. if (Xu = {
  7690. privateKey: new Uint8Array(c4(o.a)),
  7691. publicKey: new Uint8Array(c4(o.b))
  7692. }, Xu.publicKey.length === 32 && Xu.privateKey.length === 64) return
  7693. }
  7694. } catch (i) {
  7695. console.error(i)
  7696. }
  7697. const e = await zo();
  7698. A.setItem(u, JSON.stringify({a: Z(e.privateKey), b: Z(e.publicKey)})), Xu = e
  7699. } catch (u) {
  7700. console.error("failed to init key pair", u)
  7701. }
  7702. }
  7703. function Z(u) {
  7704. return Pn(u)
  7705. }
  7706. function c4(u) {
  7707. return Gt(u)
  7708. }
  7709. async function zo() {
  7710. return await qn()
  7711. }
  7712. function N4() {
  7713. return "web"
  7714. }
  7715. function wt() {
  7716. return "web"
  7717. }
  7718. function St() {
  7719. return Z(Xu.publicKey)
  7720. }
  7721. function Po() {
  7722. return Zu([St()])
  7723. }
  7724. function Zu(u) {
  7725. const e = new aa.exports.Hash;
  7726. return u.forEach(i => (typeof i == "string" && (i = new TextEncoder().encode(i)), e.update(i))), e.digest()
  7727. }
  7728. function zt() {
  7729. const u = navigator.userAgent.toLowerCase();
  7730. return u.includes("win") ? Y4 : u.includes("mac") ? Be : u.includes("linux") ? De : u.includes("android") ? vt : u.includes("iphone") || u.includes("ipad") ? $a : "Unknown OS"
  7731. }
  7732. async function Ro(u, e) {
  7733. for (let i = 0; i < 2; i++) {
  7734. const a = e === void 0 ? await u.next() : await u.next(e);
  7735. if (!(!a || (a == null ? void 0 : a.key_exchange))) return a
  7736. }
  7737. }
  7738. function Io() {
  7739. return A.getItem("key") || void 0
  7740. }
  7741. function Pt() {
  7742. return A.getItem("option:local:access_token") || void 0
  7743. }
  7744. function To() {
  7745. return A.getItem("option:local:user_info") || void 0
  7746. }
  7747. function A4() {
  7748. return Yu
  7749. }
  7750. const Fe = {
  7751. Alt: 56,
  7752. AltGr: 57400,
  7753. Backspace: 14,
  7754. CapsLock: 58,
  7755. ControlLeft: 29,
  7756. ControlRight: 57373,
  7757. Delete: 57427,
  7758. UpArrow: 57416,
  7759. DownArrow: 57424,
  7760. LeftArrow: 57419,
  7761. RightArrow: 57421,
  7762. End: 57423,
  7763. Escape: 1,
  7764. F1: 59,
  7765. F2: 60,
  7766. F3: 61,
  7767. F4: 62,
  7768. F5: 63,
  7769. F6: 64,
  7770. F7: 65,
  7771. F8: 66,
  7772. F9: 67,
  7773. F10: 68,
  7774. F11: 87,
  7775. F12: 88,
  7776. F13: 100,
  7777. F14: 101,
  7778. F15: 102,
  7779. F16: 103,
  7780. F17: 104,
  7781. F18: 105,
  7782. F19: 106,
  7783. F20: 107,
  7784. F21: 108,
  7785. F22: 109,
  7786. F23: 110,
  7787. F24: 118,
  7788. Home: 57415,
  7789. MetaLeft: 57435,
  7790. PageDown: 57425,
  7791. PageUp: 57417,
  7792. Return: 28,
  7793. ShiftLeft: 42,
  7794. ShiftRight: 54,
  7795. Space: 57,
  7796. Tab: 15,
  7797. PrintScreen: 57399,
  7798. ScrollLock: 70,
  7799. NumLock: 69,
  7800. BackQuote: 41,
  7801. Num1: 2,
  7802. Num2: 3,
  7803. Num3: 4,
  7804. Num4: 5,
  7805. Num5: 6,
  7806. Num6: 7,
  7807. Num7: 8,
  7808. Num8: 9,
  7809. Num9: 10,
  7810. Num0: 11,
  7811. Minus: 12,
  7812. Equal: 13,
  7813. KeyQ: 16,
  7814. KeyW: 17,
  7815. KeyE: 18,
  7816. KeyR: 19,
  7817. KeyT: 20,
  7818. KeyY: 21,
  7819. KeyU: 22,
  7820. KeyI: 23,
  7821. KeyO: 24,
  7822. KeyP: 25,
  7823. LeftBracket: 26,
  7824. RightBracket: 27,
  7825. BackSlash: 43,
  7826. KeyA: 30,
  7827. KeyS: 31,
  7828. KeyD: 32,
  7829. KeyF: 33,
  7830. KeyG: 34,
  7831. KeyH: 35,
  7832. KeyJ: 36,
  7833. KeyK: 37,
  7834. KeyL: 38,
  7835. SemiColon: 39,
  7836. Quote: 40,
  7837. IntlBackslash: 86,
  7838. IntlRo: 115,
  7839. IntlYen: 125,
  7840. KanaMode: 112,
  7841. KeyZ: 44,
  7842. KeyX: 45,
  7843. KeyC: 46,
  7844. KeyV: 47,
  7845. KeyB: 48,
  7846. KeyN: 49,
  7847. KeyM: 50,
  7848. Comma: 51,
  7849. Dot: 52,
  7850. Slash: 53,
  7851. Insert: 57426,
  7852. KpMinus: 74,
  7853. KpPlus: 78,
  7854. KpMultiply: 55,
  7855. KpDivide: 57397,
  7856. KpDecimal: 83,
  7857. KpReturn: 57372,
  7858. KpEqual: 89,
  7859. KpComma: 126,
  7860. Kp0: 82,
  7861. Kp1: 79,
  7862. Kp2: 80,
  7863. Kp3: 81,
  7864. Kp4: 75,
  7865. Kp5: 76,
  7866. Kp6: 77,
  7867. Kp7: 71,
  7868. Kp8: 72,
  7869. Kp9: 73,
  7870. MetaRight: 57436,
  7871. Apps: 57437,
  7872. VolumeUp: 57392,
  7873. VolumeDown: 57390,
  7874. VolumeMute: 57376,
  7875. Lang1: 123,
  7876. Lang2: 121,
  7877. Lang3: 120,
  7878. Lang4: 119,
  7879. Lang5: 118,
  7880. Kana: 128,
  7881. Hanja: 241
  7882. }, jo = {
  7883. Alt: 64,
  7884. AltGr: 108,
  7885. Backspace: 22,
  7886. CapsLock: 66,
  7887. ControlLeft: 37,
  7888. ControlRight: 105,
  7889. Delete: 119,
  7890. DownArrow: 116,
  7891. End: 115,
  7892. Escape: 9,
  7893. F1: 67,
  7894. F10: 76,
  7895. F11: 95,
  7896. F12: 96,
  7897. F13: 191,
  7898. F14: 192,
  7899. F15: 193,
  7900. F16: 194,
  7901. F17: 195,
  7902. F18: 196,
  7903. F19: 197,
  7904. F20: 198,
  7905. F21: 199,
  7906. F22: 200,
  7907. F23: 201,
  7908. F24: 202,
  7909. F2: 68,
  7910. F3: 69,
  7911. F4: 70,
  7912. F5: 71,
  7913. F6: 72,
  7914. F7: 73,
  7915. F8: 74,
  7916. F9: 75,
  7917. Home: 110,
  7918. LeftArrow: 113,
  7919. MetaLeft: 133,
  7920. PageDown: 117,
  7921. PageUp: 112,
  7922. Return: 36,
  7923. RightArrow: 114,
  7924. ShiftLeft: 50,
  7925. ShiftRight: 62,
  7926. Space: 65,
  7927. Tab: 23,
  7928. UpArrow: 111,
  7929. PrintScreen: 107,
  7930. ScrollLock: 78,
  7931. Pause: 127,
  7932. NumLock: 77,
  7933. BackQuote: 49,
  7934. Num1: 10,
  7935. Num2: 11,
  7936. Num3: 12,
  7937. Num4: 13,
  7938. Num5: 14,
  7939. Num6: 15,
  7940. Num7: 16,
  7941. Num8: 17,
  7942. Num9: 18,
  7943. Num0: 19,
  7944. Minus: 20,
  7945. Equal: 21,
  7946. KeyQ: 24,
  7947. KeyW: 25,
  7948. KeyE: 26,
  7949. KeyR: 27,
  7950. KeyT: 28,
  7951. KeyY: 29,
  7952. KeyU: 30,
  7953. KeyI: 31,
  7954. KeyO: 32,
  7955. KeyP: 33,
  7956. LeftBracket: 34,
  7957. RightBracket: 35,
  7958. KeyA: 38,
  7959. KeyS: 39,
  7960. KeyD: 40,
  7961. KeyF: 41,
  7962. KeyG: 42,
  7963. KeyH: 43,
  7964. KeyJ: 44,
  7965. KeyK: 45,
  7966. KeyL: 46,
  7967. SemiColon: 47,
  7968. Quote: 48,
  7969. BackSlash: 51,
  7970. IntlBackslash: 94,
  7971. IntlRo: 97,
  7972. IntlYen: 132,
  7973. KanaMode: 101,
  7974. KeyZ: 52,
  7975. KeyX: 53,
  7976. KeyC: 54,
  7977. KeyV: 55,
  7978. KeyB: 56,
  7979. KeyN: 57,
  7980. KeyM: 58,
  7981. Comma: 59,
  7982. Dot: 60,
  7983. Slash: 61,
  7984. Insert: 118,
  7985. KpDecimal: 91,
  7986. KpReturn: 104,
  7987. KpMinus: 82,
  7988. KpPlus: 86,
  7989. KpMultiply: 63,
  7990. KpDivide: 106,
  7991. KpEqual: 125,
  7992. KpComma: 129,
  7993. Kp0: 90,
  7994. Kp1: 87,
  7995. Kp2: 88,
  7996. Kp3: 89,
  7997. Kp4: 83,
  7998. Kp5: 84,
  7999. Kp6: 85,
  8000. Kp7: 79,
  8001. Kp8: 80,
  8002. Kp9: 81,
  8003. MetaRight: 134,
  8004. Apps: 135,
  8005. VolumeUp: 123,
  8006. VolumeDown: 122,
  8007. VolumeMute: 121,
  8008. Lang1: 102,
  8009. Lang2: 100,
  8010. Lang3: 98,
  8011. Lang4: 99,
  8012. Lang5: 93
  8013. }, No = {
  8014. Alt: 57,
  8015. AltGr: 58,
  8016. Backspace: 67,
  8017. CapsLock: 115,
  8018. ControlLeft: 113,
  8019. ControlRight: 114,
  8020. Delete: 112,
  8021. DownArrow: 20,
  8022. End: 123,
  8023. Escape: 111,
  8024. F1: 131,
  8025. F10: 140,
  8026. F11: 141,
  8027. F12: 142,
  8028. F2: 132,
  8029. F3: 133,
  8030. F4: 134,
  8031. F5: 135,
  8032. F6: 136,
  8033. F7: 137,
  8034. F8: 138,
  8035. F9: 139,
  8036. Home: 3,
  8037. LeftArrow: 21,
  8038. MetaLeft: 117,
  8039. PageDown: 93,
  8040. PageUp: 92,
  8041. Return: 66,
  8042. RightArrow: 22,
  8043. ShiftLeft: 59,
  8044. ShiftRight: 60,
  8045. Space: 62,
  8046. Tab: 61,
  8047. UpArrow: 19,
  8048. PrintScreen: 120,
  8049. ScrollLock: 116,
  8050. NumLock: 143,
  8051. Pause: 121,
  8052. BackQuote: 75,
  8053. Num1: 8,
  8054. Num2: 9,
  8055. Num3: 10,
  8056. Num4: 11,
  8057. Num5: 12,
  8058. Num6: 13,
  8059. Num7: 14,
  8060. Num8: 15,
  8061. Num9: 16,
  8062. Num0: 7,
  8063. Minus: 69,
  8064. Equal: 70,
  8065. KeyA: 29,
  8066. KeyB: 30,
  8067. KeyC: 31,
  8068. KeyD: 32,
  8069. KeyE: 33,
  8070. KeyF: 34,
  8071. KeyG: 35,
  8072. KeyH: 36,
  8073. KeyI: 37,
  8074. KeyJ: 38,
  8075. KeyK: 39,
  8076. KeyL: 40,
  8077. KeyM: 41,
  8078. KeyN: 42,
  8079. KeyO: 43,
  8080. KeyP: 44,
  8081. KeyQ: 45,
  8082. KeyR: 46,
  8083. KeyS: 47,
  8084. KeyT: 48,
  8085. KeyU: 49,
  8086. KeyV: 50,
  8087. KeyW: 51,
  8088. KeyX: 52,
  8089. KeyY: 53,
  8090. KeyZ: 54,
  8091. LeftBracket: 71,
  8092. RightBracket: 72,
  8093. SemiColon: 74,
  8094. Quote: 75,
  8095. BackSlash: 73,
  8096. KanaMode: 218,
  8097. Comma: 55,
  8098. Dot: 56,
  8099. Slash: 76,
  8100. Insert: 124
  8101. }, Oo = {
  8102. 226: "Alt",
  8103. 230: "AltGr",
  8104. 42: "Backspace",
  8105. 57: "CapsLock",
  8106. 224: "ControlLeft",
  8107. 228: "ControlRight",
  8108. 76: "Delete",
  8109. 82: "UpArrow",
  8110. 81: "DownArrow",
  8111. 80: "LeftArrow",
  8112. 79: "RightArrow",
  8113. 77: "End",
  8114. 41: "Escape",
  8115. 58: "F1",
  8116. 59: "F2",
  8117. 60: "F3",
  8118. 61: "F4",
  8119. 62: "F5",
  8120. 63: "F6",
  8121. 64: "F7",
  8122. 65: "F8",
  8123. 66: "F9",
  8124. 67: "F10",
  8125. 68: "F11",
  8126. 69: "F12",
  8127. 104: "F13",
  8128. 105: "F14",
  8129. 106: "F15",
  8130. 107: "F16",
  8131. 108: "F17",
  8132. 109: "F18",
  8133. 110: "F19",
  8134. 111: "F20",
  8135. 112: "F21",
  8136. 113: "F22",
  8137. 114: "F23",
  8138. 115: "F24",
  8139. 74: "Home",
  8140. 227: "MetaLeft",
  8141. 78: "PageDown",
  8142. 75: "PageUp",
  8143. 40: "Return",
  8144. 225: "ShiftLeft",
  8145. 229: "ShiftRight",
  8146. 44: "Space",
  8147. 43: "Tab",
  8148. 70: "PrintScreen",
  8149. 71: "ScrollLock",
  8150. 83: "NumLock",
  8151. 53: "BackQuote",
  8152. 30: "Num1",
  8153. 31: "Num2",
  8154. 32: "Num3",
  8155. 33: "Num4",
  8156. 34: "Num5",
  8157. 35: "Num6",
  8158. 36: "Num7",
  8159. 37: "Num8",
  8160. 38: "Num9",
  8161. 39: "Num0",
  8162. 45: "Minus",
  8163. 46: "Equal",
  8164. 20: "KeyQ",
  8165. 26: "KeyW",
  8166. 8: "KeyE",
  8167. 21: "KeyR",
  8168. 23: "KeyT",
  8169. 28: "KeyY",
  8170. 24: "KeyU",
  8171. 12: "KeyI",
  8172. 18: "KeyO",
  8173. 19: "KeyP",
  8174. 47: "LeftBracket",
  8175. 48: "RightBracket",
  8176. 49: "BackSlash",
  8177. 4: "KeyA",
  8178. 22: "KeyS",
  8179. 7: "KeyD",
  8180. 9: "KeyF",
  8181. 10: "KeyG",
  8182. 11: "KeyH",
  8183. 13: "KeyJ",
  8184. 14: "KeyK",
  8185. 15: "KeyL",
  8186. 51: "SemiColon",
  8187. 52: "Quote",
  8188. 100: "IntlBackslash",
  8189. 135: "IntlRo",
  8190. 137: "IntlYen",
  8191. 29: "KeyZ",
  8192. 27: "KeyX",
  8193. 6: "KeyC",
  8194. 25: "KeyV",
  8195. 5: "KeyB",
  8196. 17: "KeyN",
  8197. 16: "KeyM",
  8198. 54: "Comma",
  8199. 55: "Dot",
  8200. 56: "Slash",
  8201. 73: "Insert",
  8202. 86: "KpMinus",
  8203. 87: "KpPlus",
  8204. 85: "KpMultiply",
  8205. 84: "KpDivide",
  8206. 99: "KpDecimal",
  8207. 88: "KpReturn",
  8208. 103: "KpEqual",
  8209. 133: "KpComma",
  8210. 98: "Kp0",
  8211. 89: "Kp1",
  8212. 90: "Kp2",
  8213. 91: "Kp3",
  8214. 92: "Kp4",
  8215. 93: "Kp5",
  8216. 94: "Kp6",
  8217. 95: "Kp7",
  8218. 96: "Kp8",
  8219. 97: "Kp9",
  8220. 231: "MetaRight",
  8221. 128: "VolumeUp",
  8222. 129: "VolumeDown",
  8223. 127: "VolumeMute",
  8224. 139: "Lang1",
  8225. 138: "Lang2",
  8226. 146: "Lang3",
  8227. 147: "Lang4",
  8228. 148: "Lang5",
  8229. 155: "Cancel",
  8230. 156: "Clear",
  8231. 136: "Kana",
  8232. 145: "Hanja",
  8233. 119: "Select",
  8234. 116: "Execute",
  8235. 117: "Help",
  8236. 159: "Separator"
  8237. }, Mo = {
  8238. KeyA: 0,
  8239. KeyS: 1,
  8240. KeyD: 2,
  8241. KeyF: 3,
  8242. KeyH: 4,
  8243. KeyG: 5,
  8244. KeyZ: 6,
  8245. KeyX: 7,
  8246. KeyC: 8,
  8247. KeyV: 9,
  8248. IntlBackslash: 10,
  8249. KeyB: 11,
  8250. KeyQ: 12,
  8251. KeyW: 13,
  8252. KeyE: 14,
  8253. KeyR: 15,
  8254. KeyY: 16,
  8255. KeyT: 17,
  8256. Num1: 18,
  8257. Num2: 19,
  8258. Num3: 20,
  8259. Num4: 21,
  8260. Num6: 22,
  8261. Num5: 23,
  8262. Equal: 24,
  8263. Num9: 25,
  8264. Num7: 26,
  8265. Minus: 27,
  8266. Num8: 28,
  8267. Num0: 29,
  8268. RightBracket: 30,
  8269. KeyO: 31,
  8270. KeyU: 32,
  8271. LeftBracket: 33,
  8272. KeyI: 34,
  8273. KeyP: 35,
  8274. Return: 36,
  8275. KeyL: 37,
  8276. KeyJ: 38,
  8277. Quote: 39,
  8278. KeyK: 40,
  8279. SemiColon: 41,
  8280. BackSlash: 42,
  8281. Comma: 43,
  8282. Slash: 44,
  8283. KeyN: 45,
  8284. KeyM: 46,
  8285. Dot: 47,
  8286. Tab: 48,
  8287. Space: 49,
  8288. BackQuote: 50,
  8289. Backspace: 51,
  8290. Escape: 53,
  8291. MetaRight: 54,
  8292. MetaLeft: 55,
  8293. ShiftLeft: 56,
  8294. CapsLock: 57,
  8295. Alt: 58,
  8296. ControlLeft: 59,
  8297. ShiftRight: 60,
  8298. AltGr: 61,
  8299. ControlRight: 62,
  8300. Function: 63,
  8301. F17: 64,
  8302. KpDecimal: 65,
  8303. KpMultiply: 67,
  8304. KpPlus: 69,
  8305. NumLock: 71,
  8306. VolumeUp: 72,
  8307. VolumeDown: 73,
  8308. VolumeMute: 74,
  8309. KpDivide: 75,
  8310. KpReturn: 76,
  8311. KpMinus: 78,
  8312. F18: 79,
  8313. F19: 80,
  8314. KpEqual: 81,
  8315. Kp0: 82,
  8316. Kp1: 83,
  8317. Kp2: 84,
  8318. Kp3: 85,
  8319. Kp4: 86,
  8320. Kp5: 87,
  8321. Kp6: 88,
  8322. Kp7: 89,
  8323. F20: 90,
  8324. Kp8: 91,
  8325. Kp9: 92,
  8326. IntlYen: 93,
  8327. IntlRo: 94,
  8328. KpComma: 95,
  8329. F5: 96,
  8330. F6: 97,
  8331. F7: 98,
  8332. F3: 99,
  8333. F8: 100,
  8334. F9: 101,
  8335. Lang2: 102,
  8336. F11: 103,
  8337. Lang1: 104,
  8338. F13: 105,
  8339. F16: 106,
  8340. F14: 107,
  8341. F10: 109,
  8342. F12: 111,
  8343. F15: 113,
  8344. Insert: 114,
  8345. Home: 115,
  8346. PageUp: 116,
  8347. Delete: 117,
  8348. F4: 118,
  8349. End: 119,
  8350. F2: 120,
  8351. PageDown: 121,
  8352. F1: 122,
  8353. LeftArrow: 123,
  8354. RightArrow: 124,
  8355. DownArrow: 125,
  8356. UpArrow: 126,
  8357. Apps: 110
  8358. }, Uo = {
  8359. AltLeft: "Alt",
  8360. AltRight: "AltGr",
  8361. Backspace: "Backspace",
  8362. CapsLock: "CapsLock",
  8363. ControlLeft: "ControlLeft",
  8364. ControlRight: "ControlRight",
  8365. Delete: "Delete",
  8366. ArrowUp: "UpArrow",
  8367. ArrowDown: "DownArrow",
  8368. ArrowLeft: "LeftArrow",
  8369. ArrowRight: "RightArrow",
  8370. End: "End",
  8371. Escape: "Escape",
  8372. F1: "F1",
  8373. F2: "F2",
  8374. F3: "F3",
  8375. F4: "F4",
  8376. F5: "F5",
  8377. F6: "F6",
  8378. F7: "F7",
  8379. F8: "F8",
  8380. F9: "F9",
  8381. F10: "F10",
  8382. F11: "F11",
  8383. F12: "F12",
  8384. F13: "F13",
  8385. F14: "F14",
  8386. F15: "F15",
  8387. F16: "F16",
  8388. F17: "F17",
  8389. F18: "F18",
  8390. F19: "F19",
  8391. F20: "F20",
  8392. F21: "F21",
  8393. F22: "F22",
  8394. F23: "F23",
  8395. F24: "F24",
  8396. Home: "Home",
  8397. MetaLeft: "MetaLeft",
  8398. PageDown: "PageDown",
  8399. PageUp: "PageUp",
  8400. Enter: "Return",
  8401. ShiftLeft: "ShiftLeft",
  8402. ShiftRight: "ShiftRight",
  8403. Space: "Space",
  8404. Tab: "Tab",
  8405. PrintScreen: "PrintScreen",
  8406. ScrollLock: "ScrollLock",
  8407. NumLock: "NumLock",
  8408. Backquote: "BackQuote",
  8409. Digit1: "Num1",
  8410. Digit2: "Num2",
  8411. Digit3: "Num3",
  8412. Digit4: "Num4",
  8413. Digit5: "Num5",
  8414. Digit6: "Num6",
  8415. Digit7: "Num7",
  8416. Digit8: "Num8",
  8417. Digit9: "Num9",
  8418. Digit0: "Num0",
  8419. Minus: "Minus",
  8420. Equal: "Equal",
  8421. KeyQ: "KeyQ",
  8422. KeyW: "KeyW",
  8423. KeyE: "KeyE",
  8424. KeyR: "KeyR",
  8425. KeyT: "KeyT",
  8426. KeyY: "KeyY",
  8427. KeyU: "KeyU",
  8428. KeyI: "KeyI",
  8429. KeyO: "KeyO",
  8430. KeyP: "KeyP",
  8431. BracketLeft: "LeftBracket",
  8432. BracketRight: "RightBracket",
  8433. Backslash: "BackSlash",
  8434. KeyA: "KeyA",
  8435. KeyS: "KeyS",
  8436. KeyD: "KeyD",
  8437. KeyF: "KeyF",
  8438. KeyG: "KeyG",
  8439. KeyH: "KeyH",
  8440. KeyJ: "KeyJ",
  8441. KeyK: "KeyK",
  8442. KeyL: "KeyL",
  8443. Semicolon: "SemiColon",
  8444. Quote: "Quote",
  8445. IntlBackslash: "IntlBackslash",
  8446. IntlRo: "IntlRo",
  8447. IntlYen: "IntlYen",
  8448. KanaMode: "KanaMode",
  8449. KeyZ: "KeyZ",
  8450. KeyX: "KeyX",
  8451. KeyC: "KeyC",
  8452. KeyV: "KeyV",
  8453. KeyB: "KeyB",
  8454. KeyN: "KeyN",
  8455. KeyM: "KeyM",
  8456. Comma: "Comma",
  8457. Period: "Dot",
  8458. Slash: "Slash",
  8459. Insert: "Insert",
  8460. NumpadSubtract: "KpMinus",
  8461. NumpadAdd: "KpPlus",
  8462. NumpadMultiply: "KpMultiply",
  8463. NumpadDivide: "KpDivide",
  8464. NumpadDecimal: "KpDecimal",
  8465. NumpadEnter: "KpReturn",
  8466. NumpadEqual: "KpEqual",
  8467. NumpadComma: "KpComma",
  8468. Numpad0: "Kp0",
  8469. Numpad1: "Kp1",
  8470. Numpad2: "Kp2",
  8471. Numpad3: "Kp3",
  8472. Numpad4: "Kp4",
  8473. Numpad5: "Kp5",
  8474. Numpad6: "Kp6",
  8475. Numpad7: "Kp7",
  8476. Numpad8: "Kp8",
  8477. Numpad9: "Kp9",
  8478. MetaRight: "MetaRight",
  8479. ContextMenu: "Apps",
  8480. AudioVolumeUp: "VolumeUp",
  8481. AudioVolumeDown: "VolumeDown",
  8482. AudioVolumeMute: "VolumeMute",
  8483. NonConvert: "Lang1",
  8484. Convert: "Lang2",
  8485. Lang3: "Lang3",
  8486. Lang4: "Lang4",
  8487. Lang5: "Lang5"
  8488. },
  8489. Lo = new Set(["BackQuote", "Num1", "Num2", "Num3", "Num4", "Num5", "Num6", "Num7", "Num8", "Num9", "Num0", "Minus", "Equal", "KeyA", "KeyB", "KeyC", "KeyD", "KeyE", "KeyF", "KeyG", "KeyH", "KeyI", "KeyJ", "KeyK", "KeyL", "KeyM", "KeyN", "KeyO", "KeyP", "KeyQ", "KeyR", "KeyS", "KeyT", "KeyU", "KeyV", "KeyW", "KeyX", "KeyY", "KeyZ", "LeftBracket", "RightBracket", "BackSlash", "SemiColon", "Quote", "Comma", "Dot", "Slash", "IntlBackslash", "Space"]),
  8490. Wo = new Set(["Kp0", "Kp1", "Kp2", "Kp3", "Kp4", "Kp5", "Kp6", "Kp7", "Kp8", "Kp9", "KpMinus", "KpMultiply", "KpDivide", "KpPlus", "KpDecimal"]);
  8491. let D4 = !1, ru = !1;
  8492. const b = {};
  8493. b[Xa] = !1;
  8494. b[Ya] = !1;
  8495. b[m4] = !1;
  8496. b[mt] = !1;
  8497. b[pe] = !1;
  8498. b[At] = !1;
  8499. b[Ft] = !1;
  8500. b[_t] = !1;
  8501. const _4 = {}, _e = u => Wo.has(u), ve = u => Lo.has(u), Vo = () => b[m4] || b[mt] || b[pe] || b[At] || b[Ft] || b[_t];
  8502. let _, O4 = !1;
  8503. function qo() {
  8504. if (O4) {
  8505. console.info("Keyboard event listener is already started");
  8506. return
  8507. }
  8508. document.addEventListener("keydown", M4), document.addEventListener("keyup", M4), _ || (_ = document.createElement("div"), _.setAttribute("contenteditable", "true"), _.id = "hiddenInput", _.style.position = "absolute", _.style.left = "-9999px", _.style.height = "1px", _.style.width = "1px", document.body.appendChild(_), Yu ? _.addEventListener("input", U4) : (H4 || Qu) && _.addEventListener("compositionend", U4), _.focus()), O4 = !0, console.info("Keyboard event listener started")
  8509. }
  8510. function Ee() {
  8511. if (!O4) {
  8512. console.info("Keyboard event listener is not started");
  8513. return
  8514. }
  8515. document.removeEventListener("keydown", M4), document.removeEventListener("keyup", M4), _ && (Yu || H4 ? _.removeEventListener("input", U4) : Qu && _.removeEventListener("compositionend", U4), _.remove(), _ = void 0), O4 = !1, console.info("Keyboard event listener stopped")
  8516. }
  8517. function ke(u, e) {
  8518. u.sendMessage({key_event: e})
  8519. }
  8520. function M4(u) {
  8521. const e = e0();
  8522. if (!e) return;
  8523. const i = u.type === "keydown";
  8524. i && !ru && u.preventDefault(), Rt(e, u, i)
  8525. }
  8526. function U4(u) {
  8527. var a, t;
  8528. const e = e0();
  8529. if (!e) return;
  8530. u.preventDefault();
  8531. let i = null;
  8532. if ((u instanceof InputEvent || u instanceof CompositionEvent) && (i = u.data), !i) return;
  8533. const o = w.fromPartial({seq: i, mode: C4.Translate, down: !0, press: !1});
  8534. ke(e, o), ((t = (a = _ == null ? void 0 : _.textContent) == null ? void 0 : a.length) != null ? t : 0) > 10 && (_.textContent = "")
  8535. }
  8536. function Rt(u, e, i) {
  8537. const o = Jo(u, e, i);
  8538. for (const a of o) ke(u, a)
  8539. }
  8540. function Ko(u, e, i, o) {
  8541. const a = Oo[e];
  8542. if (!a) {
  8543. console.error("Unknown USB HID code " + e);
  8544. return
  8545. }
  8546. const t = L4(u, a, i);
  8547. if (!t) return;
  8548. const s = _e(a), l = ve(a);
  8549. (l || s) && It(t, o, s, l);
  8550. for (const E of t) ke(u, E)
  8551. }
  8552. function Ho() {
  8553. const u = e0();
  8554. if (!!u) for (const e in _4) {
  8555. const i = _4[e];
  8556. i && Rt(u, i, !1)
  8557. }
  8558. }
  8559. function Jo(u, e, i) {
  8560. var c;
  8561. const o = e.code, a = Uo[o];
  8562. if (!a) return console.error("Key code is not supported " + o), [];
  8563. const t = u.getOption("keyboard_mode"), s = Go(e);
  8564. Qo(e, i), i ? _4[o] = e : delete _4[o];
  8565. let l = [];
  8566. switch (t) {
  8567. case Qa:
  8568. l = (c = L4(u, a, i)) != null ? c : [];
  8569. break;
  8570. case Ji:
  8571. l = Xo(u, e, a, i);
  8572. break
  8573. }
  8574. if (!l) return [];
  8575. const E = _e(a);
  8576. if (t !== Ji || E) {
  8577. const C = ve(a);
  8578. It(l, s, E, C)
  8579. }
  8580. return l
  8581. }
  8582. function It(u, e, i, o) {
  8583. for (const s of u) o && (e & 1 << 1) != 0 && s.modifiers.push(j.CapsLock), i && (e & 1 << 2) != 0 && s.modifiers.push(j.NumLock)
  8584. }
  8585. function Go(u) {
  8586. let a = 0;
  8587. return u.getModifierState("CapsLock") && (a |= 1 << 1), u.getModifierState("NumLock") && (a |= 1 << 2), u.getModifierState("ScrollLock") && (a |= 1 << 3), a
  8588. }
  8589. function Zo(u, e) {
  8590. return u == Y4 ? Fe[e] : u == De ? jo[e] : u == vt ? No[e] : u == Be ? (A.getItem("option:local:kb_layout") == eo && (e == "IntlBackslash" ? e = "BackQuote" : e == "BackQuote" && (e = "IntlBackslash")), Mo[e]) : null
  8591. }
  8592. function Qo(u, e) {
  8593. const i = u.code;
  8594. i in b && (b[i] = e)
  8595. }
  8596. function L4(u, e, i) {
  8597. const o = u.getPeerPlatform(), a = u.isSwapControlCommand();
  8598. e == "ControlLeft" || e == "ControlRight" ? a && (e = "MetaLeft") : (e == "MetaLeft" || e == "MetaRight") && a && (e = "ControlLeft");
  8599. const t = Zo(o, e);
  8600. return t == null ? (console.error("Unknown key code " + e + " for platform " + o), []) : [w.fromPartial({
  8601. chr: t,
  8602. mode: C4.Map,
  8603. down: i,
  8604. press: !1
  8605. })]
  8606. }
  8607. function Xo(u, e, i, o) {
  8608. const a = _ === document.activeElement;
  8609. if (_ && _.focus(), H4 && _ && a && e.key === "Process") return [];
  8610. const t = ve(i), s = e.key === "Dead";
  8611. if (o && ru && t) return Qu ? ru = s : ru = !1, [];
  8612. if (s) return o && (Qu ? ru = !0 : ru = !ru), ru && _ && !a && Yu && _.dispatchEvent(new KeyboardEvent(e.type, {...e})), [];
  8613. if (ru = !1, !Qu && _e(i)) return L4(u, i, o);
  8614. if (Qu && e.code === "AltRight") return [];
  8615. if (e.key === "AltGraph") return D4 && !o && (D4 = !1), !D4 && o && b[m4] ? (D4 = !0, b[m4] = !1, delete _4[m4], [w.fromPartial({
  8616. chr: Fe.ControlLeft,
  8617. mode: C4.Map,
  8618. down: !1,
  8619. press: !1
  8620. })]) : [];
  8621. const E = u.getPeerPlatform();
  8622. let c = [];
  8623. return Yu && (c = Yo(E, e, o)), (Yu || H4) && c.length === 0 && o && t && (c = Xi(e, o)), Yu && D4 || (Qu && o && t && !b[pe] && c.push(...Xi(e, o)), c.length === 0 && c.push(...L4(u, i, o))), c
  8624. }
  8625. function Yo(u, e, i) {
  8626. if (u !== Y4 || !Vo()) return [];
  8627. let o;
  8628. const a = Fe[e.code];
  8629. return a === void 0 ? (console.error("Key code cannot be converted to scan code: " + e.code), []) : (i ? e.key.length === 1 && (o = e.key.charCodeAt(0) & 65535 | a << 16) : o = a << 16, o === void 0 ? [] : [w.fromPartial({
  8630. win2win_hotkey: o,
  8631. mode: C4.Translate,
  8632. down: i,
  8633. press: !1
  8634. })])
  8635. }
  8636. function Xi(u, e) {
  8637. return u.key ? [w.fromPartial({seq: u.key, mode: C4.Translate, down: e, press: !1})] : []
  8638. }
  8639. class $o {
  8640. constructor(e, i, o, a) {
  8641. d(this, "_uri");
  8642. d(this, "_feedback");
  8643. d(this, "_key");
  8644. d(this, "_token");
  8645. d(this, "_ws");
  8646. d(this, "_interval");
  8647. d(this, "_keepAlive");
  8648. d(this, "_lastRecvMsg");
  8649. d(this, "_aliveFailed");
  8650. this._uri = e, this._feedback = i, this._key = o, this._token = a, this._keepAlive = so, this._lastRecvMsg = new Date, this._aliveFailed = !1
  8651. }
  8652. close() {
  8653. var e;
  8654. this._interval && (clearInterval(this._interval), this._interval = void 0), (e = this._ws) == null || e.close(), this._ws = void 0
  8655. }
  8656. async start() {
  8657. if (this._feedback == 0 || !this._uri || !this._token || !this._key) return;
  8658. const e = new j4(this._uri, !0, "health check");
  8659. await e.open(), console.log(new Date + ": Connected to relay server"), this._ws = e;
  8660. const i = Gu.fromPartial({token: this._token});
  8661. e.sendRendezvous({hc: i}), this.startInterval(), await this.msgLoop(), this.close()
  8662. }
  8663. startInterval() {
  8664. this._interval = setInterval(() => {
  8665. new Date().getTime() - this._lastRecvMsg.getTime() > this._keepAlive * 3 / 2 && (this._aliveFailed = !0)
  8666. }, ro)
  8667. }
  8668. async msgLoop() {
  8669. var e;
  8670. for (this._lastRecvMsg = new Date; ;) {
  8671. if (!this._ws) {
  8672. console.info("HC connection is closed as controlling connection exits");
  8673. break
  8674. }
  8675. try {
  8676. const i = await ((e = this._ws) == null ? void 0 : e.next(300));
  8677. i && (this._lastRecvMsg = new Date, this.handleMsg(i))
  8678. } catch (i) {
  8679. if (i === "Timeout") {
  8680. if (this._aliveFailed) {
  8681. console.error("HC connection is timeout");
  8682. break
  8683. }
  8684. } else {
  8685. console.error("An error occurred on health check:", i);
  8686. break
  8687. }
  8688. }
  8689. }
  8690. }
  8691. handleMsg(e) {
  8692. var i;
  8693. if (e instanceof Uint8Array) {
  8694. (i = this._ws) == null || i.sendBytes(new Uint8Array);
  8695. return
  8696. } else {
  8697. const o = e.register_pk_response;
  8698. o && o.keep_alive > 0 && (this._keepAlive = o.keep_alive * 1e3, console.log("keep_alive: " + this._keepAlive + "ms"))
  8699. }
  8700. }
  8701. }
  8702. let W4 = [], v4 = "", V4 = [], k4 = [], q4;
  8703. const ge = ["text/plain", "text/html", "image/svg+xml", "image/png"];
  8704. function he() {
  8705. V4 = [], k4 = [], q4 = void 0
  8706. }
  8707. async function Yi(u, e = !1) {
  8708. var i = [], o = "";
  8709. try {
  8710. i = await navigator.clipboard.read(), i.length === 0 && (o = await navigator.clipboard.readText())
  8711. } catch {
  8712. return
  8713. }
  8714. e || i.length === 0 && o === "" || (await un(i) ? (W4 = i, await tn(u)) : o !== v4 && (v4 = o, await an(u)))
  8715. }
  8716. async function un(u) {
  8717. if (u.length !== W4.length) return !0;
  8718. for (let e = 0; e < u.length; e++) {
  8719. const i = u[e], o = W4[e];
  8720. if (!await en(i, o)) return !0
  8721. }
  8722. return !1
  8723. }
  8724. async function en(u, e) {
  8725. if (u.types.length !== e.types.length) return !1;
  8726. for (let i = 0; i < u.types.length; i++) {
  8727. if (u.types[i] !== e.types[i]) return !1;
  8728. if (!ge.includes(u.types[i])) continue;
  8729. const o = await u.getType(u.types[i]), a = await e.getType(e.types[i]);
  8730. if (o.size !== a.size) return !1;
  8731. const t = new Uint8Array(await o.arrayBuffer()), s = new Uint8Array(await a.arrayBuffer());
  8732. for (let l = 0; l < t.length; l++) if (t[l] !== s[l]) return !1
  8733. }
  8734. return !0
  8735. }
  8736. function Tt(u) {
  8737. switch (u) {
  8738. case"text/plain":
  8739. return du.Text;
  8740. case"text/html":
  8741. return du.Html;
  8742. case"image/svg+xml":
  8743. return du.ImageSvg;
  8744. case"image/png":
  8745. return du.ImagePng;
  8746. default:
  8747. return du.UNRECOGNIZED
  8748. }
  8749. }
  8750. async function tn(u) {
  8751. const e = [], i = (await Promise.all(W4.map(async o => {
  8752. const a = [];
  8753. for (const t of o.types) {
  8754. if (!ge.includes(t)) continue;
  8755. const s = await o.getType(t);
  8756. e.push(t), a.push(new Uint8Array(await s.arrayBuffer()))
  8757. }
  8758. return a
  8759. }))).flat();
  8760. e.length !== 0 && Yt(i, !0, o => {
  8761. const a = o.map((t, s) => {
  8762. let l = !1;
  8763. t && (l = t.length < v4.length);
  8764. const E = l && t != null ? t : i[s];
  8765. return L.fromPartial({content: E, compress: l, format: Tt(e[s])})
  8766. });
  8767. u.sendMessage(iu.fromPartial({multi_clipboards: gu.fromPartial({clipboards: a})}))
  8768. })
  8769. }
  8770. async function an(u) {
  8771. const e = new TextEncoder().encode(v4);
  8772. Yt(e, !1, i => {
  8773. let o = !1;
  8774. i && (o = i.length < v4.length);
  8775. const a = o && i != null ? i : e;
  8776. let t = L.fromPartial({content: a, compress: o, format: du.Text});
  8777. u.sendMessage(iu.fromPartial({clipboard: t}))
  8778. })
  8779. }
  8780. function fe(u, e = void 0) {
  8781. const i = () => {
  8782. try {
  8783. Wn(new TextDecoder().decode(u.content)), he(), e == null || e()
  8784. } catch (o) {
  8785. console.error("Failed to copy to clipboard, ", o), document.hasFocus() || (q4 = u)
  8786. }
  8787. };
  8788. u.compress ? Pe(u.content, !1, o => {
  8789. o && (u.content = o, i())
  8790. }) : i()
  8791. }
  8792. const z4 = document.createElement("canvas"), te = z4.getContext("2d");
  8793. function on(u, e, i) {
  8794. if (z4.width = e, z4.height = i, !te) return new Uint8Array(0);
  8795. const o = te.createImageData(e, i);
  8796. return o.data.set(u), te.putImageData(o, 0, 0), Uint8Array.from(atob(z4.toDataURL("image/png").split(",")[1]), a => a.charCodeAt(0))
  8797. }
  8798. function nn(u, e = void 0) {
  8799. he();
  8800. const i = u.clipboards, o = i.filter(a => a.compress).map(a => a.content);
  8801. Pe(o, !0, async a => {
  8802. var c;
  8803. let t = 0;
  8804. for (const C of i) C.compress && (C.content = (c = a[t]) != null ? c : C.content, t++), C.compress = !1;
  8805. const s = {};
  8806. for (const C of i) {
  8807. const D = ge.find(B => C.format === Tt(B));
  8808. if (D) {
  8809. const B = new Blob([C.content], {type: D});
  8810. s[D] = B
  8811. }
  8812. }
  8813. if (!(s["image/png"] !== void 0)) {
  8814. for (const C of i) if (C.format === du.ImageRgba) {
  8815. const D = on(C.content, C.width, C.height);
  8816. D.length > 0 && (s["image/png"] = new Blob([D], {type: "image/png"}));
  8817. break
  8818. }
  8819. }
  8820. if (Object.keys(s).length === 0) return;
  8821. const E = new ClipboardItem(s);
  8822. await jt(i, E, e)
  8823. })
  8824. }
  8825. async function jt(u, e, i = void 0) {
  8826. if (!document.hasFocus()) {
  8827. V4 = u, k4 = [e];
  8828. return
  8829. }
  8830. try {
  8831. await navigator.clipboard.write([e]), he(), i == null || i()
  8832. } catch (o) {
  8833. if (console.error("Failed to write to clipboard, ", o), !document.hasFocus()) {
  8834. V4 = u, k4 = [e];
  8835. return
  8836. }
  8837. const a = u.find(t => t.format === du.Text);
  8838. a && fe(a, i)
  8839. }
  8840. }
  8841. function $i() {
  8842. zn("info", "Clipboard is synchronized", 2e3)
  8843. }
  8844. window.addEventListener("focus", function () {
  8845. k4.length > 0 ? jt(V4, k4[0], $i) : q4 && fe(q4, $i)
  8846. });
  8847. class rn {
  8848. constructor({id: e, path: i}) {
  8849. d(this, "id");
  8850. d(this, "path");
  8851. d(this, "empty_dirs");
  8852. this.id = e, this.path = i, this.empty_dirs = void 0
  8853. }
  8854. }
  8855. const su = class {
  8856. constructor({
  8857. id: e,
  8858. remote: i,
  8859. path: o,
  8860. show_hidden: a,
  8861. is_remote: t,
  8862. is_last_job: s,
  8863. file_num: l,
  8864. files: E,
  8865. conn_id: c,
  8866. total_size: C,
  8867. finished_size: D,
  8868. transferred: B,
  8869. enable_overwrite_detection: F,
  8870. file_confirmed: y,
  8871. file_skipped: S,
  8872. file_is_waiting: g,
  8873. is_dir: U
  8874. }) {
  8875. d(this, "id");
  8876. d(this, "remote");
  8877. d(this, "path");
  8878. d(this, "show_hidden");
  8879. d(this, "is_remote");
  8880. d(this, "is_last_job");
  8881. d(this, "file_num");
  8882. d(this, "files");
  8883. d(this, "conn_id");
  8884. d(this, "total_size");
  8885. d(this, "finished_size");
  8886. d(this, "transferred");
  8887. d(this, "lastTransferred");
  8888. d(this, "enable_overwrite_detection");
  8889. d(this, "file_confirmed");
  8890. d(this, "file_skipped");
  8891. d(this, "file_is_waiting");
  8892. d(this, "default_overwrite_strategy");
  8893. d(this, "is_dir");
  8894. d(this, "stream");
  8895. d(this, "writer");
  8896. d(this, "zip");
  8897. d(this, "currentData");
  8898. d(this, "fileHandles");
  8899. d(this, "currentReader");
  8900. d(this, "write", async (e, i) => {
  8901. var t;
  8902. if (e.id !== this.id) throw new Error("Wrong id");
  8903. const o = e.file_num;
  8904. if (o >= this.files.length) throw new Error("Wrong file number");
  8905. const a = this.is_dir;
  8906. if (o !== this.file_num || a && !this.zip || !a && !this.writer) if (a) {
  8907. if (this.zip || (this.zip = new Ne), this.currentData) {
  8908. const s = this.files[this.file_num];
  8909. this.zip.file(s.name, this.currentData), this.currentData = void 0
  8910. }
  8911. this.file_num = e.file_num
  8912. } else {
  8913. this.writer && await this.writer.close(), this.stream && (this.stream = void 0), this.file_num = e.file_num;
  8914. const s = this.files[o], l = su.join(this.path, s.name);
  8915. this.stream = streamSaver.createWriteStream(l, {size: s.size}), this.writer = (t = this.stream) == null ? void 0 : t.getWriter()
  8916. }
  8917. if (e.compressed) {
  8918. const s = await ua(e.data);
  8919. if (!s) throw new Error("Failed to decompress");
  8920. if (a) this.currentData ? this.currentData = new Uint8Array([...this.currentData, ...s]) : this.currentData = s; else {
  8921. if (!this.writer) throw new Error("file is None");
  8922. try {
  8923. await this.writer.write(s)
  8924. } catch (l) {
  8925. throw de(this.id, "write failed", this.file_num), i(), l
  8926. }
  8927. }
  8928. this.finished_size += s.length
  8929. } else {
  8930. if (a) this.currentData ? this.currentData = new Uint8Array([...this.currentData, ...e.data]) : this.currentData = e.data; else {
  8931. if (!this.writer) throw new Error("file is None");
  8932. try {
  8933. await this.writer.write(e.data)
  8934. } catch (s) {
  8935. throw de(this.id, "write failed", this.file_num), i(), s
  8936. }
  8937. }
  8938. this.finished_size += e.data.length
  8939. }
  8940. this.transferred += e.data.length
  8941. });
  8942. d(this, "read", async e => {
  8943. var c;
  8944. let i = this.file_num;
  8945. if (i >= this.files.length) {
  8946. (c = this.currentReader) == null || c.cancel(), this.currentReader = void 0;
  8947. return
  8948. }
  8949. let o = this.files[i];
  8950. if (!this.currentReader) {
  8951. if (!this.fileHandles || !this.fileHandles[i]) throw new Error("file is None");
  8952. let D = (await this.fileHandles[i].getFile()).stream();
  8953. this.currentReader = D.getReader({mode: "byob"}), this.file_confirmed = !1, this.file_is_waiting = !1
  8954. }
  8955. if (this.enable_overwrite_detection && !this.file_confirmed) {
  8956. this.file_is_waiting || (this.send_current_digest(e), this.file_is_waiting = !0);
  8957. return
  8958. }
  8959. const a = 128 * 1024;
  8960. let t = new ArrayBuffer(a), s = !1, l = 0;
  8961. for (; l < t.byteLength;) {
  8962. const {value: C, done: D} = await this.currentReader.read(new Uint8Array(t, l, t.byteLength - l));
  8963. if (!C) {
  8964. this.file_num += 1, this.file_confirmed = !1, this.file_is_waiting = !1, this.currentReader = void 0, t = new ArrayBuffer(0);
  8965. break
  8966. }
  8967. if (l += C.byteLength, t = C.buffer, D) break
  8968. }
  8969. let E = new Uint8Array(t, 0, l);
  8970. if (l === 0) this.file_num += 1, this.currentReader = void 0, this.file_confirmed = !1, this.file_is_waiting = !1; else {
  8971. if (this.finished_size += l, !hn(su.join(this.path, o.name))) {
  8972. const C = await $t(new Uint8Array(t, 0, l));
  8973. if (C) C.length < l && (E = new Uint8Array(C), s = !0); else throw new Error("Failed to compress")
  8974. }
  8975. this.transferred += l
  8976. }
  8977. return Su.fromPartial({id: this.id, file_num: i, data: E, compressed: s})
  8978. });
  8979. d(this, "send_current_digest", async e => {
  8980. if (!this.fileHandles || !this.fileHandles[this.file_num]) throw new Error("file is None");
  8981. let i = await this.fileHandles[this.file_num].getFile();
  8982. if (!i) throw new Error("file is None");
  8983. let o = Math.floor(i.lastModified / 1e3), a = i.size,
  8984. t = wu.fromPartial({id: this.id, file_num: this.file_num, last_modified: o, file_size: a}),
  8985. s = nu.fromPartial({digest: t}), l = iu.fromPartial({file_response: s});
  8986. e(l)
  8987. });
  8988. d(this, "read_digest", e => {
  8989. let i = this.files[e.file_num], o = su.join(this.path, i.name), a = this.default_overwrite_strategy;
  8990. if (a !== void 0) {
  8991. let t = cu.fromPartial({
  8992. id: e.id,
  8993. file_num: e.file_num,
  8994. offset_blk: a ? 0 : void 0,
  8995. skip: a ? void 0 : !0
  8996. });
  8997. return this.confirm(t), su.new_send_confirm(t)
  8998. } else {
  8999. fn(e.id, e.file_num, o, !0, e.is_identical);
  9000. return
  9001. }
  9002. });
  9003. d(this, "write_digest", e => {
  9004. let i = cu.fromPartial({id: e.id, file_num: e.file_num, offset_blk: 0});
  9005. return this.confirm(i), su.new_send_confirm(i)
  9006. });
  9007. d(this, "write_done", (e, i, o) => {
  9008. if (this.writer) {
  9009. this.writer.close();
  9010. return
  9011. }
  9012. if (this.zip || (this.zip = new Ne), this.currentData) {
  9013. const t = this.files[this.file_num];
  9014. this.zip.file(t.name, this.currentData), this.currentData = void 0
  9015. }
  9016. if (i != null) {
  9017. const t = i();
  9018. if (t != null) if (t.empty_dirs != null) for (let s of t.empty_dirs) {
  9019. var a = s.substring(t.path.length + 1);
  9020. A4() ? a = a.replace(/\//g, "\\") : a = a.replace(/\\/g, "/"), this.zip.folder(a)
  9021. } else {
  9022. setTimeout(() => {
  9023. this.write_done(e, i, o)
  9024. }, 1e3);
  9025. return
  9026. }
  9027. }
  9028. this.zip.generateAsync({type: "blob"}).then(t => {
  9029. oa.exports.saveAs(t, `${this.path}.zip`)
  9030. }), o()
  9031. });
  9032. d(this, "confirm", e => (this.file_num !== e.file_num ? console.log("file num truncated, ignoring") : e.skip !== void 0 ? e.skip ? this.set_file_skipped() : this.set_file_confirmed(!0) : e.offset_blk !== void 0 && this.set_file_confirmed(!0), !0));
  9033. d(this, "set_file_skipped", () => {
  9034. var e;
  9035. (e = this.writer) == null || e.abort(), this.writer = void 0, this.stream = void 0, this.set_file_confirmed(!1), this.set_file_is_waiting(!1), this.file_num += 1, this.file_skipped = !0
  9036. });
  9037. d(this, "set_file_confirmed", e => {
  9038. this.file_confirmed = e, this.file_skipped = !1
  9039. });
  9040. d(this, "set_file_is_waiting", e => {
  9041. this.file_is_waiting = e
  9042. });
  9043. d(this, "update_job_status", e => {
  9044. if (e <= 0) return;
  9045. let i = Math.floor((this.transferred - this.lastTransferred) / (e * 1 / 1e3));
  9046. this.lastTransferred = this.transferred;
  9047. let o = this.file_num - 1;
  9048. this.job_progress(this.id, o, i, this.finished_size)
  9049. });
  9050. d(this, "job_progress", (e, i, o, a) => {
  9051. m("job_progress", {
  9052. id: e.toString(),
  9053. file_num: i.toString(),
  9054. speed: o.toString(),
  9055. finished_size: a.toString()
  9056. })
  9057. });
  9058. d(this, "job_skipped", () => this.file_skipped && this.files.length === 1);
  9059. d(this, "job_error", () => {
  9060. if (this.job_skipped()) return "skipped"
  9061. });
  9062. d(this, "job_completed", () => !this.enable_overwrite_detection || !this.file_confirmed && !this.file_is_waiting);
  9063. d(this, "remove_download_file", () => {
  9064. if (this.writer) try {
  9065. this.writer.abort()
  9066. } catch {
  9067. }
  9068. this.writer = void 0, this.stream = void 0, this.currentData = void 0, this.zip = void 0
  9069. });
  9070. this.id = e, this.remote = i, this.path = o, this.show_hidden = a, this.is_remote = t, this.is_last_job = s, this.file_num = l, this.files = E, this.conn_id = c, this.total_size = C, this.finished_size = D, this.transferred = B, this.lastTransferred = 0, this.enable_overwrite_detection = F, this.file_confirmed = y, this.file_skipped = S, this.file_is_waiting = g, this.is_dir = U
  9071. }
  9072. };
  9073. let lu = su;
  9074. d(lu, "newWrite", (e, i, o, a, t, s, l, E, c) => {
  9075. let C = l.reduce((B, F) => B + F.size, 0);
  9076. return new su({
  9077. id: e,
  9078. remote: i,
  9079. path: o,
  9080. file_num: a,
  9081. show_hidden: t,
  9082. is_remote: s,
  9083. files: l,
  9084. total_size: C,
  9085. enable_overwrite_detection: E,
  9086. is_dir: c,
  9087. is_last_job: !1,
  9088. conn_id: 0,
  9089. finished_size: 0,
  9090. transferred: 0,
  9091. file_confirmed: !1,
  9092. file_skipped: !1,
  9093. file_is_waiting: !1
  9094. })
  9095. }), d(lu, "newRead", (e, i, o, a, t, s, l, E, c) => {
  9096. let C = l.reduce((B, F) => B + F.size, 0), D = new su({
  9097. id: e,
  9098. remote: i,
  9099. path: o,
  9100. file_num: a,
  9101. show_hidden: t,
  9102. is_remote: s,
  9103. files: l,
  9104. total_size: C,
  9105. enable_overwrite_detection: E,
  9106. is_dir: !1,
  9107. is_last_job: !1,
  9108. conn_id: 0,
  9109. finished_size: 0,
  9110. transferred: 0,
  9111. file_confirmed: !1,
  9112. file_skipped: !1,
  9113. file_is_waiting: !1
  9114. });
  9115. return D.fileHandles = c, D
  9116. }), d(lu, "new_send_confirm", e => iu.fromPartial({file_action: P.fromPartial({send_confirm: e})})), d(lu, "join", (e, i) => i === "" ? e : e.endsWith("/") || e.endsWith("\\") ? e + i : A4() ? e + "\\" + i : e + "/" + i);
  9117. const sn = (u, e, i, o) => {
  9118. let a = Pu.fromPartial({id: u, path: e, include_hidden: o, file_num: i});
  9119. return P.fromPartial({send: a})
  9120. }, ut = (u, e, i, o) => {
  9121. if (!o) return;
  9122. let a = ju.fromPartial({id: u, path: e, file_num: i});
  9123. return P.fromPartial({remove_file: a})
  9124. }, ln = (u, e, i) => {
  9125. let o = xu.fromPartial({id: u, path: e, include_hidden: i});
  9126. return P.fromPartial({all_files: o})
  9127. }, En = (u, e) => {
  9128. let i = Nu.fromPartial({id: u, path: e});
  9129. return P.fromPartial({create: i})
  9130. }, dn = u => {
  9131. let e = bu.fromPartial({id: u});
  9132. return P.fromPartial({cancel: e})
  9133. }, cn = (u, e) => {
  9134. let i = Tu.fromPartial({id: u, path: e, recursive: !0});
  9135. return P.fromPartial({remove_dir: i})
  9136. }, Cn = (u, e, i) => {
  9137. let o = yu.fromPartial({id: u, path: e, new_name: i});
  9138. return P.fromPartial({rename: o})
  9139. }, pn = (u, e, i, o, a) => {
  9140. let t = Iu.fromPartial({id: u, path: e, file_num: i, files: o, total_size: a});
  9141. return P.fromPartial({receive: t})
  9142. }, Dn = u => {
  9143. let e = nu.fromPartial({block: u});
  9144. return iu.fromPartial({file_response: e})
  9145. }, et = (u, e, i) => {
  9146. let o = nu.fromPartial({error: zu.fromPartial({id: u, error: e, file_num: i})});
  9147. return iu.fromPartial({file_response: o})
  9148. }, Bn = (u, e) => {
  9149. let i = nu.fromPartial({done: Ru.fromPartial({id: u, file_num: e})});
  9150. return iu.fromPartial({file_response: i})
  9151. }, mn = (u, e) => {
  9152. let i = fu.fromPartial({path: u, include_hidden: e});
  9153. return P.fromPartial({read_empty_dirs: i})
  9154. }, it = (u, e, i, o, a) => {
  9155. a ? m("update_folder_files", {info: An(u, e, a)}) : m("file_dir", {is_local: "false", value: Fn(u, i, e)})
  9156. }, An = (u, e, i) => {
  9157. let o = {
  9158. id: u,
  9159. entries: e.map(a => ({name: a.name, type: a.entry_type, time: a.modified_time, size: a.size})),
  9160. total_size: e.reduce((a, t) => a + t.size, 0)
  9161. };
  9162. return i && (o.num_entries = e.length, delete o.entries), JSON.stringify(o)
  9163. }, Fn = (u, e, i) => {
  9164. let o = {
  9165. id: u,
  9166. path: e,
  9167. entries: i.map(a => ({entry_type: a.entry_type, name: a.name, size: a.size, modified_time: a.modified_time}))
  9168. };
  9169. return JSON.stringify(o)
  9170. }, de = (u, e, i) => {
  9171. m("job_error", {id: u.toString(), err: e, file_num: i.toString()})
  9172. }, _n = (u, e) => {
  9173. m("job_done", {id: u.toString(), file_num: e.toString()})
  9174. };
  9175. var i0 = 0;
  9176. const vn = async (u, e) => {
  9177. try {
  9178. if (u) {
  9179. const i = await window.showDirectoryPicker();
  9180. let o = {name: i.name, size: 0, entry_type: 2, modified_time: 0};
  9181. i0++, e(i0, i), m("selected_files", {handleIndex: i0, file: o})
  9182. } else {
  9183. const i = {multiple: !0}, o = await window.showOpenFilePicker(i);
  9184. for (const a of o) {
  9185. const t = await a.getFile();
  9186. let s = {name: t.name, size: t.size, entry_type: 4, modified_time: Math.floor(t.lastModified / 1e3)};
  9187. i0++, e(i0, a), m("selected_files", {handleIndex: i0, file: s})
  9188. }
  9189. }
  9190. } catch (i) {
  9191. console.error("Failed to choose file:", i)
  9192. }
  9193. }, kn = async (u, e) => {
  9194. let i = [];
  9195. for (let o of u) if (!o.is_last_job) try {
  9196. let a = await o.read(e);
  9197. if (a) e(Dn(a)); else if (o.job_completed()) {
  9198. i.push(o.id);
  9199. let t = o.job_error();
  9200. e(t ? et(o.id, t, o.file_num) : Bn(o.id, o.file_num))
  9201. }
  9202. } catch (a) {
  9203. e(et(o.id, (a != null ? a : "read failed").toString(), o.file_num))
  9204. }
  9205. return i
  9206. }, gn = u => {
  9207. let e = u.lastIndexOf(".");
  9208. return e >= 0 ? u.substring(e + 1) : ""
  9209. }, hn = u => {
  9210. let e = gn(u);
  9211. return e === "xz" || e === "gz" || e === "zip" || e === "7z" || e === "rar" || e === "bz2" || e === "tgz" || e === "png" || e === "jpg"
  9212. }, fn = (u, e, i, o, a) => {
  9213. m("override_file_confirm", {
  9214. id: u.toString(),
  9215. file_num: e.toString(),
  9216. read_path: i,
  9217. is_upload: o.toString(),
  9218. is_identical: a.toString()
  9219. })
  9220. }, K4 = (u, e) => u === "" ? e : lu.join(u, e), Nt = async (u, e) => {
  9221. const i = [];
  9222. let o = [];
  9223. for await(const a of u.values()) if (a.kind === "file") i.push(a.getFile().then(t => {
  9224. o.push({
  9225. entry: W.fromPartial({
  9226. name: K4(e, t.name),
  9227. size: t.size,
  9228. entry_type: dt.File,
  9229. modified_time: Math.floor(t.lastModified / 1e3)
  9230. }), handle: a
  9231. })
  9232. })); else if (a.kind === "directory") {
  9233. let t = K4(e, a.name);
  9234. const s = await Nt(a, t);
  9235. o = o.concat(s)
  9236. }
  9237. return await Promise.all(i), o
  9238. }, Ot = async (u, e) => {
  9239. let i = [], o = !0;
  9240. for await(const a of u.values()) {
  9241. if (a.kind === "directory") {
  9242. let t = K4(e, a.name);
  9243. const s = await Ot(a, t);
  9244. i = i.concat(s)
  9245. }
  9246. o = !1
  9247. }
  9248. return o && i.push(K4(e, "")), i
  9249. }, Mt = 21116, Ut = "rs-ny.rustdesk.com", tt = 100, b4 = "trust-this-device";
  9250. class Lt {
  9251. constructor() {
  9252. d(this, "_msgs");
  9253. d(this, "_ws");
  9254. d(this, "_interval");
  9255. d(this, "_updateInterval");
  9256. d(this, "_id");
  9257. d(this, "_otherServer");
  9258. d(this, "_hash");
  9259. d(this, "_msgbox");
  9260. d(this, "_draw");
  9261. d(this, "_peerInfo");
  9262. d(this, "_firstFrame");
  9263. d(this, "_frameCount");
  9264. d(this, "_videoFormat");
  9265. d(this, "_password");
  9266. d(this, "_presetPassword");
  9267. d(this, "_sharedPassword");
  9268. d(this, "_passwordSource");
  9269. d(this, "_options");
  9270. d(this, "_fpsCalc");
  9271. d(this, "_updateTs");
  9272. d(this, "_serverPerms");
  9273. d(this, "_elevationRequested");
  9274. d(this, "_supportedEncoding");
  9275. d(this, "_i444");
  9276. d(this, "_healthCheck");
  9277. d(this, "_sessionId");
  9278. d(this, "_isFileTransfer");
  9279. d(this, "_readJobs");
  9280. d(this, "_writeJobs");
  9281. d(this, "_removeJobs");
  9282. d(this, "_readRemoteEmptyDirsJobs");
  9283. d(this, "_last_update_jobs_ms");
  9284. d(this, "_fileHandles");
  9285. d(this, "_ftTimer");
  9286. d(this, "_restartingRemoteDevice");
  9287. d(this, "_enableTrustedDevices");
  9288. d(this, "_lastChangeDisplay");
  9289. d(this, "_lastSendFps");
  9290. d(this, "_videoQueue");
  9291. d(this, "_decodingVideo");
  9292. d(this, "_selectedWindowsSessionId");
  9293. d(this, "enableEmptyDirs", () => {
  9294. var e;
  9295. return Q((e = this._peerInfo) == null ? void 0 : e.version) >= Q("1.3.3")
  9296. });
  9297. d(this, "enableOverwriteDetection", () => {
  9298. var e;
  9299. return Q((e = this._peerInfo) == null ? void 0 : e.version) >= Q("1.1.10")
  9300. });
  9301. this._msgbox = Wt, this._draw = Ce, this._msgs = [], this._id = "", this._frameCount = {}, this._fpsCalc = {
  9302. videoTestSpeed: [0, 0],
  9303. skipBegining: 0,
  9304. fps: void 0
  9305. }, this._updateTs = new Date().getTime(), this._serverPerms = {
  9306. keyboardEnabled: !0,
  9307. fileTransferEnabled: !0,
  9308. clipboardEnabled: !0
  9309. }, this._elevationRequested = !1, this._supportedEncoding = G.fromPartial({}), this._sessionId = 0, this._isFileTransfer = !1, this._readJobs = [], this._writeJobs = [], this._removeJobs = {}, this._readRemoteEmptyDirsJobs = [], this._last_update_jobs_ms = 0, this._fileHandles = {}, this._restartingRemoteDevice = !1, this._enableTrustedDevices = !1, this._passwordSource = {type: "Undefined"}, this._videoQueue = [], this._decodingVideo = !1
  9310. }
  9311. getPeerPlatform() {
  9312. var e, i;
  9313. return (i = (e = this._peerInfo) == null ? void 0 : e.platform) != null ? i : ""
  9314. }
  9315. isSupportVirtualDisplay() {
  9316. if (!this._peerInfo) return !1;
  9317. try {
  9318. const e = JSON.parse(this._peerInfo.platform_additions), i = e.is_installed, o = e.idd_impl;
  9319. return i && this._peerInfo.platform == "Windows" && (o == "rustdesk_idd" || o == "amyuni_idd")
  9320. } catch (e) {
  9321. return console.error("Failed to check virtual display support, ", e), !1
  9322. }
  9323. }
  9324. sendMessage(e) {
  9325. var i;
  9326. (i = this._ws) == null || i.sendMessage(e)
  9327. }
  9328. handleRelayId(e) {
  9329. return e.endsWith("\\r") || e.endsWith("/r") ? e.substring(0, e.length - 2) : e
  9330. }
  9331. setRemoteId(e) {
  9332. var o, a, t, s, l;
  9333. let i = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
  9334. if (i == 0 && (i = 1), this._sessionId = i, this._restartingRemoteDevice = !1, this._id = e, e.includes("@")) {
  9335. const E = e.split("@"), c = E[0], C = ((o = E[1]) != null ? o : "").split("?"),
  9336. D = (a = C[0]) != null ? a : "", B = (t = C[1]) != null ? t : "",
  9337. F = D == ee ? Qi : (s = B.split("&").reduce((S, g) => {
  9338. const U = g.indexOf("=");
  9339. if (U != -1) {
  9340. const h4 = g.substring(0, U).toLowerCase(), f4 = g.substring(U + 1);
  9341. S[h4] = f4
  9342. }
  9343. return S
  9344. }, {}).key) != null ? s : "", y = this.handleRelayId(c);
  9345. this._otherServer = {realId: y, server: D, key: F}, this._id = `${y}@${D}`
  9346. } else this._id = this.handleRelayId(e);
  9347. if (this._options = (l = Cu()[this._id]) != null ? l : this.getUserDefaultToggleOptions(), this._otherServer && !this._otherServer.key) {
  9348. const E = this.getOption("other-server-key");
  9349. E && (this._otherServer.key = E)
  9350. }
  9351. }
  9352. setSessionInfo(e) {
  9353. this._isFileTransfer = e.isFileTransfer, e.is_shared_password ? this._sharedPassword = e.password : this._presetPassword = e.password
  9354. }
  9355. async start() {
  9356. try {
  9357. await this._start()
  9358. } catch (e) {
  9359. this.msgbox("error", "Connection Error", e.type == "close" ? "Reset by the peer" : String(e))
  9360. }
  9361. }
  9362. getId() {
  9363. var e, i;
  9364. return (i = (e = this._otherServer) == null ? void 0 : e.realId) != null ? i : this._id
  9365. }
  9366. async _start() {
  9367. var F, y;
  9368. let e = this.getId(), i = Io(), o = Pt(), a = (F = this._otherServer) == null ? void 0 : F.server;
  9369. this._otherServer && (i = this._otherServer.key, o = "");
  9370. let t = "";
  9371. a ? a == ee ? t = R4(Ut) : t = R4(a) : t = P4(), this._options || (this._options = (y = Cu()[this._id]) != null ? y : this.getUserDefaultToggleOptions()), this._interval = setInterval(() => {
  9372. var S;
  9373. for (; this._msgs.length;) (S = this._ws) == null || S.sendMessage(this._msgs[0]), this._msgs.splice(0, 1)
  9374. }, 1);
  9375. const s = new j4(t, !0, "rendezvous");
  9376. this._ws = s, console.log(new Date + ": Connecting to rendezvous server: " + t + ", for " + e), await s.open(), console.log(new Date + ": Connected to rendezvous server");
  9377. const l = this._isFileTransfer ? ne.FILE_TRANSFER : ne.DEFAULT_CONN, E = pt.SYMMETRIC,
  9378. c = Ku.fromPartial({id: e, licence_key: i, conn_type: l, nat_type: E, token: o, version: se});
  9379. s.sendRendezvous({punch_hole_request: c});
  9380. const C = await s.next();
  9381. s.close(), console.log(new Date + ": Got relay response");
  9382. const D = C.punch_hole_response, B = C.relay_response;
  9383. if (D) {
  9384. if (D != null && D.other_failure) {
  9385. this.msgbox("error", "Error", D == null ? void 0 : D.other_failure);
  9386. return
  9387. }
  9388. if (D.failure != Z0.UNRECOGNIZED) switch (D == null ? void 0 : D.failure) {
  9389. case Z0.ID_NOT_EXIST:
  9390. this.msgbox("error", "Error", "ID does not exist");
  9391. break;
  9392. case Z0.OFFLINE:
  9393. this.msgbox("error", "Error", "Remote desktop is offline");
  9394. break;
  9395. case Z0.LICENSE_MISMATCH:
  9396. this.msgbox("error", "Error", "Key mismatch");
  9397. break;
  9398. case Z0.LICENSE_OVERUSE:
  9399. this.msgbox("error", "Error", "Key overuse");
  9400. break
  9401. }
  9402. } else if (B) {
  9403. if (!B.version) {
  9404. this.msgbox("error", "Error", "Remote version is low, not support web");
  9405. return
  9406. }
  9407. this._healthCheck = new $o(t, B.feedback, i, o), this._healthCheck.start(), await this.connectRelay(B, i)
  9408. }
  9409. }
  9410. async connectRelay(e, i) {
  9411. var c, C;
  9412. const o = e.pk;
  9413. let a = e.relay_server;
  9414. a ? a = R4(a, !0, 2) : a = P4(!0);
  9415. const t = e.uuid;
  9416. console.log(new Date + ": Connecting to relay server: " + a);
  9417. const s = new j4(a, !1, "relay");
  9418. await s.open(), console.log(new Date + ": Connected to relay server"), this._ws = s;
  9419. const l = Hu.fromPartial({licence_key: i, uuid: t});
  9420. s.sendRendezvous({request_relay: l});
  9421. const E = await this.secure(o, i) || !1;
  9422. m("connection_ready", {secure: E, direct: !1}), this._updateInterval = setInterval(() => {
  9423. this.updateStatus()
  9424. }, 1e3), (c = this._ws) == null || c.on("message", this.msgHandler.bind(this)), (C = this._ws) == null || C.on("status_change", this.onStatusChange.bind(this))
  9425. }
  9426. async secure(e, i) {
  9427. var F, y, S, g, U, h4, f4, Re;
  9428. if (e) {
  9429. try {
  9430. if (e = await rt(e, i || Qi), e) {
  9431. const T = oe.decode(e);
  9432. T.id == this.getId() && (e = T.pk)
  9433. }
  9434. (e == null ? void 0 : e.length) != 32 && (e = void 0)
  9435. } catch (T) {
  9436. console.error("Failed to verify id pk, ", T), e = void 0
  9437. }
  9438. e || console.error("Handshake failed: invalid public key from rendezvous server")
  9439. }
  9440. if (!e) {
  9441. const T = K.fromPartial({});
  9442. (F = this._ws) == null || F.sendMessage({public_key: T});
  9443. return
  9444. }
  9445. const o = await ((y = this._ws) == null ? void 0 : y.next());
  9446. let a = o == null ? void 0 : o.signed_id;
  9447. if (!a) {
  9448. console.error("Handshake failed: invalid message type");
  9449. const T = K.fromPartial({});
  9450. (S = this._ws) == null || S.sendMessage({public_key: T});
  9451. return
  9452. }
  9453. try {
  9454. a = await rt(a.id, Uint8Array.from(e))
  9455. } catch (T) {
  9456. console.error("Failed to verify signed id pk, ", T), console.error("pk mismatch, fall back to non-secure");
  9457. const ea = K.fromPartial({});
  9458. (g = this._ws) == null || g.sendMessage({public_key: ea});
  9459. return
  9460. }
  9461. const t = oe.decode(a), s = t.id, l = t.pk;
  9462. if (s != this.getId()) {
  9463. console.error("Handshake failed: sign failure");
  9464. const T = K.fromPartial({});
  9465. (U = this._ws) == null || U.sendMessage({public_key: T});
  9466. return
  9467. }
  9468. if (l.length != 32) {
  9469. console.error("Handshake failed: invalid public box key length from peer");
  9470. const T = K.fromPartial({});
  9471. (h4 = this._ws) == null || h4.sendMessage({public_key: T});
  9472. return
  9473. }
  9474. const [E, c] = Rn(), C = In(), D = Tn(C, l, E), B = K.fromPartial({asymmetric_value: c, symmetric_value: D});
  9475. return (f4 = this._ws) == null || f4.sendMessage({public_key: B}), (Re = this._ws) == null || Re.setSecretKey(C), console.log("secured"), !0
  9476. }
  9477. async msgHandler(e) {
  9478. var i;
  9479. if (this._ws) {
  9480. if (e != null && e.hash) await this.handleHash(e.hash); else if (e != null && e.test_delay) {
  9481. const o = e == null ? void 0 : e.test_delay;
  9482. o.from_client || (m("update_quality_status", {
  9483. delay: `${o.last_delay}`,
  9484. target_bitrate: `${o.target_bitrate}`
  9485. }), (i = this._ws) == null || i.sendMessage({test_delay: o}))
  9486. } else if (e != null && e.login_response) this.handleLoginResponse(e == null ? void 0 : e.login_response); else if (e != null && e.video_frame) this.handleVideoFrame(e == null ? void 0 : e.video_frame); else if (e != null && e.clipboard) fe(e == null ? void 0 : e.clipboard); else if (e != null && e.multi_clipboards) nn(e == null ? void 0 : e.multi_clipboards); else if (e != null && e.cursor_data) {
  9487. const o = e == null ? void 0 : e.cursor_data;
  9488. Pe(o.colors, !1, a => {
  9489. a && (o.colors = a, m("cursor_data", o))
  9490. })
  9491. } else if (e != null && e.cursor_id) m("cursor_id", {id: e == null ? void 0 : e.cursor_id}); else if (e != null && e.cursor_position) m("cursor_position", e == null ? void 0 : e.cursor_position); else if (e != null && e.misc) this.handleMisc(e == null ? void 0 : e.misc); else if (e != null && e.audio_frame) Un(e == null ? void 0 : e.audio_frame.data); else if (e != null && e.message_box) this.handleMsgBox(e == null ? void 0 : e.message_box); else if (e != null && e.peer_info) this.handleSyncPeerInfo(e.peer_info); else if (e.file_response) await this.handleFileResponse(e.file_response); else if (e.file_action) {
  9492. const o = e.file_action;
  9493. await this.handleFileAction(o)
  9494. }
  9495. }
  9496. }
  9497. onStatusChange(e) {
  9498. if (e === "" || e === "open") return;
  9499. if (this._restartingRemoteDevice) {
  9500. this.msgbox("restarting", "Restarting remote device", "remote_restarting_tip", "");
  9501. return
  9502. }
  9503. if (e instanceof CloseEvent && e.code == 1e3 || !this._ws) return;
  9504. e && console.error("msgLoop error: ", e);
  9505. const i = "Connection Error";
  9506. let o = "";
  9507. if (e === "Timeout") o = "Connection timeout"; else if (e instanceof CloseEvent) {
  9508. let a = `code: ${e.code}`;
  9509. e.reason && (a += `, reason: ${e.reason}`), o = `Connection closed, ${a}`
  9510. } else e instanceof Error ? o = e.message : typeof e.toString == "function" ? o = e.toString() : o = "";
  9511. this.msgbox("error", i, o, "")
  9512. }
  9513. enterOrLeave(e) {
  9514. e === !1 ? (Ho(), Ee()) : (ce(), Yi(this))
  9515. }
  9516. makeDisplaysMsg(e) {
  9517. let i = [];
  9518. return e.forEach(o => {
  9519. let a = {};
  9520. a.x = o.x, a.y = o.y, a.width = o.width, a.height = o.height, a.cursor_embedded = o.cursor_embedded ? 1 : 0, o.original_resolution && (a.original_width = o.original_resolution.width, a.original_height = o.original_resolution.height), a.scale = Math.floor(o.scale * 100), i.push(a)
  9521. }), JSON.stringify(i)
  9522. }
  9523. handleSyncPeerInfo(e) {
  9524. this._peerInfo && (this._peerInfo.displays = e.displays), m("sync_peer_info", {displays: this.makeDisplaysMsg(e.displays)}), m("sync_platform_additions", {platform_additions: e.platform_additions})
  9525. }
  9526. handleMsgBox(e) {
  9527. let i = e.link;
  9528. i in Ki ? i = Ki[i] : (console.warn("Message box ignore link " + i + " for security"), i = ""), this.msgbox(e.msgtype, e.title, e.text, i)
  9529. }
  9530. updateStatus() {
  9531. var s, l;
  9532. const e = new Date().getTime(), i = e - this._updateTs;
  9533. if (i < 1e3) return;
  9534. this._updateTs = e;
  9535. const o = ((s = this._ws) == null ? void 0 : s.getRecvDataCount()) || 0;
  9536. (l = this._ws) == null || l.resetRecvDataCount();
  9537. const a = `${(o / 1024 / i * 1e3).toFixed(2)} kb/s`, t = {};
  9538. for (const E in this._frameCount) if (this._frameCount.hasOwnProperty(E)) {
  9539. const c = this._frameCount[E];
  9540. t[E] = Math.floor(c / (i / 1e3))
  9541. }
  9542. this._frameCount = {}, m("update_quality_status", {speed: a, fps: JSON.stringify(t)})
  9543. }
  9544. handleLoginResponse(e) {
  9545. const i = {
  9546. [Ka]: {
  9547. msgtype: "error",
  9548. title: "Login Error",
  9549. text: "Login screen using Wayland is not supported",
  9550. link: "https://rustdesk.com/docs/en/manual/linux/#login-screen",
  9551. try_again: !0
  9552. },
  9553. [Ia]: {msgtype: "session-login", title: "", text: "", link: "", try_again: !0},
  9554. [Ta]: {msgtype: "session-re-login", title: "", text: "", link: "", try_again: !0},
  9555. [ja]: {
  9556. msgtype: "info-nocancel",
  9557. title: "another_user_login_title_tip",
  9558. text: "another_user_login_text_tip",
  9559. link: "",
  9560. try_again: !1
  9561. },
  9562. [Na]: {
  9563. msgtype: "info-nocancel",
  9564. title: "xorg_not_found_title_tip",
  9565. text: "xorg_not_found_text_tip",
  9566. link: "https://rustdesk.com/docs/en/manual/linux/#login-screen",
  9567. try_again: !0
  9568. },
  9569. [Oa]: {
  9570. msgtype: "info-nocancel",
  9571. title: "no_desktop_title_tip",
  9572. text: "no_desktop_text_tip",
  9573. link: "https://rustdesk.com/docs/en/manual/linux/#login-screen",
  9574. try_again: !0
  9575. },
  9576. [Ma]: {msgtype: "session-login-password", title: "", text: "", link: "", try_again: !0},
  9577. [Ua]: {msgtype: "session-login-re-password", title: "", text: "", link: "", try_again: !0},
  9578. [qa]: {
  9579. msgtype: "wait-remote-accept-nook",
  9580. title: "Prompt",
  9581. text: "Please wait for the remote side to accept your session request...",
  9582. link: "",
  9583. try_again: !0
  9584. }
  9585. }, o = e.error;
  9586. if (o) if (o == qi && (this._enableTrustedDevices = e.enable_trusted_devices), o == La && (this._password = void 0, this.msgbox("input-password", "Password Required", "", "")), o == Wa) this._password = void 0, this.msgbox("re-input-password", o, "Do you want to enter again?"); else if (o == Va || o == qi) this.getOption(b4) == "Y" && this.setOption(b4, void 0), this.msgbox("input-2fa", o, ""); else if (o in i) {
  9587. const a = i[o];
  9588. this.msgbox(a.msgtype, a.title, a.text, a.link)
  9589. } else o.includes(Ha) ? this.msgbox("error", "Login Error", o, Bt) : this.msgbox("error", "Login Error", o); else e.peer_info && (this._firstFrame = !1, this.handlePeerInfo(e.peer_info))
  9590. }
  9591. enableTrustedDevices() {
  9592. return this._enableTrustedDevices
  9593. }
  9594. msgbox(e, i, o, a = "") {
  9595. var t;
  9596. (t = this._msgbox) == null || t.call(this, e, i, o, a)
  9597. }
  9598. cancelMsgbox(e) {
  9599. m("cancel_msgbox", {tag: e})
  9600. }
  9601. draw(e, i) {
  9602. Ce(e, new Uint8Array(i.data))
  9603. }
  9604. close() {
  9605. var e, i;
  9606. this._msgs = [], this._interval && (clearInterval(this._interval), this._interval = void 0), this._updateInterval && (clearInterval(this._updateInterval), this._updateInterval = void 0), this._ftTimer && (clearTimeout(this._ftTimer), this._ftTimer = void 0), (e = this._ws) == null || e.close(), this._ws = void 0, (i = this._healthCheck) == null || i.close(), this._healthCheck = void 0, this._readJobs = [], this._writeJobs = [], this._removeJobs = {}, this._fileHandles = {}, this._readRemoteEmptyDirsJobs = [], Ee(), this._lastChangeDisplay = void 0, this._lastSendFps = void 0, this._videoQueue = [], this._decodingVideo = !1
  9607. }
  9608. refresh() {
  9609. var i;
  9610. const e = f.fromPartial({refresh_video: !0});
  9611. (i = this._ws) == null || i.sendMessage({misc: e})
  9612. }
  9613. setMsgbox(e) {
  9614. this._msgbox = e
  9615. }
  9616. setDraw(e) {
  9617. this._draw = e
  9618. }
  9619. async handleHash(e) {
  9620. this._hash = e;
  9621. let i = this._password;
  9622. (!i || i.length === 0) && this._presetPassword && (i = Zu([this._presetPassword, e.salt]), this._passwordSource = {type: "Undefined"});
  9623. let o = this._sharedPassword;
  9624. if (this._sharedPassword = void 0, o && (i = Zu([o, e.salt]), this._passwordSource = {
  9625. type: "SharedAb",
  9626. value: o
  9627. }), !i || i.length === 0) {
  9628. const l = this.getOption("password");
  9629. typeof l == "string" && l.length > 0 && (i = c4(l), this._passwordSource = {type: "Undefined"})
  9630. }
  9631. if (!i || i.length === 0) {
  9632. let l = Ae("access_token"), E = await xt();
  9633. if (l && l === E.access_token) {
  9634. let c = E.ab_entries.find(C => ho(C));
  9635. if (c) {
  9636. let C = c.peers.find(D => D.id == this._id);
  9637. if (C) {
  9638. let D = c4(C.hash);
  9639. D.length > 0 && (i = D, this._passwordSource = {type: "PersonalAb", value: D})
  9640. }
  9641. }
  9642. }
  9643. }
  9644. this._password = i;
  9645. let a;
  9646. !i || i.length === 0 ? (a = new Uint8Array(0), this.msgbox("input-password", "Password Required", "")) : a = Zu([i, e.challenge]);
  9647. let t = this.getOption("os-username") || "", s = this.getOption("os-password") || "";
  9648. this._sendLoginMessage({os_login: {username: t, password: s}, password: a})
  9649. }
  9650. handle_login_from_ui(e, i, o, a) {
  9651. let t;
  9652. if (o === "") {
  9653. let l = this._password;
  9654. if (!l || l.length === 0) {
  9655. const E = this.getOption("password");
  9656. typeof E == "string" && E.length > 0 && (l = c4(E), this._passwordSource = {type: "Undefined"})
  9657. }
  9658. t = l
  9659. } else this._passwordSource = {type: "Undefined"}, t = Zu([o, this._hash.salt]), this.setRemember(a);
  9660. this._password = t;
  9661. let s = Zu([t != null ? t : Uint8Array.from([]), this._hash.challenge]);
  9662. this._sendLoginMessage({os_login: {username: e, password: i}, password: s})
  9663. }
  9664. changePreferCodec() {
  9665. var a;
  9666. const e = this.getSupportedDecoding(), i = z.fromPartial({supported_decoding: e}),
  9667. o = f.fromPartial({option: i});
  9668. (a = this._ws) == null || a.sendMessage({misc: o})
  9669. }
  9670. async reconnect() {
  9671. this.close(), await this.start()
  9672. }
  9673. _getHwid(e = void 0) {
  9674. return (e != null ? e : this.getOption(b4) == "Y") ? Po() : new Uint8Array
  9675. }
  9676. _sendLoginMessage(e) {
  9677. var E;
  9678. const i = this._otherServer ? `${N4()}@${P4()}` : N4(), o = To();
  9679. let a = wt();
  9680. if (o) try {
  9681. const c = JSON.parse(o);
  9682. c.name && (a = c.name)
  9683. } catch (c) {
  9684. console.error("Failed to get user info, ", c)
  9685. }
  9686. let t;
  9687. if (this._isFileTransfer) {
  9688. let c = this.getOption("remote_dir"), C = this.getOption("remote_show_hidden") === "Y";
  9689. t = Fu.fromPartial({dir: c, show_hidden: C})
  9690. }
  9691. const s = this._getHwid(), l = H.fromPartial({
  9692. username: this.getId(),
  9693. my_id: i,
  9694. my_name: a,
  9695. session_id: this._sessionId,
  9696. password: e.password,
  9697. option: this.getOptionMessage(),
  9698. video_ack_required: !0,
  9699. os_login: e.os_login,
  9700. version: se,
  9701. my_platform: uo,
  9702. file_transfer: t,
  9703. hwid: s
  9704. });
  9705. (E = this._ws) == null || E.sendMessage({login_request: l})
  9706. }
  9707. getOptionMessage() {
  9708. if (this._isFileTransfer) return;
  9709. let e = 0;
  9710. const i = z.fromPartial({}), o = this.getImageQuality(), a = this.getImageQualityEnum(o, !0), t = x.Yes;
  9711. if (a != null) i.image_quality = a, e += 1; else if (o === "custom") {
  9712. let l = 50, E = this.getOption("custom_image_quality");
  9713. if (E) try {
  9714. l = parseInt(E)
  9715. } catch {
  9716. }
  9717. i.custom_image_quality = l << 8, e += 1;
  9718. let c = this.getOption("custom-fps");
  9719. if (c) try {
  9720. i.custom_fps = parseInt(c), this._lastSendFps = i.custom_fps, e += 1
  9721. } catch {
  9722. }
  9723. }
  9724. const s = this.getOption("view-only");
  9725. return s && (i.disable_keyboard = t), (s || this._options["show-remote-cursor"]) && (i.show_remote_cursor = t, e += 1), this._options["follow-remote-cursor"] && (i.follow_remote_cursor = t, e += 1), this._options["follow-remote-window"] && (i.follow_remote_window = t, e += 1), !s && this._options["lock-after-session-end"] && (i.lock_after_session_end = t, e += 1), this._options["disable-audio"] && (i.disable_audio = t, e += 1), (s || this._options["disable-clipboard"]) && (i.disable_clipboard = t, e += 1), i.supported_decoding = this.getSupportedDecoding(), e += 1, e > 0 ? i : void 0
  9726. }
  9727. sendVideoReceived() {
  9728. var i;
  9729. const e = f.fromPartial({video_received: !0});
  9730. (i = this._ws) == null || i.sendMessage({misc: e})
  9731. }
  9732. getCodecFormat(e) {
  9733. return e.vp9s ? "VP9" : e.vp8s ? "VP8" : e.av1s ? "AV1" : e.h264s ? "H264" : e.h265s ? "H265" : "Unknown"
  9734. }
  9735. getSupportedEncoding() {
  9736. return this._supportedEncoding
  9737. }
  9738. getSupportedDecoding() {
  9739. let e = this.getOption("codec-preference");
  9740. e == "vp8" ? e = Au.VP8 : e == "vp9" ? e = Au.VP9 : e == "av1" ? e = Au.AV1 : e == "h264" ? e = Au.H264 : e == "h265" ? e = Au.H265 : e = Au.Auto;
  9741. let i = this.getOption("i444") == "Y" ? ae.I444 : ae.I420;
  9742. return Vu.fromPartial({
  9743. ability_vp8: 1,
  9744. ability_vp9: 1,
  9745. ability_av1: 1,
  9746. ability_h264: 1,
  9747. ability_h265: 1,
  9748. prefer: e,
  9749. prefer_chroma: i,
  9750. i444: J.fromPartial({vp9: !0, av1: !0})
  9751. })
  9752. }
  9753. getAlternativeCodecs() {
  9754. const e = this.getSupportedEncoding(), i = this.getSupportedDecoding();
  9755. return JSON.stringify({
  9756. vp8: e.vp8 && i.ability_vp8 == 1,
  9757. av1: e.av1 && i.ability_av1 == 1,
  9758. h264: e.h264 && i.ability_h264 == 1,
  9759. h265: e.h265 && i.ability_h265 == 1
  9760. })
  9761. }
  9762. fpsCalculate(e, i) {
  9763. if (e) {
  9764. this._fpsCalc.skipBegining = 0, this._fpsCalc.videoTestSpeed = [0, 0];
  9765. return
  9766. }
  9767. if (this._fpsCalc.skipBegining < 3) {
  9768. this._fpsCalc.skipBegining += 1;
  9769. return
  9770. }
  9771. this._fpsCalc.videoTestSpeed[1] += i, this._fpsCalc.videoTestSpeed[0] += 1, this._fpsCalc.videoTestSpeed[0] % 10 == 0 && i > 0 && (this._fpsCalc.fps = Math.floor(this._fpsCalc.videoTestSpeed[0] * 1e3 / this._fpsCalc.videoTestSpeed[1]), console.log("max decode fps: " + this._fpsCalc.fps)), this._fpsCalc.videoTestSpeed[0] >= 30 && (this._fpsCalc.videoTestSpeed = [0, 0])
  9772. }
  9773. handleVideoFrame(e) {
  9774. if (!this._firstFrame) {
  9775. this.msgbox("", "", ""), this._firstFrame = !0, this.sendToggleVirtualDisplayMsg(), this.sendTogglePrivacyModeMsg(), ce(), Yi(this, !0);
  9776. const i = 0;
  9777. for (let o = 0; o < i; o++) this.sendVideoReceived();
  9778. console.log(`send ${i} video received in advance for high fps`)
  9779. }
  9780. this._videoQueue.push(e), this._decodingVideo || this.processVideoQueue()
  9781. }
  9782. async processVideoQueue() {
  9783. this._decodingVideo = !0;
  9784. try {
  9785. for (; this._videoQueue.length > 0;) await this.handleOneVideoFrame(this._videoQueue.shift())
  9786. } catch (e) {
  9787. console.error("deal video queue failed", e)
  9788. }
  9789. this._decodingVideo = !1
  9790. }
  9791. async handleOneVideoFrame(e) {
  9792. const i = this.getCodecFormat(e), o = this._videoFormat != i;
  9793. o && (this._videoFormat = i, m("update_quality_status", {codec_format: i}));
  9794. var a = new Date().getTime(), t = 0, s = void 0;
  9795. if (e.vp8s) t = 0, s = e.vp8s; else if (e.vp9s) t = 1, s = e.vp9s; else if (e.av1s) t = 2, s = e.av1s; else if (e.h264s) t = 3, s = e.h264s; else if (e.h265s) t = 4, s = e.h265s; else {
  9796. console.log("unknown codec");
  9797. return
  9798. }
  9799. const l = s == null ? void 0 : s.frames.length;
  9800. this._frameCount[e.display] = (this._frameCount[e.display] || 0) + l, this.sendVideoReceived();
  9801. try {
  9802. for (let E = 0; E < l; E++) {
  9803. let c = s.frames[E];
  9804. const C = await Pa(t, c.data.slice(0).buffer);
  9805. if (C.data && l - 1 == E) {
  9806. this.draw(e.display, C.data);
  9807. const D = new Date().getTime();
  9808. this.fpsCalculate(o, D - a);
  9809. const B = C.data.yuvFormat == 5;
  9810. this._i444 != B && (this._i444 = B, m("update_quality_status", {chroma: B ? "4:4:4" : "4:2:0"}))
  9811. }
  9812. }
  9813. } catch (E) {
  9814. console.error("decode error: ", E)
  9815. }
  9816. }
  9817. sendToggleVirtualDisplayMsg() {
  9818. if (!this.isSupportVirtualDisplay()) return;
  9819. const e = this.getOption("virtual-display");
  9820. !e || e.split(",").forEach(i => {
  9821. const o = Number(i);
  9822. isNaN(o) || this._sendToggleVirtualDisplayMsg(o, !0)
  9823. })
  9824. }
  9825. sendTogglePrivacyModeMsg() {
  9826. if (!!this._peerInfo && !(Q(this._peerInfo.version) < Q("1.2.4")) && this.getOption("privacy-mode")) {
  9827. const e = this.getOption("privacy-mode-impl-key");
  9828. if (e == "privacy_mode_impl_virtual_display" && this.isSupportVirtualDisplay()) return;
  9829. this._sendTogglePrivacyModeMsg(e, !0)
  9830. }
  9831. }
  9832. handlePeerInfo(e) {
  9833. var a, t, s;
  9834. if (this._peerInfo = e, e.current_display > e.displays.length && (e.current_display = 0), Q(e.version) < Q("1.1.10") && this.setPermission("restart", !1), this._isFileTransfer) {
  9835. if (!e.username.length && !((a = e.windows_sessions) != null && a.sessions.length)) {
  9836. this.msgbox("error", "Error", "No active console user logged on, please connect and logon first.");
  9837. return
  9838. }
  9839. } else if (e.displays.length == 0) {
  9840. this.lcHandlePeerInfo(e), m("update_privacy_mode", {}), this.msgbox("error", "Remote Error", "No Display");
  9841. return
  9842. }
  9843. m("peer_info", {
  9844. ...e,
  9845. displays: this.makeDisplaysMsg(e.displays),
  9846. resolutions: JSON.stringify(e.resolutions)
  9847. }), this._isFileTransfer || (this.msgbox("success", "Successful", "Connected, waiting for image..."), this.tryChangeInitResolution(e.current_display));
  9848. const i = this.shouldAutoLogin();
  9849. i && this.inputOsPassword(i);
  9850. const o = (t = this.getOption("info")) == null ? void 0 : t.username;
  9851. o && !e.username && (e.username = o), m("update_privacy_mode", {}), this.lcHandlePeerInfo(e), (s = e.windows_sessions) != null && s.sessions.length && (this._selectedWindowsSessionId == e.windows_sessions.current_sid ? this.sendSelectedSessionId(e.windows_sessions.current_sid.toString()) : this.setMultipleWindowsSession(e.windows_sessions.sessions))
  9852. }
  9853. lcHandlePeerInfo(e) {
  9854. var l;
  9855. let i = le(this._id) || {};
  9856. i.info = {username: e.username, hostname: e.hostname, platform: e.platform};
  9857. let o = this._password, a = i.password, t = this.getRemember(), s = this._hash;
  9858. t ? o && o.length > 0 && Z(o) !== a && !at(this._passwordSource, o, s) && (i.password = Z(o), console.log("remember password of " + this._id)) : o && o.length > 0 && ot(this._passwordSource, o) ? (i.password = Z(o), console.log("save ab password of " + this._id + " to recent")) : a && (i.password = void 0, console.log("remove password of " + this._id)), (l = this._otherServer) != null && l.server && this._otherServer.server != ee && this.setOption("other-server-key", this._otherServer.key), i.password && o && o.length > 0 && !at(this._passwordSource, o, s) && !ot(this._passwordSource, o) && m("sync_peer_hash_password_to_personal_ab", {
  9859. id: this._id,
  9860. hash: Z(o)
  9861. }), this.saveConfig(i), e.encoding && (this._supportedEncoding = e.encoding)
  9862. }
  9863. setPermission(e, i) {
  9864. m("permission", {[e]: i})
  9865. }
  9866. shouldAutoLogin() {
  9867. const e = this.getOption("lock-after-session-end"), i = !!this.getOption("auto-login"),
  9868. o = this.getOption("os-password");
  9869. return o && e && i ? o : ""
  9870. }
  9871. handleMisc(e) {
  9872. if (e.audio_format) Mn(e.audio_format.channels, e.audio_format.sample_rate); else if (e.chat_message) m("chat_client_mode", {text: e.chat_message.text}); else if (e.permission_info) {
  9873. const i = e.permission_info;
  9874. console.info("Change permission " + i.permission + " -> " + i.enabled);
  9875. let o;
  9876. switch (i.permission) {
  9877. case t0.Keyboard:
  9878. this._serverPerms.keyboardEnabled = i.enabled, o = "keyboard";
  9879. break;
  9880. case t0.Clipboard:
  9881. this._serverPerms.clipboardEnabled = i.enabled, o = "clipboard";
  9882. break;
  9883. case t0.Audio:
  9884. o = "audio";
  9885. break;
  9886. case t0.Restart:
  9887. o = "restart";
  9888. break;
  9889. case t0.BlockInput:
  9890. o = "block_input";
  9891. break;
  9892. default:
  9893. return !0
  9894. }
  9895. this.setPermission(o, i.enabled)
  9896. } else if (e.switch_display) m("switch_display", e.switch_display), this.setCustomResolution(e.switch_display); else {
  9897. if (e.close_reason) return this.msgbox("error", "Connection Error", e.close_reason), this.close(), !1;
  9898. if (e.back_notification) {
  9899. if (!this.handleBackNotification(e.back_notification)) return this.close(), !1
  9900. } else e.uac !== void 0 ? e.uac && this._serverPerms.keyboardEnabled ? this.msgbox("on-uac", "Prompt", "Please wait for confirmation of UAC...", "") : (this.cancelMsgbox("on-uac"), this.cancelMsgbox("wait-uac"), this.cancelMsgbox("elevation-error")) : e.foreground_window_elevated !== void 0 ? e.foreground_window_elevated && this._serverPerms.keyboardEnabled ? this.msgbox("on-foreground-elevated", "Prompt", "elevated_foreground_window_tip", "") : (this.cancelMsgbox("on-foreground-elevated"), this.cancelMsgbox("wait-uac"), this.cancelMsgbox("elevation-error")) : e.elevation_response !== void 0 ? e.elevation_response === "" ? this.msgbox("wait-uac", "", "", "") : (this.cancelMsgbox("wait-uac"), this.msgbox("elevation-error", "Elevation Error", e.elevation_response, "")) : e.portable_service_running !== void 0 ? (this.portableServiceRunning(e.portable_service_running), this._elevationRequested && e.portable_service_running && this.msgbox("custom-nocancel-success", "Successful", "Elevate successfully", "")) : e.supported_encoding ? this._supportedEncoding = e.supported_encoding : e.follow_current_display !== void 0 && this.handleFollowCurrentDisplay(e.follow_current_display)
  9901. }
  9902. return !0
  9903. }
  9904. portableServiceRunning(e) {
  9905. m("portable_service_running", {running: e.toString()})
  9906. }
  9907. handleFollowCurrentDisplay(e) {
  9908. m("follow_current_display", {display_idx: e.toString()})
  9909. }
  9910. handleBackNotification(e) {
  9911. if (e.block_input_state) this.handleBackMsgBlockInput(e.block_input_state, e.details); else if (e.privacy_mode_state) return this.handleBackMsgPrivacyMode(e.privacy_mode_state, e.details, e.impl_key);
  9912. return !0
  9913. }
  9914. updateBlockInputState(e) {
  9915. m("update_block_input_state", {input_state: e ? "on" : "off"})
  9916. }
  9917. handleBackMsgBlockInput(e, i) {
  9918. switch (e) {
  9919. case B4.BlkOnSucceeded:
  9920. this.updateBlockInputState(!0);
  9921. break;
  9922. case B4.BlkOnFailed:
  9923. this.msgbox("custom-error", "Block user input", i == "" ? "Failed" : i, ""), this.updateBlockInputState(!1);
  9924. break;
  9925. case B4.BlkOffSucceeded:
  9926. this.updateBlockInputState(!1);
  9927. break;
  9928. case B4.BlkOffFailed:
  9929. this.msgbox("custom-error", "Unblock user input", i == "" ? "Failed" : i, "");
  9930. break
  9931. }
  9932. }
  9933. updatePrivacyMode(e, i) {
  9934. i && (e == "" && (e = "privacy_mode_impl_mag"), this.setOption("privacy-mode-impl-key", e)), this.setOption("privacy-mode", i), m("update_privacy_mode", {})
  9935. }
  9936. handleBackMsgPrivacyMode(e, i, o) {
  9937. switch (e) {
  9938. case ou.PrvOnByOther:
  9939. return this.msgbox("error", "Connecting...", "Someone turns on privacy mode, exit", ""), !1;
  9940. case ou.PrvNotSupported:
  9941. this.msgbox("custom-error", "Privacy mode", "Unsupported", ""), this.updatePrivacyMode(o, !1);
  9942. break;
  9943. case ou.PrvOnSucceeded:
  9944. this.msgbox("custom-nocancel", "Privacy mode", "Enter privacy mode", ""), this.updatePrivacyMode(o, !0);
  9945. break;
  9946. case ou.PrvOnFailedDenied:
  9947. this.msgbox("custom-error", "Privacy mode", "Peer denied", ""), this.updatePrivacyMode(o, !1);
  9948. break;
  9949. case ou.PrvOnFailedPlugin:
  9950. this.msgbox("custom-error", "Privacy mode", "Please install plugins", ""), this.updatePrivacyMode(o, !1);
  9951. break;
  9952. case ou.PrvOnFailed:
  9953. this.msgbox("custom-error", "Privacy mode", i == "" ? "Failed" : i, ""), this.updatePrivacyMode(o, !1);
  9954. break;
  9955. case ou.PrvOffSucceeded:
  9956. this.msgbox("custom-nocancel", "Privacy mode", "Exit privacy mode", ""), this.updatePrivacyMode(o, !1);
  9957. break;
  9958. case ou.PrvOffFailed:
  9959. this.msgbox("custom-error", "Privacy mode", i == "" ? "Failed to turn off" : i, "");
  9960. break;
  9961. case ou.PrvOffUnknown:
  9962. this.msgbox("custom-error", "Privacy mode", "Turned off", ""), this.updatePrivacyMode(o, !1);
  9963. break
  9964. }
  9965. return !0
  9966. }
  9967. getRemember() {
  9968. return this._options.remember || !1
  9969. }
  9970. setRemember(e) {
  9971. this.setOption("remember", e)
  9972. }
  9973. getOption(e) {
  9974. var i;
  9975. return (i = this._options[e]) != null ? i : u0(e)
  9976. }
  9977. getUserDefaultToggleOptions() {
  9978. const e = {}, i = {
  9979. "show-remote-cursor": "show_remote_cursor",
  9980. "lock-after-session-end": "lock_after_session_end",
  9981. "privacy-mode": "privacy_mode",
  9982. "enable-file-copy-paste": "enable-file-copy-paste",
  9983. "disable-audio": "disable_audio",
  9984. "disable-clipboard": "disable_clipboard",
  9985. "show-quality-monitor": "show_quality_monitor",
  9986. allow_swap_key: "allow_swap_key",
  9987. "view-only": "view_only",
  9988. "follow-remote-cursor": "follow_remote_cursor",
  9989. "follow-remote-window": "follow_remote_window"
  9990. };
  9991. for (const [a, t] of Object.entries(i)) e[a] = u0(t) == "Y";
  9992. const o = ["codec-preference", "custom-fps", "zoom-cursor", "touch-mode", "i444", "swap-left-right-mouse", "collapse_toolbar"];
  9993. for (const a of o) e[a] = u0(a);
  9994. return e
  9995. }
  9996. getToggleOption(e) {
  9997. const i = ["show-remote-cursor", "privacy-mode", "enable-file-copy-paste"], o = this._options[e];
  9998. return typeof o == "string" ? o != "" : o != null ? o : !!i.includes(e)
  9999. }
  10000. getStatus() {
  10001. return JSON.stringify({status_num: 10})
  10002. }
  10003. checkConnStatus() {
  10004. }
  10005. saveConfig(e) {
  10006. this._options = e, this._options.tm = new Date().getTime(), Do(this._id, e)
  10007. }
  10008. loadConfig() {
  10009. return le(this._id) || {}
  10010. }
  10011. setOption(e, i) {
  10012. i == null ? delete this._options[e] : this._options[e] = i, this._options.tm = new Date().getTime(), kt(this._id, e, i)
  10013. }
  10014. setFlutterUiOption(e, i) {
  10015. this.setOption(`flutter_ui:${e}`, i)
  10016. }
  10017. getFlutterUiOption(e) {
  10018. return this.getOption(`flutter_ui:${e}`)
  10019. }
  10020. inputKey(e, i, o, a, t, s, l) {
  10021. var c;
  10022. const E = wo(e, Sn());
  10023. !E || (a && (e == "VK_MENU" || e == "RAlt") && (a = !1), t && (e == "VK_CONTROL" || e == "RControl") && (t = !1), s && (e == "VK_SHIFT" || e == "RShift") && (s = !1), l && (e == "Meta" || e == "RWin") && (l = !1), E.down = i, E.press = o, E.modifiers = this.getMod(a, t, s, l), (c = this._ws) == null || c.sendMessage({key_event: E}))
  10024. }
  10025. ctrlAltDel() {
  10026. var i, o;
  10027. const e = w.fromPartial({down: !0});
  10028. ((i = this._peerInfo) == null ? void 0 : i.platform) == "Windows" ? e.control_key = j.CtrlAltDel : (e.control_key = j.Delete, e.modifiers = this.getMod(!0, !0, !1, !1)), (o = this._ws) == null || o.sendMessage({key_event: e})
  10029. }
  10030. restart() {
  10031. var i;
  10032. this._restartingRemoteDevice = !0;
  10033. const e = f.fromPartial({});
  10034. e.restart_remote_device = !0, (i = this._ws) == null || i.sendMessage({misc: e})
  10035. }
  10036. inputString(e) {
  10037. var o;
  10038. const i = w.fromPartial({seq: e});
  10039. (o = this._ws) == null || o.sendMessage({key_event: i})
  10040. }
  10041. send2fa(e) {
  10042. var i;
  10043. try {
  10044. const o = JSON.parse(e), a = o.code, t = o.trust_this_device;
  10045. t && this.setOption(b4, "Y");
  10046. const s = this._getHwid(t), l = _u.fromPartial({code: a, hwid: s});
  10047. (i = this._ws) == null || i.sendMessage({auth_2fa: l})
  10048. } catch {
  10049. console.log('Failed to switch display, invalid param "' + e + '"')
  10050. }
  10051. }
  10052. _captureDisplays({add: e, sub: i, set: o}) {
  10053. var s;
  10054. const a = Uu.fromPartial({add: e, sub: i, set: o}), t = f.fromPartial({capture_displays: a});
  10055. (s = this._ws) == null || s.sendMessage({misc: t})
  10056. }
  10057. switchDisplay(e) {
  10058. var i;
  10059. try {
  10060. const o = JSON.parse(e), a = o.value, t = o.isDesktop;
  10061. if (a.length == 1) {
  10062. let s = this.getCustomResolution(a[0]);
  10063. const l = Mu.fromPartial({display: a[0], width: s ? s[0] : void 0, height: s ? s[1] : void 0}),
  10064. E = f.fromPartial({switch_display: l});
  10065. (i = this._ws) == null || i.sendMessage({misc: E}), t || this._captureDisplays({set: a})
  10066. } else this._captureDisplays({set: a})
  10067. } catch {
  10068. console.log('Failed to switch display, invalid param "' + e + '"')
  10069. }
  10070. }
  10071. elevateDirect() {
  10072. var o;
  10073. const e = Du.fromPartial({direct: !0}), i = f.fromPartial({elevation_request: e});
  10074. (o = this._ws) == null || o.sendMessage({misc: i}), this._elevationRequested = !0
  10075. }
  10076. elevateWithLogon(e) {
  10077. var i;
  10078. try {
  10079. const o = JSON.parse(e), a = qu.fromPartial({username: o.username, password: o.password}),
  10080. t = Du.fromPartial({logon: a}), s = f.fromPartial({elevation_request: t});
  10081. (i = this._ws) == null || i.sendMessage({misc: s}), this._elevationRequested = !0
  10082. } catch {
  10083. console.log('Failed to elevate with logon, invalid param "' + e + '"')
  10084. }
  10085. }
  10086. async inputOsPassword(e) {
  10087. var a, t;
  10088. this.inputMouse(), await ie(50), this.inputMouse(0, 3, 3), await ie(50), this.inputMouse(1 | 1 << 3), this.inputMouse(2 | 1 << 3), await ie(1200);
  10089. const i = w.fromPartial({press: !0, seq: e});
  10090. (a = this._ws) == null || a.sendMessage({key_event: i});
  10091. const o = w.fromPartial({press: !0, control_key: j.Return});
  10092. (t = this._ws) == null || t.sendMessage({key_event: o})
  10093. }
  10094. lockScreen() {
  10095. var i;
  10096. const e = w.fromPartial({down: !0, control_key: j.LockScreen});
  10097. (i = this._ws) == null || i.sendMessage({key_event: e})
  10098. }
  10099. isSwapControlCommand() {
  10100. return this.getToggleOption("allow_swap_key")
  10101. }
  10102. getMod(e, i, o, a) {
  10103. const t = [];
  10104. return e && t.push(j.Alt), i && (this.isSwapControlCommand() ? t.push(j.Meta) : t.push(j.Control)), o && t.push(j.Shift), a && (this.isSwapControlCommand() ? t.push(j.Control) : t.push(j.Meta)), t
  10105. }
  10106. inputMouse(e = 0, i = 0, o = 0, a = !1, t = !1, s = !1, l = !1) {
  10107. var c;
  10108. const E = ku.fromPartial({mask: e, x: i, y: o, modifiers: this.getMod(a, t, s, l)});
  10109. (c = this._ws) == null || c.sendMessage({mouse_event: E})
  10110. }
  10111. toggleOption(e) {
  10112. var s;
  10113. const i = !this._options[e], o = z.fromPartial({}), a = i ? x.Yes : x.No;
  10114. switch (e) {
  10115. case"show-remote-cursor":
  10116. o.show_remote_cursor = a;
  10117. break;
  10118. case"follow-remote-cursor":
  10119. o.follow_remote_cursor = a;
  10120. break;
  10121. case"follow-remote-window":
  10122. o.follow_remote_window = a;
  10123. break;
  10124. case"disable-audio":
  10125. o.disable_audio = a;
  10126. break;
  10127. case"disable-clipboard":
  10128. o.disable_clipboard = a;
  10129. break;
  10130. case"lock-after-session-end":
  10131. o.lock_after_session_end = a;
  10132. break;
  10133. case"privacy-mode":
  10134. o.privacy_mode = a;
  10135. break;
  10136. case"enable-file-copy-paste":
  10137. o.enable_file_transfer = a;
  10138. break;
  10139. case"block-input":
  10140. o.block_input = x.Yes;
  10141. break;
  10142. case"unblock-input":
  10143. o.block_input = x.No;
  10144. break;
  10145. case"show-quality-monitor":
  10146. case"allow_swap_key":
  10147. break;
  10148. case"view-only":
  10149. i ? (o.disable_keyboard = x.Yes, o.disable_clipboard = x.Yes, o.show_remote_cursor = x.Yes, o.enable_file_transfer = x.No, o.lock_after_session_end = x.No) : (o.disable_keyboard = x.No, o.disable_clipboard = this.getToggleOption("disable-clipboard") ? x.Yes : x.No, o.show_remote_cursor = this.getToggleOption("show-remote-cursor") ? x.Yes : x.No, o.enable_file_transfer = this.getToggleOption("enable-file-copy-paste") ? x.Yes : x.No, o.lock_after_session_end = this.getToggleOption("lock-after-session-end") ? x.Yes : x.No);
  10150. break;
  10151. default:
  10152. this.setOption(e, this._options[e] ? void 0 : "Y");
  10153. return
  10154. }
  10155. e.indexOf("block-input") < 0 && this.setOption(e, i);
  10156. const t = f.fromPartial({option: o});
  10157. (s = this._ws) == null || s.sendMessage({misc: t})
  10158. }
  10159. toggleVirtualDisplay(e) {
  10160. try {
  10161. const i = JSON.parse(e);
  10162. this._sendToggleVirtualDisplayMsg(i.index, i.on), this.updateVirtualDisplay(i.index, i.on)
  10163. } catch {
  10164. console.log('Failed to toggle virtual display, invalid param "' + e + '"')
  10165. }
  10166. }
  10167. togglePrivacyMode(e) {
  10168. try {
  10169. const i = JSON.parse(e);
  10170. this._sendTogglePrivacyModeMsg(i.impl_key, i.on)
  10171. } catch {
  10172. console.log('Failed to toggle privacy mode, invalid param "' + e + '"')
  10173. }
  10174. }
  10175. _sendToggleVirtualDisplayMsg(e, i) {
  10176. var t;
  10177. const o = Lu.fromPartial({display: e, on: i}), a = f.fromPartial({toggle_virtual_display: o});
  10178. (t = this._ws) == null || t.sendMessage({misc: a})
  10179. }
  10180. _sendTogglePrivacyModeMsg(e, i) {
  10181. var t;
  10182. const o = Wu.fromPartial({impl_key: e, on: i}), a = f.fromPartial({toggle_privacy_mode: o});
  10183. (t = this._ws) == null || t.sendMessage({misc: a})
  10184. }
  10185. updateVirtualDisplay(e, i) {
  10186. const o = "virtual-display", a = this.getOption(o);
  10187. if (i) {
  10188. const t = a.split(","), s = t.length;
  10189. e == 0 ? t.splice(0, t.length) : t.indexOf(e.toString()) < 0 && t.push(e.toString()), t.length != s && this.setOption(o, t.join(","))
  10190. } else if (e == -1) a != "" && this.setOption(o, ""); else {
  10191. const t = a.split(","), s = t.length;
  10192. if (e == 0) t.pop(); else {
  10193. const l = t.indexOf(e.toString());
  10194. l >= 0 && t.splice(l, 1)
  10195. }
  10196. t.length != s && this.setOption(o, t.join(","))
  10197. }
  10198. }
  10199. getImageQuality() {
  10200. return this.getOption("image_quality")
  10201. }
  10202. getImageQualityEnum(e, i) {
  10203. switch (e) {
  10204. case"low":
  10205. return w4.Low;
  10206. case"best":
  10207. return w4.Best;
  10208. case"balanced":
  10209. return i ? void 0 : w4.Balanced;
  10210. default:
  10211. return
  10212. }
  10213. }
  10214. setImageQuality(e) {
  10215. var t;
  10216. this.setOption("image_quality", e);
  10217. const i = this.getImageQualityEnum(e, !1);
  10218. if (i == null) return;
  10219. const o = z.fromPartial({image_quality: i}), a = f.fromPartial({option: o});
  10220. (t = this._ws) == null || t.sendMessage({misc: a}), this._lastSendFps != 30 && this.setCustomFps(30, !1)
  10221. }
  10222. setCustomImageQuality(e) {
  10223. var t;
  10224. const i = e << 8, o = z.fromPartial({custom_image_quality: i}), a = f.fromPartial({option: o});
  10225. (t = this._ws) == null || t.sendMessage({misc: a}), this.setOption("custom_image_quality", e.toString()), this.setOption("image_quality", "custom")
  10226. }
  10227. setCustomFps(e, i) {
  10228. var s;
  10229. const o = e, a = z.fromPartial({custom_fps: o}), t = f.fromPartial({option: a});
  10230. (s = this._ws) == null || s.sendMessage({misc: t}), this._lastSendFps = o, i && this.setOption("custom-fps", e.toString())
  10231. }
  10232. sendNote(e, i) {
  10233. let o = i;
  10234. fetch(e, {
  10235. method: "POST",
  10236. headers: {"Content-Type": "application/json"},
  10237. body: JSON.stringify({id: this._id, session_id: this._sessionId, note: o})
  10238. }).then(a => {
  10239. if (!a.ok) throw new Error(a.statusText);
  10240. return a.text()
  10241. }).then(a => {
  10242. console.log("Send note response:", a)
  10243. }).catch(a => {
  10244. console.error("Failed to send note:", a)
  10245. })
  10246. }
  10247. getPlatform() {
  10248. var e;
  10249. return ((e = this._peerInfo) == null ? void 0 : e.platform) || ""
  10250. }
  10251. async handleFileResponse(e) {
  10252. var i, o;
  10253. if (e.dir) {
  10254. let a = e.dir, t = a.entries;
  10255. if (!A4() && this.getPeerPlatform() == "Windows") for (let s = 0; s < t.length; s++) t[s].name = t[s].name.replace(/\\/g, "/");
  10256. it(a.id, t, a.path, !1, !1), this._writeJobs.forEach(s => {
  10257. s.id == a.id && (s.files = t)
  10258. }), this._removeJobs[a.id] && (this._removeJobs[a.id].files = t)
  10259. } else if (e.empty_dirs != null) {
  10260. const a = e.empty_dirs;
  10261. for (let t = 0; t < this._readRemoteEmptyDirsJobs.length; t++) this._readRemoteEmptyDirsJobs[t].path == a.path && (this._readRemoteEmptyDirsJobs[t].empty_dirs = a.empty_dirs.map(s => s.path))
  10262. } else if (e.block) {
  10263. const a = e.block, t = this._writeJobs.find(s => s.id == a.id);
  10264. if (t) try {
  10265. await t.write(a, () => {
  10266. console.log(`cancel job ${t.id} due to write failed`), this.cancelJob(t.id)
  10267. })
  10268. } catch (s) {
  10269. console.log("write file failed", s)
  10270. }
  10271. this.update_jobs_status()
  10272. } else if (e.digest) {
  10273. const a = e.digest;
  10274. if (a.is_upload) {
  10275. const t = this._readJobs.find(s => s.id == a.id);
  10276. if (t) {
  10277. const s = t.read_digest(a);
  10278. s && ((i = this._ws) == null || i.sendMessage(s))
  10279. }
  10280. } else {
  10281. const t = this._writeJobs.find(s => s.id == a.id);
  10282. if (t) {
  10283. const s = t.write_digest(a);
  10284. s && ((o = this._ws) == null || o.sendMessage(s))
  10285. }
  10286. }
  10287. } else if (e.done) {
  10288. const a = e.done, t = this._writeJobs.find(l => l.id == a.id);
  10289. let s;
  10290. t && (t.write_done(a, () => this._readRemoteEmptyDirsJobs.find(l => l.id == a.id), () => this.removeReadRemoteEmptryDirJob(a.id)), s = t.job_error(), this._writeJobs = this._writeJobs.filter(l => l.id != a.id)), this.handle_job_status(a.id, a.file_num, s)
  10291. } else if (e.error) {
  10292. const a = e.error;
  10293. this._writeJobs = this._writeJobs.filter(t => t.id != a.id), this.removeReadRemoteEmptryDirJob(a.id), this.handle_job_status(a.id, a.file_num, a.error)
  10294. }
  10295. }
  10296. removeReadRemoteEmptryDirJob(e) {
  10297. this._readRemoteEmptyDirsJobs = this._readRemoteEmptyDirsJobs.filter(i => i.id != e)
  10298. }
  10299. readRemoteDir(e) {
  10300. var i;
  10301. try {
  10302. const o = JSON.parse(e),
  10303. a = P.fromPartial({read_dir: hu.fromPartial({path: o.path, include_hidden: o.include_hidden})});
  10304. (i = this._ws) == null || i.sendMessage({file_action: a})
  10305. } catch (o) {
  10306. console.error("Failed to read remote dir:", o)
  10307. }
  10308. }
  10309. async sendFiles(e) {
  10310. var i;
  10311. try {
  10312. const o = JSON.parse(e), {
  10313. id: a,
  10314. path: t,
  10315. to: s,
  10316. file_num: l,
  10317. include_hidden: E,
  10318. is_remote: c,
  10319. is_dir: C
  10320. } = o, D = this.enableOverwriteDetection();
  10321. if (c) {
  10322. this._writeJobs.push(lu.newWrite(a, t, s, l, E, c, [], D, C));
  10323. const B = sn(a, t, l, E);
  10324. (i = this._ws) == null || i.sendMessage({file_action: B}), C && this.enableEmptyDirs() && (this._readRemoteEmptyDirsJobs.find(F => F.id == a) == null && this._readRemoteEmptyDirsJobs.push(new rn({
  10325. id: a,
  10326. path: t
  10327. })), this.sendMessage({file_action: mn(t, E)}))
  10328. }
  10329. } catch (o) {
  10330. console.error("Failed to send files:", o)
  10331. }
  10332. }
  10333. async sendLocalFiles(e) {
  10334. try {
  10335. const i = JSON.parse(e), {
  10336. handle_index: o,
  10337. id: a,
  10338. path: t,
  10339. to: s,
  10340. file_num: l,
  10341. include_hidden: E,
  10342. is_remote: c
  10343. } = i, C = this.enableOverwriteDetection();
  10344. if (!c) try {
  10345. let D = this._fileHandles[o];
  10346. if (!D) throw new Error("Failed to get file handle");
  10347. let B = [], F = [];
  10348. if (D instanceof FileSystemFileHandle) {
  10349. let g = await D.getFile();
  10350. B = [W.fromPartial({
  10351. size: g.size,
  10352. entry_type: 4,
  10353. modified_time: Math.floor(g.lastModified / 1e3)
  10354. })], F = [D]
  10355. } else {
  10356. let g = await Nt(D, "");
  10357. B = g.map(U => U.entry), F = g.map(U => U.handle)
  10358. }
  10359. let y = lu.newRead(a, t, s, l, E, c, B, C, F);
  10360. it(a, B, t, !c, !0), this._readJobs.push(y), this._ftTimer || (this._ftTimer = setTimeout(this.readJobTimerCallback.bind(this), tt));
  10361. let S = [...B];
  10362. if (A4() && this.getPeerPlatform() != "Windows") for (let g = 0; g < S.length; g++) S[g].name = S[g].name.replace(/\\/g, "/");
  10363. if (this.sendMessage({file_action: pn(a, s, l, S, y.total_size)}), this.enableEmptyDirs()) {
  10364. const g = await Ot(D, D.name);
  10365. g.length > 0 && m("send_emptry_dirs", {dirs: g})
  10366. }
  10367. } catch (D) {
  10368. console.error("Failed to send files:", D), this.handle_job_status(a, -1, (D != null ? D : "Failed to send files").toString())
  10369. }
  10370. } catch (i) {
  10371. console.error("Failed to send files:", i)
  10372. }
  10373. }
  10374. async readJobTimerCallback() {
  10375. let e = await kn(this._readJobs, this.sendMessage.bind(this));
  10376. this._readJobs = this._readJobs.filter(i => !e.includes(i.id)), this.update_jobs_status(), this._readJobs.length == 0 ? (clearTimeout(this._ftTimer), this._ftTimer = void 0) : this._ftTimer = setTimeout(this.readJobTimerCallback.bind(this), tt)
  10377. }
  10378. update_jobs_status() {
  10379. const e = new Date().getTime() - this._last_update_jobs_ms;
  10380. e >= 1e3 && (this._readJobs.forEach(i => {
  10381. i.update_job_status(e)
  10382. }), this._writeJobs.forEach(i => {
  10383. i.update_job_status(e)
  10384. }), this._last_update_jobs_ms = new Date().getTime())
  10385. }
  10386. handle_job_status(e, i, o) {
  10387. var a;
  10388. if (this._removeJobs[e] && this._removeJobs[e].no_confirm) {
  10389. const t = this._removeJobs[e].files;
  10390. if (i + 1 < t.length) {
  10391. const s = this._removeJobs[e].path + this._removeJobs[e].sep + t[i + 1].name;
  10392. if ((a = this._ws) == null || a.sendMessage({file_action: ut(e, s, i + 1, this._removeJobs[e].is_remote)}), new Date().getTime() - this._removeJobs[e].last_update_job_status >= 1e3) this._removeJobs[e].last_update_job_status = new Date().getTime(); else return
  10393. } else delete this._removeJobs[e], console.log("remove jobs:", this._removeJobs)
  10394. }
  10395. o ? de(e, o, i) : _n(e, i)
  10396. }
  10397. cancelJob(e) {
  10398. var o;
  10399. (o = this._ws) == null || o.sendMessage({file_action: dn(e)});
  10400. let i = this._writeJobs.find(a => a.id == e);
  10401. i && i.remove_download_file(), this._writeJobs = this._writeJobs.filter(a => a.id != e), this._readJobs = this._readJobs.filter(a => a.id != e), delete this._removeJobs[e]
  10402. }
  10403. removeAllEmptyDirs(e) {
  10404. var i;
  10405. try {
  10406. const o = JSON.parse(e);
  10407. (i = this._ws) == null || i.sendMessage({file_action: cn(o.id, o.path)})
  10408. } catch (o) {
  10409. console.error("Failed to remove all empty dirs:", o)
  10410. }
  10411. }
  10412. removeFile(e) {
  10413. var i;
  10414. try {
  10415. const o = JSON.parse(e), {id: a, path: t, file_num: s, is_remote: l} = o;
  10416. l && ((i = this._ws) == null || i.sendMessage({file_action: ut(a, t, s, l)}))
  10417. } catch (o) {
  10418. console.error("Failed to remove files:", o)
  10419. }
  10420. }
  10421. readDirToRemoveRecursive(e) {
  10422. var i;
  10423. try {
  10424. const o = JSON.parse(e), {id: a, path: t, is_remote: s, show_hidden: l} = o;
  10425. if (s) {
  10426. (i = this._ws) == null || i.sendMessage({file_action: ln(a, t, l)});
  10427. const E = (c, C) => (c ? C === "Windows" : A4()) ? "\\" : "/";
  10428. this._removeJobs[a] = {
  10429. path: t,
  10430. files: [],
  10431. no_confirm: !1,
  10432. is_remote: s,
  10433. sep: E(s, this.getPeerPlatform()),
  10434. last_update_job_status: new Date().getTime()
  10435. }
  10436. }
  10437. } catch (o) {
  10438. console.error("Failed to read dir to remove recursive:", o)
  10439. }
  10440. }
  10441. createDir(e) {
  10442. var i;
  10443. try {
  10444. const o = JSON.parse(e), {id: a, path: t, is_remote: s} = o;
  10445. s && ((i = this._ws) == null || i.sendMessage({file_action: En(a, t)}))
  10446. } catch (o) {
  10447. console.error("Failed to create dir:", o)
  10448. }
  10449. }
  10450. renameFile(e) {
  10451. var i;
  10452. try {
  10453. const o = JSON.parse(e), {id: a, path: t, new_name: s, is_remote: l} = o;
  10454. l && ((i = this._ws) == null || i.sendMessage({file_action: Cn(a, t, s)}))
  10455. } catch (o) {
  10456. console.error("Failed to rename file:", o)
  10457. }
  10458. }
  10459. async seletFiles(e) {
  10460. await vn(e, (i, o) => {
  10461. this._fileHandles[i] = o
  10462. })
  10463. }
  10464. async handleFileAction(e) {
  10465. if (e.send_confirm) {
  10466. const i = e.send_confirm, o = this._readJobs.find(a => a.id == i.id);
  10467. o && o.confirm(i)
  10468. }
  10469. }
  10470. async confirmOverrideFile(e) {
  10471. try {
  10472. const i = JSON.parse(e), {id: o, file_num: a, need_override: t, remember: s, is_upload: l} = i;
  10473. if (l) {
  10474. const E = this._readJobs.find(c => c.id == o);
  10475. E && (s && (E.default_overwrite_strategy = t), E.confirm(cu.fromPartial({
  10476. id: o,
  10477. file_num: a,
  10478. offset_blk: t ? 0 : void 0,
  10479. skip: t ? void 0 : !0
  10480. })))
  10481. }
  10482. } catch (i) {
  10483. console.error("Failed to confirm override file:", i)
  10484. }
  10485. }
  10486. sendChat(e) {
  10487. const i = vu.fromPartial({text: e}), o = f.fromPartial({chat_message: i});
  10488. this.sendMessage({misc: o})
  10489. }
  10490. changeResolution(e) {
  10491. var i;
  10492. try {
  10493. const o = JSON.parse(e), a = v.fromPartial({width: o.width, height: o.height});
  10494. let t;
  10495. this._peerInfo && Q(this._peerInfo.version) >= Q("1.2.4") ? t = f.fromPartial({
  10496. change_display_resolution: Ou.fromPartial({
  10497. display: o.display,
  10498. resolution: a
  10499. })
  10500. }) : t = f.fromPartial({change_resolution: a}), (i = this._ws) == null || i.sendMessage({misc: t}), this._lastChangeDisplay = {
  10501. display: o.display,
  10502. width: o.width,
  10503. height: o.height,
  10504. time: new Date().getTime()
  10505. }
  10506. } catch (o) {
  10507. console.error("Failed to change resolution:", o)
  10508. }
  10509. }
  10510. setCustomResolution(e) {
  10511. var a, t;
  10512. const i = (s, l) => {
  10513. const E = s.toString(), c = this.loadConfig();
  10514. c.custom_resolutions || (c.custom_resolutions = {}), l ? c.custom_resolutions[E] = {
  10515. w: l[0],
  10516. h: l[1]
  10517. } : delete c.custom_resolutions[E], this.saveConfig(c)
  10518. }, o = () => {
  10519. var s, l, E;
  10520. return ((s = this._lastChangeDisplay) == null ? void 0 : s.display) == e.display && ((l = this._lastChangeDisplay) == null ? void 0 : l.width) == e.width && ((E = this._lastChangeDisplay) == null ? void 0 : E.height) == e.height && new Date().getTime() - this._lastChangeDisplay.time < 15e3
  10521. };
  10522. if (e.width == ((a = e.original_resolution) == null ? void 0 : a.width) && e.height == ((t = e.original_resolution) == null ? void 0 : t.height)) i(e.display, void 0); else {
  10523. const s = this._lastChangeDisplay;
  10524. if ((s == null ? void 0 : s.display) == e.display) {
  10525. const l = o() ? [e.width, e.height] : void 0;
  10526. i(e.display, l)
  10527. }
  10528. }
  10529. }
  10530. getCustomResolution(e) {
  10531. const o = this.loadConfig().custom_resolutions;
  10532. if (o) {
  10533. const a = o[e.toString()];
  10534. if (a && a.w && a.h) return [a.w, a.h]
  10535. }
  10536. }
  10537. tryChangeInitResolution(e) {
  10538. const i = this.getCustomResolution(e);
  10539. i && this.changeResolution(JSON.stringify({display: e, width: i[0], height: i[1]}))
  10540. }
  10541. setMultipleWindowsSession(e) {
  10542. let i = [];
  10543. e.forEach(o => {
  10544. let a = {};
  10545. a.sid = o.sid.toString(), a.name = o.name, i.push(a)
  10546. }), m("set_multiple_windows_session", {windows_sessions: JSON.stringify(i)})
  10547. }
  10548. sendSelectedSessionId(e) {
  10549. var o, a;
  10550. const i = parseInt(e);
  10551. if (isNaN(i)) console.error("selected invalid sid: ", e); else {
  10552. this._selectedWindowsSessionId = i;
  10553. const t = f.fromPartial({selected_sid: i});
  10554. (o = this._ws) == null || o.sendMessage({misc: t});
  10555. const s = this._peerInfo;
  10556. s && ((a = s.windows_sessions) == null ? void 0 : a.current_sid) == i && (this._isFileTransfer ? s.username || this.msgbox("error", "Error", "No active console user logged on, please connect and logon first.") : this.msgbox("success", "Successful", "Connected, waiting for image..."))
  10557. }
  10558. }
  10559. }
  10560. function P4(u = !1) {
  10561. const e = A.getItem("custom-rendezvous-server");
  10562. return R4(e || Ut, u)
  10563. }
  10564. function R4(u, e = !1, i = 0) {
  10565. const p = isHttps() ? "wss://" : "ws://"
  10566. const domain = uriDomain(u)
  10567. const uriport = uriPort(u)
  10568. if (isHttps() && (!uriport)) {
  10569. return p + domain + "/ws/" + (e ? "relay" : "id");
  10570. }
  10571. if (uriport) {
  10572. const a = parseInt(uriport);
  10573. u = domain + ":" + (a + (e ? i || 3 : 2))
  10574. } else u += ":" + (Mt + (e ? 3 : 2));
  10575. return p + u
  10576. }
  10577. function isHttps() {
  10578. return window.location.protocol === "https:"
  10579. }
  10580. function uriDomain(u) {
  10581. return u.indexOf(":") > 0 ? u.split(":")[0] : u
  10582. }
  10583. function uriPort(u) {
  10584. return u.indexOf(":") > 0 ? u.split(":")[1] : ''
  10585. }
  10586. const at = (u, e, i) => e && u.type == "SharedAb" ? Z(Zu([u.value, i.salt])) === Z(e) : !1,
  10587. ot = (u, e) => e && u.type == "PersonalAb" ? Z(u.value) === Z(e) : !1;
  10588. function bn() {
  10589. return P4()
  10590. }
  10591. function nt(u, e) {
  10592. ye("callback_query_onlines", {onlines: u.join(","), offlines: e.join(",")})
  10593. }
  10594. const onlineCache = {}
  10595. // Query onlines
  10596. async function myQueryOnline(id) {
  10597. const last_online = onlineCache[id]
  10598. if (last_online && new Date().getTime() - last_online < 20 * 1000) {
  10599. return true
  10600. }
  10601. // 映射 方便后期更新
  10602. const maps = {
  10603. uri: P4(),
  10604. ws: j4,
  10605. conn_type: ne.DEFAULT_CONN,
  10606. nat_type: pt.SYMMETRIC,
  10607. token: Pt(),
  10608. version: se,
  10609. licence_key: Io(),
  10610. rendezvousPunchHoleRequest: Ku,
  10611. rendezvousPunchHoleResponse_Failure: Z0
  10612. }
  10613. const s = new maps.ws(maps.uri, !0, "rendezvous");
  10614. await s.open();
  10615. const punch_hole_request = maps.rendezvousPunchHoleRequest.fromPartial({
  10616. id: id,
  10617. licence_key: maps.licence_key,
  10618. conn_type: maps.conn_type,
  10619. nat_type: maps.nat_type,
  10620. token: maps.token,
  10621. version: maps.version
  10622. });
  10623. s.sendRendezvous({punch_hole_request: punch_hole_request});
  10624. const msg = await s.next();
  10625. s.close();
  10626. let online = false
  10627. const phr = msg.punch_hole_response, rr = msg.relay_response;
  10628. if (phr) {
  10629. online = true
  10630. if (phr != null && phr.other_failure) {
  10631. online = false
  10632. return online
  10633. }
  10634. if (phr.failure != maps.rendezvousPunchHoleResponse_Failure.UNRECOGNIZED) switch (phr == null ? void 0 : phr.failure) {
  10635. case maps.rendezvousPunchHoleResponse_Failure.ID_NOT_EXIST:
  10636. case maps.rendezvousPunchHoleResponse_Failure.OFFLINE:
  10637. case maps.rendezvousPunchHoleResponse_Failure.LICENSE_MISMATCH:
  10638. case maps.rendezvousPunchHoleResponse_Failure.LICENSE_OVERUSE:
  10639. online = false
  10640. break
  10641. }
  10642. } else if (rr) {
  10643. online = true
  10644. if (!rr.version) {
  10645. online = false
  10646. return online
  10647. }
  10648. }
  10649. if (online) {
  10650. onlineCache[id] = new Date().getTime()
  10651. } else if (onlineCache[id]) {
  10652. delete onlineCache[id]
  10653. }
  10654. return online
  10655. }
  10656. async function wn(u) {
  10657. let e = [];
  10658. try {
  10659. e = JSON.parse(u)
  10660. } catch (a) {
  10661. console.error("Failed to query onlines, ", a);
  10662. return
  10663. }
  10664. if (e.length === 0) return;
  10665. if (window.webclient_magic_queryonline) {
  10666. const onlines = []
  10667. const offlines = []
  10668. for (let i = 0; i < e.length; i++) {
  10669. let online = await myQueryOnline(e[i])
  10670. if (online) {
  10671. onlines.push(e[i])
  10672. } else {
  10673. offlines.push(e[i])
  10674. }
  10675. }
  10676. console.log("onlines: ", onlines, "offlines: ", offlines)
  10677. nt(onlines, offlines)
  10678. } else {
  10679. const i = bn(), o = new j4(i, !0, "query onlines");
  10680. try {
  10681. await o.open();
  10682. const a = Ju.fromPartial({id: N4(), peers: e});
  10683. o.sendRendezvous({online_request: a})
  10684. } catch (a) {
  10685. console.error("Failed to query onlines, ", a), nt([], e), o.close();
  10686. return
  10687. }
  10688. for (let a = 0; a < 2; a++) {
  10689. const t = await Ro(o, 3e3);
  10690. if (!t || (t == null ? void 0 : t.key_exchange) || (t == null ? void 0 : t.online_response) === void 0) continue;
  10691. const s = t.online_response.states;
  10692. let l = [], E = [];
  10693. for (let c = 0; c < e.length; c++) {
  10694. const C = 1 << 7 - c % 8;
  10695. (s[Math.floor(c / 8)] & C) === C ? l.push(e[c]) : E.push(e[c])
  10696. }
  10697. nt(l, E), o.close();
  10698. return
  10699. }
  10700. o.close(), console.error("Failed to query online states, no online response")
  10701. }
  10702. }
  10703. window.curConn = void 0;
  10704. 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));
  10705. const xe = zt(), Yu = xe === Y4, H4 = xe === De, Qu = xe === Be;
  10706. function Sn() {
  10707. return !isMobile()
  10708. }
  10709. function Wt(u, e, i, o) {
  10710. if (!(!u || u == "error" && !i)) {
  10711. i.toLowerCase();
  10712. var a = Eo(u, e, i) ? "true" : "";
  10713. onGlobalEvent(JSON.stringify({
  10714. name: "msgbox",
  10715. type: u,
  10716. title: e,
  10717. text: i,
  10718. link: o != null ? o : "",
  10719. hasRetry: a
  10720. }))
  10721. }
  10722. }
  10723. function zn(u, e, i) {
  10724. onGlobalEvent(JSON.stringify({name: "toast", type: u, text: e, dur_msec: i}))
  10725. }
  10726. function Vt(u) {
  10727. var e = {};
  10728. for (const [i, o] of Object.entries(u)) !i || (o instanceof String || typeof o == "string" ? e[i] = o : o instanceof Uint8Array ? e[i] = "[" + o.toString() + "]" : e[i] = JSON.stringify(o));
  10729. return e
  10730. }
  10731. function m(u, e) {
  10732. e = Vt(e), e.name = u, onGlobalEvent(JSON.stringify(e))
  10733. }
  10734. function ce() {
  10735. var e;
  10736. ((e = Ae("input-source")) != null ? e : Hi) === Hi ? qo() : Ee()
  10737. }
  10738. function ye(u, e) {
  10739. e = Vt(e), e.name = u, onRegisteredEvent(JSON.stringify(e))
  10740. }
  10741. function Ce(u, e) {
  10742. onRgba(u, e)
  10743. }
  10744. function be(u) {
  10745. window.curConn = u
  10746. }
  10747. function e0() {
  10748. return window.curConn
  10749. }
  10750. async function qt() {
  10751. await curConn.start()
  10752. }
  10753. function we() {
  10754. var u;
  10755. (u = e0()) == null || u.close(), be(void 0)
  10756. }
  10757. function Kt() {
  10758. var e;
  10759. (e = window.curConn) == null || e.close();
  10760. const u = new Lt;
  10761. return be(u), u
  10762. }
  10763. let q;
  10764. async function Ht() {
  10765. try {
  10766. q || (await I4.ready, q = I4)
  10767. } catch (u) {
  10768. console.error("Failed to init sodium: " + u.message)
  10769. }
  10770. }
  10771. function Jt() {
  10772. return q
  10773. }
  10774. async function rt(u, e) {
  10775. return await Ht(), typeof e == "string" && (e = Gt(e)), q.crypto_sign_open(u, e)
  10776. }
  10777. function Gt(u) {
  10778. return q.from_base64(u, q.base64_variants.ORIGINAL)
  10779. }
  10780. function Pn(u) {
  10781. return q.to_base64(u, q.base64_variants.ORIGINAL)
  10782. }
  10783. function Rn() {
  10784. const u = q.crypto_box_keypair(), e = u.privateKey, i = u.publicKey;
  10785. return [e, i]
  10786. }
  10787. function In() {
  10788. return q.crypto_secretbox_keygen()
  10789. }
  10790. function Tn(u, e, i) {
  10791. const o = Uint8Array.from(Array(24).fill(0));
  10792. return q.crypto_box_easy(u, o, e, i)
  10793. }
  10794. function $4(u) {
  10795. for (var e = Array(24).fill(0), i = 0; i < e.length && u > 0; i++) {
  10796. var o = u & 255;
  10797. e[i] = o, u = (u - o) / 256
  10798. }
  10799. return Uint8Array.from(e)
  10800. }
  10801. function st(u, e, i) {
  10802. return q.crypto_secretbox_easy(u, $4(e), i)
  10803. }
  10804. function jn(u, e, i) {
  10805. return q.crypto_secretbox_open_easy(u, $4(e), i)
  10806. }
  10807. window.setByName = (u, e) => {
  10808. switch (u) {
  10809. case"connect":
  10810. Kt(), qt();
  10811. break;
  10812. case"login":
  10813. e = JSON.parse(e), curConn.handle_login_from_ui(e.os_username, e.os_password, e.password, e.remember);
  10814. break;
  10815. case"close":
  10816. we();
  10817. break;
  10818. case"refresh":
  10819. curConn.refresh();
  10820. break;
  10821. case"reconnect":
  10822. curConn == null || curConn.reconnect();
  10823. break;
  10824. case"toggle_virtual_display":
  10825. curConn.toggleVirtualDisplay(e);
  10826. break;
  10827. case"toggle_privacy_mode":
  10828. curConn.togglePrivacyMode(e);
  10829. break;
  10830. case"image_quality":
  10831. curConn.setImageQuality(e);
  10832. break;
  10833. case"custom_image_quality":
  10834. curConn.setCustomImageQuality(e);
  10835. break;
  10836. case"custom-fps":
  10837. curConn.setCustomFps(e, !0);
  10838. break;
  10839. case"lock_screen":
  10840. curConn.lockScreen();
  10841. break;
  10842. case"ctrl_alt_del":
  10843. curConn.ctrlAltDel();
  10844. break;
  10845. case"switch_display":
  10846. curConn.switchDisplay(e);
  10847. break;
  10848. case"remove_peer":
  10849. po(e);
  10850. break;
  10851. case"input_key":
  10852. e = JSON.parse(e), curConn.inputKey(e.name, e.down == "true", e.press == "true", e.alt == "true", e.ctrl == "true", e.shift == "true", e.command == "true");
  10853. break;
  10854. case"input_string":
  10855. curConn.inputString(e);
  10856. break;
  10857. case"flutter_key_event":
  10858. e = JSON.parse(e), Ko(curConn, e.usb_hid, e.down == "true", e.lock_modes);
  10859. break;
  10860. case"send_mouse":
  10861. Nn(e);
  10862. break;
  10863. case"send_2fa":
  10864. curConn == null || curConn.send2fa(e);
  10865. break;
  10866. case"option":
  10867. e = JSON.parse(e), A.setItem(e.name, e.value);
  10868. break;
  10869. case"options":
  10870. e = JSON.parse(e);
  10871. for (const [o, a] of Object.entries(a)) A.setItem(o, a);
  10872. break;
  10873. case"option:local": {
  10874. let o = JSON.parse(e);
  10875. if (o.name == 'access_token' && o.value) {
  10876. getServerConf(o.value)
  10877. }
  10878. gt(o.name, o.value), o.name === "input-source" && ce(), o.name == "lang" && fo()
  10879. }
  10880. break;
  10881. case"option:flutter:local":
  10882. e = JSON.parse(e), Ao(e.name, e.value);
  10883. break;
  10884. case"option:flutter:peer":
  10885. e = JSON.parse(e), curConn.setFlutterUiOption(e.name, e.value);
  10886. break;
  10887. case"option:user:default":
  10888. Kn(e);
  10889. break;
  10890. case"option:session":
  10891. e = JSON.parse(e), curConn.setOption(e.name, e.value);
  10892. break;
  10893. case"option:peer":
  10894. try {
  10895. e = JSON.parse(e), kt(e.id, e.name, e.value)
  10896. } catch (o) {
  10897. console.error('Failed to set peer option: "' + e + '", ' + o.message)
  10898. }
  10899. break;
  10900. case"option:toggle":
  10901. return curConn.toggleOption(e);
  10902. case"input_os_password":
  10903. curConn.inputOsPassword(e);
  10904. break;
  10905. case"session_add_sync":
  10906. return Gn(e);
  10907. case"session_start":
  10908. Zn();
  10909. break;
  10910. case"session_close":
  10911. Qn();
  10912. break;
  10913. case"elevate_direct":
  10914. curConn.elevateDirect();
  10915. break;
  10916. case"elevate_with_logon":
  10917. curConn.elevateWithLogon(e);
  10918. break;
  10919. case"peer_exists":
  10920. return !!Cu()[e];
  10921. case"restart":
  10922. curConn.restart();
  10923. break;
  10924. case"fav":
  10925. return A.setItem("fav", e);
  10926. case"query_onlines":
  10927. wn(e);
  10928. break;
  10929. case"change_prefer_codec":
  10930. curConn.changePreferCodec(e);
  10931. break;
  10932. case"cursor":
  10933. Vn(e);
  10934. break;
  10935. case"enter_or_leave":
  10936. curConn == null || curConn.enterOrLeave(e);
  10937. break;
  10938. case"fullscreen":
  10939. e == "Y" ? Yn() : $n();
  10940. break;
  10941. case"send_note":
  10942. const i = Xt("conn");
  10943. i && (curConn == null || curConn.sendNote(i, e));
  10944. break;
  10945. case"read_remote_dir":
  10946. curConn == null || curConn.readRemoteDir(e);
  10947. break;
  10948. case"send_files":
  10949. curConn == null || curConn.sendFiles(e);
  10950. break;
  10951. case"send_local_files":
  10952. curConn == null || curConn.sendLocalFiles(e);
  10953. break;
  10954. case"cancel_job":
  10955. curConn == null || curConn.cancelJob(e);
  10956. break;
  10957. case"remove_all_empty_dirs":
  10958. curConn == null || curConn.removeAllEmptyDirs(e);
  10959. break;
  10960. case"remove_file":
  10961. curConn == null || curConn.removeFile(e);
  10962. break;
  10963. case"create_dir":
  10964. curConn == null || curConn.createDir(e);
  10965. break;
  10966. case"rename_file":
  10967. curConn == null || curConn.renameFile(e);
  10968. break;
  10969. case"read_dir_to_remove_recursive":
  10970. curConn == null || curConn.readDirToRemoveRecursive(e);
  10971. break;
  10972. case"select_files":
  10973. curConn == null || curConn.seletFiles(e);
  10974. break;
  10975. case"confirm_override_file":
  10976. curConn == null || curConn.confirmOverrideFile(e);
  10977. break;
  10978. case"send_chat":
  10979. curConn == null || curConn.sendChat(e);
  10980. break;
  10981. case"load_ab":
  10982. ir();
  10983. break;
  10984. case"save_ab":
  10985. Fo(e);
  10986. break;
  10987. case"clear_ab":
  10988. _o();
  10989. break;
  10990. case"load_group":
  10991. tr();
  10992. break;
  10993. case"save_group":
  10994. vo(e);
  10995. break;
  10996. case"clear_group":
  10997. go();
  10998. break;
  10999. case"change_resolution":
  11000. curConn == null || curConn.changeResolution(e);
  11001. break;
  11002. case"selected_sid":
  11003. curConn == null || curConn.sendSelectedSessionId(e);
  11004. break
  11005. }
  11006. };
  11007. function Nn(u) {
  11008. if (!curConn) return;
  11009. let e = 0;
  11010. switch (u = JSON.parse(u), u.type) {
  11011. case"down":
  11012. e = io;
  11013. break;
  11014. case"up":
  11015. e = to;
  11016. break;
  11017. case"wheel":
  11018. e = Gi;
  11019. break;
  11020. case"trackpad":
  11021. e = Zi;
  11022. break
  11023. }
  11024. switch (u.buttons) {
  11025. case"left":
  11026. e |= x4 << 3;
  11027. break;
  11028. case"right":
  11029. e |= y4 << 3;
  11030. break;
  11031. case"wheel":
  11032. e |= ao << 3;
  11033. break;
  11034. case"back":
  11035. e |= oo << 3;
  11036. break;
  11037. case"forward":
  11038. e |= no << 3;
  11039. break
  11040. }
  11041. let i = parseInt(u.x || "0"), o = parseInt(u.y || "0");
  11042. (e == Gi || e == Zi) && curConn.getOption("reverse_mouse_wheel") == "Y" && (i = -i, o = -o);
  11043. const a = (e & x4 << 3) > 0 ? 1 : 0, t = (e & y4 << 3) > 0 ? 1 : 0;
  11044. a ^ t && curConn.getToggleOption("swap-left-right-mouse") && (a ? e = e & ~(x4 << 3) | y4 << 3 : e = e & ~(y4 << 3) | x4 << 3), curConn.inputMouse(e, i, o, u.alt == "true", u.ctrl == "true", u.shift == "true", u.command == "true")
  11045. }
  11046. window.getByName = (u, e) => {
  11047. let i = On(u, e);
  11048. return typeof i == "string" || i instanceof String ? i : i == null || i == null ? "" : JSON.stringify(i)
  11049. };
  11050. function On(u, e) {
  11051. var o, a, t, s;
  11052. switch (u) {
  11053. case"remember":
  11054. return curConn.getRemember();
  11055. case"option":
  11056. return A.getItem(e);
  11057. case"options":
  11058. const l = ["custom-rendezvous-server", "relay-server", "api-server", "key"], E = {};
  11059. return l.forEach(C => {
  11060. const D = A.getItem(C);
  11061. D && (E[C] = D)
  11062. }), JSON.stringify(E);
  11063. case"option:local":
  11064. const res = Ae(e) || ""
  11065. if (e == 'access_token' && res) {
  11066. getServerConf(res)
  11067. }
  11068. return res;
  11069. case"option:flutter:local":
  11070. return mo(e) || "";
  11071. case"option:flutter:peer":
  11072. return curConn.getFlutterUiOption(e) || "";
  11073. case"image_quality":
  11074. return curConn.getImageQuality();
  11075. case"translate":
  11076. return e = JSON.parse(e), xo(e.locale, e.text);
  11077. case"option:user:default":
  11078. return u0(e);
  11079. case"option:session":
  11080. return curConn ? curConn.getOption(e) : u0(e);
  11081. case"option:peer":
  11082. try {
  11083. const C = JSON.parse(e);
  11084. return (o = Bo(C.id, C.name)) != null ? o : u0(C.name)
  11085. } catch (C) {
  11086. return console.error('Failed to get peer option: "' + e + '", ' + C.message), ""
  11087. }
  11088. case"option:toggle":
  11089. return curConn == null ? void 0 : curConn.getToggleOption(e);
  11090. case"get_conn_status":
  11091. return curConn ? curConn.getStatus() : JSON.stringify({status_num: 0});
  11092. case"test_if_valid_server":
  11093. break;
  11094. case"version":
  11095. return se;
  11096. case"load_recent_peers":
  11097. Hn();
  11098. break;
  11099. case"load_fav_peers":
  11100. Jn();
  11101. break;
  11102. case"fav":
  11103. return (a = A.getItem("fav")) != null ? a : "[]";
  11104. case"load_recent_peers_sync":
  11105. return JSON.stringify({peers: JSON.stringify(ze())});
  11106. case"api_server":
  11107. return Qt();
  11108. case"is_using_public_server":
  11109. return !A.getItem("custom-rendezvous-server");
  11110. case"get_version_number":
  11111. return Q(e);
  11112. case"audit_server":
  11113. return Xt(e);
  11114. case"alternative_codecs":
  11115. return curConn.getAlternativeCodecs();
  11116. case"screen_info":
  11117. return JSON.stringify({
  11118. frame: {
  11119. l: window.screenX,
  11120. t: window.screenY,
  11121. r: window.screenX + window.innerWidth,
  11122. b: window.screenY + window.innerHeight
  11123. },
  11124. visibleFrame: {
  11125. l: window.screen.availLeft,
  11126. t: window.screen.availTop,
  11127. r: window.screen.availLeft + window.screen.availWidth,
  11128. b: window.screen.availTop + window.screen.availHeight
  11129. },
  11130. scaleFactor: window.devicePixelRatio
  11131. });
  11132. case"main_display":
  11133. return JSON.stringify({
  11134. w: window.screen.availWidth,
  11135. h: window.screen.availHeight,
  11136. scaleFactor: window.devicePixelRatio
  11137. });
  11138. case"langs":
  11139. var i = Object.entries(lo).map(([C, D]) => [C, `${D} (${C})`]);
  11140. return i.sort((C, D) => C[0].localeCompare(D[0])), JSON.stringify(i);
  11141. case"build_date":
  11142. return Co;
  11143. case"my_id":
  11144. return N4();
  11145. case"my_name":
  11146. return wt();
  11147. case"uuid":
  11148. return St();
  11149. case"local_os":
  11150. return zt();
  11151. case"peer_has_password":
  11152. return ((t = (Cu()[e] || {}).password) != null ? t : "") !== "";
  11153. case"fullscreen":
  11154. return ur() ? "Y" : "N";
  11155. case"platform":
  11156. return curConn.getPlatform();
  11157. case"enable_trusted_devices":
  11158. return (s = curConn == null ? void 0 : curConn.enableTrustedDevices()) != null && s ? "Y" : "N"
  11159. }
  11160. return ""
  11161. }
  11162. let Se = new Worker("./libopus.js?v=02816afa"), Zt;
  11163. function Mn(u, e) {
  11164. Zt = Ln(u, e), Se.postMessage({channels: u, sampleRate: e})
  11165. }
  11166. function Un(u) {
  11167. Se.postMessage(u, [u.buffer])
  11168. }
  11169. window.init = async () => {
  11170. try {
  11171. Se.onmessage = u => {
  11172. Zt.feed(u.data)
  11173. }, await Ht(), await So(), await za(), await N.init(), console.log("init done"), onInitFinished()
  11174. } catch (u) {
  11175. console.error("Failed to init: " + u.message), onInitFinished()
  11176. }
  11177. };
  11178. window.onunload = () => {
  11179. console.log("window close"), Ra()
  11180. };
  11181. function Ln(u, e) {
  11182. return new na({channels: u, sampleRate: e, flushingTime: 2e3})
  11183. }
  11184. function Wn(u) {
  11185. if (window.clipboardData && window.clipboardData.setData) return window.clipboardData.setData("Text", u);
  11186. if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
  11187. var e = document.createElement("textarea");
  11188. e.textContent = u, e.style.position = "fixed", document.body.appendChild(e), e.select();
  11189. try {
  11190. return document.execCommand("copy")
  11191. } catch (i) {
  11192. console.warn("Copy to clipboard failed.", i)
  11193. } finally {
  11194. document.body.removeChild(e)
  11195. }
  11196. }
  11197. }
  11198. function Q(u) {
  11199. try {
  11200. let e = u.split("-"), i = 0;
  11201. if (e.length > 0) {
  11202. let o = 0;
  11203. for (let a of e[0].split(".")) o = parseInt(a) || 0, i = i * 1e3 + o;
  11204. i -= o, i += o * 10
  11205. }
  11206. return e.length > 1 && (i += parseInt(e[1]) || 0), i
  11207. } catch (e) {
  11208. return console.error('Failed to parse version number: "' + u + '" ' + e.message), 0
  11209. }
  11210. }
  11211. function Vn(u) {
  11212. let e = "auto";
  11213. if (u != "auto") try {
  11214. const t = JSON.parse(u);
  11215. if (!t.url) return;
  11216. e = `url(${t.url}) ${t.hotx} ${t.hoty}, auto`
  11217. } catch (t) {
  11218. console.error("Failed to set custom cursor: " + t.message);
  11219. return
  11220. }
  11221. for (var i = document.body, o = 0; o < i.children.length; o++) {
  11222. var a = i.children[o];
  11223. a.tagName == "FLUTTER-VIEW" && (a.style.cursor = e)
  11224. }
  11225. }
  11226. async function qn() {
  11227. await I4.ready;
  11228. const u = I4.crypto_sign_keypair();
  11229. return {publicKey: u.publicKey, privateKey: u.privateKey}
  11230. }
  11231. function Kn(u) {
  11232. try {
  11233. const e = JSON.parse(u), i = JSON.parse(A.getItem("user-default-options")) || {};
  11234. i[e.name] = e.value, A.setItem("user-default-options", JSON.stringify(i))
  11235. } catch (e) {
  11236. console.error("Failed to set user default options: " + e.message)
  11237. }
  11238. }
  11239. function u0(u) {
  11240. var i, o, a;
  11241. const e = {
  11242. view_style: "original",
  11243. scroll_style: "scrollauto",
  11244. image_quality: "balanced",
  11245. "codec-preference": "auto",
  11246. custom_image_quality: "50",
  11247. "custom-fps": "30"
  11248. };
  11249. try {
  11250. return (o = (i = (JSON.parse(A.getItem("user-default-options")) || {})[u]) != null ? i : e[u]) != null ? o : ""
  11251. } catch (t) {
  11252. return console.error("Failed to get user default options: " + t.message), (a = e[u]) != null ? a : ""
  11253. }
  11254. }
  11255. function ze() {
  11256. const u = [];
  11257. for (const [e, i] of Object.entries(Cu())) {
  11258. if (!e) continue;
  11259. const o = i.tm, a = i.info, t = {
  11260. id: e,
  11261. username: a.username || "",
  11262. hostname: a.hostname || "",
  11263. platform: a.platform || "",
  11264. alias: i.alias || ""
  11265. };
  11266. !o || !t || u.push([o, e, t])
  11267. }
  11268. return u.sort().reverse().map(e => e[2])
  11269. }
  11270. function Hn() {
  11271. const u = ze();
  11272. u && ye("load_recent_peers", {peers: JSON.stringify(u)})
  11273. }
  11274. function Jn() {
  11275. var u;
  11276. try {
  11277. const e = (u = A.getItem("fav")) != null ? u : "[]", i = JSON.parse(e), o = ze().filter(a => i.includes(a.id));
  11278. o && ye("load_fav_peers", {peers: JSON.stringify(o)})
  11279. } catch (e) {
  11280. console.error("Failed to load fav peers: " + e.message)
  11281. }
  11282. }
  11283. function Gn(u) {
  11284. var e;
  11285. try {
  11286. const i = JSON.parse(u), o = i.id;
  11287. if (o) {
  11288. (e = window.curConn) == null || e.close();
  11289. const a = new Lt;
  11290. return a.setRemoteId(o), a.setSessionInfo(i), be(a), gt("last_remote_id", o), ""
  11291. } else return "No id found in session data " + u
  11292. } catch (i) {
  11293. return i.message
  11294. }
  11295. }
  11296. function Zn(u) {
  11297. try {
  11298. if (!e0()) return;
  11299. qt()
  11300. } catch (e) {
  11301. Wt("error", "Error", e.message, "")
  11302. }
  11303. }
  11304. function Qn(u) {
  11305. we()
  11306. }
  11307. function Xn(u, e) {
  11308. function i(o) {
  11309. return /^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$/.test(o)
  11310. }
  11311. if (i(u)) {
  11312. if (u.startsWith("[")) {
  11313. let o = u.split("]:");
  11314. if (o.length === 2) {
  11315. let a = parseInt(o[1]) || 0;
  11316. if (a > 0) return `${o[0]}]:${a + e}`
  11317. }
  11318. }
  11319. } else if (u.includes(":")) {
  11320. let o = u.split(":");
  11321. if (o.length === 2) {
  11322. let a = parseInt(o[1]) || 0;
  11323. if (a > 0) return `${o[0]}:${a + e}`
  11324. }
  11325. }
  11326. return u
  11327. }
  11328. function Qt() {
  11329. const u = A.getItem("api-server");
  11330. if (u) return u;
  11331. const e = A.getItem("custom-rendezvous-server");
  11332. if (e) {
  11333. let i = Xn(e, -2);
  11334. return i == e ? `http://${i}:${Mt - 2}` : `http://${i}`
  11335. }
  11336. return "https://admin.rustdesk.com"
  11337. }
  11338. function Xt(u) {
  11339. if (!Pt()) return "";
  11340. const e = Qt();
  11341. return !e || e.includes("rustdesk.com") ? "" : e + "/api/audit/" + u
  11342. }
  11343. function Yt(u, e, i) {
  11344. try {
  11345. Z4.exports.ZstdCodec.run(a => {
  11346. var t = new a.Simple;
  11347. i(e ? u.map(s => t.compress(s, 3)) : t.compress(u, 3))
  11348. })
  11349. } catch (o) {
  11350. console.error("Compress failed: ", o)
  11351. }
  11352. }
  11353. function Pe(u, e, i) {
  11354. try {
  11355. Z4.exports.ZstdCodec.run(o => {
  11356. var a = new o.Simple;
  11357. i(e ? u.map(t => a.decompress(t)) : a.decompress(u))
  11358. })
  11359. } catch (o) {
  11360. console.error("Decompress failed: ", o)
  11361. }
  11362. }
  11363. async function $t(u, e) {
  11364. return new Promise((i, o) => {
  11365. try {
  11366. Z4.exports.ZstdCodec.run(a => {
  11367. var t = new a.Simple;
  11368. i(t.compress(u, 3))
  11369. })
  11370. } catch (a) {
  11371. o(a)
  11372. }
  11373. })
  11374. }
  11375. async function ua(u, e) {
  11376. return new Promise((i, o) => {
  11377. try {
  11378. Z4.exports.ZstdCodec.run(a => {
  11379. var t = new a.Simple;
  11380. i(t.decompress(u))
  11381. })
  11382. } catch (a) {
  11383. o(a)
  11384. }
  11385. })
  11386. }
  11387. function Yn() {
  11388. const u = document.documentElement;
  11389. u.requestFullscreen ? u.requestFullscreen() : u.mozRequestFullScreen ? u.mozRequestFullScreen() : u.webkitRequestFullscreen ? u.webkitRequestFullscreen() : u.msRequestFullscreen && u.msRequestFullscreen()
  11390. }
  11391. function $n() {
  11392. document.exitFullscreen ? document.exitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.msExitFullscreen && document.msExitFullscreen()
  11393. }
  11394. function ur() {
  11395. return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement
  11396. }
  11397. var lt = !1;
  11398. function er() {
  11399. lt || (console.log("listen fullscreen"), lt = !0, document.addEventListener("fullscreenchange", () => onFullscreenChanged(!!document.fullscreenElement)), document.addEventListener("mozfullscreenchange", () => onFullscreenChanged(!!document.mozFullScreen)), document.addEventListener("webkitfullscreenchange", () => onFullscreenChanged(!!document.webkitFullscreenElement)), document.addEventListener("msfullscreenchange", () => onFullscreenChanged(!!document.msFullscreenElement)))
  11400. }
  11401. er();
  11402. async function ir() {
  11403. try {
  11404. let u = await xt();
  11405. onLoadAbFinished(JSON.stringify(u))
  11406. } catch (u) {
  11407. console.error("Failed to load ab: " + u.message), onLoadAbFinished("")
  11408. }
  11409. }
  11410. async function tr() {
  11411. try {
  11412. let u = await ko();
  11413. onLoadGroupFinished(JSON.stringify(u))
  11414. } catch (u) {
  11415. console.error("Failed to load group: " + u.message), onLoadGroupFinished("")
  11416. }
  11417. }
  11418. const Et = document.querySelector("#app");
  11419. if (Et) {
  11420. let e = function (i, o, a) {
  11421. !e0() || (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;">' + a + "</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;">' + a + "</div>") : (document.querySelector("div#canvas").style.display = "block", document.querySelector("div#password").style.display = "none", document.querySelector("div#status").style.display = "none"))
  11422. };
  11423. Et.innerHTML = `
  11424. <div id="connect" style="text-align: center"><table style="display: inline-block">
  11425. <tr><td><span>Host: </span></td><td><input id="host" /></td></tr>
  11426. <tr><td><span>Key: </span></td><td><input id="key" /></td></tr>
  11427. <tr><td><span>Id: </span></td><td><input id="id" /></td></tr>
  11428. <tr><td></td><td><button onclick="connect();">Connect</button></td></tr>
  11429. </table></div>
  11430. <div id="password" style="display: none;">
  11431. <input type="password" id="password" />
  11432. <button id="confirm" onclick="confirm()">Confirm</button>
  11433. <button id="cancel" onclick="cancel();">Cancel</button>
  11434. </div>
  11435. <div id="status" style="display: none;">
  11436. <div id="text" style="line-height: 2em"></div>
  11437. <button id="cancel" onclick="cancel();">Cancel</button>
  11438. </div>
  11439. <div id="canvas" style="display: none;">
  11440. <button id="cancel" onclick="cancel();">Cancel</button>
  11441. <canvas id="player"></canvas>
  11442. <canvas id="test-yuv-decoder-canvas"></canvas>
  11443. </div>
  11444. `;
  11445. let u;
  11446. window.init(), document.body.onload = () => {
  11447. const i = document.querySelector("#host");
  11448. i.value = A.getItem("custom-rendezvous-server");
  11449. const o = document.querySelector("#id");
  11450. o.value = A.getItem("id");
  11451. const a = document.querySelector("#key");
  11452. a.value = A.getItem("key"), u = YUVCanvas.attach(document.getElementById("player"))
  11453. }, window.connect = () => {
  11454. const i = document.querySelector("#host");
  11455. A.setItem("custom-rendezvous-server", i.value);
  11456. const o = document.querySelector("#id");
  11457. A.setItem("id", o.value);
  11458. const a = document.querySelector("#key");
  11459. A.setItem("key", a.value), (async () => {
  11460. const s = Kt();
  11461. s.setMsgbox(e), s.setDraw(l => {
  11462. Ce(l), u.drawFrame(l)
  11463. }), document.querySelector("div#status").style.display = "block", document.querySelector("div#connect").style.display = "none", document.querySelector("div#text").innerHTML = "Connecting ...", s.setPeerId(o.value), await s.start()
  11464. })()
  11465. }, window.cancel = () => {
  11466. we(), 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"
  11467. }, window.confirm = () => {
  11468. const i = document.querySelector("input#password").value;
  11469. i && (document.querySelector("div#password").style.display = "none", e0().login(i))
  11470. }
  11471. }