var LishogiCli=function(e){"use strict";const n=window.lishogi;function t(e,t,o){return'
'+e.split(" ").map((e=>`
${e} ${n.escapeHtml(t)}
`)).join("")+`
${o} `}return e.app=function(e,o){const a=e.find("input");n.userAutocomplete(a,{focus:1,friend:!0,onSelect(e){a.val("").blur(),function(e){if(!e)return;if("/"==e[0])return function(e){var o=e.split(" "),a=o[0];const l=function(e){return e.split(" ").includes(a)};l("tv follow")&&o[1]?location.href="/@/"+o[1]+"/tv":l("tv")?location.href="/tv":l("play challenge match")&&o[1]?location.href="/?user="+o[1]+"#friend":l("light dark transp")?(s=e=>e.subs.background.set(a),n.loadScript(n.compiledScript("dasher")).then((function(){window.LishogiDasher(document.createElement("div"),{playing:$("body").hasClass("playing")}).then(s)}))):l("stream")&&o[1]?location.href="/streamer/"+o[1]:l("help")?(n.loadCssPath("clinput.help"),$.modal("Commands
"+t("/tv /follow"," ","Watch someone play")+t("/play /challenge /match"," ","Challenge someone to play")+t("/light /dark /transp","","Change the background theme")+t("/stream","","Watch someone stream")+"Global hotkeys
"+t("s","","Search for a user")+t("/","","Type a command")+t("c","","Focus the chat input")+t("esc","","Close modals like this one"),"clinput-help")):alert(`Unknown command: "${e}". Type /help for the list of commands`);var s}(e.replace(/\//g,""));location.href="/@/"+e}(e.name||e.trim()),$("body").hasClass("clinput")&&o()}}).done((function(){a.on("blur",(()=>{a.val(""),$("body").hasClass("clinput")&&o()}))}))},Object.defineProperty(e,"__esModule",{value:!0}),e}({});