From fe75098edb10afadd3c9e935a46297e80ec6740a Mon Sep 17 00:00:00 2001 From: mopsfl Date: Sun, 21 Jul 2024 22:13:23 +0200 Subject: [PATCH] dogshit ahh bug idk why it works now. didnt even change anythin --- dist/js/index.js | 2 +- dist/js/modules/Functions.js | 3 --- modules/Functions.ts | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/dist/js/index.js b/dist/js/index.js index 6b18488..817bd19 100644 --- a/dist/js/index.js +++ b/dist/js/index.js @@ -5,5 +5,5 @@ import{a as z,b as la}from"../chunk-ZIMNNZGL.js";var Ie=z(Y=>{"use strict";var s ]]${t?` -${t}`:""}`.replace(/^\s+/gm,"");break}}return n},EncodeRequestDataQuery(e){return encodeURIComponent(btoa(String.fromCharCode.apply(null,new Uint16Array(br.default.gzip(JSON.stringify(e))))))}}});var bi=z(Qe=>{"use strict";var ge=Qe&&Qe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qe,"__esModule",{value:!0});var K=ge(Ae()),le=ge(bi()),Je=ge(xt()),ia=ge(gi()),pr=ge(Ie()),wr=ge(pt()),mr=ge(Ve()),na=new Map;Qe.default={blockFunctionTrigger:!1,Init(){console.log("init functions");let e=$(".function-btn-template"),i=$(".function-category-title-template"),t=$(".sidebar-buttons");Object.keys(le.default.List).forEach(s=>{console.log(s);let l=le.default.List[s],f=i.contents().clone();f.text(s),f.appendTo(t),l.forEach(r=>{if(console.log(r),r.divider){let c=document.createElement("div");c.classList.add("seperator"),$(c).appendTo(t)}else{let c=e.contents().clone(),w=c.find("#function-icon"),u=c.find("#function-name"),d=c.get(1);u.text(r.name),w.text(r.icon_id),c.attr("data-tooltip",r.tooltip),c.attr("data-function",r.id),c.appendTo(t),na.set(r.id,{element:c,func:r})}})});let n=e.contents().clone(),o=n.find("#function-icon"),a=n.find("#function-name");n.addClass("modal-trigger"),n.attr("href","#settingsmodal"),a.text("Settings"),o.text("settings"),n.attr("data-function","settings"),n.appendTo(t),na.forEach((s,l,f)=>{s.element.on("click",async()=>{if(!le.default.List["Quick Actions"].find(r=>r.id===l)||s.func.quickActionsOverride){if(le.default.blockFunctionTrigger)return;le.default.blockFunctionTrigger=!0,K.default.ToggleLoading("Processing"),K.default.ToggleReadOnly(!0),await ia.default.new(l,btoa(String.fromCharCode.apply(null,new Uint16Array(wr.default.gzip(K.default.GetValue())))),Je.default.options,pr.default.GetKey(Je.default.settings.config.storage_key,"settings"),Je.default.clientSession).then(async r=>{if(r instanceof Response){let c=r.headers,w=c.get("uglifier-session"),u=c.get("uglifier-ms-time"),d="";r.ok?(d=await r.text(),Je.default.clientSession=w,console.log(`[Server] Uglification process took ${u}ms. (session: ${Je.default.clientSession})`),K.default.SetValue(d)):K.default.SetValue(ia.default.CreateResponseError("lua",`${r.statusText} - ${r.status}`,K.default.GetValue()))}}).catch(console.error).finally(()=>{K.default.ToggleLoading(),K.default.ToggleReadOnly(!1),le.default.blockFunctionTrigger=!1})}else le.default.QuickAction_Callbacks[l]&&le.default.QuickAction_Callbacks[l]()})})},List:{"Quick Actions":[{name:"Quick Uglify",id:"uglify",icon_id:"draw",tooltip:"Uglify your script with the default methods.",quickActionsOverride:!0},{name:"Virtualize",id:"virtualize",icon_id:"inventory",tooltip:"Virtualizes your script using IronBrew2 VM.

This function is currently using the luaobfuscator.com API, so the process might take a few seconds.",quickActionsOverride:!0},{name:"Minify",id:"minify",icon_id:"close_fullscreen",tooltip:"Minifies your script by renaming variables / globals and removing whitespaces.",quickActionsOverride:!0},{name:"Copy",id:"copy",icon_id:"content_copy",tooltip:"Copies the current editor script."},{name:"Clear",id:"clear",icon_id:"delete",tooltip:"Clears the editor input."},{name:"Download",id:"download",icon_id:"download",tooltip:"Downloads the current editor script."}],Functions:[{name:"Bytestrings",id:"bytestrings",icon_id:"tag",tooltip:`Encrypts string constants to encrypted byte strings using one key and bit32.bxor.

