From 800d9b795e57ea12b4af64da3ac2dc61aca1f9b7 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 14 Oct 2024 20:40:27 +0100 Subject: [PATCH] app: currect default settings tab --- app/dist/assets/{index-BCbFGrIy.js => index-CDqugPW9.js} | 2 +- app/dist/index.html | 2 +- app/src/lib/Components/SettingsModal.svelte | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename app/dist/assets/{index-BCbFGrIy.js => index-CDqugPW9.js} (99%) diff --git a/app/dist/assets/index-BCbFGrIy.js b/app/dist/assets/index-CDqugPW9.js similarity index 99% rename from app/dist/assets/index-BCbFGrIy.js rename to app/dist/assets/index-CDqugPW9.js index b5f5d7d6..237b8265 100644 --- a/app/dist/assets/index-BCbFGrIy.js +++ b/app/dist/assets/index-CDqugPW9.js @@ -3,4 +3,4 @@ var Wt=Object.defineProperty;var Vt=(n,e,t)=>e in n?Wt(n,e,{enumerable:!0,config to add it.`},m(t,l){y(t,e,l)},p:M,d(t){t&&w(e)}}}function es(n){let e=Object.keys(n[0].pluginList).includes(n[1])&&n[8]!==null,t,l=e&&Lt(n);return{c(){l&&l.c(),t=me()},m(o,r){l&&l.m(o,r),y(o,t,r)},p(o,r){r[0]&259&&(e=Object.keys(o[0].pluginList).includes(o[1])&&o[8]!==null),e?l?l.p(o,r):(l=Lt(o),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},d(o){o&&w(t),l&&l.d(o)}}}function Lt(n){let e,t,l,o,r,i,a,u={ctx:n,current:null,token:null,hasCatch:!0,pending:ss,then:ns,catch:ts,value:29};return Je(e=n[8],u),{c(){u.block.c(),t=R(),l=b("button"),l.textContent="Remove",o=R(),r=b("button"),r.textContent="Reload",m(l,"class","mx-auto mb-1 w-[min(144px,_25%)] rounded-lg p-2 font-bold text-black duration-200 enabled:bg-rose-500 enabled:hover:opacity-75 disabled:bg-gray-500"),m(r,"class","mx-auto mb-1 w-[min(144px,_25%)] rounded-lg p-2 font-bold text-black duration-200 enabled:bg-blue-500 enabled:hover:opacity-75 disabled:bg-gray-500")},m(c,d){u.block.m(c,u.anchor=d),u.mount=()=>t.parentNode,u.anchor=t,y(c,t,d),y(c,l,d),y(c,o,d),y(c,r,d),i||(a=[U(l,"click",n[19]),U(r,"click",n[20])],i=!0)},p(c,d){n=c,u.ctx=n,d[0]&256&&e!==(e=n[8])&&Je(e,u)||Ft(u,n,d)},d(c){c&&(w(t),w(l),w(o),w(r)),u.block.d(c),u.token=null,u=null,i=!1,oe(a)}}}function ts(n){let e,t,l;return{c(){e=b("p"),e.textContent="error",t=R(),l=b("br")},m(o,r){y(o,e,r),y(o,t,r),y(o,l,r)},p:M,d(o){o&&(w(e),w(t),w(l))}}}function ns(n){let e,t=(n[29].name??je)+"",l,o,r,i=(n[29].description??"no description")+"",a,u,c,d;return{c(){e=b("p"),l=X(t),o=R(),r=b("p"),a=X(i),c=R(),d=b("br"),m(e,"class","pb-4 text-xl font-bold"),m(r,"class",u=n[29].description?null:"italic")},m(f,_){y(f,e,_),k(e,l),y(f,o,_),y(f,r,_),k(r,a),y(f,c,_),y(f,d,_)},p(f,_){_[0]&256&&t!==(t=(f[29].name??je)+"")&&ue(l,t),_[0]&256&&i!==(i=(f[29].description??"no description")+"")&&ue(a,i),_[0]&256&&u!==(u=f[29].description?null:"italic")&&m(r,"class",u)},d(f){f&&(w(e),w(o),w(r),w(c),w(d))}}}function ss(n){let e;return{c(){e=b("p"),e.textContent="loading..."},m(t,l){y(t,e,l)},p:M,d(t){t&&w(e)}}}function ls(n){let e,t,l,o,r,i,a,u,c,d,f;function _(L,N){return L[3].length==0?jn:Mn}let g=_(n),p=g(n);function $(L,N){return L[0].hasBoltPlugins?Dn:An}let h=$(n),S=h(n);return{c(){e=b("div"),t=b("button"),l=X("Manage Plugins"),r=R(),i=b("hr"),a=R(),p.c(),u=R(),c=b("div"),S.c(),m(t,"class",o="mx-auto mb-2 w-[95%] rounded-lg border-2 "+(n[6]?"border-blue-500 text-black dark:text-white":"border-black bg-blue-500 text-black")+" p-2 font-bold hover:opacity-75"),m(i,"class","p-1 dark:border-slate-700"),m(e,"class","left-0 float-left h-full w-[min(180px,_50%)] overflow-hidden border-r-2 border-slate-300 pt-2 dark:border-slate-800"),m(c,"class","h-full pt-10")},m(L,N){y(L,e,N),k(e,t),k(t,l),k(e,r),k(e,i),k(e,a),p.m(e,null),y(L,u,N),y(L,c,N),S.m(c,null),d||(f=U(t,"click",n[16]),d=!0)},p(L,N){N[0]&64&&o!==(o="mx-auto mb-2 w-[95%] rounded-lg border-2 "+(L[6]?"border-blue-500 text-black dark:text-white":"border-black bg-blue-500 text-black")+" p-2 font-bold hover:opacity-75")&&m(t,"class",o),g===(g=_(L))&&p?p.p(L,N):(p.d(1),p=g(L),p&&(p.c(),p.m(e,null))),h===(h=$(L))&&S?S.p(L,N):(S.d(1),S=h(L),S&&(S.c(),S.m(c,null)))},d(L){L&&(w(e),w(u),w(c)),p.d(),S.d(),d=!1,f()}}}function os(n){let e,t,l={class:"h-[90%] w-[90%] text-center",$$slots:{default:[ls]},$$scope:{ctx:n}};return e=new Qe({props:l}),n[23](e),e.$on("close",n[24]),{c(){ee(e.$$.fragment)},m(o,r){Y(e,o,r),t=!0},p(o,r){const i={};r[0]&1007|r[1]&1024&&(i.$$scope={dirty:r,ctx:o}),e.$set(i)},i(o){t||(j(e.$$.fragment,o),t=!0)},o(o){B(e.$$.fragment,o),t=!1},d(o){n[23](null),Z(e,o)}}}const lt="bolt.json",rs="main.lua",je="(unnamed)",Ct="(new character)";function is(n,e,t){let l,o,r,i;ce(n,it,H=>t(3,i=H));let a;const u=C.platform==="windows"?"\\":"/",c=u.concat(lt);function d(){a.open()}const f=H=>new Promise((O,D)=>{const de=H.concat(H.endsWith(u)?lt:c);var W=new XMLHttpRequest;W.onreadystatechange=()=>{W.readyState==4&&(W.status==200?O(JSON.parse(W.responseText)):D(W.responseText))},W.open("GET","/read-json-file?".concat(new URLSearchParams({path:de}).toString()),!0),W.send()}),_=H=>{const D=C.pluginList[H];if(!D)return null;const de=D.path;return de?f(de):null},g=(H,O)=>{f(H).then(D=>{do t(1,L=crypto.randomUUID());while(Object.keys(C.pluginList).includes(L));t(0,C.pluginList[L]={name:D.name??je,path:H},C),t(7,T=!0)}).catch(D=>{console.error(`Config file '${O}' couldn't be fetched, reason: ${D}`)})};let p=!1;const $=()=>{t(5,p=!0);var H=new XMLHttpRequest;H.onreadystatechange=()=>{if(H.readyState==4&&(t(5,p=!1),H.status==200))if(H.responseText.endsWith(c)){const O=H.responseText.substring(0,H.responseText.length-lt.length);g(O,H.responseText)}else console.log(`Selection '${H.responseText}' is not named bolt.json; ignored`)},H.open("GET","/json-file-picker",!0),H.send()};st();const h=(H,O,D,de)=>{const W=C.platform==="windows"?D.replaceAll("\\","/"):D,qe=W.endsWith(u)?W:W.concat("/");var Oe=new XMLHttpRequest;Oe.onreadystatechange=()=>{Oe.readyState==4&&(st(),P.info(`Start-plugin status: ${Oe.statusText.trim()}`))},Oe.open("GET","/start-plugin?".concat(new URLSearchParams({client:H.toString(),id:O,path:qe,main:de}).toString()),!0),Oe.send()},S=(H,O)=>{var D=new XMLHttpRequest;D.onreadystatechange=()=>{D.readyState==4&&(st(),P.info(`Stop-plugin status: ${D.statusText.trim()}`))},D.open("GET","/stop-plugin?".concat(new URLSearchParams({client:H.toString(),uid:O.toString()}).toString()),!0),D.send()};var L,N=!1,I;let T=!1;const A=()=>t(6,N=!1),E=H=>{t(2,I=H.uid),t(6,N=!0)};function v(){L=at(this),t(1,L),t(0,C)}const x=()=>{t(8,r=null),t(7,T=!0);let H=C.pluginList;delete H[L],t(0,C.pluginList=H,C)},G=()=>t(8,r=_(L)),F=H=>h(I,L,o,H.main??rs),J=H=>{S(I,H.uid)};function te(H){ge[H?"unshift":"push"](()=>{a=H,t(4,a)})}const ne=()=>{T&&Nn()};return n.$$.update=()=>{n.$$.dirty[0]&12&&(i.some(H=>H.uid===I)||t(6,N=!1)),n.$$.dirty[0]&3&&t(15,l=C.pluginList[L]),n.$$.dirty[0]&32768&&t(9,o=l?l.path:null),n.$$.dirty[0]&2&&t(8,r=_(L))},[C,L,I,i,a,p,N,T,r,o,_,$,h,S,d,l,A,E,v,x,G,F,J,te,ne]}class as extends ie{constructor(e){super(),re(this,e,is,os,se,{open:14},null,[-1,-1])}get open(){return this.$$.ctx[14]}}function Rt(n,e,t){const l=n.slice();return l[18]=e[t],l}function Tt(n,e,t){const l=n.slice();return l[21]=e[t],l}function cs(n){let e,t,l={};return e=new as({props:l}),n[14](e),{c(){ee(e.$$.fragment)},m(o,r){Y(e,o,r),t=!0},p(o,r){const i={};e.$set(i)},i(o){t||(j(e.$$.fragment,o),t=!0)},o(o){B(e.$$.fragment,o),t=!1},d(o){n[14](null),Z(e,o)}}}function xt(n){let e,t;return{c(){e=b("div"),t=X(n[7]),m(e,"class","absolute left-[2%] w-[96%] rounded-lg rounded-lg bg-blue-400 px-2 text-black")},m(l,o){y(l,e,o),k(e,t)},p(l,o){o&128&&ue(t,l[7])},d(l){l&&w(e)}}}function us(n){let e,t,l;return{c(){e=b("button"),e.textContent="Plugin menu",e.disabled=!C.hasBoltPlugins,m(e,"title",C.hasBoltPlugins?null:"Coming soon..."),m(e,"class","w-52 rounded-lg p-2 font-bold text-black duration-200 enabled:bg-blue-500 enabled:hover:opacity-75 disabled:bg-gray-500")},m(o,r){y(o,e,r),t||(l=U(e,"click",n[17]),t=!0)},p:M,d(o){o&&w(e),t=!1,l()}}}function ds(n){let e,t,l,o,r,i,a=le(ut[n[1].selected.game]),u=[];for(let c=0;cn[16].call(o)),m(e,"class","flex flex-col")},m(c,d){y(c,e,d),k(e,t),k(e,l),k(e,o);for(let f=0;ft(1,i=T));let _=Ie(null);ce(n,_,T=>t(7,u=T));let g=Ie(!0);ce(n,g,T=>t(6,a=T));function p(T,A){if(!l)return P.warn("Please log in or select a user to play.");if(!o)return P.warn("Please select a character from the select menu.");const E=V.findSession(i.selected.user_id);if(!E)return P.warn("Unable to launch game, session was not found.");const{session_id:v}=E,x=V.findAccount(E.accounts,o);if(!x)return P.warn("Unable to launch game, account was not found.");const{accountId:G,displayName:F}=x,J=C.platform===Ne.Windows,te=C.platform===Ne.Linux;switch(T){case K.osrs:switch(A){case ke.official:gt(J,!0,v,G,F);break;case ke.runelite:Jt(v,G,F,!1);break;case ke.hdos:Un(v,G,F);break}break;case K.rs3:te?En(v,G,F):gt(J,!1,v,G,F);break}}function $(T){const A=T.target.value;if(!l)return;const E=i.userDetails[l];E?(E.account_id=A,he(f,i.userDetails[l]=E,i)):he(f,i.userDetails[l]={account_id:A},i)}function h(T){ge[T?"unshift":"push"](()=>{c=T,t(2,c)})}function S(T){ge[T?"unshift":"push"](()=>{d=T,t(3,d)})}const L=()=>{a?p(i.selected.game,i.selected.client):c.open(p,i.selected.game,i.selected.client)};function N(){i.selected.client=at(this),f.set(i)}const I=()=>{d.open()};return n.$$.update=()=>{var T,A;if(n.$$.dirty&2&&t(12,l=i.selected.user_id),n.$$.dirty&4098&&t(4,o=(T=i.userDetails[l??""])==null?void 0:T.account_id),n.$$.dirty&2&&t(5,r=((A=V.findSession(i.selected.user_id))==null?void 0:A.accounts)??[]),n.$$.dirty&2)if(i.check_announcements){const E=`${C.env.psa_url}${i.selected.game==K.osrs?"osrs":C.env.provider}.json`;fetch(E,{method:"GET"}).then(v=>v.json()).then(v=>{he(_,u=v.psa&&v.psa.length>0?v.psa:null,u),he(g,a=!(v.isDisabled??!1),a)})}else he(_,u=null,u),he(g,a=!0,a)},[p,i,c,d,o,r,a,u,f,_,g,$,l,h,S,L,N,I]}class hs extends ie{constructor(e){super(),re(this,e,gs,_s,se,{launch:0})}get launch(){return this.$$.ctx[0]}}function Ot(n,e,t){const l=n.slice();return l[1]=e[t].date,l[2]=e[t].severity,l[3]=e[t].content,l}function Et(n){var u;let e,t=((u=n[1])==null?void 0:u.toLocaleTimeString())+"",l,o,r=n[3]+"",i,a;return{c(){e=b("li"),l=X(t),o=X(` - `),i=X(r),a=R(),Q(e,"text-rose-500",n[2]===Ue.error),Q(e,"text-orange-700",n[2]===Ue.warn)},m(c,d){y(c,e,d),k(e,l),k(e,o),k(e,i),k(e,a)},p(c,d){var f;d&1&&t!==(t=((f=c[1])==null?void 0:f.toLocaleTimeString())+"")&&ue(l,t),d&1&&r!==(r=c[3]+"")&&ue(i,r),d&1&&Q(e,"text-rose-500",c[2]===Ue.error),d&1&&Q(e,"text-orange-700",c[2]===Ue.warn)},d(c){c&&w(e)}}}function ms(n){let e,t,l,o,r=le(n[0]),i=[];for(let a=0;a',l=R(),o=b("ol");for(let a=0;a{"logs"in o&&t(0,l=o.logs)},[l]}class ks extends ie{constructor(e){super(),re(this,e,bs,ms,se,{logs:0})}}function Ut(n,e,t){const l=n.slice();return l[7]=e[t],l}function Nt(n,e){let t,l=e[7].user.displayName+"",o,r;return{key:n,first:null,c(){t=b("option"),o=X(l),t.__value=r=e[7].user.userId,ae(t,t.__value),m(t,"class","dark:bg-slate-900"),this.first=t},m(i,a){y(i,t,a),k(t,o)},p(i,a){e=i,a&2&&l!==(l=e[7].user.displayName+"")&&ue(o,l),a&2&&r!==(r=e[7].user.userId)&&(t.__value=r,ae(t,t.__value))},d(i){i&&w(t)}}}function ws(n){let e,t,l=[],o=new Map,r,i,a,u,c,d,f,_,g,p=le(n[1]);const $=h=>h[7].user.userId;for(let h=0;hn[4].call(e)),m(a,"class","mx-auto mr-2 rounded-lg bg-blue-500 p-2 font-bold text-black duration-200 hover:opacity-75"),m(c,"class","mx-auto rounded-lg border-2 border-blue-500 p-2 font-bold duration-200 hover:opacity-75"),c.disabled=f=!n[0].selected.user_id,m(i,"class","mt-5 flex")},m(h,S){y(h,e,S),k(e,t);for(let L=0;Lt(1,o=d)),ce(n,i,d=>t(0,l=d));function a(){l.selected.user_id=at(this),i.set(l)}return[l,o,r,i,a,()=>{const{origin:d,redirect:f,clientid:_}=C.env;pe.openLoginWindow(d,f,_)},async()=>{l.selected.user_id&&(await V.logout(l.selected.user_id),V.saveCredentials())}]}class vs extends ie{constructor(e){super(),re(this,e,ys,ws,se,{})}}function $s(n,{callback:e,ignore:t=[]}){const l=o=>{const r=t.some(i=>i.contains(o.target));n&&!n.contains(o.target)&&!o.defaultPrevented&&!r&&e()};return document.addEventListener("click",l,!0),document.addEventListener("contextmenu",l,!0),{destroy(){document.removeEventListener("click",l,!0),document.removeEventListener("contextmenu",l,!0)}}}const Ss=n=>({}),Mt=n=>({});function jt(n){let e,t,l,o,r,i;const a=n[9].content,u=Ve(a,n,n[8],Mt);return{c(){e=b("div"),u&&u.c(),m(e,"class",t="dropdown-color absolute z-20 rounded-lg border-2 "+n[1]+" "+n[2]+" svelte-xifudk")},m(c,d){y(c,e,d),u&&u.m(e,null),o=!0,r||(i=Qt(l=$s.call(null,e,{callback:n[3],ignore:[n[5]]})),r=!0)},p(c,d){u&&u.p&&(!o||d&256)&&Ye(u,a,c,c[8],o?ze(a,c[8],d,Ss):Ze(c[8]),Mt),(!o||d&6&&t!==(t="dropdown-color absolute z-20 rounded-lg border-2 "+c[1]+" "+c[2]+" svelte-xifudk"))&&m(e,"class",t),l&&We(l.update)&&d&32&&l.update.call(null,{callback:c[3],ignore:[c[5]]})},i(c){o||(j(u,c),o=!0)},o(c){B(u,c),o=!1},d(c){c&&w(e),u&&u.d(c),r=!1,i()}}}function Ls(n){let e,t,l,o,r,i,a;const u=n[9].default,c=Ve(u,n,n[8],null);let d=n[4]&&jt(n);return{c(){e=b("div"),t=b("button"),c&&c.c(),l=R(),d&&d.c(),m(e,"class",o="relative h-fit w-fit "+n[0]+" svelte-xifudk")},m(f,_){y(f,e,_),k(e,t),c&&c.m(t,null),n[10](t),k(e,l),d&&d.m(e,null),r=!0,i||(a=U(t,"click",n[6]),i=!0)},p(f,[_]){c&&c.p&&(!r||_&256)&&Ye(c,u,f,f[8],r?ze(u,f[8],_,null):Ze(f[8]),null),f[4]?d?(d.p(f,_),_&16&&j(d,1)):(d=jt(f),d.c(),j(d,1),d.m(e,null)):d&&(Ae(),B(d,1,1,()=>{d=null}),De()),(!r||_&1&&o!==(o="relative h-fit w-fit "+f[0]+" svelte-xifudk"))&&m(e,"class",o)},i(f){r||(j(c,f),j(d),r=!0)},o(f){B(c,f),B(d),r=!1},d(f){f&&w(e),c&&c.d(f),n[10](null),d&&d.d(),i=!1,a()}}}function Cs(n,e,t){let{$$slots:l={},$$scope:o}=e,{class:r=""}=e,{position:i="bottom"}=e,{align:a="start"}=e,u=!1,c;function d(){t(4,u=!0)}function f(){t(4,u=!1)}function _(){u?f():d()}function g(p){ge[p?"unshift":"push"](()=>{c=p,t(5,c)})}return n.$$set=p=>{"class"in p&&t(0,r=p.class),"position"in p&&t(1,i=p.position),"align"in p&&t(2,a=p.align),"$$scope"in p&&t(8,o=p.$$scope)},[r,i,a,f,u,c,_,d,o,l,g]}class Rs extends ie{constructor(e){super(),re(this,e,Cs,Ls,se,{class:0,position:1,align:2,open:7,close:3})}get open(){return this.$$.ctx[7]}get close(){return this.$$.ctx[3]}}function Ts(n){let e,t,l,o,r,i,a,u,c,d,f,_,g;return{c(){e=b("button"),e.innerHTML=`
Browse app data Browse App Data
`,t=R(),l=b("div"),o=b("label"),o.textContent="Check game announcements:",r=R(),i=b("input"),a=R(),u=b("div"),c=b("label"),c.textContent="Close Bolt after launching a game:",d=R(),f=b("input"),m(e,"id","data_dir_button"),m(e,"class","p-2 hover:opacity-75"),m(o,"for","check_announcements"),m(i,"id","check_announcements"),m(i,"type","checkbox"),m(i,"class","ml-2"),m(l,"class","mx-auto p-2"),m(c,"for","close_after_launch"),m(f,"id","close_after_launch"),m(f,"type","checkbox"),m(f,"class","ml-2"),m(u,"class","mx-auto p-2")},m(p,$){y(p,e,$),y(p,t,$),y(p,l,$),k(l,o),k(l,r),k(l,i),i.checked=n[0].check_announcements,y(p,a,$),y(p,u,$),k(u,c),k(u,d),k(u,f),f.checked=n[0].close_after_launch,_||(g=[U(e,"click",n[3]),U(i,"change",n[4]),U(f,"change",n[5])],_=!0)},p(p,[$]){$&1&&(i.checked=p[0].check_announcements),$&1&&(f.checked=p[0].close_after_launch)},i:M,o:M,d(p){p&&(w(e),w(t),w(l),w(a),w(u)),_=!1,oe(g)}}}function xs(n,e,t){let l;function o(){var c=new XMLHttpRequest;c.open("GET","/browse-data"),c.onreadystatechange=()=>{c.readyState==4&&P.info(`Browse status: '${c.responseText.trim()}'`)},c.send()}const{config:r}=q;ce(n,r,c=>t(0,l=c));const i=()=>{o()};function a(){l.check_announcements=this.checked,r.set(l)}function u(){l.close_after_launch=this.checked,r.set(l)}return[l,o,r,i,a,u]}class Ps extends ie{constructor(e){super(),re(this,e,xs,Ts,se,{})}}function Hs(n){let e,t,l,o,r,i,a,u,c,d,f,_,g,p,$,h,S,L,N;return{c(){var I,T;e=b("button"),t=b("div"),t.innerHTML=`Configure RuneLite - Configure RuneLite`,o=R(),r=b("div"),i=b("label"),i.textContent="Use custom RuneLite JAR:",a=R(),u=b("input"),c=R(),d=b("div"),f=b("textarea"),g=R(),p=b("br"),$=R(),h=b("button"),S=X("Select File"),m(t,"class","flex"),e.disabled=l=!((I=n[0])!=null&&I.session_id)||!((T=n[3])!=null&&T.accountId),m(e,"class","p-2 pb-5 hover:opacity-75"),m(i,"for","use_custom_jar"),m(u,"id","use_custom_jar"),m(u,"type","checkbox"),m(u,"class","ml-2"),m(r,"class","mx-auto border-t-2 border-slate-300 p-2 pt-5 dark:border-slate-800"),m(f,"class","h-10 rounded border-2 border-slate-300 bg-slate-100 text-slate-950 dark:border-slate-800 dark:bg-slate-900 dark:text-slate-50"),f.disabled=_=!n[1].runelite_use_custom_jar,m(h,"class","mt-1 rounded-lg border-2 border-blue-500 p-1 duration-200 hover:opacity-75"),h.disabled=n[2],m(d,"class","mx-auto p-2"),Q(d,"opacity-25",!n[1].runelite_use_custom_jar)},m(I,T){y(I,e,T),k(e,t),y(I,o,T),y(I,r,T),k(r,i),k(r,a),k(r,u),u.checked=n[1].runelite_use_custom_jar,y(I,c,T),y(I,d,T),k(d,f),ae(f,n[1].runelite_custom_jar),k(d,g),k(d,p),k(d,$),k(d,h),k(h,S),L||(N=[U(e,"click",n[7]),U(u,"change",n[8]),U(f,"input",n[9]),U(h,"click",n[10])],L=!0)},p(I,[T]){var A,E;T&9&&l!==(l=!((A=I[0])!=null&&A.session_id)||!((E=I[3])!=null&&E.accountId))&&(e.disabled=l),T&2&&(u.checked=I[1].runelite_use_custom_jar),T&2&&_!==(_=!I[1].runelite_use_custom_jar)&&(f.disabled=_),T&2&&ae(f,I[1].runelite_custom_jar),T&4&&(h.disabled=I[2]),T&2&&Q(d,"opacity-25",!I[1].runelite_use_custom_jar)},i:M,o:M,d(I){I&&(w(e),w(o),w(r),w(c),w(d)),L=!1,oe(N)}}}function Is(n,e,t){let l,o,r;const{config:i}=q;ce(n,i,p=>t(1,r=p));let a=!1;async function u(){t(2,a=!0),he(i,r.runelite_custom_jar=await V.openFilePicker(),r),console.log("done picking"),t(2,a=!1)}function c(){!(l!=null&&l.session_id)||!(o!=null&&o.accountId)||!(o!=null&&o.displayName)||Jt(l.session_id,o.accountId,o.displayName,!0)}const d=()=>c();function f(){r.runelite_use_custom_jar=this.checked,i.set(r)}function _(){r.runelite_custom_jar=this.value,i.set(r)}const g=()=>{u()};return n.$$.update=()=>{var p;n.$$.dirty&2&&t(0,l=V.findSession(r.selected.user_id)),n.$$.dirty&3&&t(3,o=V.findAccount((l==null?void 0:l.accounts)??[],(p=r.userDetails[r.selected.user_id??""])==null?void 0:p.account_id))},[l,r,a,o,i,u,c,d,f,_,g]}class Os extends ie{constructor(e){super(),re(this,e,Is,Hs,se,{})}}function Es(n){let e,t,l,o,r,i;return{c(){e=b("div"),t=b("label"),t.textContent="Enable Bolt plugin loader:",l=R(),o=b("input"),m(t,"for","enable_plugins"),m(o,"type","checkbox"),m(o,"name","enable_plugins"),m(o,"id","enable_plugins"),m(o,"class","ml-2"),m(e,"class","mx-auto p-2")},m(a,u){y(a,e,u),k(e,t),k(e,l),k(e,o),o.checked=n[0].rs_plugin_loader,r||(i=U(o,"change",n[2]),r=!0)},p(a,u){u&1&&(o.checked=a[0].rs_plugin_loader)},d(a){a&&w(e),r=!1,i()}}}function Us(n){let e,t,l,o,r,i,a,u,c,d,f,_=C.hasBoltPlugins&&Es(n);return{c(){_&&_.c(),e=R(),t=b("div"),l=b("label"),l.textContent="Use custom config URI:",o=R(),r=b("input"),i=R(),a=b("div"),u=b("textarea"),m(l,"for","use_custom_uri"),m(r,"id","use_custom_uri"),m(r,"type","checkbox"),m(r,"class","ml-2"),m(t,"class","mx-auto p-2"),m(u,"class","rounded border-2 border-slate-300 bg-slate-100 text-slate-950 disabled:opacity-50 dark:border-slate-800 dark:bg-slate-900 dark:text-slate-50"),u.disabled=c=!n[0].use_custom_rs_config_uri,m(u,"rows","4"),m(u,"placeholder",C.env.default_config_uri),m(a,"class","p-2")},m(g,p){_&&_.m(g,p),y(g,e,p),y(g,t,p),k(t,l),k(t,o),k(t,r),r.checked=n[0].use_custom_rs_config_uri,y(g,i,p),y(g,a,p),k(a,u),ae(u,n[0].rs_config_uri),d||(f=[U(r,"change",n[3]),U(u,"input",n[4])],d=!0)},p(g,[p]){C.hasBoltPlugins&&_.p(g,p),p&1&&(r.checked=g[0].use_custom_rs_config_uri),p&1&&c!==(c=!g[0].use_custom_rs_config_uri)&&(u.disabled=c),p&1&&ae(u,g[0].rs_config_uri)},i:M,o:M,d(g){g&&(w(e),w(t),w(i),w(a)),_&&_.d(g),d=!1,oe(f)}}}function Ns(n,e,t){let l;const{config:o}=q;ce(n,o,u=>t(0,l=u));function r(){l.rs_plugin_loader=this.checked,o.set(l)}function i(){l.use_custom_rs_config_uri=this.checked,o.set(l)}function a(){l.rs_config_uri=this.value,o.set(l)}return[l,o,r,i,a]}class Ms extends ie{constructor(e){super(),re(this,e,Ns,Us,se,{})}}function js(n){let e,t;return e=new Ms({}),{c(){ee(e.$$.fragment)},m(l,o){Y(e,l,o),t=!0},i(l){t||(j(e.$$.fragment,l),t=!0)},o(l){B(e.$$.fragment,l),t=!1},d(l){Z(e,l)}}}function As(n){let e,t;return e=new Os({}),{c(){ee(e.$$.fragment)},m(l,o){Y(e,l,o),t=!0},i(l){t||(j(e.$$.fragment,l),t=!0)},o(l){B(e.$$.fragment,l),t=!1},d(l){Z(e,l)}}}function Ds(n){let e,t;return e=new Ps({}),{c(){ee(e.$$.fragment)},m(l,o){Y(e,l,o),t=!0},i(l){t||(j(e.$$.fragment,l),t=!0)},o(l){B(e.$$.fragment,l),t=!1},d(l){Z(e,l)}}}function qs(n){let e,t,l,o,r,i,a,u,c,d,f,_,g,p,$,h,S,L,N,I;const T=[Ds,As,js],A=[];function E(v,x){return v[1]==v[2].general?0:v[1]==v[2].osrs?1:v[1]==v[2].rs3?2:-1}return~(h=E(n))&&(S=A[h]=T[h](n)),{c(){e=b("div"),t=b("div"),l=b("button"),o=X("General"),i=R(),a=b("button"),u=X("OSRS"),d=R(),f=b("button"),_=X("RS3"),p=R(),$=b("div"),S&&S.c(),m(l,"class",r=n[1]===n[2].general?Le:Ce),m(a,"class",c=n[1]===n[2].osrs?Le:Ce),m(f,"class",g=n[1]===n[2].rs3?Le:Ce),m(t,"class","flex flex-col items-center gap-2 border-r-2 border-slate-300 pt-10 dark:border-slate-800"),m($,"class","col-span-3 p-5 pt-10 text-center"),m(e,"class","grid h-full grid-cols-4")},m(v,x){y(v,e,x),k(e,t),k(t,l),k(l,o),k(t,i),k(t,a),k(a,u),k(t,d),k(t,f),k(f,_),k(e,p),k(e,$),~h&&A[h].m($,null),L=!0,N||(I=[U(l,"click",n[4]),U(a,"click",n[5]),U(f,"click",n[6])],N=!0)},p(v,x){(!L||x&2&&r!==(r=v[1]===v[2].general?Le:Ce))&&m(l,"class",r),(!L||x&2&&c!==(c=v[1]===v[2].osrs?Le:Ce))&&m(a,"class",c),(!L||x&2&&g!==(g=v[1]===v[2].rs3?Le:Ce))&&m(f,"class",g);let G=h;h=E(v),h!==G&&(S&&(Ae(),B(A[G],1,1,()=>{A[G]=null}),De()),~h?(S=A[h],S||(S=A[h]=T[h](v),S.c()),j(S,1),S.m($,null)):S=null)},i(v){L||(j(S),L=!0)},o(v){B(S),L=!1},d(v){v&&w(e),~h&&A[h].d(),N=!1,oe(I)}}}function Bs(n){let e,t,l={class:"h-3/4 w-3/4 select-none",$$slots:{default:[qs]},$$scope:{ctx:n}};return e=new Qe({props:l}),n[7](e),{c(){ee(e.$$.fragment)},m(o,r){Y(e,o,r),t=!0},p(o,[r]){const i={};r&258&&(i.$$scope={dirty:r,ctx:o}),e.$set(i)},i(o){t||(j(e.$$.fragment,o),t=!0)},o(o){B(e.$$.fragment,o),t=!1},d(o){n[7](null),Z(e,o)}}}let Le="border-2 border-blue-500 bg-blue-500 hover:opacity-75 font-bold text-black duration-200 rounded-lg p-1 w-3/4",Ce="border-2 border-blue-500 hover:opacity-75 duration-200 rounded-lg p-1 w-3/4";function Gs(n,e,t){let l;function o(){l.open()}var r=(f=>(f[f.general=0]="general",f[f.osrs=1]="osrs",f[f.rs3=2]="rs3",f))(r||{});let i=1;const a=()=>{t(1,i=r.general)},u=()=>{t(1,i=r.osrs)},c=()=>{t(1,i=r.rs3)};function d(f){ge[f?"unshift":"push"](()=>{l=f,t(0,l)})}return[l,i,r,o,a,u,c,d]}class Fs extends ie{constructor(e){super(),re(this,e,Gs,Bs,se,{open:3})}get open(){return this.$$.ctx[3]}}function Xs(n){const e=n.slice(),t=V.findSession(e[1].selected.user_id??"");return e[11]=t,e}function Js(n){let e,t,l;return{c(){e=b("button"),e.textContent="Login",m(e,"class","h-11 w-48 rounded-lg border-2 border-slate-300 bg-inherit p-2 text-center font-bold text-black duration-200 hover:opacity-75 dark:border-slate-800 dark:text-slate-50")},m(o,r){y(o,e,r),t||(l=U(e,"click",n[10]),t=!0)},p:M,i:M,o:M,d(o){o&&w(e),t=!1,l()}}}function Ws(n){let e,t;return e=new Rs({props:{align:"center",$$slots:{content:[zs],default:[Vs]},$$scope:{ctx:n}}}),{c(){ee(e.$$.fragment)},m(l,o){Y(e,l,o),t=!0},p(l,o){const r={};o&4098&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(j(e.$$.fragment,l),t=!0)},o(l){B(e.$$.fragment,l),t=!1},d(l){Z(e,l)}}}function Vs(n){var o;let e,t=(((o=n[11])==null?void 0:o.user.displayName)??"No user selected")+"",l;return{c(){e=b("button"),l=X(t),m(e,"class","h-11 w-48 rounded-lg border-2 border-slate-300 bg-inherit text-center font-bold text-black duration-200 hover:opacity-75 dark:border-slate-800 dark:text-slate-50")},m(r,i){y(r,e,i),k(e,l)},p(r,i){var a;i&2&&t!==(t=(((a=r[11])==null?void 0:a.user.displayName)??"No user selected")+"")&&ue(l,t)},d(r){r&&w(e)}}}function zs(n){let e,t,l;return t=new vs({}),{c(){e=b("div"),ee(t.$$.fragment),m(e,"slot","content"),m(e,"class","w-40")},m(o,r){y(o,e,r),Y(t,e,null),l=!0},p:M,i(o){l||(j(t.$$.fragment,o),l=!0)},o(o){B(t.$$.fragment,o),l=!1},d(o){o&&w(e),Z(t)}}}function Ys(n){let e,t,l,o,r,i,a,u,c,d,f,_,g,p,$,h,S,L,N={};e=new Fs({props:N}),n[5](e);const I=[Ws,Js],T=[];function A(v,x){return v[2].length>0?0:1}function E(v,x){return x===0?Xs(v):v}return p=A(n),$=T[p]=I[p](E(n,p)),{c(){ee(e.$$.fragment),t=R(),l=b("div"),o=b("div"),r=b("button"),r.textContent="RS3",i=R(),a=b("button"),a.textContent="OSRS",u=R(),c=b("div"),d=b("button"),d.innerHTML='Change Theme',f=R(),_=b("button"),_.innerHTML='Settings',g=R(),$.c(),m(r,"class","mx-1 w-20 rounded-lg border-2 border-blue-500 p-2 duration-200 hover:opacity-75"),Q(r,"text-black",n[1].selected.game===K.rs3),Q(r,"bg-blue-500",n[1].selected.game===K.rs3),m(a,"class","mx-1 w-20 rounded-lg border-2 border-blue-500 bg-blue-500 p-2 text-black duration-200 hover:opacity-75"),Q(a,"text-black",n[1].selected.game===K.osrs),Q(a,"bg-blue-500",n[1].selected.game===K.osrs),m(o,"class","m-3 ml-9 font-bold"),m(d,"class","h-10 w-10 rounded-full bg-blue-500 text-center duration-200 hover:rotate-45 hover:opacity-75"),m(_,"class","h-10 w-10 rounded-full bg-blue-500 text-center duration-200 hover:rotate-45 hover:opacity-75"),m(c,"class","m-2 ml-auto flex gap-2"),m(l,"class","fixed top-0 flex h-16 w-screen border-b-2 border-slate-300 bg-slate-100 duration-200 dark:border-slate-800 dark:bg-slate-900")},m(v,x){Y(e,v,x),y(v,t,x),y(v,l,x),k(l,o),k(o,r),k(o,i),k(o,a),k(l,u),k(l,c),k(c,d),k(c,f),k(c,_),k(c,g),T[p].m(c,null),h=!0,S||(L=[U(r,"click",n[6]),U(a,"click",n[7]),U(d,"click",n[8]),U(_,"click",n[9])],S=!0)},p(v,[x]){const G={};e.$set(G),(!h||x&2)&&Q(r,"text-black",v[1].selected.game===K.rs3),(!h||x&2)&&Q(r,"bg-blue-500",v[1].selected.game===K.rs3),(!h||x&2)&&Q(a,"text-black",v[1].selected.game===K.osrs),(!h||x&2)&&Q(a,"bg-blue-500",v[1].selected.game===K.osrs);let F=p;p=A(v),p===F?T[p].p(E(v,p),x):(Ae(),B(T[F],1,1,()=>{T[F]=null}),De(),$=T[p],$?$.p(E(v,p),x):($=T[p]=I[p](E(v,p)),$.c()),j($,1),$.m(c,null))},i(v){h||(j(e.$$.fragment,v),j($),h=!0)},o(v){B(e.$$.fragment,v),B($),h=!1},d(v){v&&(w(t),w(l)),n[5](null),Z(e,v),T[p].d(),S=!1,oe(L)}}}function Zs(n,e,t){let l,o;const{config:r,sessions:i}=q;ce(n,r,p=>t(1,l=p)),ce(n,i,p=>t(2,o=p));let a;function u(p){ge[p?"unshift":"push"](()=>{a=p,t(0,a)})}return[a,l,o,r,i,u,()=>{he(r,l.selected.game=K.rs3,l)},()=>{he(r,l.selected.game=K.osrs,l)},()=>he(r,l.use_dark_theme=!l.use_dark_theme,l),()=>a.open(),()=>{const{origin:p,redirect:$,clientid:h}=C.env;pe.openLoginWindow(p,$,h)}]}class Ks extends ie{constructor(e){super(),re(this,e,Zs,Ys,se,{})}}function Qs(n){let e,t,l,o,r,i,a,u,c,d,f,_,g;return e=new xn({}),l=new Ks({}),u=new hs({}),_=new ks({props:{logs:n[0]}}),{c(){ee(e.$$.fragment),t=R(),ee(l.$$.fragment),o=R(),r=b("div"),i=b("div"),a=R(),ee(u.$$.fragment),c=R(),d=b("div"),f=R(),ee(_.$$.fragment),m(r,"class","mt-16 grid h-full grid-flow-col grid-cols-3")},m(p,$){Y(e,p,$),y(p,t,$),Y(l,p,$),y(p,o,$),y(p,r,$),k(r,i),k(r,a),Y(u,r,null),k(r,c),k(r,d),y(p,f,$),Y(_,p,$),g=!0},p(p,$){const h={};$&1&&(h.logs=p[0]),_.$set(h)},i(p){g||(j(e.$$.fragment,p),j(l.$$.fragment,p),j(u.$$.fragment,p),j(_.$$.fragment,p),g=!0)},o(p){B(e.$$.fragment,p),B(l.$$.fragment,p),B(u.$$.fragment,p),B(_.$$.fragment,p),g=!1},d(p){p&&(w(t),w(o),w(r),w(f)),Z(e,p),Z(l,p),Z(u),Z(_,p)}}}function el(n){let e,t,l,o;return e=new Xt({props:{$$slots:{default:[Qs]},$$scope:{ctx:n}}}),{c(){ee(e.$$.fragment)},m(r,i){Y(e,r,i),t=!0,l||(o=U(window,"beforeunload",n[2]),l=!0)},p(r,[i]){const a={};i&9&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(j(e.$$.fragment,r),t=!0)},o(r){B(e.$$.fragment,r),t=!1},d(r){Z(e,r),l=!1,o()}}}function tl(n,e,t){let l;const o=P.logs;return ce(n,o,i=>t(0,l=i)),[l,o,()=>V.saveConfig()]}class nl extends ie{constructor(e){super(),re(this,e,tl,el,se,{})}}const At={target:document.getElementById("app")};window.opener||window.location.search.includes("&id_token")?new $n(At):(sl(),mn(),ll(),ol(),new nl(At));function sl(){const n=new URLSearchParams(window.location.search);C.platform=n.get("platform"),C.isFlathub=n.get("flathub")==="1",C.rs3DebInstalledHash=n.get("rs3_deb_installed_hash"),C.rs3ExeInstalledHash=n.get("rs3_exe_installed_hash"),C.rs3AppInstalledHash=n.get("rs3_app_installed_hash"),C.osrsExeInstalledHash=n.get("osrs_exe_installed_hash"),C.osrsAppInstalledHash=n.get("osrs_app_installed_hash"),C.runeLiteInstalledId=n.get("runelite_installed_id"),C.hdosInstalledVersion=n.get("hdos_installed_version");const e=n.get("plugins");if(C.hasBoltPlugins=e!==null,e!==null)try{C.pluginList=JSON.parse(e)}catch{P.error("Unable to parse plugin list")}const t=n.get("credentials");if(t)try{const l=JSON.parse(t),o=l.every(r=>typeof r.session_id=="string"&&typeof r.tokens=="object"&&typeof r.accounts=="object"&&typeof r.user=="object");o?q.sessions.set(l):(q.sessions.set([]),V.saveCredentials(),P.warn("Credentials saved on disk are out of date. Please sign in again.")),q.sessions.set(o?l:[])}catch{q.sessions.set([]),V.saveCredentials(),P.error("Unable to parse saved credentials. Please sign in again.")}}function ll(){const{origin:n,origin_2fa:e}=C.env,t=[window.location.origin,n,e];let l=null;window.addEventListener("message",async o=>{var r;if(!t.includes(o.origin)){P.info(`discarding window message from origin ${o.origin}`);return}switch(o.data.type){case"authTokenUpdate":{l=o.data.tokens;break}case"authSessionUpdate":{if(l===null)return P.error("auth is null. Please try again.");const i=o.data.sessionId,a=await V.login(l,i);a.ok?P.info(`Added new user '${a.value.user.displayName}'`):P.error(`Unable to add new user. Please try again. ${a.error}`),V.saveCredentials(),pe.pendingLoginWindow=null,l=null;break}case"authFailed":{P.error(`Unable to authenticate: ${o.data.reason}`),pe.pendingLoginWindow=null,l=null;break}case"externalUrl":{const i=new XMLHttpRequest;i.onreadystatechange=()=>{i.readyState==4&&P.info(`External URL status: '${i.responseText.trim()}'`)},i.open("POST","/open-external-url",!0),i.send(o.data.url);break}case"gameClientList":fe(q.config).close_after_launch&&o.data.clients.length>fe(it).length?window.close():it.set(o.data.clients);break;default:{const i=((r=o.data)==null?void 0:r.type)??"no type provided";P.info(`Unknown message type: ${i}`);break}}})}async function ol(){const n=fe(q.sessions),e=[];for(const t of n){const l=await pe.refreshOAuthToken(t.tokens);if(!l.ok){l.error===0?P.error(`Unable to verify saved login, status: ${l.error}. Do you have an internet connection? Please relaunch Bolt to try again.`):(P.error(`Discarding expired login, status: ${l.error}. Please sign in again.`),e.push(t.tokens.sub));continue}const o=l.value;t.tokens=o;const r=await V.login(o,t.session_id);r.ok?P.info(`Signed into saved user '${r.value.user.displayName}'`):(P.error(`Unable to sign into saved user '${t.user.displayName}' - please sign in again. ${r.error}`),e.push(t.tokens.sub))}e.forEach(t=>{V.logout(t)}),q.sessions.set(n),V.saveCredentials()} + Configure RuneLite`,o=R(),r=b("div"),i=b("label"),i.textContent="Use custom RuneLite JAR:",a=R(),u=b("input"),c=R(),d=b("div"),f=b("textarea"),g=R(),p=b("br"),$=R(),h=b("button"),S=X("Select File"),m(t,"class","flex"),e.disabled=l=!((I=n[0])!=null&&I.session_id)||!((T=n[3])!=null&&T.accountId),m(e,"class","p-2 pb-5 hover:opacity-75"),m(i,"for","use_custom_jar"),m(u,"id","use_custom_jar"),m(u,"type","checkbox"),m(u,"class","ml-2"),m(r,"class","mx-auto border-t-2 border-slate-300 p-2 pt-5 dark:border-slate-800"),m(f,"class","h-10 rounded border-2 border-slate-300 bg-slate-100 text-slate-950 dark:border-slate-800 dark:bg-slate-900 dark:text-slate-50"),f.disabled=_=!n[1].runelite_use_custom_jar,m(h,"class","mt-1 rounded-lg border-2 border-blue-500 p-1 duration-200 hover:opacity-75"),h.disabled=n[2],m(d,"class","mx-auto p-2"),Q(d,"opacity-25",!n[1].runelite_use_custom_jar)},m(I,T){y(I,e,T),k(e,t),y(I,o,T),y(I,r,T),k(r,i),k(r,a),k(r,u),u.checked=n[1].runelite_use_custom_jar,y(I,c,T),y(I,d,T),k(d,f),ae(f,n[1].runelite_custom_jar),k(d,g),k(d,p),k(d,$),k(d,h),k(h,S),L||(N=[U(e,"click",n[7]),U(u,"change",n[8]),U(f,"input",n[9]),U(h,"click",n[10])],L=!0)},p(I,[T]){var A,E;T&9&&l!==(l=!((A=I[0])!=null&&A.session_id)||!((E=I[3])!=null&&E.accountId))&&(e.disabled=l),T&2&&(u.checked=I[1].runelite_use_custom_jar),T&2&&_!==(_=!I[1].runelite_use_custom_jar)&&(f.disabled=_),T&2&&ae(f,I[1].runelite_custom_jar),T&4&&(h.disabled=I[2]),T&2&&Q(d,"opacity-25",!I[1].runelite_use_custom_jar)},i:M,o:M,d(I){I&&(w(e),w(o),w(r),w(c),w(d)),L=!1,oe(N)}}}function Is(n,e,t){let l,o,r;const{config:i}=q;ce(n,i,p=>t(1,r=p));let a=!1;async function u(){t(2,a=!0),he(i,r.runelite_custom_jar=await V.openFilePicker(),r),console.log("done picking"),t(2,a=!1)}function c(){!(l!=null&&l.session_id)||!(o!=null&&o.accountId)||!(o!=null&&o.displayName)||Jt(l.session_id,o.accountId,o.displayName,!0)}const d=()=>c();function f(){r.runelite_use_custom_jar=this.checked,i.set(r)}function _(){r.runelite_custom_jar=this.value,i.set(r)}const g=()=>{u()};return n.$$.update=()=>{var p;n.$$.dirty&2&&t(0,l=V.findSession(r.selected.user_id)),n.$$.dirty&3&&t(3,o=V.findAccount((l==null?void 0:l.accounts)??[],(p=r.userDetails[r.selected.user_id??""])==null?void 0:p.account_id))},[l,r,a,o,i,u,c,d,f,_,g]}class Os extends ie{constructor(e){super(),re(this,e,Is,Hs,se,{})}}function Es(n){let e,t,l,o,r,i;return{c(){e=b("div"),t=b("label"),t.textContent="Enable Bolt plugin loader:",l=R(),o=b("input"),m(t,"for","enable_plugins"),m(o,"type","checkbox"),m(o,"name","enable_plugins"),m(o,"id","enable_plugins"),m(o,"class","ml-2"),m(e,"class","mx-auto p-2")},m(a,u){y(a,e,u),k(e,t),k(e,l),k(e,o),o.checked=n[0].rs_plugin_loader,r||(i=U(o,"change",n[2]),r=!0)},p(a,u){u&1&&(o.checked=a[0].rs_plugin_loader)},d(a){a&&w(e),r=!1,i()}}}function Us(n){let e,t,l,o,r,i,a,u,c,d,f,_=C.hasBoltPlugins&&Es(n);return{c(){_&&_.c(),e=R(),t=b("div"),l=b("label"),l.textContent="Use custom config URI:",o=R(),r=b("input"),i=R(),a=b("div"),u=b("textarea"),m(l,"for","use_custom_uri"),m(r,"id","use_custom_uri"),m(r,"type","checkbox"),m(r,"class","ml-2"),m(t,"class","mx-auto p-2"),m(u,"class","rounded border-2 border-slate-300 bg-slate-100 text-slate-950 disabled:opacity-50 dark:border-slate-800 dark:bg-slate-900 dark:text-slate-50"),u.disabled=c=!n[0].use_custom_rs_config_uri,m(u,"rows","4"),m(u,"placeholder",C.env.default_config_uri),m(a,"class","p-2")},m(g,p){_&&_.m(g,p),y(g,e,p),y(g,t,p),k(t,l),k(t,o),k(t,r),r.checked=n[0].use_custom_rs_config_uri,y(g,i,p),y(g,a,p),k(a,u),ae(u,n[0].rs_config_uri),d||(f=[U(r,"change",n[3]),U(u,"input",n[4])],d=!0)},p(g,[p]){C.hasBoltPlugins&&_.p(g,p),p&1&&(r.checked=g[0].use_custom_rs_config_uri),p&1&&c!==(c=!g[0].use_custom_rs_config_uri)&&(u.disabled=c),p&1&&ae(u,g[0].rs_config_uri)},i:M,o:M,d(g){g&&(w(e),w(t),w(i),w(a)),_&&_.d(g),d=!1,oe(f)}}}function Ns(n,e,t){let l;const{config:o}=q;ce(n,o,u=>t(0,l=u));function r(){l.rs_plugin_loader=this.checked,o.set(l)}function i(){l.use_custom_rs_config_uri=this.checked,o.set(l)}function a(){l.rs_config_uri=this.value,o.set(l)}return[l,o,r,i,a]}class Ms extends ie{constructor(e){super(),re(this,e,Ns,Us,se,{})}}function js(n){let e,t;return e=new Ms({}),{c(){ee(e.$$.fragment)},m(l,o){Y(e,l,o),t=!0},i(l){t||(j(e.$$.fragment,l),t=!0)},o(l){B(e.$$.fragment,l),t=!1},d(l){Z(e,l)}}}function As(n){let e,t;return e=new Os({}),{c(){ee(e.$$.fragment)},m(l,o){Y(e,l,o),t=!0},i(l){t||(j(e.$$.fragment,l),t=!0)},o(l){B(e.$$.fragment,l),t=!1},d(l){Z(e,l)}}}function Ds(n){let e,t;return e=new Ps({}),{c(){ee(e.$$.fragment)},m(l,o){Y(e,l,o),t=!0},i(l){t||(j(e.$$.fragment,l),t=!0)},o(l){B(e.$$.fragment,l),t=!1},d(l){Z(e,l)}}}function qs(n){let e,t,l,o,r,i,a,u,c,d,f,_,g,p,$,h,S,L,N,I;const T=[Ds,As,js],A=[];function E(v,x){return v[1]==v[2].general?0:v[1]==v[2].osrs?1:v[1]==v[2].rs3?2:-1}return~(h=E(n))&&(S=A[h]=T[h](n)),{c(){e=b("div"),t=b("div"),l=b("button"),o=X("General"),i=R(),a=b("button"),u=X("OSRS"),d=R(),f=b("button"),_=X("RS3"),p=R(),$=b("div"),S&&S.c(),m(l,"class",r=n[1]===n[2].general?Le:Ce),m(a,"class",c=n[1]===n[2].osrs?Le:Ce),m(f,"class",g=n[1]===n[2].rs3?Le:Ce),m(t,"class","flex flex-col items-center gap-2 border-r-2 border-slate-300 pt-10 dark:border-slate-800"),m($,"class","col-span-3 p-5 pt-10 text-center"),m(e,"class","grid h-full grid-cols-4")},m(v,x){y(v,e,x),k(e,t),k(t,l),k(l,o),k(t,i),k(t,a),k(a,u),k(t,d),k(t,f),k(f,_),k(e,p),k(e,$),~h&&A[h].m($,null),L=!0,N||(I=[U(l,"click",n[4]),U(a,"click",n[5]),U(f,"click",n[6])],N=!0)},p(v,x){(!L||x&2&&r!==(r=v[1]===v[2].general?Le:Ce))&&m(l,"class",r),(!L||x&2&&c!==(c=v[1]===v[2].osrs?Le:Ce))&&m(a,"class",c),(!L||x&2&&g!==(g=v[1]===v[2].rs3?Le:Ce))&&m(f,"class",g);let G=h;h=E(v),h!==G&&(S&&(Ae(),B(A[G],1,1,()=>{A[G]=null}),De()),~h?(S=A[h],S||(S=A[h]=T[h](v),S.c()),j(S,1),S.m($,null)):S=null)},i(v){L||(j(S),L=!0)},o(v){B(S),L=!1},d(v){v&&w(e),~h&&A[h].d(),N=!1,oe(I)}}}function Bs(n){let e,t,l={class:"h-3/4 w-3/4 select-none",$$slots:{default:[qs]},$$scope:{ctx:n}};return e=new Qe({props:l}),n[7](e),{c(){ee(e.$$.fragment)},m(o,r){Y(e,o,r),t=!0},p(o,[r]){const i={};r&258&&(i.$$scope={dirty:r,ctx:o}),e.$set(i)},i(o){t||(j(e.$$.fragment,o),t=!0)},o(o){B(e.$$.fragment,o),t=!1},d(o){n[7](null),Z(e,o)}}}let Le="border-2 border-blue-500 bg-blue-500 hover:opacity-75 font-bold text-black duration-200 rounded-lg p-1 w-3/4",Ce="border-2 border-blue-500 hover:opacity-75 duration-200 rounded-lg p-1 w-3/4";function Gs(n,e,t){let l;function o(){l.open()}var r=(f=>(f[f.general=0]="general",f[f.osrs=1]="osrs",f[f.rs3=2]="rs3",f))(r||{});let i=0;const a=()=>{t(1,i=r.general)},u=()=>{t(1,i=r.osrs)},c=()=>{t(1,i=r.rs3)};function d(f){ge[f?"unshift":"push"](()=>{l=f,t(0,l)})}return[l,i,r,o,a,u,c,d]}class Fs extends ie{constructor(e){super(),re(this,e,Gs,Bs,se,{open:3})}get open(){return this.$$.ctx[3]}}function Xs(n){const e=n.slice(),t=V.findSession(e[1].selected.user_id??"");return e[11]=t,e}function Js(n){let e,t,l;return{c(){e=b("button"),e.textContent="Login",m(e,"class","h-11 w-48 rounded-lg border-2 border-slate-300 bg-inherit p-2 text-center font-bold text-black duration-200 hover:opacity-75 dark:border-slate-800 dark:text-slate-50")},m(o,r){y(o,e,r),t||(l=U(e,"click",n[10]),t=!0)},p:M,i:M,o:M,d(o){o&&w(e),t=!1,l()}}}function Ws(n){let e,t;return e=new Rs({props:{align:"center",$$slots:{content:[zs],default:[Vs]},$$scope:{ctx:n}}}),{c(){ee(e.$$.fragment)},m(l,o){Y(e,l,o),t=!0},p(l,o){const r={};o&4098&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(j(e.$$.fragment,l),t=!0)},o(l){B(e.$$.fragment,l),t=!1},d(l){Z(e,l)}}}function Vs(n){var o;let e,t=(((o=n[11])==null?void 0:o.user.displayName)??"No user selected")+"",l;return{c(){e=b("button"),l=X(t),m(e,"class","h-11 w-48 rounded-lg border-2 border-slate-300 bg-inherit text-center font-bold text-black duration-200 hover:opacity-75 dark:border-slate-800 dark:text-slate-50")},m(r,i){y(r,e,i),k(e,l)},p(r,i){var a;i&2&&t!==(t=(((a=r[11])==null?void 0:a.user.displayName)??"No user selected")+"")&&ue(l,t)},d(r){r&&w(e)}}}function zs(n){let e,t,l;return t=new vs({}),{c(){e=b("div"),ee(t.$$.fragment),m(e,"slot","content"),m(e,"class","w-40")},m(o,r){y(o,e,r),Y(t,e,null),l=!0},p:M,i(o){l||(j(t.$$.fragment,o),l=!0)},o(o){B(t.$$.fragment,o),l=!1},d(o){o&&w(e),Z(t)}}}function Ys(n){let e,t,l,o,r,i,a,u,c,d,f,_,g,p,$,h,S,L,N={};e=new Fs({props:N}),n[5](e);const I=[Ws,Js],T=[];function A(v,x){return v[2].length>0?0:1}function E(v,x){return x===0?Xs(v):v}return p=A(n),$=T[p]=I[p](E(n,p)),{c(){ee(e.$$.fragment),t=R(),l=b("div"),o=b("div"),r=b("button"),r.textContent="RS3",i=R(),a=b("button"),a.textContent="OSRS",u=R(),c=b("div"),d=b("button"),d.innerHTML='Change Theme',f=R(),_=b("button"),_.innerHTML='Settings',g=R(),$.c(),m(r,"class","mx-1 w-20 rounded-lg border-2 border-blue-500 p-2 duration-200 hover:opacity-75"),Q(r,"text-black",n[1].selected.game===K.rs3),Q(r,"bg-blue-500",n[1].selected.game===K.rs3),m(a,"class","mx-1 w-20 rounded-lg border-2 border-blue-500 bg-blue-500 p-2 text-black duration-200 hover:opacity-75"),Q(a,"text-black",n[1].selected.game===K.osrs),Q(a,"bg-blue-500",n[1].selected.game===K.osrs),m(o,"class","m-3 ml-9 font-bold"),m(d,"class","h-10 w-10 rounded-full bg-blue-500 text-center duration-200 hover:rotate-45 hover:opacity-75"),m(_,"class","h-10 w-10 rounded-full bg-blue-500 text-center duration-200 hover:rotate-45 hover:opacity-75"),m(c,"class","m-2 ml-auto flex gap-2"),m(l,"class","fixed top-0 flex h-16 w-screen border-b-2 border-slate-300 bg-slate-100 duration-200 dark:border-slate-800 dark:bg-slate-900")},m(v,x){Y(e,v,x),y(v,t,x),y(v,l,x),k(l,o),k(o,r),k(o,i),k(o,a),k(l,u),k(l,c),k(c,d),k(c,f),k(c,_),k(c,g),T[p].m(c,null),h=!0,S||(L=[U(r,"click",n[6]),U(a,"click",n[7]),U(d,"click",n[8]),U(_,"click",n[9])],S=!0)},p(v,[x]){const G={};e.$set(G),(!h||x&2)&&Q(r,"text-black",v[1].selected.game===K.rs3),(!h||x&2)&&Q(r,"bg-blue-500",v[1].selected.game===K.rs3),(!h||x&2)&&Q(a,"text-black",v[1].selected.game===K.osrs),(!h||x&2)&&Q(a,"bg-blue-500",v[1].selected.game===K.osrs);let F=p;p=A(v),p===F?T[p].p(E(v,p),x):(Ae(),B(T[F],1,1,()=>{T[F]=null}),De(),$=T[p],$?$.p(E(v,p),x):($=T[p]=I[p](E(v,p)),$.c()),j($,1),$.m(c,null))},i(v){h||(j(e.$$.fragment,v),j($),h=!0)},o(v){B(e.$$.fragment,v),B($),h=!1},d(v){v&&(w(t),w(l)),n[5](null),Z(e,v),T[p].d(),S=!1,oe(L)}}}function Zs(n,e,t){let l,o;const{config:r,sessions:i}=q;ce(n,r,p=>t(1,l=p)),ce(n,i,p=>t(2,o=p));let a;function u(p){ge[p?"unshift":"push"](()=>{a=p,t(0,a)})}return[a,l,o,r,i,u,()=>{he(r,l.selected.game=K.rs3,l)},()=>{he(r,l.selected.game=K.osrs,l)},()=>he(r,l.use_dark_theme=!l.use_dark_theme,l),()=>a.open(),()=>{const{origin:p,redirect:$,clientid:h}=C.env;pe.openLoginWindow(p,$,h)}]}class Ks extends ie{constructor(e){super(),re(this,e,Zs,Ys,se,{})}}function Qs(n){let e,t,l,o,r,i,a,u,c,d,f,_,g;return e=new xn({}),l=new Ks({}),u=new hs({}),_=new ks({props:{logs:n[0]}}),{c(){ee(e.$$.fragment),t=R(),ee(l.$$.fragment),o=R(),r=b("div"),i=b("div"),a=R(),ee(u.$$.fragment),c=R(),d=b("div"),f=R(),ee(_.$$.fragment),m(r,"class","mt-16 grid h-full grid-flow-col grid-cols-3")},m(p,$){Y(e,p,$),y(p,t,$),Y(l,p,$),y(p,o,$),y(p,r,$),k(r,i),k(r,a),Y(u,r,null),k(r,c),k(r,d),y(p,f,$),Y(_,p,$),g=!0},p(p,$){const h={};$&1&&(h.logs=p[0]),_.$set(h)},i(p){g||(j(e.$$.fragment,p),j(l.$$.fragment,p),j(u.$$.fragment,p),j(_.$$.fragment,p),g=!0)},o(p){B(e.$$.fragment,p),B(l.$$.fragment,p),B(u.$$.fragment,p),B(_.$$.fragment,p),g=!1},d(p){p&&(w(t),w(o),w(r),w(f)),Z(e,p),Z(l,p),Z(u),Z(_,p)}}}function el(n){let e,t,l,o;return e=new Xt({props:{$$slots:{default:[Qs]},$$scope:{ctx:n}}}),{c(){ee(e.$$.fragment)},m(r,i){Y(e,r,i),t=!0,l||(o=U(window,"beforeunload",n[2]),l=!0)},p(r,[i]){const a={};i&9&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(j(e.$$.fragment,r),t=!0)},o(r){B(e.$$.fragment,r),t=!1},d(r){Z(e,r),l=!1,o()}}}function tl(n,e,t){let l;const o=P.logs;return ce(n,o,i=>t(0,l=i)),[l,o,()=>V.saveConfig()]}class nl extends ie{constructor(e){super(),re(this,e,tl,el,se,{})}}const At={target:document.getElementById("app")};window.opener||window.location.search.includes("&id_token")?new $n(At):(sl(),mn(),ll(),ol(),new nl(At));function sl(){const n=new URLSearchParams(window.location.search);C.platform=n.get("platform"),C.isFlathub=n.get("flathub")==="1",C.rs3DebInstalledHash=n.get("rs3_deb_installed_hash"),C.rs3ExeInstalledHash=n.get("rs3_exe_installed_hash"),C.rs3AppInstalledHash=n.get("rs3_app_installed_hash"),C.osrsExeInstalledHash=n.get("osrs_exe_installed_hash"),C.osrsAppInstalledHash=n.get("osrs_app_installed_hash"),C.runeLiteInstalledId=n.get("runelite_installed_id"),C.hdosInstalledVersion=n.get("hdos_installed_version");const e=n.get("plugins");if(C.hasBoltPlugins=e!==null,e!==null)try{C.pluginList=JSON.parse(e)}catch{P.error("Unable to parse plugin list")}const t=n.get("credentials");if(t)try{const l=JSON.parse(t),o=l.every(r=>typeof r.session_id=="string"&&typeof r.tokens=="object"&&typeof r.accounts=="object"&&typeof r.user=="object");o?q.sessions.set(l):(q.sessions.set([]),V.saveCredentials(),P.warn("Credentials saved on disk are out of date. Please sign in again.")),q.sessions.set(o?l:[])}catch{q.sessions.set([]),V.saveCredentials(),P.error("Unable to parse saved credentials. Please sign in again.")}}function ll(){const{origin:n,origin_2fa:e}=C.env,t=[window.location.origin,n,e];let l=null;window.addEventListener("message",async o=>{var r;if(!t.includes(o.origin)){P.info(`discarding window message from origin ${o.origin}`);return}switch(o.data.type){case"authTokenUpdate":{l=o.data.tokens;break}case"authSessionUpdate":{if(l===null)return P.error("auth is null. Please try again.");const i=o.data.sessionId,a=await V.login(l,i);a.ok?P.info(`Added new user '${a.value.user.displayName}'`):P.error(`Unable to add new user. Please try again. ${a.error}`),V.saveCredentials(),pe.pendingLoginWindow=null,l=null;break}case"authFailed":{P.error(`Unable to authenticate: ${o.data.reason}`),pe.pendingLoginWindow=null,l=null;break}case"externalUrl":{const i=new XMLHttpRequest;i.onreadystatechange=()=>{i.readyState==4&&P.info(`External URL status: '${i.responseText.trim()}'`)},i.open("POST","/open-external-url",!0),i.send(o.data.url);break}case"gameClientList":fe(q.config).close_after_launch&&o.data.clients.length>fe(it).length?window.close():it.set(o.data.clients);break;default:{const i=((r=o.data)==null?void 0:r.type)??"no type provided";P.info(`Unknown message type: ${i}`);break}}})}async function ol(){const n=fe(q.sessions),e=[];for(const t of n){const l=await pe.refreshOAuthToken(t.tokens);if(!l.ok){l.error===0?P.error(`Unable to verify saved login, status: ${l.error}. Do you have an internet connection? Please relaunch Bolt to try again.`):(P.error(`Discarding expired login, status: ${l.error}. Please sign in again.`),e.push(t.tokens.sub));continue}const o=l.value;t.tokens=o;const r=await V.login(o,t.session_id);r.ok?P.info(`Signed into saved user '${r.value.user.displayName}'`):(P.error(`Unable to sign into saved user '${t.user.displayName}' - please sign in again. ${r.error}`),e.push(t.tokens.sub))}e.forEach(t=>{V.logout(t)}),q.sessions.set(n),V.saveCredentials()} diff --git a/app/dist/index.html b/app/dist/index.html index ef51b3b5..b6cbd12c 100644 --- a/app/dist/index.html +++ b/app/dist/index.html @@ -4,7 +4,7 @@ Bolt Launcher - + diff --git a/app/src/lib/Components/SettingsModal.svelte b/app/src/lib/Components/SettingsModal.svelte index 8deeae6d..1c1f2dea 100644 --- a/app/src/lib/Components/SettingsModal.svelte +++ b/app/src/lib/Components/SettingsModal.svelte @@ -17,7 +17,7 @@ } // variables for swapping options and styling - let openTab: Tab = Tab.osrs; + let openTab: Tab = Tab.general; let activeClass = 'border-2 border-blue-500 bg-blue-500 hover:opacity-75 font-bold text-black duration-200 rounded-lg p-1 w-3/4'; let inactiveClass = 'border-2 border-blue-500 hover:opacity-75 duration-200 rounded-lg p-1 w-3/4';