104,6,146,33,342,23,904,39,486,25,704,29,736,35,233,31,894,29,1182,33,1037,15,1006,8,426,38,1188,41,245 _info {"project":"debug","branch":"master","version":73,"versionDate":"2024-05-07T09:24:50.000Z","fromVersion":0,"reset":true,"checksumDocs":"13-9736"} container/closeIcon/closeIcon.ls (function(){ return function(){ return Div().addClass('safeAreaMarginTop').css({ position: 'absolute', top: 0, right: 0, zIndex: 10, display: "inline-block", padding: '0em 0.4em 0.5em 1em', cursor: "pointer", fontSize: "2em", color: "rgb(158, 158, 158)" }).html("×").tap(function(){ return engine.debugContainer.clearMessages(); }); }; })(); container/container.ls (function(){ return function(){ var clearMessages, container, messages; if (typeof body == 'undefined' || body === null) { return; } clearMessages = function(){ messages.empty(); return container.hide(); }; body.append(container = Div({ position: "fixed", top: 0, left: 0, right: 0, fontSize: engine.isMobileApp ? "15px" : "13px", fontFamily: "monospace", zIndex: 100, margin: "0 3em", opacity: "0.9" }).addClass("debugContainer").addClass("container").addClass("safeAreaPaddingTop").hide().html(include("closeIcon/closeIcon")(), messages = Div({ maxHeight: "20em", overflowX: "hidden", overflowY: "scroll", webkitOverflowScrolling: "touch", userSelect: "text" }).addClass("messages").addClass("debugMessages"))); container.appendMessage = include("message/message")(messages); container.appendError = include("error/error")(messages); container.clearMessages = clearMessages; return container; }; })(); container/error/codeLines/codeLines.ls (function(){ return function(e){ var lines, i, l; if (!e.codeLine) { return; } lines = [e.codeLineBefore, e.codeLine, e.codeLineAfter]; return Div().css({ color: Color.grey[700] }).html((function(){ var i$, ref$, len$, results$ = []; for (i$ = 0, len$ = (ref$ = lines).length; i$ < len$; ++i$) { i = i$; l = ref$[i$]; if (l) { results$.push(Div().css({ whiteSpace: "nowrap", overflow: "hidden", color: i === 1 ? Color.red[500] : void 8 }).html(l)); } } return results$; }())); }; })(); container/error/error.ls (function(){ return function(messages){ var fileDiv, messageDiv, codeLines, stack; fileDiv = include("file/file"); messageDiv = include("message/message"); codeLines = include("codeLines/codeLines"); stack = include("stack/stack"); return function(error){ var e; try { console.log(error); Div().addClass("error").css({ position: "relative", backgroundColor: Color.red[50], borderBottom: "1px solid " + Color.grey[50], padding: "0.3em" }).append(fileDiv(error), messageDiv(error), codeLines(error), stack(error)).appendTo(messages); messages.parent().show(); return messages.scrollTop = messages.scrollHeight; } catch (e$) { e = e$; return console.error("error in error message", error, e); } }; }; })(); container/error/file/file.ls (function(){ return function(error){ var file, line, project, branch, ref$, click; file = error.file || "unknown file"; line = error.line; project = file.split("/")[2]; branch = (ref$ = projects.info()[project]) != null ? ref$.branch : void 8; click = function(){ var b; b = branch === "master" ? "develop" : branch; return window.parent.postMessage("ideOpenFile_" + b + "_" + file, '*'); }; return Div().css({ display: "block", textDecoration: "underline", color: Color.grey[700], padding: "0.1em", whiteSpace: "pre-wrap", wordWrap: "break-word", cursor: window !== window.top ? "pointer" : void 8 }).html(file + (line > 0 ? ":" + line : "") + (branch ? " [" + branch + "]" : "")).tap(window !== window.top ? click : void 8); }; })(); container/error/message/message.ls (function(){ return function(error){ var message; message = error.message || "unknown error"; return Div().css({ color: Color.red[500], whiteSpace: "pre-wrap", marginBottom: "0.3em", wordWrap: "break-word" }).html(message); }; })(); container/error/stack/stack.ls (function(){ return function(e){ var ref$, stack, isExpanded, div, collapsed, expanded; if (!((ref$ = e.error) != null && ref$.stack)) { return; } stack = e.stack || e.error.stack.toString().split("$$").join("").split("$S").join("/").split("$D").join(".").split("$M").join("-").split("$B").join(" ").split("$P").join(":"); isExpanded = false; return div = Div().css({ marginTop: "1em" }).html(collapsed = Div().css({ color: Color.grey[700], whiteSpace: "pre-wrap", marginBottom: "0.3em", wordWrap: "break-word", textDecoration: "underline" }).html("Stack show").tap(function(){ isExpanded = !isExpanded; if (isExpanded) { expanded.show(); return collapsed.html("Stack hide"); } else { expanded.hide(); return collapsed.html("Stack show"); } }), expanded = Div().css({ color: Color.red[500], whiteSpace: "pre-wrap", marginBottom: "0.3em", wordWrap: "break-word" }).html(stack).hide()); }; })(); container/message/message.ls (function(){ return function(messages){ var f; return f = function(type, args, file, line){ var ref$, message, i$, len$, argument, t; if (args[0] === "clear") { engine.debugContainer.clearMessages(); if (args.length > 1) { f(type, _.slice(args, 1), file, line); } return; } messages.parent().show(); if ((ref$ = args[0]) === "start timer" || ref$ === "stop timer" || ref$ === "frame timer" || ref$ === "measure func") { messages.append(include("timer/timer")(args[0], args[1])); messages.scrollTop = messages.scrollHeight; return; } messages.append(message = Div({ position: "relative", borderBottom: "1px solid " + Color.grey[50], padding: "0.3em", backgroundColor: type === "debug" ? Color.grey[200] : Color.grey[300] }).addClass(type)); for (i$ = 0, len$ = args.length; i$ < len$; ++i$) { argument = args[i$]; message.append(JSONFormatter(argument)); } if (type !== "debug" && file) { t = line ? file + ":" + line : file; message.prepend(Div({ display: "block", textDecoration: "underline", color: Color.grey[700], padding: "0.1em", whiteSpace: "pre-wrap", wordWrap: "break-word" }).attr({ title: t }).append(t)); } return messages.scrollTop = messages.scrollHeight; }; }; })(); container/message/timer/timer.ls (function(){ var last; last = null; return function(mode, func){ var now, dif, total, times, f; if (mode === "start timer") { last = performance.now(); } else if (mode === "stop timer") { now = performance.now(); dif = now - last; last = now; return Div().css({ backgroundColor: Color.blue[100], borderBottom: "1px solid " + Color.grey[50], padding: "0.3em" }).html("Timer: " + _.round(dif, 0) + " ms"); } else if (mode === "frame timer") { last = performance.now(); total = 0; times = []; f = function(){ return requestAnimationFrame(function(){ total++; if (total < 6) { times.push(_.round(performance.now() - last, 0)); last = performance.now(); return f(); } else { return debug("frames: " + times.join(", ") + " (ms)"); } }); }; f(); } else if (mode === "measure func") { last = performance.now(); func(); now = performance.now(); dif = now - last; last = now; return Div().css({ backgroundColor: Color.blue[100], borderBottom: "1px solid " + Color.grey[50], padding: "0.3em" }).html("Time: " + _.round(dif, 0) + " ms"); } }; })(); debug/debug.ls (function(){ return projects.includeInjections.debug = function(filePath){ return function(){ var ref$, file, ref1$, args, js; if (typeof navigator != 'undefined' && navigator !== null) { if ((ref$ = navigator.splashscreen) != null) { if (typeof ref$.hide == 'function') { ref$.hide(); } } } if (filePath == null) { file = (ref1$ = _.find(arguments, function(argument){ return argument.filePath != null; })) != null ? ref1$.filePath : void 8; args = _.filter(arguments, function(argument){ return !(argument != null && argument.filePath); }); } else { file = filePath.replace('/../', '/'); args = arguments; args = _.map(args, function(arg){ return _.cloneDeep({ arg: arg }).arg; }); } if ((typeof Store == 'function' ? Store('debug') : void 8) === true || ((typeof engine != 'undefined' && engine !== null) && engine.isDebugChallenge)) { engine.debugContainer.appendMessage('debug', args, file); } js = "console.log.apply(console, args)\n//# sourceURL=" + file; eval(js); return arguments[0]; }; }; })(); init.ls (function(){ return function(p){ var i$, ref$, len$, el; for (i$ = 0, len$ = (ref$ = document.body.getElementsByClassName("debugContainer")).length; i$ < len$; ++i$) { el = ref$[i$]; el.remove(); } engine.debugContainer = include("container/container")(); if ((p != null ? p.dontSetErrorHandler : void 8) !== true) { include('/lib/util/errorHandler/errorHandler')(); } return window.debug = include('debug/debug')(); }; })(); lib/util/errorHandler/errorHandler.ls (function(){ return function(){ if (window.customErrorHandler) { return; } window.originalErrorHandler = window.onerror; window.customErrorHandler = function(message, file, line, col, error){ var info, e, e2, ref$; if (message === "socket error" || message === "log error") { return; } if (_.includes(navigator.userAgent, "Firefox")) { try { info = include("firefox/firefox")(error); if (info.file) { file = info.file; line = info.line; col = info.col; } } catch (e$) {} } e = { event: "error", logId: typeof log != 'undefined' && log !== null ? log.id() : void 8, message: message, file: file, line: line, col: col, error: error }; try { helpers.postEvent("INT-errors", e); } catch (e$) {} if (window.log != null) { try { e2 = _.cloneDeep(e); delete e2.logId; window.log.log(e2); } catch (e$) {} } if ((typeof Store == 'function' ? Store("debug") : void 8) === true) { if (typeof navigator != 'undefined' && navigator !== null) { if ((ref$ = navigator.splashscreen) != null) { if (typeof ref$.hide == 'function') { ref$.hide(); } } } engine.debugContainer.appendError(e); } }; window.onerror = window.customErrorHandler; return helpers.errorHandler = window.customErrorHandler; }; })(); lib/util/errorHandler/firefox/firefox.ls (function(){ return function(error){ var s, l, i, result; if (!error.stack) { return; } try { s = error.stack; l = s.split("\n"); i = l[0].split("@")[1].split(":"); return result = { file: i[0], line: i[1], col: i[2] }; } catch (e$) {} }; })();