e.g.: 'Hello' = function("\\226\\207\\198\\198\\197")`},{name:"Numberstrings",id:"numberstrings",icon_id:"tag",tooltip:"Encodes string constants into number tables that will be decoded by a implemented function.

e.g.: 'Hello' = function({{176,4576,832}, {161,3381,2100}, ...})"},{divider:!0},{name:"NonSense Strings",id:"nonsensestrings",icon_id:"question_mark",tooltip:"Turns strings into random non sense.

e.g.: 'Hello World' = '?\u0192*/\u6DAE\u0432+%\u7649\u0446\u98F4'

EXPERIMENTAL - Might break the script"},{name:"Numbers",id:"transformnums",icon_id:"looks_one",tooltip:"Transforms numbers into binary expression.

e.g.: 100 = (369 - 169) / 2"},{name:"Number Combine",id:"numbercombine",icon_id:"merge_type",tooltip:"Combines all numeric literals into a single local declaration and then uses that and makes x-y thin something idk."},{name:"Booleans",id:"transformbooleans",icon_id:"check_box",tooltip:"Transforms all booleans into binary expressions.

e.g.: false = 100 < ( 100 - 5 )"},{name:"Functions",id:"functiontransform",icon_id:"functions",tooltip:'Puts all functions into a table and gets defined by an IndexExpression, to hide its name.
(not working when used _GLookup first)

e.g.: function x() print("69") end
x()
=
local a = {}
a["x"] = function() print("69") end

a["x"]()
'},{name:"Hex Numbers",id:"hexnumbers",icon_id:"looks_two",tooltip:"Transforms numbers into hex numbers.

e.g.: 100.123 = 0x64.1f7ced916874

(Decimal numbers do not work for LuaU)"},{divider:!0},{name:"solve binaryexp",id:"solveBinaryExp",icon_id:"bug_report",tooltip:"Solves all binary expressions.

e.g.: (69 / (10*2)) + 100 - 3.45 = 100"},{name:"Number Tables",id:"numbertable",icon_id:"data_object",tooltip:"Converts all numbers into tables containing random numbers.

e.g.: print(100) = print(table.concat({194+22})-table.concat({94+22}))

(might slow down the script)"},{name:"Bracket Numbers",id:"bracketnumbers",icon_id:"data_array",tooltip:"Puts all number into a random amount of brackets.

e.g.: 69 = ((((((69))))))"},{name:"Table Length",id:"tablelennumbers",icon_id:"table_chart",tooltip:"Transforms all numbers into tables, containing empty tables and using the length of
the base table. (does that make sense?)

e.g.: 5 = #{{},{},{},{},{}}

(might slow down the script)"},{divider:!0},{name:"Table Lookup",id:"tablelookup",icon_id:"data_object",tooltip:'Turns all member expression identifiers into an index expression, aka a table lookup.

e.g.: math.randomseed(69) = math["randomseed"](69)
or
e.g.: { index: ... } = { ["index"]: ... }
or
e.g.: x:gsub(y, z) = x["gsub"](x, y, z)'},{name:"_G Lookup",id:"glookup",icon_id:"g_mobiledata",tooltip:"Makes all global variables get called by _G, wich will hide
the actual variable / function, that's being called.

e.g.: math.randomseed(69) = _G[...][...](69)

(Currently only works with max. 2 index expressions)"},{name:"AnononymDecls",id:"anonymousdeclarations",icon_id:"functions",tooltip:"Transforms and anonymizes function declarations by using string-based keys and table lookups.

e.g.: function x.y(a, b) return a,b end = x['y'] = function(self, a, b) return self,a,b end

EXPERIMENTAL - Might break the script"},{name:"GlobalsToLocals",id:"globals_to_locals",icon_id:"transform",tooltip:"Turns all global usages into local declarations or puts all globals into a table.

e.g.: print(math.random(1, 5))
=
local _random = math.random
local _print = print

_print(_random(1, 5))


EXPERIMENTAL - Might break the script"},{divider:!0}],"Tester Functions":[{name:"Dead Code",id:"deadcode",icon_id:"code_off",tooltip:"Adds random dead code to your script.

e.g.: ...
abcdefg = (369 - 169) / 2
...
"},{name:"Constant Chunk",id:"constantchunk",icon_id:"feed",tooltip:"Converts all constants (strings, numbers, booleans) into some kind of bytecode? but not really

e.g.: ['Hello World', 69, true] = 'A115B7...22B74C'"},{name:"Identifiers",id:"renameidentifiers",icon_id:"fingerprint",tooltip:"Renames all identifiers to the smallest name possible.

e.g.: ...
local test1 = 60
local test2 = 69
=
...
local a = 60
local b = 69
...
"},{name:"Control Flow",id:"controlflow",icon_id:"quiz",tooltip:"Injects while loops into all possible blocks to alter the logical flow of the code
to make it harder to understand and analyze.

This is still in work and very buggy"},{name:"Fake Args",id:"fakeargs",icon_id:"format_list_bulleted",tooltip:"Inserts fake arguments to function declarations and a assignment statement into the function body."},{name:"CallReturn",id:"stringsplit",icon_id:"format_list_bulleted",tooltip:"Wraps all constants (string, number, boolean) into a anonymous function call wich returns the constant value.

e.g.: print(69) =
print((function()
return 69
end)())
"},{divider:!0},{name:"TLN Solver Test",id:"test_a1f3f945673de",icon_id:"",tooltip:"testing function: a1f3f945673de"},{name:"CFF Solver Test",id:"test_aed2bdfc69f",icon_id:"",tooltip:"testing function: aed2bdfc69f"},{name:"concat hook prot",id:"test_a6a1a9ec6a1cd",icon_id:"",tooltip:"testing function: a6a1a9ec6a1cd"},{name:"Constant Chunk 2",id:"test_newcchunk",icon_id:"",tooltip:"Converts all constants (strings, numbers, booleans) into a bytecode?

e.g.: ['Hello World', 69, true] = '1H1I1...I1010'"},{name:"anti beautify",id:"test_antibeautify",icon_id:"",tooltip:"testing function: test_antibeautify (debug lib)"},{name:"anti beautify v2",id:"test_antibeautifyv2",icon_id:"",tooltip:"testing function: test_antibeautifyv2 (pcall method)"},{name:"test_strenc_cchunk3",id:"test_strenc_cchunk3",icon_id:"",tooltip:"testing function: test_strenc_cchunk3"},{name:"Decode Bytestring",id:"decode_bytestring",icon_id:"",tooltip:"Decodes a bytestring."},{name:"Remove LuaU Types",id:"removeluautypes",icon_id:"",tooltip:"Removes all LuaU type declarations and annotations.

e.g.: local a: number = nil
local b = nil :: number
local c: {} = {}
= local a = nil
local b = nil
local c = {}


EXPERIMENTAL - Might break the script"},{name:"TableConcat Strings",id:"tableconcatstrings",icon_id:"",tooltip:"Turns all strings into a table and then combines them again using table.concat."},{name:"Args To Vararg",id:"argstovararg",icon_id:"",tooltip:"Turns all arguments in a function to a vararg call statement.

e.g.: function _func(a,b,c) return a,b,c end = function _func(...) return ({...})[1],({...})[2],({...})[3] end

EXPERIMENTAL - Might break the script
Note: AssignmentStatements to an argument won't work."},{name:"Virtualize_Test",id:"virtualize_testa9ec6a9h",icon_id:"",tooltip:"Test with some GoofyLuaUglifier functions and the IB2 VM."},{name:"Control Flow 2",id:"controlflow2",icon_id:"",tooltip:"controlflow2
EXPERIMENTAL - Might break the script"},{divider:!0}]},QuickAction_Callbacks:{copy:K.default.CopyValue,download:mr.default.DownloadContent,clear:K.default.Clear}}});var wi=z(tt=>{"use strict";var pi=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tt,"__esModule",{value:!0});var et=pi(xt()),be=pi(wi()),xr=pi(Ve());tt.default={accountStateFetched:!1,Init(){$(".infomodal-openbtn").on("click",()=>{be.default.UpdateStats(),be.default.UpdateAccoutState()}),$(".acc_login").on("click",async()=>{location.replace(`${et.default.options.mopsfl_api_url()}oauth/login/discord`)}),$(".acc_logout").on("click",()=>{$(".acc_logout").text("...").attr("disabled","disabled"),fetch(`${et.default.options.mopsfl_api_url()}oauth/account/logout`,{credentials:"include"}).then(i=>{be.default.ToggleLoginState(!1),$(".acc_logout").text("Logout").removeAttr("disabled")})})},async UpdateStats(){await fetch(`${et.default.options.api_url()}api/uglifier/stats`,{cache:"no-store"}).then(async e=>{if(e.ok){let i=await e.json();$("#total_requests").text(i.total_requests),$("#total_functions_called").text(i.total_functions_called);return}throw new Error(`Unable to update uglifier stats! +${t}`:""}`.replace(/^\s+/gm,"");break}}return n},EncodeRequestDataQuery(e){return encodeURIComponent(btoa(String.fromCharCode.apply(null,new Uint16Array(br.default.gzip(JSON.stringify(e))))))}}});var bi=z(Qe=>{"use strict";var ge=Qe&&Qe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qe,"__esModule",{value:!0});var K=ge(Ae()),le=ge(bi()),Je=ge(xt()),ia=ge(gi()),pr=ge(Ie()),wr=ge(pt()),mr=ge(Ve()),na=new Map;Qe.default={blockFunctionTrigger:!1,Init(){let e=$(".function-btn-template"),i=$(".function-category-title-template"),t=$(".sidebar-buttons");Object.keys(le.default.List).forEach(s=>{let l=le.default.List[s],f=i.contents().clone();f.text(s),f.appendTo(t),l.forEach(r=>{if(r.divider){let c=document.createElement("div");c.classList.add("seperator"),$(c).appendTo(t)}else{let c=e.contents().clone(),w=c.find("#function-icon"),u=c.find("#function-name"),d=c.get(1);u.text(r.name),w.text(r.icon_id),c.attr("data-tooltip",r.tooltip),c.attr("data-function",r.id),c.appendTo(t),na.set(r.id,{element:c,func:r})}})});let n=e.contents().clone(),o=n.find("#function-icon"),a=n.find("#function-name");n.addClass("modal-trigger"),n.attr("href","#settingsmodal"),a.text("Settings"),o.text("settings"),n.attr("data-function","settings"),n.appendTo(t),na.forEach((s,l,f)=>{s.element.on("click",async()=>{if(!le.default.List["Quick Actions"].find(r=>r.id===l)||s.func.quickActionsOverride){if(le.default.blockFunctionTrigger)return;le.default.blockFunctionTrigger=!0,K.default.ToggleLoading("Processing"),K.default.ToggleReadOnly(!0),await ia.default.new(l,btoa(String.fromCharCode.apply(null,new Uint16Array(wr.default.gzip(K.default.GetValue())))),Je.default.options,pr.default.GetKey(Je.default.settings.config.storage_key,"settings"),Je.default.clientSession).then(async r=>{if(r instanceof Response){let c=r.headers,w=c.get("uglifier-session"),u=c.get("uglifier-ms-time"),d="";r.ok?(d=await r.text(),Je.default.clientSession=w,console.log(`[Server] Uglification process took ${u}ms. (session: ${Je.default.clientSession})`),K.default.SetValue(d)):K.default.SetValue(ia.default.CreateResponseError("lua",`${r.statusText} - ${r.status}`,K.default.GetValue()))}}).catch(console.error).finally(()=>{K.default.ToggleLoading(),K.default.ToggleReadOnly(!1),le.default.blockFunctionTrigger=!1})}else le.default.QuickAction_Callbacks[l]&&le.default.QuickAction_Callbacks[l]()})})},List:{"Quick Actions":[{name:"Quick Uglify",id:"uglify",icon_id:"draw",tooltip:"Uglify your script with the default methods.",quickActionsOverride:!0},{name:"Virtualize",id:"virtualize",icon_id:"inventory",tooltip:"Virtualizes your script using IronBrew2 VM.

This function is currently using the luaobfuscator.com API, so the process might take a few seconds.",quickActionsOverride:!0},{name:"Minify",id:"minify",icon_id:"close_fullscreen",tooltip:"Minifies your script by renaming variables / globals and removing whitespaces.",quickActionsOverride:!0},{name:"Copy",id:"copy",icon_id:"content_copy",tooltip:"Copies the current editor script."},{name:"Clear",id:"clear",icon_id:"delete",tooltip:"Clears the editor input."},{name:"Download",id:"download",icon_id:"download",tooltip:"Downloads the current editor script."}],Functions:[{name:"Bytestrings",id:"bytestrings",icon_id:"tag",tooltip:`Encrypts string constants to encrypted byte strings using one key and bit32.bxor.

e.g.: 'Hello' = function("\\226\\207\\198\\198\\197")`},{name:"Numberstrings",id:"numberstrings",icon_id:"tag",tooltip:"Encodes string constants into number tables that will be decoded by a implemented function.

e.g.: 'Hello' = function({{176,4576,832}, {161,3381,2100}, ...})"},{divider:!0},{name:"NonSense Strings",id:"nonsensestrings",icon_id:"question_mark",tooltip:"Turns strings into random non sense.

e.g.: 'Hello World' = '?\u0192*/\u6DAE\u0432+%\u7649\u0446\u98F4'

EXPERIMENTAL - Might break the script"},{name:"Numbers",id:"transformnums",icon_id:"looks_one",tooltip:"Transforms numbers into binary expression.

e.g.: 100 = (369 - 169) / 2"},{name:"Number Combine",id:"numbercombine",icon_id:"merge_type",tooltip:"Combines all numeric literals into a single local declaration and then uses that and makes x-y thin something idk."},{name:"Booleans",id:"transformbooleans",icon_id:"check_box",tooltip:"Transforms all booleans into binary expressions.

e.g.: false = 100 < ( 100 - 5 )"},{name:"Functions",id:"functiontransform",icon_id:"functions",tooltip:'Puts all functions into a table and gets defined by an IndexExpression, to hide its name.
(not working when used _GLookup first)

e.g.: function x() print("69") end
x()
=
local a = {}
a["x"] = function() print("69") end

a["x"]()
'},{name:"Hex Numbers",id:"hexnumbers",icon_id:"looks_two",tooltip:"Transforms numbers into hex numbers.

e.g.: 100.123 = 0x64.1f7ced916874

(Decimal numbers do not work for LuaU)"},{divider:!0},{name:"solve binaryexp",id:"solveBinaryExp",icon_id:"bug_report",tooltip:"Solves all binary expressions.

e.g.: (69 / (10*2)) + 100 - 3.45 = 100"},{name:"Number Tables",id:"numbertable",icon_id:"data_object",tooltip:"Converts all numbers into tables containing random numbers.

e.g.: print(100) = print(table.concat({194+22})-table.concat({94+22}))

(might slow down the script)"},{name:"Bracket Numbers",id:"bracketnumbers",icon_id:"data_array",tooltip:"Puts all number into a random amount of brackets.

e.g.: 69 = ((((((69))))))"},{name:"Table Length",id:"tablelennumbers",icon_id:"table_chart",tooltip:"Transforms all numbers into tables, containing empty tables and using the length of
the base table. (does that make sense?)

e.g.: 5 = #{{},{},{},{},{}}

(might slow down the script)"},{divider:!0},{name:"Table Lookup",id:"tablelookup",icon_id:"data_object",tooltip:'Turns all member expression identifiers into an index expression, aka a table lookup.

e.g.: math.randomseed(69) = math["randomseed"](69)
or
e.g.: { index: ... } = { ["index"]: ... }
or
e.g.: x:gsub(y, z) = x["gsub"](x, y, z)'},{name:"_G Lookup",id:"glookup",icon_id:"g_mobiledata",tooltip:"Makes all global variables get called by _G, wich will hide
the actual variable / function, that's being called.

e.g.: math.randomseed(69) = _G[...][...](69)

(Currently only works with max. 2 index expressions)"},{name:"AnononymDecls",id:"anonymousdeclarations",icon_id:"functions",tooltip:"Transforms and anonymizes function declarations by using string-based keys and table lookups.

e.g.: function x.y(a, b) return a,b end = x['y'] = function(self, a, b) return self,a,b end

EXPERIMENTAL - Might break the script"},{name:"GlobalsToLocals",id:"globals_to_locals",icon_id:"transform",tooltip:"Turns all global usages into local declarations or puts all globals into a table.

e.g.: print(math.random(1, 5))
=
local _random = math.random
local _print = print

_print(_random(1, 5))


EXPERIMENTAL - Might break the script"},{divider:!0}],"Tester Functions":[{name:"Dead Code",id:"deadcode",icon_id:"code_off",tooltip:"Adds random dead code to your script.

e.g.: ...
abcdefg = (369 - 169) / 2
...
"},{name:"Constant Chunk",id:"constantchunk",icon_id:"feed",tooltip:"Converts all constants (strings, numbers, booleans) into some kind of bytecode? but not really

e.g.: ['Hello World', 69, true] = 'A115B7...22B74C'"},{name:"Identifiers",id:"renameidentifiers",icon_id:"fingerprint",tooltip:"Renames all identifiers to the smallest name possible.

e.g.: ...
local test1 = 60
local test2 = 69
=
...
local a = 60
local b = 69
...
"},{name:"Control Flow",id:"controlflow",icon_id:"quiz",tooltip:"Injects while loops into all possible blocks to alter the logical flow of the code
to make it harder to understand and analyze.

This is still in work and very buggy"},{name:"Fake Args",id:"fakeargs",icon_id:"format_list_bulleted",tooltip:"Inserts fake arguments to function declarations and a assignment statement into the function body."},{name:"CallReturn",id:"stringsplit",icon_id:"format_list_bulleted",tooltip:"Wraps all constants (string, number, boolean) into a anonymous function call wich returns the constant value.

e.g.: print(69) =
print((function()
return 69
end)())
"},{divider:!0},{name:"TLN Solver Test",id:"test_a1f3f945673de",icon_id:"",tooltip:"testing function: a1f3f945673de"},{name:"CFF Solver Test",id:"test_aed2bdfc69f",icon_id:"",tooltip:"testing function: aed2bdfc69f"},{name:"concat hook prot",id:"test_a6a1a9ec6a1cd",icon_id:"",tooltip:"testing function: a6a1a9ec6a1cd"},{name:"Constant Chunk 2",id:"test_newcchunk",icon_id:"",tooltip:"Converts all constants (strings, numbers, booleans) into a bytecode?

e.g.: ['Hello World', 69, true] = '1H1I1...I1010'"},{name:"anti beautify",id:"test_antibeautify",icon_id:"",tooltip:"testing function: test_antibeautify (debug lib)"},{name:"anti beautify v2",id:"test_antibeautifyv2",icon_id:"",tooltip:"testing function: test_antibeautifyv2 (pcall method)"},{name:"test_strenc_cchunk3",id:"test_strenc_cchunk3",icon_id:"",tooltip:"testing function: test_strenc_cchunk3"},{name:"Decode Bytestring",id:"decode_bytestring",icon_id:"",tooltip:"Decodes a bytestring."},{name:"Remove LuaU Types",id:"removeluautypes",icon_id:"",tooltip:"Removes all LuaU type declarations and annotations.

e.g.: local a: number = nil
local b = nil :: number
local c: {} = {}
= local a = nil
local b = nil
local c = {}


EXPERIMENTAL - Might break the script"},{name:"TableConcat Strings",id:"tableconcatstrings",icon_id:"",tooltip:"Turns all strings into a table and then combines them again using table.concat."},{name:"Args To Vararg",id:"argstovararg",icon_id:"",tooltip:"Turns all arguments in a function to a vararg call statement.

e.g.: function _func(a,b,c) return a,b,c end = function _func(...) return ({...})[1],({...})[2],({...})[3] end

EXPERIMENTAL - Might break the script
Note: AssignmentStatements to an argument won't work."},{name:"Virtualize_Test",id:"virtualize_testa9ec6a9h",icon_id:"",tooltip:"Test with some GoofyLuaUglifier functions and the IB2 VM."},{name:"Control Flow 2",id:"controlflow2",icon_id:"",tooltip:"controlflow2
EXPERIMENTAL - Might break the script"},{divider:!0}]},QuickAction_Callbacks:{copy:K.default.CopyValue,download:mr.default.DownloadContent,clear:K.default.Clear}}});var wi=z(tt=>{"use strict";var pi=tt&&tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tt,"__esModule",{value:!0});var et=pi(xt()),be=pi(wi()),xr=pi(Ve());tt.default={accountStateFetched:!1,Init(){$(".infomodal-openbtn").on("click",()=>{be.default.UpdateStats(),be.default.UpdateAccoutState()}),$(".acc_login").on("click",async()=>{location.replace(`${et.default.options.mopsfl_api_url()}oauth/login/discord`)}),$(".acc_logout").on("click",()=>{$(".acc_logout").text("...").attr("disabled","disabled"),fetch(`${et.default.options.mopsfl_api_url()}oauth/account/logout`,{credentials:"include"}).then(i=>{be.default.ToggleLoginState(!1),$(".acc_logout").text("Logout").removeAttr("disabled")})})},async UpdateStats(){await fetch(`${et.default.options.api_url()}api/uglifier/stats`,{cache:"no-store"}).then(async e=>{if(e.ok){let i=await e.json();$("#total_requests").text(i.total_requests),$("#total_functions_called").text(i.total_functions_called);return}throw new Error(`Unable to update uglifier stats! ${e.statusText} - ${e.status}`)}).catch(e=>{console.error(e)})},async UpdateAccoutState(){be.default.accountStateFetched!==!0&&(be.default.accountStateFetched=!0,xr.default.GetCookie("_ASID")?fetch(`${et.default.options.mopsfl_api_url()}oauth/account/get`,{credentials:"include"}).then(e=>e.json()).then(async e=>{e.code===0?($(".acc_logout").hide(),$("#account_username").text("Not logged in"),$("#account_id").text("N/A"),$("#discord-avatar").hide()):e.oauth==="discord"&&(await fetch(`${et.default.options.api_url()}oauth/account/isTester`,{credentials:"include"}).then(i=>i.json()).then(i=>{$("#tester_access").text(i==!0?"Yes":"No")}),window.discordAccount=e.user,window.discordAvatar=`https://cdn.discordapp.com/avatars/${e.user.id}/${e.user.avatar}`,be.default.ToggleLoginState(!0))}):be.default.ToggleLoginState(!1))},ToggleLoginState(e){e===!0?($(".acc_login").hide(),$("#discord-avatar").show(),$(".acc_logout").show(),$("#account_username").text(window.discordAccount.username),$("#account_id").text(window.discordAccount.id),$("#discord-avatar").attr("src",window.discordAvatar)):($(".acc_logout").hide(),$(".acc_login").show(),$("#account_username").text("Not logged in"),$("#account_id").text("N/A"),$("#discord-avatar").hide())}}});var xt=z(it=>{var De=it&&it.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(it,"__esModule",{value:!0});var aa=De(la()),oa=De(Ae()),kr=De(ta()),yr=De(bi()),vr=De(Ve()),Er=De(wi()),ra=new kr.default;(0,aa.default)(()=>{ra.init(),yr.default.Init(),oa.default.Init(),Er.default.Init(),M.AutoInit()});aa.default.readyException=e=>{console.error(e),oa.default.ToggleLoading(`
Application error: a client-side exception has occurred!


${e.name}: ${e.message}
Stack:
${e.stack.replace(/\s/gm,"
")}
`,!0,!0)};it.default={options:{api_url:()=>location.hostname=="localhost"&&!window.forceProduction?"http://localhost:6968/v1/":"https://goofyluauglifier.mopsfl.de/v1/",mopsfl_api_url:()=>location.hostname=="localhost"&&!window.forceProduction?"http://localhost:6969/v1/":"https://api.mopsfl.de/v1/"},clientSession:vr.default.GetCookie("_GLUSES")||void 0,pageTime:new Date().getTime(),settings:ra}});export default xt(); diff --git a/dist/js/modules/Functions.js b/dist/js/modules/Functions.js index fff97e5..add3f86 100644 --- a/dist/js/modules/Functions.js +++ b/dist/js/modules/Functions.js @@ -14,16 +14,13 @@ const functionButtons = new Map; exports.default = { blockFunctionTrigger: false, Init() { - console.log("init functions"); const _functionBtnTemplate = $(".function-btn-template"), _functionCategoryTitleTemplate = $(".function-category-title-template"), _sideBarButtons = $(".sidebar-buttons"); Object.keys(Functions_1.default.List).forEach((categoryName) => { - console.log(categoryName); const categoryFunctions = Functions_1.default.List[categoryName]; const _functionCategoryTitle = _functionCategoryTitleTemplate.contents().clone(); _functionCategoryTitle.text(categoryName); _functionCategoryTitle.appendTo(_sideBarButtons); categoryFunctions.forEach(categoryFunction => { - console.log(categoryFunction); if (!categoryFunction.divider) { const functionBtn = _functionBtnTemplate.contents().clone(), functionBtnIcon = functionBtn.find("#function-icon"), functionBtnName = functionBtn.find("#function-name"), functionBtnHtmlElement = functionBtn.get(1); functionBtnName.text(categoryFunction.name); diff --git a/modules/Functions.ts b/modules/Functions.ts index 79efc20..bbc31c6 100644 --- a/modules/Functions.ts +++ b/modules/Functions.ts @@ -10,20 +10,17 @@ const functionButtons = new Map, func: CategoryFu export default { blockFunctionTrigger: false, Init() { - console.log("init functions"); const _functionBtnTemplate = $(".function-btn-template"), _functionCategoryTitleTemplate = $(".function-category-title-template"), _sideBarButtons = $(".sidebar-buttons") Object.keys(self.List).forEach((categoryName) => { - console.log(categoryName); const categoryFunctions: CategoryFunction[] = self.List[categoryName] const _functionCategoryTitle = _functionCategoryTitleTemplate.contents().clone() _functionCategoryTitle.text(categoryName) _functionCategoryTitle.appendTo(_sideBarButtons) categoryFunctions.forEach(categoryFunction => { - console.log(categoryFunction); if (!categoryFunction.divider) { const functionBtn = _functionBtnTemplate.contents().clone(), functionBtnIcon = functionBtn.find("#function-icon"),