From 96827a19b295ca59bdb598a483a60587622ce578 Mon Sep 17 00:00:00 2001 From: typer Date: Sun, 8 Nov 2020 17:43:47 -0800 Subject: [PATCH 01/40] removed code comments in js files --- src/js/account.js | 300 -------------------------- src/js/commandline.js | 40 ---- src/js/db.js | 36 ---- src/js/leaderboards.js | 39 ---- src/js/script.js | 477 ----------------------------------------- src/js/settings.js | 10 +- src/js/userconfig.js | 136 ------------ 7 files changed, 1 insertion(+), 1037 deletions(-) diff --git a/src/js/account.js b/src/js/account.js index 75c7ce3b5..809489cf7 100644 --- a/src/js/account.js +++ b/src/js/account.js @@ -262,7 +262,6 @@ firebase.auth().onAuthStateChanged(function (user) { var isAnonymous = user.isAnonymous; var uid = user.uid; var providerData = user.providerData; - // showNotification('Signed in', 1000); $(".pageLogin .preloader").addClass("hidden"); $("#menu .icon-button.account .text").text(displayName); @@ -307,14 +306,6 @@ firebase.auth().onAuthStateChanged(function (user) { setCustomTheme(true); setCustomThemeInputs(); applyCustomThemeColors(); - // let save = []; - // $.each( - // $(".pageSettings .section.customTheme [type='color']"), - // (index, element) => { - // save.push($(element).attr("value")); - // } - // ); - // setCustomThemeColors(save); } }); @@ -329,7 +320,6 @@ function getAccountDataAndInit() { if (cookieConfig === null) { accountIconLoading(false); applyConfig(dbSnapshot.config); - // showNotification('Applying db config',3000); updateSettingsPage(); saveConfigToCookie(true); restartTest(false, true); @@ -431,11 +421,6 @@ var resultHistoryChart = new Chart($(".pageAccount #resultHistoryChart"), { data: [], borderColor: "#f44336", borderWidth: 2, - // trendlineLinear: { - // style: "rgba(244,67,54,.25)", - // lineStyle: "solid", - // width: 1 - // } trendlineLinear: { style: "rgba(255,105,180, .8)", lineStyle: "dotted", @@ -528,10 +513,6 @@ var resultHistoryChart = new Chart($(".pageAccount #resultHistoryChart"), { }, responsive: true, maintainAspectRatio: false, - // tooltips: { - // mode: 'index', - // intersect: false, - // }, hover: { mode: "nearest", intersect: false, @@ -725,7 +706,6 @@ let hoverChart = new Chart($(".pageAccount #hoverChart"), { { label: "wpm", data: [], - // backgroundColor: 'rgba(255, 255, 255, 0.25)', borderColor: "rgba(125, 125, 125, 1)", borderWidth: 2, yAxisID: "wpm", @@ -735,7 +715,6 @@ let hoverChart = new Chart($(".pageAccount #hoverChart"), { { label: "raw", data: [], - // backgroundColor: 'rgba(255, 255, 255, 0.25)', borderColor: "rgba(125, 125, 125, 1)", borderWidth: 2, yAxisID: "raw", @@ -745,13 +724,11 @@ let hoverChart = new Chart($(".pageAccount #hoverChart"), { { label: "errors", data: [], - // backgroundColor: 'rgba(255, 255, 255, 0.25)', borderColor: "rgba(255, 125, 125, 1)", pointBackgroundColor: "rgba(255, 125, 125, 1)", borderWidth: 2, order: 1, yAxisID: "error", - // barPercentage: 0.1, maxBarThickness: 10, type: "scatter", pointStyle: "crossRot", @@ -783,10 +760,6 @@ let hoverChart = new Chart($(".pageAccount #hoverChart"), { }, responsive: true, maintainAspectRatio: false, - // hover: { - // mode: 'x', - // intersect: false - // }, scales: { xAxes: [ { @@ -987,10 +960,6 @@ $(document).on("click", ".pageAccount .hoverChartBg", (event) => { hideHoverChart(); }); -// $(document).on("mouseleave", ".pageAccount .hoverChartButton", (event) => { -// hideHoverChart(); -// }); - let defaultAccountFilters = { difficulty: { normal: true, @@ -1094,7 +1063,6 @@ function updateFilterTags() { "hidden" ); } - // showActiveFilters(); } function toggleFilter(group, filter) { @@ -1110,117 +1078,7 @@ function setFilter(group, filter, set) { config.resultFilters[group][filter] = set; } -// function toggleFilterButton(filter) { -// const element = $( -// `.pageAccount .content .filterButtons .button[filter=${filter}]` -// ); -// if (element.hasClass("active")) { -// //disable that filter - -// if (filter == "all" || filter == "none") { -// return; -// } else if (filter == "mode_words") { -// // $.each($(`.pageAccount .content .filterButtons .buttons.wordsFilter .button`),(index,obj)=>{ -// // let f = $(obj).attr('filter') -// // disableFilterButton(f) -// // }) -// } else if (filter == "mode_time") { -// // $.each($(`.pageAccount .content .filterButtons .buttons.timeFilter .button`),(index,obj)=>{ -// // let f = $(obj).attr('filter') -// // disableFilterButton(f) -// // }) -// } else if (filter == "punc_off") { -// enableFilterButton("punc_on"); -// } else if (filter == "punc_on") { -// enableFilterButton("punc_off"); -// } -// disableFilterButton(filter); -// disableFilterButton("all"); -// } else { -// //enable that filter -// disableFilterButton("none"); - -// if (filter == "all") { -// $.each( -// $(`.pageAccount .content .filterButtons .button`), -// (index, obj) => { -// let f = $(obj).attr("filter"); -// if ( -// f != "none" && -// f != "date_month" && -// f != "date_week" && -// f != "date_day" -// ) { -// enableFilterButton(f); -// } -// } -// ); -// } else if (filter == "none") { -// disableFilterButton("all"); -// $.each( -// $(`.pageAccount .content .filterButtons .button`), -// (index, obj) => { -// let f = $(obj).attr("filter"); -// if (f != "none") { -// disableFilterButton(f); -// } -// } -// ); -// } else if ( -// filter == "date_all" || -// filter == "date_month" || -// filter == "date_week" || -// filter == "date_day" -// ) { -// disableFilterButton("date_all"); -// disableFilterButton("date_month"); -// disableFilterButton("date_week"); -// disableFilterButton("date_day"); -// enableFilterButton(filter); -// } -// // else if(filter == "mode_words"){ -// // $.each($(`.pageAccount .content .filterButtons .buttons.wordsFilter .button`),(index,obj)=>{ -// // let f = $(obj).attr('filter'); -// // enableFilterButton(f); -// // }) -// // }else if(filter == "mode_time"){ -// // $.each($(`.pageAccount .content .filterButtons .buttons.timeFilter .button`),(index,obj)=>{ -// // let f = $(obj).attr('filter'); -// // enableFilterButton(f); -// // }) -// // }else if(['10','25','50','100','200'].includes(filter)){ -// // enableFilterButton('words'); -// // }else if(['15','30','60','120'].includes(filter)){ -// // enableFilterButton('time'); -// // } - -// enableFilterButton(filter); -// } -// showActiveFilters(); -// } - -// function disableFilterButton(filter) { -// const element = $( -// `.pageAccount .content .filterButtons .button[filter=${filter}]` -// ); -// element.removeClass("active"); -// } - -// function enableFilterButton(filter) { -// const element = $( -// `.pageAccount .content .filterButtons .button[filter=${filter}]` -// ); -// element.addClass("active"); -// } - function showActiveFilters() { - // activeFilters = []; - // $.each($(".pageAccount .filterButtons .button"), (i, obj) => { - // if ($(obj).hasClass("active")) { - // activeFilters.push($(obj).attr("filter")); - // } - // }); - let aboveChartDisplay = {}; Object.keys(config.resultFilters).forEach((group) => { @@ -1288,8 +1146,6 @@ function showActiveFilters() { if (aboveChartDisplay[group].all) { ret += "all"; } else { - //TODO: is this used? - //allall = false; if (group === "tags") { ret += aboveChartDisplay.tags.array .map((id) => { @@ -1352,77 +1208,6 @@ function showActiveFilters() { //tags chartString += addText("tags"); - // chartString += `
`; - - // let allall = true; - // let count = 0; - // Object.keys(aboveChartDisplay).forEach((group) => { - // count++; - // if (group === "time" && !aboveChartDisplay.mode.array.includes("time")) - // return; - // if (group === "words" && !aboveChartDisplay.mode.array.includes("words")) - // return; - - // if (aboveChartDisplay[group].array.length > 0) { - // chartString += "
"; - // if (group == "difficulty") { - // chartString += ``; - // } else if (group == "mode") { - // chartString += ``; - // } else if (group == "punctuation") { - // chartString += `!?`; - // } else if (group == "numbers") { - // chartString += `15`; - // } else if (group == "words") { - // chartString += ``; - // } else if (group == "time") { - // chartString += ``; - // } else if (group == "date") { - // chartString += ``; - // } else if (group == "tags") { - // chartString += ``; - // } else if (group == "language") { - // chartString += ``; - // } else if (group == "funbox") { - // chartString += ``; - // } - - // if (aboveChartDisplay[group].all) { - // chartString += "all"; - // } else { - // allall = false; - // if (group === "tags") { - // chartString += aboveChartDisplay.tags.array - // .map((id) => { - // if (id == "none") return id; - // let name = dbSnapshot.tags.filter((t) => t.id == id)[0]; - // if (name !== undefined) { - // return dbSnapshot.tags.filter((t) => t.id == id)[0].name; - // } - // }) - // .join(", "); - // } else { - // chartString += aboveChartDisplay[group].array - // .join(", ") - // .replace(/_/g, " "); - // } - // } - // chartString += "
"; - // if (Object.keys(aboveChartDisplay).length !== count) - // chartString += `
`; - // } - // }); - - // if (allall) chartString = `all`; $(".pageAccount .group.chart .above").html(chartString); @@ -1514,7 +1299,6 @@ $( ).click(".button", (e) => { const filter = $(e.target).attr("filter"); const group = $(e.target).parents(".buttons").attr("group"); - // toggleFilterButton(filter); if ($(e.target).hasClass("allFilters")) { Object.keys(config.resultFilters).forEach((group) => { Object.keys(config.resultFilters[group]).forEach((filter) => { @@ -1790,12 +1574,6 @@ function loadMoreLines() { const result = filteredResults[i]; if (result == undefined) continue; let withpunc = ""; - // if (result.punctuation) { - // withpunc = '
punctuation'; - // } - // if (result.blindMode) { - // withpunc = '
blind'; - // } let diff = result.difficulty; if (diff == undefined) { diff = "normal"; @@ -1864,10 +1642,6 @@ function loadMoreLines() { tagNames = tagNames.substring(0, tagNames.length - 2); } - // if(tagNames !== ""){ - // icons += ``; - // } - let restags; if (result.tags === undefined) { restags = "[]"; @@ -1963,8 +1737,6 @@ function refreshAccountPage() { let chartData = []; let wpmChartData = []; - //TODO: is this used? - //let rawChartData = []; let accChartData = []; visibleTableLines = 0; @@ -1995,8 +1767,6 @@ function refreshAccountPage() { let totalCons10 = 0; let consCount = 0; - //TODO: is this used? - //let dailyActivityDays = []; let activityChartData = {}; filteredResults = []; @@ -2020,16 +1790,13 @@ function refreshAccountPage() { } totalSeconds += tt; - // console.log(result); //apply filters try { let resdiff = result.difficulty; if (resdiff == undefined) { resdiff = "normal"; } - // if (!activeFilters.includes("difficulty_" + resdiff)) return; if (!config.resultFilters.difficulty[resdiff]) return; - // if (!activeFilters.includes("mode_" + result.mode)) return; if (!config.resultFilters.mode[result.mode]) return; if (result.mode == "time") { @@ -2037,19 +1804,15 @@ function refreshAccountPage() { if ([15, 30, 60, 120].includes(parseInt(result.mode2))) { timefilter = result.mode2; } - // if (!activeFilters.includes(timefilter)) return; if (!config.resultFilters.time[timefilter]) return; } else if (result.mode == "words") { let wordfilter = "custom"; if ([10, 25, 50, 100, 200].includes(parseInt(result.mode2))) { wordfilter = result.mode2; } - // if (!activeFilters.includes(wordfilter)) return; if (!config.resultFilters.words[wordfilter]) return; } - // if (!activeFilters.includes("lang_" + result.language)) return; - let langFilter = config.resultFilters.language[result.language]; if ( @@ -2065,7 +1828,6 @@ function refreshAccountPage() { puncfilter = "on"; } if (!config.resultFilters.punctuation[puncfilter]) return; - // if (!activeFilters.includes(puncfilter)) return; let numfilter = "off"; if (result.numbers) { @@ -2074,10 +1836,8 @@ function refreshAccountPage() { if (!config.resultFilters.numbers[numfilter]) return; if (result.funbox === "none" || result.funbox === undefined) { - // if (!activeFilters.includes("funbox_none")) return; if (!config.resultFilters.funbox.none) return; } else { - // if (!activeFilters.includes("funbox_" + result.funbox)) return; if (!config.resultFilters.funbox[result.funbox]) return; } @@ -2086,7 +1846,6 @@ function refreshAccountPage() { if (result.tags === undefined || result.tags.length === 0) { //no tags, show when no tag is enabled if (dbSnapshot.tags.length > 0) { - // if (activeFilters.includes("tag_notag")) tagHide = false; if (config.resultFilters.tags.none) tagHide = false; } else { tagHide = false; @@ -2100,7 +1859,6 @@ function refreshAccountPage() { //check if tag is valid if (validTags.includes(tag)) { //tag valid, check if filter is on - // if (activeFilters.includes("tag_" + tag)) tagHide = false; if (config.resultFilters.tags[tag]) tagHide = false; } else { //tag not found in valid tags, meaning probably deleted @@ -2115,15 +1873,6 @@ function refreshAccountPage() { let datehide = true; - // if ( - // activeFilters.includes("date_all") || - // (activeFilters.includes("date_day") && timeSinceTest <= 86400) || - // (activeFilters.includes("date_week") && timeSinceTest <= 604800) || - // (activeFilters.includes("date_month") && timeSinceTest <= 18144000) - // ) { - // datehide = false; - // } - if ( config.resultFilters.date.all || (config.resultFilters.date.last_day && timeSinceTest <= 86400) || @@ -2299,8 +2048,6 @@ function refreshAccountPage() { lastTimestamp = date; }); - // console.log(activityChartData); - activityChart.options.scales.xAxes[0].ticks.minor.fontColor = themeColors.sub; activityChart.options.scales.yAxes[0].ticks.minor.fontColor = @@ -2320,7 +2067,6 @@ function refreshAccountPage() { activityChart.options.scales.yAxes[1].scaleLabel.fontColor = themeColors.sub; activityChart.data.datasets[1].borderColor = themeColors.sub; - // activityChart.data.datasets[1].backgroundColor = themeColors.main; activityChart.data.datasets[1].data = activityChartData_avgWpm; activityChart.options.legend.labels.fontColor = themeColors.sub; @@ -2384,9 +2130,6 @@ function refreshAccountPage() { $(".pageAccount .triplegroup.stats").removeClass("hidden"); } - // moment - // .utc(moment.duration(totalSeconds, "seconds").asMilliseconds()) - // .format("HH:mm:ss") let th = Math.floor(totalSeconds / 3600); let tm = Math.floor((totalSeconds % 3600) / 60); let ts = Math.floor((totalSeconds % 3600) % 60); @@ -2396,9 +2139,6 @@ function refreshAccountPage() { ts < 10 ? "0" + ts : ts } `); - //moment - // .utc(moment.duration(totalSecondsFiltered, "seconds").asMilliseconds()) - // .format("HH:mm:ss") let tfh = Math.floor(totalSecondsFiltered / 3600); let tfm = Math.floor((totalSecondsFiltered % 3600) / 60); let tfs = Math.floor((totalSecondsFiltered % 3600) % 60); @@ -2431,9 +2171,6 @@ function refreshAccountPage() { Math.round(totalAcc10 / last10) + "%" ); - // console.log(totalCons10); - // console.log(last10); - if (totalCons == 0 || totalCons == undefined) { $(".pageAccount .avgCons .val").text("-"); $(".pageAccount .avgCons10 .val").text("-"); @@ -2458,31 +2195,6 @@ function refreshAccountPage() { (testRestarts / testCount).toFixed(1) ); - // if(testCount == 0){ - // $('.pageAccount .group.chart').fadeOut(125); - // $('.pageAccount .triplegroup.stats').fadeOut(125); - // $('.pageAccount .group.history').fadeOut(125); - // }else{ - // $('.pageAccount .group.chart').fadeIn(125); - // $('.pageAccount .triplegroup.stats').fadeIn(125); - // $('.pageAccount .group.history').fadeIn(125); - // } - - // let favMode = testModes.words10; - // let favModeName = 'words10'; - // $.each(testModes, (key, mode) => { - // if (mode.length > favMode.length) { - // favMode = mode; - // favModeName = key; - // } - // }) - // if (favModeName == 'words10' && testModes.words10.length == 0) { - // //new user - // $(".pageAccount .favouriteTest .val").text(`-`); - // } else { - // $(".pageAccount .favouriteTest .val").text(`${favModeName} (${Math.floor((favMode.length/testCount) * 100)}%)`); - // } - if (resultHistoryChart.data.datasets[0].data.length > 0) { resultHistoryChart.options.plugins.trendlineLinear = true; } else { @@ -2503,7 +2215,6 @@ function refreshAccountPage() { let wpmChangePerHour = wpmChange * (3600 / totalSecondsFiltered); - // let slope = calculateSlope(trend); let plus = wpmChangePerHour > 0 ? "+" : ""; $(".pageAccount .group.chart .below .text").text( @@ -2523,13 +2234,11 @@ function refreshAccountPage() { } else if (dbSnapshot.results === undefined) { db_getUserResults().then((d) => { if (d) { - // cont(); showActiveFilters(); } else { setTimeout(() => { changePage(""); }, 500); - // console.log("something went wrong"); } }); } else { @@ -2617,13 +2326,6 @@ function updateActiveResultEditTagsPanelButtons(active) { } else { $(obj).removeClass("active"); } - // active.forEach(activetagid => { - // if(activetagid === tagid){ - // $(obj).addClass('active'); - // }else{ - // $(obj).removeClass('active'); - // } - // }) }); } @@ -2697,8 +2399,6 @@ $("#resultEditTagsPanel .confirmButton").click((f) => { "no tags" ); } - - // refreshAccountPage(); } else { showNotification("Error updating tags", 3000); } diff --git a/src/js/commandline.js b/src/js/commandline.js index faf52de62..b77dc95a7 100644 --- a/src/js/commandline.js +++ b/src/js/commandline.js @@ -224,13 +224,6 @@ let commands = { toggleHideExtraLetters(); }, }, - // { - // id: "toggleReadAheadMode", - // display: "Toggle read ahead mode", - // exec: () => { - // toggleReadAheadMode(); - // }, - // }, { id: "toggleQuickEnd", display: "Toggle quick end", @@ -929,14 +922,6 @@ let commandsPaceCaret = { setPaceCaret("custom"); }, }, - // { - // id: "setPaceCaretCustomSpeed", - // display: "Set custom speed...", - // input: true, - // exec: (input) => { - // console.log(input); - // }, - // }, ], }; @@ -959,14 +944,6 @@ let commandsMinWpm = { setMinWpm("custom"); }, }, - // { - // id: "setPaceCaretCustomSpeed", - // display: "Set custom speed...", - // input: true, - // exec: (input) => { - // console.log(input); - // }, - // }, ], }; @@ -1596,11 +1573,9 @@ let commandsLanguages = { ], }; -// if (getLanguageList().length > 0) { commandsLanguages.list = []; getLanguageList().then((languages) => { languages.forEach((language) => { - // if (language === "english_10k") return; commandsLanguages.list.push({ id: "changeLanguage" + capitalizeFirstLetter(language), display: language.replace(/_/g, " "), @@ -1611,19 +1586,7 @@ getLanguageList().then((languages) => { }, }); }); - // if (language === "english_expanded") { - // commandsLanguages.list.push({ - // id: "changeLanguageEnglish10k", - // display: "english 10k", - // exec: () => { - // changeLanguage("english_10k"); - // restartTest(); - // saveConfigToCookie(); - // }, - // }); - // } }); -// } let commandsLayouts = { title: "Change layout...", @@ -2040,7 +2003,4 @@ function displayFoundCommands() { } catch (e) {} } $("#commandLine .listTitle").remove(); - // if(currentCommands.title != ''){ - // $("#commandLine .suggestions").before("
"+currentCommands.title+"
"); - // } } diff --git a/src/js/db.js b/src/js/db.js index b51424253..4d5ed78f1 100644 --- a/src/js/db.js +++ b/src/js/db.js @@ -22,37 +22,11 @@ async function db_getUserSnapshot() { }, }, }; - // await db.collection('results') - // .orderBy('timestamp', 'desc') - // .where('uid', '==', user.uid) - // .get() - // .then(data => { - // // console.log('getting data from db!'); - // data.docs.forEach(doc => { - // ret.push(doc.data()); - // }) - // }) try { - // await db - // .collection(`users/${user.uid}/results/`) - // .orderBy("timestamp", "desc") - // .get() - // .then((data) => { - // // console.log('getting data from db!'); - // data.docs.forEach((doc) => { - // let result = doc.data(); - // result.id = doc.id; - // snap.results.push(result); - // }); - // }) - // .catch((e) => { - // throw e; - // }); await db .collection(`users/${user.uid}/tags/`) .get() .then((data) => { - // console.log('getting data from db!'); data.docs.forEach((doc) => { let tag = doc.data(); tag.id = doc.id; @@ -67,7 +41,6 @@ async function db_getUserSnapshot() { .doc(user.uid) .get() .then((res) => { - // console.log('getting data from db!'); let data = res.data(); if (data === undefined) return; if (data.personalBests !== undefined) { @@ -157,9 +130,6 @@ async function db_getUserHighestWpm( let retval; if (dbSnapshot == null || dbSnapshot.results === undefined) { - // await db_getUserResults().then(data => { - // retval = cont(); - // }); retval = 0; } else { retval = cont(); @@ -188,9 +158,6 @@ async function db_getLocalPB(mode, mode2, punctuation, language, difficulty) { let retval; if (dbSnapshot == null) { - // await db_getUserResults().then(data => { - // retval = cont(); - // }); } else { retval = cont(); } @@ -260,9 +227,6 @@ async function db_saveLocalPB( } if (dbSnapshot == null) { - // await db_getUserResults().then(data => { - // retval = cont(); - // }); } else { cont(); } diff --git a/src/js/leaderboards.js b/src/js/leaderboards.js index a016a3249..bab70d73b 100644 --- a/src/js/leaderboards.js +++ b/src/js/leaderboards.js @@ -40,37 +40,8 @@ function updateLeaderboards() { `#leaderboardsWrapper .buttons .button[board=${currentLeaderboard}]` ).addClass("active"); - // $( - // `#leaderboardsWrapper .leaderboardMode .button[mode=${currentLeaderboard.mode}]` - // ).addClass("active"); - - // $("#leaderboardsWrapper .leaderboardWords .button").removeClass("active"); - // $( - // `#leaderboardsWrapper .leaderboardWords .button[words=${currentLeaderboard.words}]` - // ).addClass("active"); - - // $("#leaderboardsWrapper .leaderboardTime .button").removeClass("active"); - // $( - // `#leaderboardsWrapper .leaderboardTime .button[time=${currentLeaderboard.time}]` - // ).addClass("active"); - let boardinfo = currentLeaderboard.split("_"); - // if (boardinfo[0] === "time") { - // $("#leaderboardsWrapper .leaderboardWords").addClass("hidden"); - // $("#leaderboardsWrapper .leaderboardTime").removeClass("hidden"); - // } else if (currentLeaderboard.mode === "words") { - // $("#leaderboardsWrapper .leaderboardWords").removeClass("hidden"); - // $("#leaderboardsWrapper .leaderboardTime").addClass("hidden"); - // } - - // let mode2; - // if (currentLeaderboard.mode === "words") { - // mode2 = currentLeaderboard.words; - // } else if (currentLeaderboard.mode === "time") { - // mode2 = currentLeaderboard.time; - // } - let uid = null; if (firebase.auth().currentUser !== null) { uid = firebase.auth().currentUser.uid; @@ -260,13 +231,3 @@ $("#leaderboardsWrapper .buttons .button").click((e) => { currentLeaderboard = $(e.target).attr("board"); updateLeaderboards(); }); - -// $("#leaderboardsWrapper .leaderboardWords .button").click((e) => { -// currentLeaderboard.words = $(e.target).attr("words"); -// updateLeaderboards(); -// }); - -// $("#leaderboardsWrapper .leaderboardTime .button").click((e) => { -// currentLeaderboard.time = $(e.target).attr("time"); -// updateLeaderboards(); -// }); diff --git a/src/js/script.js b/src/js/script.js index 701309226..91215eec9 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -259,7 +259,6 @@ function copyResultToClipboard() { x: sourceX - 25, y: sourceY - 25, }).then(function (canvas) { - // document.body.appendChild(canvas); canvas.toBlob(function (blob) { navigator.clipboard .write([ @@ -373,10 +372,6 @@ function activateFunbox(funbox, mode) { function toggleScriptFunbox(...params) { if (activeFunBox === "tts") { var msg = new SpeechSynthesisUtterance(); - // var voices = window.speechSynthesis.getVoices(); - // msg.voice = voices[0]; - // msg.volume = 1; // From 0 to 1 - // msg.rate = 1; // From 0.1 to 10 msg.text = params[0]; msg.lang = "en-US"; window.speechSynthesis.cancel(); @@ -458,7 +453,6 @@ async function initWords() { config.mode == "words" || config.mode == "custom" ) { - // let wordsBound = config.mode == "time" ? 60 : config.words; let wordsBound = 100; if (config.showAllLines) { if (config.mode === "custom") { @@ -900,39 +894,28 @@ function updateActiveElement() { } active.classList.remove("active"); } - // $("#words .word").removeClass("active"); - // $($("#words .word")[currentWordIndex]).addClass("active").removeClass("error"); - - // document.querySelectorAll("#words .word")[currentWordIndex].classList.add("active"); try { let activeWord = document.querySelectorAll("#words .word")[ currentWordElementIndex ]; activeWord.classList.add("active"); activeWord.classList.remove("error"); - - // activeWordTop = $("#words .word.active").position().top; activeWordTop = document.querySelector("#words .active").offsetTop; if (config.highlightMode == "word") { activeWord.querySelectorAll("letter").forEach((e) => { e.classList.add("correct"); }); } - // updateHighlightedKeymapKey(); } catch (e) {} toggleScriptFunbox(wordsList[currentWordIndex]); } function compareInput(showError) { - // let wrdAtIndex = $("#words .word")[wrdIndex]; let input = currentInput; let wordAtIndex; let currentWord; wordAtIndex = document.querySelector("#words .word.active"); currentWord = wordsList[currentWordIndex]; - // while (wordAtIndex.firstChild) { - // wordAtIndex.removeChild(wordAtIndex.firstChild); - // } let ret = ""; if (config.highlightMode == "word") { @@ -972,7 +955,6 @@ function compareInput(showError) { if (charCorrect) { ret += '' + currentWord[i] + ""; - // $(letterElems[i]).removeClass('incorrect').addClass('correct'); } else { if (config.difficulty == "master") { if (!resultVisible) { @@ -991,7 +973,6 @@ function compareInput(showError) { } if (!showError) { if (currentWord[i] == undefined) { - // ret += '' + input[i] + ""; } else { ret += '' + currentWord[i] + ""; } @@ -1040,7 +1021,6 @@ function compareInput(showError) { showResult(); } } - // liveWPM() } function highlightBadWord(index, showError) { @@ -1051,14 +1031,6 @@ function highlightBadWord(index, showError) { function showTimer() { let op = config.showTimerProgress ? config.timerOpacity : 0; if (config.timerStyle === "bar") { - // let op = 0.25; - // if ( - // $("#timerNumber").hasClass("timerSub") || - // $("#timerNumber").hasClass("timerText") || - // $("#timerNumber").hasClass("timerMain") - // ) { - // op = 1; - // } $("#timerWrapper").stop(true, true).removeClass("hidden").animate( { opacity: op, @@ -1066,14 +1038,6 @@ function showTimer() { 250 ); } else if (config.timerStyle === "text") { - // let op = 0.25; - // if ( - // $("#timerNumber").hasClass("timerSub") || - // $("#timerNumber").hasClass("timerText") || - // $("#timerNumber").hasClass("timerMain") - // ) { - // op = 1; - // } $("#timerNumber").stop(true, true).removeClass("hidden").animate( { opacity: op, @@ -1156,26 +1120,11 @@ function updateTimer() { "linear" ); } else if (config.timerStyle === "text") { - // var displayTime = new Date(null); - // displayTime.setSeconds(config.time - time); - // displayTime = displayTime.toISOString().substr(11, 8); - // while ( - // displayTime.substr(0, 2) == "00" || - // displayTime[0] == ":" || - // (displayTime.length == 2 && displayTime[0] == "0") - // ) { - // if (displayTime.substr(0, 2) == "00") { - // displayTime = displayTime.substr(3); - // } else { - // displayTime = displayTime.substr(1); - // } - // } let displayTime = secondsToString(config.time - time); if (config.time === 0) { displayTime = secondsToString(time); } $("#timerNumber").html("
" + displayTime + "
"); - // $("#timerNumber").html(config.time - time); } else if (config.timerStyle === "mini") { let displayTime = secondsToString(config.time - time); if (config.time === 0) { @@ -1228,7 +1177,6 @@ function updateTimer() { "
" + `${inputHistory.length}/${outof}` + "
" ); } - // $("#timerNumber").html(config.time - time); } else if (config.timerStyle === "mini") { let outof = wordsList.length; if (config.mode === "words") { @@ -1288,32 +1236,6 @@ function showKeymap() { } function flashPressedKeymapKey(key, correct) { - // return; - // $(`#${key}`).css("animation", "none").removeClass("flash").addClass("flash"); - // setTimeout((f) => { - // $(`#${key}`).removeClass("flash"); - // }, 1000); - - // from { - // color: var(--bg-color); - // background-color: var(--main-color); - // border-color: var(--main-color); - // } - - // to { - // color: var(--sub-color); - // background-color: var(--bg-color); - // border-color: var(--sub-color); - // } - - // TODO: is this used? - // let errorColor; - // if (config.colorfulMode) { - // errorColor = themeColors.colorfulError; - // } else { - // errorColor = themeColors.error; - // } - switch (key) { case "\\": case "|": @@ -1398,7 +1320,6 @@ function flashPressedKeymapKey(key, correct) { } function updateHighlightedKeymapKey() { - // return; try { if ($(".active-key") != undefined) { $(".active-key").removeClass("active-key"); @@ -1460,21 +1381,18 @@ function updateHighlightedKeymapKey() { } function updateCaretPosition() { - // return; if ($("#wordsWrapper").hasClass("hidden")) return; if ($("#caret").hasClass("off")) { return; } let caret = $("#caret"); - // let activeWord = $("#words .word.active"); let inputLen = currentInput.length; let currentLetterIndex = inputLen - 1; if (currentLetterIndex == -1) { currentLetterIndex = 0; } - // let currentLetter = $("#words .word.active letter")[currentLetterIndex]; try { let currentLetter = document .querySelector("#words .active") @@ -1621,21 +1539,10 @@ function countChars() { function calculateStats() { let testSeconds = (testEnd - testStart) / 1000; - - // if (config.mode == "words" && config.difficulty == "normal") { - // if (inputHistory.length != wordsList.length) return; - // } let chars = countChars(); - // let testNow = Date.now(); - let wpm = roundTo2( ((chars.correctWordChars + chars.correctSpaces) * (60 / testSeconds)) / 5 ); - // console.log( - // `pre-spacegate ${roundTo2( - // ((chars.correctWordChars + chars.spaces) * (60 / testSeconds)) / 5 - // )} (current ${wpm})` - // ); let wpmraw = roundTo2( ((chars.allCorrectChars + chars.spaces + @@ -1738,7 +1645,6 @@ function showResult(difficultyFailed = false) { } $("#result .stats .acc .bottom").text(roundTo2(stats.acc) + "%"); - // $("#result .stats .time .bottom").text(roundTo2(testtime) + "s"); let time = roundTo2(testtime) + "s"; if (testtime > 61) { time = secondsToString(roundTo2(testtime)); @@ -1788,18 +1694,7 @@ function showResult(difficultyFailed = false) { if (afkSecondsPercent > 0) { $("#result .stats .time .bottom .afk").text(afkSecondsPercent + "% afk"); } - - // TODO: is this used? - // let correctcharpercent = roundTo2( - // ((stats.correctChars + stats.correctSpaces) / - // (stats.correctChars + - // stats.correctSpaces + - // stats.incorrectChars + - // stats.extraChars)) * - // 100 - // ); $("#result .stats .key .bottom").text(testtime + "s"); - // $("#result .stats .key .bottom").attr("aria-label", `Correct, incorrect, missed and extra \n ${correctcharpercent}%`); $("#words").removeClass("blurred"); $(".outOfFocusWarning").addClass("hidden"); $("#result .stats .key .bottom").text( @@ -1948,9 +1843,6 @@ function showResult(difficultyFailed = false) { wpmOverTimeChart.options.scales.yAxes[1].ticks.min = 0; } - // wpmOverTimeChart.options.scales.yAxes[0].ticks.min = Math.round(minChartVal); - // wpmOverTimeChart.options.scales.yAxes[1].ticks.min = Math.round(minChartVal); - let errorsNoZero = []; for (let i = 0; i < errorsPerSecond.length; i++) { @@ -2024,7 +1916,6 @@ function showResult(difficultyFailed = false) { difficulty: config.difficulty, testDuration: testtime, blindMode: config.blindMode, - // readAheadMode: config.readAheadMode, theme: config.theme, tags: activeTags, keySpacing: keypressStats.spacing.array, @@ -2040,8 +1931,6 @@ function showResult(difficultyFailed = false) { ((config.difficulty == "master" || config.difficulty == "expert") && !difficultyFailed) ) { - // console.log(incompleteTestSeconds); - // console.log(restartCount); restartCount = 0; incompleteTestSeconds = 0; } @@ -2113,9 +2002,7 @@ function showResult(difficultyFailed = false) { obj: completedEvent, }) .then((e) => { - // console.log(e.data); accountIconLoading(false); - // console.log(JSON.stringify(e.data)); if (e.data == null) { showNotification( "Unexpected response from the server.", @@ -2308,7 +2195,6 @@ function showResult(difficultyFailed = false) { obj: dbSnapshot.lbMemory, }).then((d) => { if (d.data.returnCode === 1) { - // showNotification('config saved to db',1000); } else { showNotification( `Error saving lb memory ${d.data.message}`, @@ -2346,10 +2232,6 @@ function showResult(difficultyFailed = false) { if (e.data.resultCode === 2) { //new pb if (!localPb) { - // showNotification( - // "Local PB data is out of sync! Resyncing.", - // 5000 - // ); } db_saveLocalPB( config.mode, @@ -2385,8 +2267,6 @@ function showResult(difficultyFailed = false) { console.log("Analytics unavailable"); } notSignedInLastResult = completedEvent; - - // showNotification("Sign in to save your result",3000); } } else { showNotification("Test invalid", 3000); @@ -2444,9 +2324,6 @@ function showResult(difficultyFailed = false) { if (config.blindMode) { testType += "
blind"; } - // if (config.readAheadMode) { - // testType += "
read_ahead"; - // } if (activeFunBox !== "none") { testType += "
" + activeFunBox.replace(/_/g, " "); } @@ -2531,31 +2408,11 @@ function showResult(difficultyFailed = false) { if (config.alwaysShowWordsHistory) { toggleResultWordsDisplay(); } - // if (config.blindMode) { - // $.each($("#words .word"), (i, word) => { - // let input = inputHistory[i]; - // if (input == undefined) input = currentInput; - // compareInput(i, input, true); - // if (inputHistory[i] != wordsList[i]) { - // highlightBadWord(i, true); - // } - // }); - // } - // let remove = false; - // $.each($("#words .word"), (i, obj) => { - // if (remove) { - // $(obj).remove(); - // } else { - // $(obj).removeClass("hidden"); - // if ($(obj).hasClass("active")) remove = true; - // } - // }); }); } function startTest() { if (!dbConfigLoaded) { - // console.log("config changed before db loaded!"); configChangedBeforeDb = true; } try { @@ -2569,13 +2426,10 @@ function startTest() { } testActive = true; testStart = Date.now(); - // if (config.mode == "time") { restartTimer(); showTimer(); $("#liveWpm").text("0"); showLiveWpm(); - // } - // updateActiveElement(); updateTimer(); clearTimeout(timer); keypressStats = { @@ -2605,16 +2459,9 @@ function startTest() { const delay = expectedStepEnd - Date.now(); timer = setTimeout(function () { time++; - // if(config.paceCaret !== "off") movePaceCaret(); if (config.mode === "time") { updateTimer(); } - // console.time("livewpm"); - // let wpm = liveWPM(); - // updateLiveWpm(wpm); - // showLiveWpm(); - // wpmHistory.push(wpm); - // rawHistory.push(liveRaw()); let wpmAndRaw = liveWpmAndRaw(); updateLiveWpm(wpmAndRaw.wpm, wpmAndRaw.raw); wpmHistory.push(wpmAndRaw.wpm); @@ -2653,7 +2500,6 @@ function startTest() { settingsGroups.layout.updateButton(); } - // console.timeEnd("livewpm"); keypressPerSecond.push(currentKeypress); currentKeypress = { count: 0, @@ -2664,21 +2510,6 @@ function startTest() { count: 0, words: [], }; - // if ( - // keypressPerSecond[time - 1] == 0 && - // keypressPerSecond[time - 2] == 0 && - // keypressPerSecond[time - 3] == 0 && - // keypressPerSecond[time - 4] == 0 && - // keypressPerSecond[time - 5] == 0 && - // keypressPerSecond[time - 6] == 0 && - // keypressPerSecond[time - 7] == 0 && - // keypressPerSecond[time - 8] == 0 && - // keypressPerSecond[time - 9] == 0 && - // !afkDetected - // ) { - // showNotification("AFK detected", 3000); - // afkDetected = true; - // } if ( config.minWpm === "custom" && wpmAndRaw.wpm < parseInt(config.minWpmCustomSpeed) @@ -2703,7 +2534,6 @@ function startTest() { return; } } - // console.log('step'); loop(expectedStepEnd + stepIntervalMS); }, delay); })(testStart + stepIntervalMS); @@ -2740,7 +2570,6 @@ function restartTest(withSameWordset = false, nosave = false) { manualRestart = false; clearTimeout(timer); time = 0; - // afkDetected = false; wpmHistory = []; rawHistory = []; missedWords = {}; @@ -2779,7 +2608,6 @@ function restartTest(withSameWordset = false, nosave = false) { }, }; $("#timerNumber").css("opacity", 0); - // restartTimer(); let el = null; if (resultVisible) { //results are being displayed @@ -2800,8 +2628,6 @@ function restartTest(withSameWordset = false, nosave = false) { } resultVisible = false; - // .css("transition", "1s linear"); - el.stop(true, true).animate( { opacity: 0, @@ -2846,8 +2672,6 @@ function restartTest(withSameWordset = false, nosave = false) { $("#result").addClass("hidden"); $("#testModesNotice").removeClass("hidden").css({ opacity: 1, - // 'height': 'auto', - // 'margin-bottom': '1.25rem' }); resetPaceCaret(); $("#typingTest") @@ -2867,37 +2691,10 @@ function restartTest(withSameWordset = false, nosave = false) { wpmOverTimeChart.options.annotation.annotations[0].value = "-30"; wpmOverTimeChart.update(); updateTestModesNotice(); - - // let oldHeight = $("#words").height(); - // let newHeight = $("#words") - // .css("height", "fit-content") - // .css("height", "-moz-fit-content") - // .height(); - // if (testMode == "words" || testMode == "custom") { - // $("#words") - // .stop(true, true) - // .css("height", oldHeight) - // .animate({ height: newHeight }, 250, () => { - // $("#words") - // .css("height", "fit-content") - // .css("height", "-moz-fit-content"); - // $("#wordsInput").focus(); - // updateCaretPosition(); - // }); - // } else if (testMode == "time") { - // $("#words") - // .stop(true, true) - // .css("height", oldHeight) - // .animate({ height: 78 }, 250, () => { - // $("#wordsInput").focus(); - // updateCaretPosition(); - // }); - // } } ); } ); - // $(".active-key").classList.remove("active-key"); } function focusWords() { @@ -2916,7 +2713,6 @@ function setCustomText() { setMode("time"); customText = "The quick brown fox jumped over the lazy dog".split(" "); } - // initWords(); } function cleanTypographySymbols(textToClean) { @@ -3058,37 +2854,10 @@ function setMode(mode, nosave) { $("#top .config .numbersMode").addClass("hidden"); $("#result .stats .source").removeClass("hidden"); $("#top .config .quoteLength").removeClass("hidden"); - // changeLanguage("english", nosave); } if (!nosave) saveConfigToCookie(); } -// function liveWPM() { -// let correctWordChars = 0; -// for (let i = 0; i < inputHistory.length; i++) { -// if (inputHistory[i] == wordsList[i]) { -// //the word is correct -// //+1 for space -// correctWordChars += wordsList[i].length + 1; -// } -// } -// let testNow = Date.now(); -// let testSeconds = (testNow - testStart) / 1000; -// wpm = (correctWordChars * (60 / testSeconds)) / 5; -// return Math.round(wpm); -// } - -// function liveRaw() { -// let chars = 0; -// for (let i = 0; i < inputHistory.length; i++) { -// chars += inputHistory[i].length + 1; -// } -// let testNow = Date.now(); -// let testSeconds = (testNow - testStart) / 1000; -// raw = (chars * (60 / testSeconds)) / 5; -// return Math.round(raw); -// } - function liveWpmAndRaw() { let chars = 0; let correctWordChars = 0; @@ -3124,7 +2893,6 @@ function updateLiveWpm(wpm, raw) { } else { showLiveWpm(); } - // let wpmstring = wpm < 100 ? ` ${wpm}` : `${wpm}`; let number = wpm; if (config.blindMode) { number = raw; @@ -3134,7 +2902,6 @@ function updateLiveWpm(wpm, raw) { } document.querySelector("#miniTimerAndLiveWpm .wpm").innerHTML = number; document.querySelector("#liveWpm").innerHTML = number; - // $("#liveWpm").html(wpm); } function showLiveWpm() { @@ -3145,9 +2912,6 @@ function showLiveWpm() { } else { $("#liveWpm").css("opacity", config.timerOpacity); } - // if (config.timerStyle === "text") { - // $("#timerNumber").css("opacity", config.timerOpacity); - // } } function hideLiveWpm() { @@ -3222,16 +2986,12 @@ function updateAccountLoginButton() { $("#menu .icon-button.account"), 250 ); - // $("#menu .icon-button.account").removeClass('hidden'); - // $("#menu .icon-button.login").addClass('hidden'); } else { swapElements( $("#menu .icon-button.account"), $("#menu .icon-button.login"), 250 ); - // $("#menu .icon-button.login").removeClass('hidden'); - // $("#menu .icon-button.account").addClass('hidden'); } } @@ -3280,7 +3040,6 @@ function toggleResultWordsDisplay() { async function loadWordsHistory() { $("#resultWordsHistory .words").empty(); - // inputHistory.forEach((input, index) => { for (let i = 0; i < inputHistory.length + 2; i++) { let input = inputHistory[i]; let wordEl = ""; @@ -3340,7 +3099,6 @@ async function loadWordsHistory() { } for (let c = 0; c < loop; c++) { - // input.forEach((inputLetter, inputLetteri) => { let correctedChar; try { correctedChar = correctedHistory[i][c]; @@ -3414,14 +3172,6 @@ function applyColorfulMode(tc) { } } -// function applyReadAheadMode(tc) { -// if (tc) { -// $("#words").addClass("readAheadMode"); -// } else { -// $("#words").removeClass("readAheadMode"); -// } -// } - function showEditTags(action, id, name) { if (action === "add") { $("#tagsWrapper #tagsEdit").attr("action", "add"); @@ -3533,12 +3283,6 @@ function updateTestModesNotice() { ); } - // if (config.readAheadMode) { - // $(".pageTest #testModesNotice").append( - // `
read ahead
` - // ); - // } - if (activeFunBox !== "none") { $(".pageTest #testModesNotice").append( `
${activeFunBox.replace( @@ -3572,11 +3316,6 @@ function updateTestModesNotice() { } let tagsString = ""; - // $.each($('.pageSettings .section.tags .tagsList .tag'), (index, tag) => { - // if($(tag).children('.active').attr('active') === 'true'){ - // tagsString += $(tag).children('.title').text() + ', '; - // } - // }) try { dbSnapshot.tags.forEach((tag) => { if (tag.active === true) { @@ -3694,8 +3433,6 @@ function tagsEdit() { updateResultEditTagsPanelButtons(); updateSettingsPage(); updateFilterTags(); - //TODO: is this used? - //updateActiveTags(); } else if (status < -1) { showNotification("Unknown error", 3000); } @@ -3781,21 +3518,11 @@ $("#customTextPopup .button").click((e) => { text = cleanTypographySymbols(text); } text = text.split(" "); - // if (text.length >= 10000) { - // showNotification("Custom text cannot be longer than 10000 words.", 4000); - // setMode("time"); - // text = "The quick brown fox jumped over the lazy dog".split(" "); - // } else { customText = text; customTextIsRandom = $("#customTextPopup .check input").prop("checked"); - // if (customTextIsRandom && customText.length < 3) { - // showNotification("Random custom text requires at least 3 words", 4000); - // customTextIsRandom = false; - // } customTextWordCount = $("#customTextPopup .wordcount input").val(); manualRestart = true; restartTest(); - // } hideCustomTextPopup(); }); @@ -3847,9 +3574,6 @@ function playClickSound() { if (randomSound.counter === 2) randomSound.counter = 0; randomSound.sounds[randomSound.counter].currentTime = 0; randomSound.sounds[randomSound.counter].play(); - - // clickSound.currentTime = 0; - // clickSound.play(); } function playErrorSound() { @@ -3904,114 +3628,6 @@ async function initPaceCaret(nosave = false) { }; } -// function movePaceCaret() { -// if (paceCaret === null) { -// return; -// } -// if ($("#paceCaret").hasClass("hidden")) { -// $("#paceCaret").removeClass("hidden"); -// } -// try { -// let currentMove = 0; -// let newCurrentWord = paceCaret.currentWordIndex; -// let newCurrentLetter = paceCaret.currentLetterIndex; - -// while (currentMove < paceCaret.cps) { -// let currentWordLen; -// try { -// if (newCurrentLetter < 0) { -// currentWordLen = wordsList[newCurrentWord].length; -// } else { -// currentWordLen = wordsList[newCurrentWord].length - newCurrentLetter; -// } -// } catch (e) { -// //out of words -// paceCaret = null; -// $("#paceCaret").addClass("hidden"); -// return; -// } -// if (currentMove + currentWordLen <= paceCaret.cps) { -// //good to move -// currentMove += currentWordLen; -// currentMove++; //space -// newCurrentWord++; -// newCurrentLetter = -1; -// } else { -// //too much, need to go sub -// if (currentWordLen === 1) { -// newCurrentWord++; -// currentMove += paceCaret.cps - currentMove; -// newCurrentLetter = -1; -// } else { -// newCurrentLetter += paceCaret.cps - currentMove; -// currentMove += paceCaret.cps - currentMove; -// } - -// // newCurrentWord++; -// } -// } - -// paceCaret.currentWordIndex = Math.round(newCurrentWord); -// paceCaret.currentLetterIndex = Math.round(newCurrentLetter); - -// let caret = $("#paceCaret"); -// let currentLetter; -// let newTop; -// let newLeft; -// try { -// if (paceCaret.currentLetterIndex === -1) { -// currentLetter = document -// .querySelectorAll("#words .word") -// [ -// paceCaret.currentWordIndex - -// (currentWordIndex - currentWordElementIndex) -// ].querySelectorAll("letter")[0]; -// } else { -// currentLetter = document -// .querySelectorAll("#words .word") -// [ -// paceCaret.currentWordIndex - -// (currentWordIndex - currentWordElementIndex) -// ].querySelectorAll("letter")[paceCaret.currentLetterIndex]; -// } -// newTop = currentLetter.offsetTop - $(currentLetter).height() / 4; -// newLeft; -// if (paceCaret.currentLetterIndex === -1) { -// newLeft = currentLetter.offsetLeft; -// } else { -// newLeft = -// currentLetter.offsetLeft + $(currentLetter).width() - caret.width() / 2; -// } -// }catch(e){} - -// let duration = 0; - -// if (newTop > document.querySelector("#paceCaret").offsetTop) { -// duration = 0; -// } - -// let smoothlinescroll = $("#words .smoothScroller").height(); -// if (smoothlinescroll === undefined) smoothlinescroll = 0; - -// $("#paceCaret").css({ -// top: newTop - smoothlinescroll, -// }); - -// caret.stop(true, true).animate( -// { -// left: newLeft, -// }, -// duration, -// "linear" -// ); -// } catch (e) { -// // $("#paceCaret").animate({ opacity: 0 }, 250, () => { -// console.error(e); -// $("#paceCaret").addClass("hidden"); -// // }); -// } -// } - function movePaceCaret(expectedStepEnd) { if (paceCaret === null || !testActive || resultVisible) { return; @@ -4034,8 +3650,6 @@ function movePaceCaret(expectedStepEnd) { } if (!config.blindMode) { if (paceCaret.correction < 0) { - // paceCaret.correction++; - while (paceCaret.correction < 0) { paceCaret.currentLetterIndex--; if (paceCaret.currentLetterIndex <= -2) { @@ -4112,7 +3726,6 @@ function movePaceCaret(expectedStepEnd) { }); let duration = expectedStepEnd - performance.now(); - // console.log(duration); if (config.smoothCaret) { caret.stop(true, true).animate( @@ -4139,10 +3752,8 @@ function movePaceCaret(expectedStepEnd) { } }, duration); } catch (e) { - // $("#paceCaret").animate({ opacity: 0 }, 250, () => { console.error(e); $("#paceCaret").addClass("hidden"); - // }); } } @@ -4253,21 +3864,6 @@ $(document).on("click", "#top .logo", (e) => { $(document).on("click", "#top .config .wordCount .text-button", (e) => { const wrd = $(e.currentTarget).attr("wordCount"); if (wrd == "custom") { - // let newWrd = prompt("Custom word amount"); - // if (newWrd !== null && !isNaN(newWrd) && newWrd > 0 && newWrd <= 10000) { - // setWordCount(newWrd); - // if (newWrd > 2000) { - // showNotification( - // "Very long tests can cause performance issues or crash the website on some machines!", - // 5000 - // ); - // } - // } else { - // showNotification( - // "Custom word amount can only be set between 1 and 10000", - // 3000 - // ); - // } showCustomMode2Popup("words"); } else { setWordCount(wrd); @@ -4279,18 +3875,6 @@ $(document).on("click", "#top .config .wordCount .text-button", (e) => { $(document).on("click", "#top .config .time .text-button", (e) => { let mode = $(e.currentTarget).attr("timeConfig"); if (mode == "custom") { - // let newTime = prompt("Custom time in seconds"); - // if (newTime !== null && !isNaN(newTime) && newTime > 0 && newTime <= 3600) { - // setTimeConfig(newTime); - // if (newTime >= 1800) { - // showNotification( - // "Very long tests can cause performance issues or crash the website on some machines!", - // 5000 - // ); - // } - // } else { - // showNotification("Custom time can only be set between 1 and 3600", 3000); - // } showCustomMode2Popup("time"); } else { setTimeConfig(mode); @@ -4308,8 +3892,6 @@ $(document).on("click", "#top .config .quoteLength .text-button", (e) => { }); $(document).on("click", "#top .config .customText .text-button", (e) => { - // changeCustomText(); - // restartTest(); showCustomTextPopup(); }); @@ -4655,10 +4237,7 @@ $(document).keydown((event) => { if (currentInput === "") return; event.preventDefault(); let currentWord = wordsList[currentWordIndex]; - // if (config.mode == "time") { if (!config.showAllLines || config.mode == "time") { - // let currentTop = Math.floor($($("#words .word")[currentWordIndex]).position().top); - // let nextTop = Math.floor($($("#words .word")[currentWordIndex + 1]).position().top); if (config.stopOnError != "off") { if (currentWord !== currentInput) return; } @@ -4691,10 +4270,8 @@ $(document).keydown((event) => { let wordElements = $("#words .word"); for (let i = 0; i < currentWordElementIndex + 1; i++) { if ($(wordElements[i]).hasClass("hidden")) continue; - // let forWordTop = Math.floor($(wordElements[i]).position().top); let forWordTop = Math.floor(wordElements[i].offsetTop); if (forWordTop < hideBound - 10) { - // $($("#words .word")[i]).addClass("hidden"); toHide.push($($("#words .word")[i])); } } @@ -4745,29 +4322,6 @@ $(document).keydown((event) => { document.querySelector("#paceCaret").offsetTop - wordHeight, }); } - // if (config.smoothLineScroll) { - // let word = $(document.querySelector(".word")); - // $("#words").prepend( - // `
` - // ); - // lineTransition = true; - // $("#words .smoothScroller").animate( - // { - // height: 0, - // }, - // 100, - // () => { - // $("#words .smoothScroller").remove(); - // lineTransition = false; - // $(this).remove(); - // activeWordTop = document.querySelector("#words .active") - // .offsetTop; - // } - // ); - // } - // toHide.forEach((el) => el.remove()); } currentTestLine++; } @@ -4786,9 +4340,6 @@ $(document).keydown((event) => { settingsGroups.layout.updateButton(); } if (config.blindMode) $("#words .word.active letter").addClass("correct"); - // document - // .querySelector("#words .word.active") - // .setAttribute("input", currentInput); dontInsertSpace = true; if (currentWord == currentInput) { //correct word @@ -4844,12 +4395,10 @@ $(document).keydown((event) => { correctedHistory.push(currentCorrected); lastSecondNotRound = true; showResult(true); - // if (!afkDetected) { let testNow = Date.now(); let testSeconds = roundTo2((testNow - testStart) / 1000); incompleteTestSeconds += testSeconds; restartCount++; - // } return; } return; @@ -4865,12 +4414,10 @@ $(document).keydown((event) => { //submitted last word incorrect and failed test lastSecondNotRound = true; showResult(true); - // if (!afkDetected) { let testNow = Date.now(); let testSeconds = roundTo2((testNow - testStart) / 1000); incompleteTestSeconds += testSeconds; restartCount++; - // } return; } else if (currentWordIndex == wordsList.length) { //submitted last word that is incorrect @@ -4897,11 +4444,6 @@ $(document).keydown((event) => { ) { updateTimer(); } - // if (config.showAllLines) { - // if (config.mode == "time") { - // addWord(); - // } - // } else { if ( config.mode == "time" || config.mode == "words" || @@ -4909,7 +4451,6 @@ $(document).keydown((event) => { ) { addWord(); } - // } } } }); @@ -5023,7 +4564,6 @@ $(document).keydown(function (event) { currentError.words.push(currentWordIndex); thisCharCorrect = false; if (!Object.keys(missedWords).includes(wordsList[currentWordIndex])) { - // missedWords.push(wordsList[currentWordIndex]); missedWords[wordsList[currentWordIndex]] = 1; } else { missedWords[wordsList[currentWordIndex]]++; @@ -5085,9 +4625,6 @@ $(document).keydown(function (event) { activeWordTopBeforeJump = activeWordTop; compareInput(!config.blindMode); - // let newActiveTop = $("#words .word.active").position().top; - - // console.time("offcheck1"); let newActiveTop = document.querySelector("#words .word.active").offsetTop; if (activeWordTopBeforeJump < newActiveTop && !lineTransition) { activeWordJumped = true; @@ -5101,8 +4638,6 @@ $(document).keydown(function (event) { activeWordJumped = false; } - // console.timeEnd("offcheck2"); - if (config.keymapMode === "react") { flashPressedKeymapKey(event.key, thisCharCorrect); } else if (config.keymapMode === "next") { @@ -5113,7 +4648,6 @@ $(document).keydown(function (event) { $(document).keydown((event) => { keypressStats.duration.current = performance.now(); - // if ($(".pageTest").hasClass("active")) { try { if ( !config.capsLockBackspace && @@ -5124,7 +4658,6 @@ $(document).keydown((event) => { hideCapsWarning(); } } catch (e) {} - // } }); $(document).keyup((event) => { @@ -5216,8 +4749,6 @@ $("#wpmChart").on("mouseleave", (e) => { $(document).ready(() => { updateFavicon(32, 14); $("body").css("transition", ".25s"); - // manualRestart = true; - // restartTest(false,true); if (config.quickTab) { $("#restartTestButton").addClass("hidden"); } @@ -5277,7 +4808,6 @@ let wpmOverTimeChart = new Chart(ctx, { { label: "wpm", data: [], - // backgroundColor: 'rgba(255, 255, 255, 0.25)', borderColor: "rgba(125, 125, 125, 1)", borderWidth: 2, yAxisID: "wpm", @@ -5287,7 +4817,6 @@ let wpmOverTimeChart = new Chart(ctx, { { label: "raw", data: [], - // backgroundColor: 'rgba(255, 255, 255, 0.25)', borderColor: "rgba(125, 125, 125, 1)", borderWidth: 2, yAxisID: "raw", @@ -5297,13 +4826,11 @@ let wpmOverTimeChart = new Chart(ctx, { { label: "errors", data: [], - // backgroundColor: 'rgba(255, 255, 255, 0.25)', borderColor: "rgba(255, 125, 125, 1)", pointBackgroundColor: "rgba(255, 125, 125, 1)", borderWidth: 2, order: 1, yAxisID: "error", - // barPercentage: 0.1, maxBarThickness: 10, type: "scatter", pointStyle: "crossRot", @@ -5353,10 +4880,6 @@ let wpmOverTimeChart = new Chart(ctx, { }, responsive: true, maintainAspectRatio: false, - // hover: { - // mode: 'x', - // intersect: false - // }, scales: { xAxes: [ { diff --git a/src/js/settings.js b/src/js/settings.js index 3a10ff84a..5066306f1 100644 --- a/src/js/settings.js +++ b/src/js/settings.js @@ -145,10 +145,6 @@ settingsGroups.hideExtraLetters = new SettingsGroup( settingsGroups.blindMode = new SettingsGroup("blindMode", setBlindMode); settingsGroups.quickEnd = new SettingsGroup("quickEnd", setQuickEnd); settingsGroups.enableAds = new SettingsGroup("enableAds", setEnableAds); -// settingsGroups.readAheadMode = new SettingsGroup( -// "readAheadMode", -// setReadAheadMode -// ); settingsGroups.alwaysShowWordsHistory = new SettingsGroup( "alwaysShowWordsHistory", setAlwaysShowWordsHistory @@ -193,9 +189,7 @@ settingsGroups.playSoundOnClick = new SettingsGroup( "playSoundOnClick", setPlaySoundOnClick, () => { - if (config.playSoundOnClick !== "off") - // clickSounds[config.playSoundOnClick][0].sounds[0].play(); - playClickSound(); + if (config.playSoundOnClick !== "off") playClickSound(); } ); settingsGroups.showAllLines = new SettingsGroup( @@ -497,8 +491,6 @@ $("#customThemeShare .button").click((e) => { }); $("#shareCustomThemeButton").click((e) => { - // showCustomThemeShare(); - if (e.shiftKey) { showCustomThemeShare(); } else { diff --git a/src/js/userconfig.js b/src/js/userconfig.js index 73e91d488..2ead7fa06 100644 --- a/src/js/userconfig.js +++ b/src/js/userconfig.js @@ -31,7 +31,6 @@ let defaultConfig = { difficulty: "normal", blindMode: false, quickEnd: false, - // readAheadMode: false, caretStyle: "default", paceCaretStyle: "default", flipTestColors: false, @@ -86,13 +85,10 @@ let configChangedBeforeDb = false; //cookies async function saveConfigToCookie(noDbCheck = false) { if (!dbConfigLoaded && !noDbCheck) { - // console.log('config changed before db loaded!'); configChangedBeforeDb = true; } - // showNotification('saving to cookie',1000); let d = new Date(); d.setFullYear(d.getFullYear() + 1); - // $.cookie("config", null); $.cookie("config", JSON.stringify(config), { expires: d, path: "/", @@ -103,14 +99,11 @@ async function saveConfigToCookie(noDbCheck = false) { async function saveConfigToDB() { if (firebase.auth().currentUser !== null) { - // showNotification('saving to db',1000); accountIconLoading(true); saveConfig({ uid: firebase.auth().currentUser.uid, obj: config }).then( (d) => { - // console.log(d.data); accountIconLoading(false); if (d.data.returnCode === 1) { - // showNotification('config saved to db',1000); } else { showNotification( `Error saving config to DB! ${d.data.message}`, @@ -189,7 +182,6 @@ function applyConfig(configObj) { setDifficulty(configObj.difficulty, true); setBlindMode(configObj.blindMode, true); setQuickEnd(configObj.quickEnd, true); - // setReadAheadMode(configObj.readAheadMode, true); setFlipTestColors(configObj.flipTestColors, true); setColorfulMode(configObj.colorfulMode, true); setConfidenceMode(configObj.confidenceMode, true); @@ -230,13 +222,6 @@ function applyConfig(configObj) { setHideExtraLetters(configObj.hideExtraLetters, true); setStartGraphsAtZero(configObj.startGraphsAtZero, true); setMode(configObj.mode, true); - // if ( - // configObj.resultFilters !== null && - // configObj.resultFilters !== undefined - // ) { - // accountFilters = configObj.resultFilters; - // } - // config = configObj; try { setEnableAds(configObj.enableAds, true); @@ -441,35 +426,6 @@ function setChartStyle(chartStyle, nosave) { if (!nosave) saveConfigToCookie(); } -//read ahead mode -// function toggleReadAheadMode() { -// config.readAheadMode = !config.readAheadMode; -// applyReadAheadMode(config.readAheadMode); -// updateTestModesNotice(); -// saveConfigToCookie(); -// } - -// function setReadAheadMode(readAhead, nosave) { -// if (readAhead == undefined) { -// readAhead = false; -// } -// config.readAheadMode = readAhead; -// applyReadAheadMode(readAhead); -// updateTestModesNotice(); -// if (!nosave) saveConfigToCookie(); -// } - -//stoponerror -// function toggleStopOnError() { -// soe = !config.stopOnError; -// if (soe == undefined) { -// soe = false; -// } -// config.stopOnError = soe; -// updateTestModesNotice(); -// saveConfigToCookie(); -// } - function setStopOnError(soe, nosave) { if (soe == undefined || soe === true || soe === false) { soe = "off"; @@ -780,17 +736,11 @@ function setShowLiveWpm(live, nosave) { live = false; } config.showLiveWpm = live; - // if (config.keymapMode !== "off") { - // config.keymapMode = "off"; - // } if (!nosave) saveConfigToCookie(); } function toggleShowLiveWpm() { config.showLiveWpm = !config.showLiveWpm; - // if (config.keymapMode !== "off") { - // config.keymapMode = "off"; - // } saveConfigToCookie(); } @@ -812,9 +762,6 @@ function setHideExtraLetters(val, nosave) { function toggleHideExtraLetters() { config.hideExtraLetters = !config.hideExtraLetters; - // if (config.keymapMode !== "off") { - // config.keymapMode = "off"; - // } saveConfigToCookie(); } @@ -971,11 +918,6 @@ function setStartGraphsAtZero(mode, nosave) { if (!nosave) saveConfigToCookie(); } -// function toggleSmoothCaret() { -// config.smoothCaret = !config.smoothCaret; -// saveConfigToCookie(); -// } - //linescroll function setSmoothLineScroll(mode, nosave) { config.smoothLineScroll = mode; @@ -991,14 +933,12 @@ function toggleSmoothLineScroll() { function setQuickTabMode(mode, nosave) { config.quickTab = mode; if (!config.quickTab) { - // $(".pageTest").append('
'); $("#restartTestButton").removeClass("hidden"); $("#restartTestButton").css("opacity", 1); $("#bottom .keyTips") .html(`tab and enter / space - restart test
esc - command line`); } else { - // $("#restartTestButton").remove(); $("#restartTestButton").addClass("hidden"); $("#bottom .keyTips").html(`tab - restart test
esc - command line`); @@ -1009,14 +949,12 @@ function setQuickTabMode(mode, nosave) { function toggleQuickTabMode() { config.quickTab = !config.quickTab; if (!config.quickTab) { - // $(".pageTest").append('
'); $("#restartTestButton").removeClass("hidden"); $("#restartTestButton").css("opacity", 1); $("#bottom .keyTips") .html(`tab and enter / space - restart test
esc - command line`); } else { - // $("#restartTestButton").remove(); $("#restartTestButton").addClass("hidden"); $("#bottom .keyTips").html(`tab - restart test
esc - command line`); @@ -1071,7 +1009,6 @@ function previewFontFamily(font) { font = "Roboto_Mono"; } document.documentElement.style.setProperty("--font", font.replace(/_/g, " ")); - // if (!nosave) saveConfigToCookie(); } //font family @@ -1205,14 +1142,8 @@ function setRandomTheme(val, nosave) { if (!nosave) saveConfigToCookie(); } -// function toggleRandomTheme() { -// config.randomTheme = !config.randomTheme; -// saveConfigToCookie(); -// } - function setCustomTheme(boolean, nosave) { if (boolean !== undefined) config.customTheme = boolean; - // setCustomThemeColors(config.customThemeColors, nosave); if (!nosave) saveConfigToCookie(); } @@ -1251,8 +1182,6 @@ function togglePresetCustomTheme() { if (config.customTheme) { setCustomTheme(false); applyCustomThemeColors(); - // $('[tabContent="custom"]').removeClass("reveal"); - // $('[tabContent="preset"]').addClass("reveal"); swapElements( $('.pageSettings [tabContent="custom"]'), $('.pageSettings [tabContent="preset"]'), @@ -1266,8 +1195,6 @@ function togglePresetCustomTheme() { $('.pageSettings [tabContent="custom"]'), 250 ); - // $('[tabContent="preset"]').removeClass("reveal"); - // $('[tabContent="custom"]').addClass("reveal"); } $(".keymap-key").attr("style", ""); } @@ -1308,7 +1235,6 @@ function updateFavicon(size, curveSize) { ctx.textAlign = "center"; ctx.fillStyle = maincolor; ctx.fillText("mt", size / 2 + size / 32, (size / 3) * 2.1); - // document.body.appendChild(canvas); $("#favicon").attr("href", canvas.toDataURL("image/png")); } @@ -1363,12 +1289,8 @@ function setKeymapMode(mode, nosave) { if (mode == null || mode == undefined) { mode = "off"; } - // if (mode === "react" ||) { $(".active-key").removeClass("active-key"); - // } - // if (mode === "next") { $(".keymap-key").attr("style", ""); - // } config.keymapMode = mode; if (!nosave) restartTest(false, nosave); if (!nosave) saveConfigToCookie(); @@ -1390,55 +1312,10 @@ function setKeymapStyle(style, nosave) { } else if (style === "split_matrix") { $(".keymap").addClass("split_matrix"); } - // if (style === "staggered") { - // $(".keymap .keymap-split-spacer").addClass("hidden"); - // $(".keymap .r1, .r2, .r3, .r4").removeClass("matrix"); - // $(".keymap .r5").removeClass("matrixSpace"); - // $(".keymap #KeyLeftBracket").removeClass("hide-key"); - // $(".keymap #KeyRightBracket").removeClass("hide-key"); - // $(".keymap #KeyQuote").removeClass("hide-key"); - // } - // if (style === "split") { - // $(".keymap .keymap-split-spacer").removeClass("hidden"); - // $(".keymap .r1, .keymap .r2, .keymap .r3, .keymap .r4").removeClass( - // "matrix" - // ); - // $(".keymap .r5").removeClass("splitSpace"); - // $(".keymap #KeyLeftBracket").removeClass("hide-key"); - // $(".keymap #KeyRightBracket").removeClass("hide-key"); - // $(".keymap #KeyQuote").removeClass("hide-key"); - // } - // if (style === "matrix") { - // $(".keymap .keymap-split-spacer").addClass("hidden"); - // $(".keymap .r1, .keymap .r2, .keymap .r3, .keymap .r4").addClass("matrix"); - // $(".keymap .r5").addClass("matrixSpace"); - // $(".keymap #KeyLeftBracket").addClass("hide-key"); - // $(".keymap #KeyRightBracket").addClass("hide-key"); - // $(".keymap #KeyQuote").addClass("hide-key"); - // } config.keymapStyle = style; if (!nosave) saveConfigToCookie(); } -// function toggleISOKeymap() { -// val = !config.isoKeymap; -// if (val == undefined) { -// val = false; -// } -// config.isoKeymap = val; -// updateKeymapBottomRow(); -// saveConfigToCookie(); -// } - -// function setISOKeymap(val, nosave) { -// if (val == undefined) { -// val = false; -// } -// config.isoKeymap = val; -// updateKeymapBottomRow(); -// if (!nosave) saveConfigToCookie(); -// } - function keymapShowIsoKey(tf) { if (tf) { $(".keymap .r4 .keymap-key.first").removeClass("hidden-key"); @@ -1454,10 +1331,6 @@ function setKeymapLayout(layout, nosave) { config.keymapLayout = layout; refreshKeymapKeys(layout); if (!nosave) saveConfigToCookie(); - // layouts[layout].forEach((x) => { - // console.log(x); - // }); - // console.log(all.join()); } function refreshKeymapKeys(layout) { @@ -1486,16 +1359,10 @@ function refreshKeymapKeys(layout) { keymapShowIsoKey(lts.iso); var toReplace = lts.keys.slice(1, 48); - // var _ = toReplace.splice(12, 1); var count = 0; $(".keymap .letter") .map(function () { - // if ( - // !this.parentElement.classList.contains("hidden-key") && - // !this.classList.contains("hidden-key") - // ) { - if (count < toReplace.length) { var key = toReplace[count].charAt(0); this.innerHTML = key; @@ -1556,7 +1423,6 @@ function setFontSize(fontSize, nosave) { if (fontSize == null || fontSize == undefined) { fontSize = 1; } - // $("#words").stop(true, true).animate({ opacity: 0 }, 125, e => { config.fontSize = fontSize; $("#words").removeClass("size125"); $("#caret, #paceCaret").removeClass("size125"); @@ -1590,6 +1456,4 @@ function setFontSize(fontSize, nosave) { $("#miniTimerAndLiveWpm").addClass("size3"); } if (!nosave) saveConfigToCookie(); - // restartTest(); - // }); } From 01be6603d0e50e0c288c780cad498ba014d6f703 Mon Sep 17 00:00:00 2001 From: decaf Date: Sun, 8 Nov 2020 22:21:48 -0600 Subject: [PATCH 02/40] Added result options to commandline --- src/js/commandline.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/js/commandline.js b/src/js/commandline.js index faf52de62..aa370328c 100644 --- a/src/js/commandline.js +++ b/src/js/commandline.js @@ -614,6 +614,44 @@ let commands = { window.open("https://discord.gg/monkeytype"); }, }, + { + id: "repeatTest", + display: "Repeat test", + exec: () => { + if (resultVisible) { + restartTest(true); + } + }, + }, + { + id: "practiceMissedWords", + display: "Practice missed words", + exec: () => { + if (Object.keys(missedWords).length > 0) { + initPractiseMissedWords(); + } else { + showNotification("You haven't missed any words.", 2000); + } + }, + }, + { + id: "toggleWordHistory", + display: "Toggle word history", + exec: () => { + if (resultVisible) { + toggleResultWordsDisplay(); + } + }, + }, + { + id: "saveScreenshot", + display: "Save screenshot", + exec: () => { + if (resultVisible) { + copyResultToClipboard(); + } + }, + }, ], }; From 2b059bbefa545295f9a2953ae96f90babb466a75 Mon Sep 17 00:00:00 2001 From: decaf Date: Sun, 8 Nov 2020 22:42:31 -0600 Subject: [PATCH 03/40] Added onedark theme --- static/themes/list.json | 5 +++++ static/themes/onedark.css | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 static/themes/onedark.css diff --git a/static/themes/list.json b/static/themes/list.json index 3fa346d8f..d47c3aa99 100644 --- a/static/themes/list.json +++ b/static/themes/list.json @@ -433,5 +433,10 @@ "name": "iceberg_light", "bgColor": "#e8e9ec", "textColor": "#33374c" + }, + { + "name": "onedark", + "bgColor": "#2f343f", + "textColor": "#98c379" } ] diff --git a/static/themes/onedark.css b/static/themes/onedark.css new file mode 100644 index 000000000..ac94e1f58 --- /dev/null +++ b/static/themes/onedark.css @@ -0,0 +1,11 @@ +:root { + --bg-color: #2f343f; + --caret-color: #61afef; + --main-color: #61afef; + --sub-color: #eceff4; + --text-color: #98c379; + --error-color: #e06c75; + --error-extra-color: #d62436; + --colorful-error-color: #d62436; + --colorful-error-extra-color: #ff0019; +} From 5fb11b8793b74abc1ea1726707ec5b4b90ae2039 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 9 Nov 2020 21:40:38 +0000 Subject: [PATCH 04/40] removed unnecessary version tag --- static/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/index.html b/static/index.html index 95dd85869..c18942f8c 100644 --- a/static/index.html +++ b/static/index.html @@ -6,7 +6,7 @@ Monkeytype - + From 4fc64274b1f124629d53d18f038c5dc051dabb90 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 9 Nov 2020 21:41:14 +0000 Subject: [PATCH 05/40] fixed privacy policy style --- static/privacy-policy.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/privacy-policy.html b/static/privacy-policy.html index 3ff74b74e..aa12335e7 100644 --- a/static/privacy-policy.html +++ b/static/privacy-policy.html @@ -6,7 +6,7 @@ Monkeytype - + From b376ebf95e768772beb389a0c20c12170b75a920 Mon Sep 17 00:00:00 2001 From: decaf Date: Mon, 9 Nov 2020 17:29:49 -0600 Subject: [PATCH 06/40] Added resultVisible check to missed words command --- src/js/commandline.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/js/commandline.js b/src/js/commandline.js index aa370328c..a87e0622a 100644 --- a/src/js/commandline.js +++ b/src/js/commandline.js @@ -627,10 +627,12 @@ let commands = { id: "practiceMissedWords", display: "Practice missed words", exec: () => { - if (Object.keys(missedWords).length > 0) { - initPractiseMissedWords(); - } else { - showNotification("You haven't missed any words.", 2000); + if (resultVisible) { + if (Object.keys(missedWords).length > 0) { + initPractiseMissedWords(); + } else { + showNotification("You haven't missed any words.", 2000); + } } }, }, From edf0904836b7ceffb29d4f96032360c94354fd6a Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 10 Nov 2020 13:53:54 +0000 Subject: [PATCH 07/40] fixed tts box caret showing words #566 --- static/funbox/simon_says.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/funbox/simon_says.css b/static/funbox/simon_says.css index 7a19a3b22..1e6b73267 100644 --- a/static/funbox/simon_says.css +++ b/static/funbox/simon_says.css @@ -3,5 +3,5 @@ } */ #words .word { - color: var(--bg-color) !important; + color: transparent !important; } From 72e5d257e0f5d62df6db1481820adf8279573792 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 10 Nov 2020 17:51:55 +0000 Subject: [PATCH 08/40] fixed strict space causing weird behaviour with stop on word. fixes #565 --- src/js/script.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/script.js b/src/js/script.js index 701309226..4abae3d95 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -4659,9 +4659,9 @@ $(document).keydown((event) => { if (!config.showAllLines || config.mode == "time") { // let currentTop = Math.floor($($("#words .word")[currentWordIndex]).position().top); // let nextTop = Math.floor($($("#words .word")[currentWordIndex + 1]).position().top); - if (config.stopOnError != "off") { - if (currentWord !== currentInput) return; - } + // if (config.stopOnError != "off") { + // if (currentWord !== currentInput) return; + // } let currentTop = Math.floor( document.querySelectorAll("#words .word")[currentWordElementIndex] From 6452fb274f37a496c42ed1c616a3b09adddbceee Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 10 Nov 2020 17:55:51 +0000 Subject: [PATCH 09/40] fixed 'current settings' button for quotes will always select english if quote mode and any of the english languages are selected --- src/js/account.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/js/account.js b/src/js/account.js index 75c7ce3b5..34cb31a4a 100644 --- a/src/js/account.js +++ b/src/js/account.js @@ -1486,7 +1486,11 @@ $(".pageAccount .topFilters .button.currentConfigFilter").click((e) => { } else { config.resultFilters.numbers.off = true; } - config.resultFilters.language[config.language] = true; + if (config.mode === "quote" && /english.*/.test(config.language)) { + config.resultFilters.language["english"] = true; + } else { + config.resultFilters.language[config.language] = true; + } config.resultFilters.funbox[activeFunBox] = true; config.resultFilters.tags.none = true; dbSnapshot.tags.forEach((tag) => { From eb62aaa70b99be2f1db4fc493f1104051d31eab5 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 10 Nov 2020 18:07:42 +0000 Subject: [PATCH 10/40] fixed word highlight causing difficulties to not work as intended. fixes #550 --- src/js/script.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/js/script.js b/src/js/script.js index 4abae3d95..d0fa67e25 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -941,6 +941,23 @@ function compareInput(showError) { // this is when input so far is correct correctSoFar = true; } + if (!correctSoFar) { + if (config.difficulty == "master") { + if (!resultVisible) { + inputHistory.push(currentInput); + correctedHistory.push(currentCorrected); + document + .querySelector("#words .word.active") + .setAttribute("input", currentInput.replace(/'/g, "'")); + lastSecondNotRound = true; + showResult(true); + } + let testNow = Date.now(); + let testSeconds = roundTo2((testNow - testStart) / 1000); + incompleteTestSeconds += testSeconds; + restartCount++; + } + } let classString = correctSoFar ? "correct" : "incorrect"; if (config.blindMode) { classString = "correct"; From 3ebf98c14edbda750d3d3a728673b4ca5c294ba4 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 10 Nov 2020 18:11:01 +0000 Subject: [PATCH 11/40] fixed strict space setting not loading --- src/js/userconfig.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/userconfig.js b/src/js/userconfig.js index 73e91d488..cd1fdc63c 100644 --- a/src/js/userconfig.js +++ b/src/js/userconfig.js @@ -229,6 +229,7 @@ function applyConfig(configObj) { setAlwaysShowCPM(configObj.alwaysShowCPM, true); setHideExtraLetters(configObj.hideExtraLetters, true); setStartGraphsAtZero(configObj.startGraphsAtZero, true); + setStrictSpace(configObj.strictSpace, true); setMode(configObj.mode, true); // if ( // configObj.resultFilters !== null && From 76e65c4ee0597f22a55dd68978194594c14055d7 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 10 Nov 2020 20:23:14 +0000 Subject: [PATCH 12/40] fixed custom theme state not saving. closes #547 --- src/js/settings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/settings.js b/src/js/settings.js index 3a10ff84a..83b336e3a 100644 --- a/src/js/settings.js +++ b/src/js/settings.js @@ -826,7 +826,7 @@ $(".pageSettings .section.themes .tabs .button").click((e) => { $target.addClass("active"); setCustomThemeInputs(); if ($target.attr("tab") == "preset") { - setCustomTheme(false, true); + setCustomTheme(false); applyCustomThemeColors(); swapElements( $('.pageSettings .section.themes .tabContainer [tabContent="custom"]'), @@ -834,7 +834,7 @@ $(".pageSettings .section.themes .tabs .button").click((e) => { 250 ); } else { - setCustomTheme(true, true); + setCustomTheme(true); applyCustomThemeColors(); swapElements( $('.pageSettings .section.themes .tabContainer [tabContent="preset"]'), From d8ab40b35ff2967a8a55e57d0a1a9f2807b0d2bc Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 10 Nov 2020 22:01:00 +0000 Subject: [PATCH 13/40] yeeting the key data because its completely pointless --- functions/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/functions/index.js b/functions/index.js index 778f4b657..1afe52dea 100644 --- a/functions/index.js +++ b/functions/index.js @@ -1003,6 +1003,10 @@ exports.testCompleted = functions } } + //yeet the key data + obj.keySpacing = null; + obj.keyDuration = null; + return db .collection(`users/${request.uid}/results`) .add(obj) From 4b900c646fc714b975917a6a9e8331ab0dcc5ecc Mon Sep 17 00:00:00 2001 From: decaf Date: Wed, 11 Nov 2020 07:33:57 -0600 Subject: [PATCH 14/40] Added command to open "change custom text" popup --- src/js/commandline.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/js/commandline.js b/src/js/commandline.js index e329fef24..e62100451 100644 --- a/src/js/commandline.js +++ b/src/js/commandline.js @@ -647,6 +647,19 @@ let commands = { } }, }, + { + id: "changeCustomModeText", + display: "Change custom text", + exec: () => { + if (config.mode === "custom") { + showCustomTextPopup(); + setTimeout(() => { + // Workaround to focus textarea since hideCommandLine() will focus test words + $("#customTextPopup textarea").focus(); + }, 150); + } + }, + }, ], }; From c68cc0bec51d489ef400dd997392eb27486c06f3 Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 11 Nov 2020 13:48:05 +0000 Subject: [PATCH 15/40] added toggle always show words history to the command line --- src/js/commandline.js | 7 +++++++ src/js/userconfig.js | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/src/js/commandline.js b/src/js/commandline.js index e329fef24..2ac7695c5 100644 --- a/src/js/commandline.js +++ b/src/js/commandline.js @@ -210,6 +210,13 @@ let commands = { toggleBlindMode(); }, }, + { + id: "toggleAlwaysShowWordsHistory", + display: "Toggle always show words history", + exec: () => { + toggleAlwaysShowWordsHistory(); + }, + }, { id: "toggleIndicateTypos", display: "Toggle indicate typos", diff --git a/src/js/userconfig.js b/src/js/userconfig.js index bdc14a05d..0c5246a13 100644 --- a/src/js/userconfig.js +++ b/src/js/userconfig.js @@ -552,6 +552,15 @@ function setAlwaysShowWordsHistory(val, nosave) { if (!nosave) saveConfigToCookie(); } +function toggleAlwaysShowWordsHistory() { + let val = !config.alwaysShowWordsHistory; + if (val == undefined) { + val = false; + } + config.alwaysShowWordsHistory = val; + saveConfigToCookie(); +} + //single list command line function setSingleListCommandLine(option, nosave) { if (!option) option = "manual"; From 21498e7e289591bdde1e796bcd5fd50d9f5a86be Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 11 Nov 2020 14:29:14 +0000 Subject: [PATCH 16/40] fitting the graph to the wpm line if dont start graphs at zero is enabled --- src/js/script.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/js/script.js b/src/js/script.js index 5a9c10e45..54f065a9c 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -1866,8 +1866,12 @@ function showResult(difficultyFailed = false) { ); if (!config.startGraphsAtZero) { - wpmOverTimeChart.options.scales.yAxes[0].ticks.min = minChartVal; - wpmOverTimeChart.options.scales.yAxes[1].ticks.min = minChartVal; + wpmOverTimeChart.options.scales.yAxes[0].ticks.min = Math.min( + ...wpmHistory + ); + wpmOverTimeChart.options.scales.yAxes[1].ticks.min = Math.min( + ...wpmHistory + ); } else { wpmOverTimeChart.options.scales.yAxes[0].ticks.min = 0; wpmOverTimeChart.options.scales.yAxes[1].ticks.min = 0; @@ -4268,7 +4272,6 @@ $(document).keydown((event) => { event.preventDefault(); let currentWord = wordsList[currentWordIndex]; if (!config.showAllLines || config.mode == "time") { - let currentTop = Math.floor( document.querySelectorAll("#words .word")[currentWordElementIndex] .offsetTop From 61f9bd512a1c7656cb5ee666bca0289e1926c1f9 Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 11 Nov 2020 14:52:26 +0000 Subject: [PATCH 17/40] added alphabetic layout --- src/js/layouts.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/js/layouts.js b/src/js/layouts.js index 6c738d87b..905caeede 100644 --- a/src/js/layouts.js +++ b/src/js/layouts.js @@ -202,5 +202,15 @@ const layouts = { "<>", "wW", "xX", "cC", "vV", "bB", "nN", ",?", ";.", ":/", "!§", " " ] - } + }, + alpha: { + keymapShowTopRow: false, + keys: [ + "`~", "1!", "2@", "3#", "4$", "5%", "6^", "7&", "8*", "9(", "0)", "-_", "=+", + "aA", "bB", "cC", "dD", "eE", "fF", "gG", "hH", "iI", "jJ", "[{", "]}", "\\|", + "kK", "lL", "mM", "nN", "oO", "pP", "qQ", "rR", "sS", ";:", "'\"", + "\\|", "tT", "uU", "vV", "wW", "xX", "yY", "zZ", ",<", ".>", "/?", + " " + ] + }, } From 8ade02f17064fb7cc5483dfe712318289a401955 Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 11 Nov 2020 15:26:09 +0000 Subject: [PATCH 18/40] added qwertz --- src/js/layouts.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/js/layouts.js b/src/js/layouts.js index 905caeede..7df095cf8 100644 --- a/src/js/layouts.js +++ b/src/js/layouts.js @@ -82,6 +82,17 @@ const layouts = { " " ], }, + qwertz: { + keymapShowTopRow: false, + iso: true, + keys: [ + "^°", "1!", "2\"", "3§", "4$", "5%", "6&", "7/", "8(", "9)", "0=", "ß?", "´`", + "qQ", "wW", "eE", "rR", "tT", "zZ", "uU", "iI", "oO", "pP", "üÜ", "+*", "'#", + "aA", "sS", "dD", "fF", "gG", "hH", "jJ", "kK", "lL", "öÖ", "äÄ", + "<>", "yY", "xX", "cC", "vV", "bB", "nN", "mM", ",;", ".:", "-_", + " " + ] + }, workman: { keymapShowTopRow: false, keys: [ From d17b3dfa34269ecca5b82b92b2e0624442627433 Mon Sep 17 00:00:00 2001 From: decaf Date: Wed, 11 Nov 2020 10:34:58 -0600 Subject: [PATCH 19/40] Added available() method to commands to hide them from the list --- src/js/commandline.js | 81 ++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 44 deletions(-) diff --git a/src/js/commandline.js b/src/js/commandline.js index e62100451..c982190eb 100644 --- a/src/js/commandline.js +++ b/src/js/commandline.js @@ -573,32 +573,27 @@ let commands = { id: "bailOutForSure", display: "Yes, I am sure", exec: () => { - if ( - (config.mode === "custom" && - customTextIsRandom && - customTextWordCount >= 5000) || - (config.mode === "custom" && - !customTextIsRandom && - customText.length >= 5000) || - (config.mode === "words" && config.words >= 5000) || - config.words === 0 || - (config.mode === "time" && - (config.time >= 3600 || config.time === 0)) - ) { - bailout = true; - showResult(); - } else { - showNotification( - "You can only bailout out of test longer than 3600 seconds / 5000 words.", - 5000 - ); - } + bailout = true; + showResult(); }, }, ], }); showCommandLine(); }, + available: () => { + return ( + (config.mode === "custom" && + customTextIsRandom && + customTextWordCount >= 5000) || + (config.mode === "custom" && + !customTextIsRandom && + customText.length >= 5000) || + (config.mode === "words" && config.words >= 5000) || + config.words === 0 || + (config.mode === "time" && (config.time >= 3600 || config.time === 0)) + ); + }, }, { id: "joinDiscord", @@ -611,53 +606,51 @@ let commands = { id: "repeatTest", display: "Repeat test", exec: () => { - if (resultVisible) { - restartTest(true); - } + restartTest(true); + }, + available: () => { + return resultVisible; }, }, { id: "practiceMissedWords", display: "Practice missed words", exec: () => { - if (resultVisible) { - if (Object.keys(missedWords).length > 0) { - initPractiseMissedWords(); - } else { - showNotification("You haven't missed any words.", 2000); - } - } + initPractiseMissedWords(); + }, + available: () => { + return resultVisible && Object.keys(missedWords).length > 0; }, }, { id: "toggleWordHistory", display: "Toggle word history", exec: () => { - if (resultVisible) { - toggleResultWordsDisplay(); - } + toggleResultWordsDisplay(); + }, + available: () => { + return resultVisible; }, }, { id: "saveScreenshot", display: "Save screenshot", exec: () => { - if (resultVisible) { - copyResultToClipboard(); - } + copyResultToClipboard(); + }, + available: () => { + return resultVisible; }, }, { id: "changeCustomModeText", display: "Change custom text", exec: () => { - if (config.mode === "custom") { - showCustomTextPopup(); - setTimeout(() => { - // Workaround to focus textarea since hideCommandLine() will focus test words - $("#customTextPopup textarea").focus(); - }, 150); - } + showCustomTextPopup(); + setTimeout(() => { + // Workaround to focus textarea since hideCommandLine() will focus test words + $("#customTextPopup textarea").focus(); + }, 150); }, }, ], @@ -2029,7 +2022,7 @@ function displayFoundCommands() { $("#commandLine .suggestions").empty(); let list = currentCommands[currentCommands.length - 1]; $.each(list.list, (index, obj) => { - if (obj.found) { + if (obj.found && (obj.available !== undefined ? obj.available() : true)) { $("#commandLine .suggestions").append( '
' + obj.display + "
" ); From 7c75ffe237987903cff69906f92c853b5e469141 Mon Sep 17 00:00:00 2001 From: s1mple-Lemon <58873964+s1mple-Lemon@users.noreply.github.com> Date: Thu, 12 Nov 2020 19:14:20 +0700 Subject: [PATCH 20/40] update vietnamese wordlist top common vietnamese words --- static/languages/vietnamese.json | 449 +++++++++++++++++++++---------- 1 file changed, 308 insertions(+), 141 deletions(-) diff --git a/static/languages/vietnamese.json b/static/languages/vietnamese.json index 2610a5fc7..668f62520 100644 --- a/static/languages/vietnamese.json +++ b/static/languages/vietnamese.json @@ -2,156 +2,323 @@ "name": "vietnamese", "leftToRight": true, "words": [ - "chào", - "má", - "ba", - "cha", - "con", - "anh", - "em", - "chị", - "bà", - "ngoại", - "ông", - "nội", - "ăn", - "cơm", - "chưa", - "rồi", - "sáng", - "đi", - "học", - "làm", - "bài", - "tập", - "trái", - "cây", - "tắm", - "chơi", - "bia", - "rượu", - "cà", - "phê", - "cơm", - "tấm", - "hủ", - "tiếu", - "sướng", - "ngày", + "là", "độc", "lập", - "trong", - "tim", - "mỗi", - "người", "sung", - "đời", - "à", + "sướng", + "bếp", + "sài", + "gòn", "phải", - "tiền", - "nhiêu", - "lấy", - "của", - "để", - "không", - "phí", - "sữa", - "văn", - "chút", - "thuốc", - "hút", - "điện", - "thoại", - "di", - "động", - "máy", - "vi", - "tính", - "công", - "cộng", - "siêu", - "thị", - "được", - "trường", + "khoa", + "mình", + "hạnh", + "phúc", "công", "ty", - "ngân", - "ở", - "tại", - "sao", - "ai", - "cảm", - "ơn", - "xin", - "lỗi", - "mắc", - "quận", - "đói", - "nhung", - "lụa", - "thích", - "yêu", - "hiểu", - "gì", - "cười", - "bởi", - "hôm", - "qua", - "ngày", - "nhục", - "phục", - "thù", - "xào", - "luộc", - "tri", - "thức", - "nước", - "tương", - "nước", - "đá", - "đọc", + "nắng", + "kính", "bao", - "lâu", + "quát", + "trường", + "học", + "rán", + "thi", + "hành", "nhà", - "vệ", - "sinh", - "đúng", - "giận", - "dỗi", - "mang", - "xà", - "bông", - "bởi", - "vì", - "dầu", - "gội", - "đầu", - "trai", - "quán", - "ăn", - "chúng", - "mình", - "hoàn", - "xong", - "việc", - "dự", - "định", - "đến", - "trễ", - "giặt", - "chuẩn", - "bị", - "nhanh", - "nhức", - "đầu", - "mập", - "vui", - "mừng", + "loài", + "vật", + "cười", + "tự", + "do", + "tôi", + "nhạc", + "kính", + "lịch", + "sử", + "đất", + "tổ", + "quốc", + "bay", + "ngày", + "tỉnh", + "lũ", + "đinh", + "tham", "cầu", "đường", - "du", - "lịch", + "phương", + "đinh", + "đất", + "xin", + "lỗi", + "mà", + "giao", + "thông", + "trong", + "xây", + "dựng", + "bà", + "cầu", + "đường", + "cười", + "công", + "trình", + "hoài", + "hay", + "nói", + "đỏ", + "trần", + "pháp", + "luật", + "làm", + "tổ", + "quốc", + "hà", + "lao", + "xao", + "chăm", + "bánh", + "xanh", + "sống", + "hỷ", + "thế", + "giới", + "hướng", + "xin", + "kinh", + "chị", + "quá", + "viết", + "lách", + "tia", + "nắng", + "thế", + "giới", + "gửi", + "tự", + "do", + "phép", + "sợ", + "thanh", + "tháng", + "phối", + "hợp", + "cô", + "giấy", + "tờ", + "thanh", + "niên", + "sư", + "phạm", + "phương", + "tri", + "xinh", + "đẹp", + "quảng", + "nam", + "báo", + "sư", + "phạm", + "ngoài", + "ngành", + "khoa", + "lang", + "cảm", + "trang", + "đợi", + "chi", + "xã", + "hội", + "im", + "vui", + "vẻ", + "khó", + "khăn", + "màu", + "tình", + "yêu", + "trong", + "nhân", + "dân", + "khoa", + "phải", + "giành", + "lựu", + "ba", + "khoa", + "thành", + "cảm", + "ơn", + "biển", + "phối", + "hợp", + "hãy", + "cảm", + "ơn", + "chim", + "khóc", + "điện", + "tử", + "gì", + "trời", + "chú", + "sài", + "gòn", + "nắng", + "phép", + "biển", + "lành", + "độc", + "lập", + "đánh", + "vệ", + "sinh", + "vì", + "nhung", + "em", + "da", + "bếp", + "công", + "trình", + "theo", + "hả", + "trang", + "xã", + "hội", + "bóng", + "nào", + "ký", + "tên", + "bão", + "dạ", + "vâng", + "làm", + "ẩm", + "thực", + "áo", + "quần", + "hà", + "nội", + "mà", + "chính", + "chú", + "minh", + "hạnh", + "phúc", + "chia", + "sẻ", + "công", + "nghệ", + "thư", + "quảng", + "nam", + "lành", + "huế", + "dũng", + "thành", + "rán", + "thang", + "tham", + "cuộc", + "đời", + "thay", + "mặt", + "gửi", + "dạy", + "sơ", + "chào", + "dạy", + "lại", + "đi", + "xanh", + "sơ", + "màu", + "món", + "ăn", + "hay", + "đàn", + "sáo", + "gió", + "em", + "ba", + "báo", + "đỏ", + "chăm", + "khóc", + "kiến", + "trúc", + "phủ", + "ngữ", + "văn", + "bão", + "tin", + "minh", + "công", + "nghệ", + "hãy", + "chào", + "cao", + "anh", + "sợ", + "vệ", + "sinh", + "tay", + "quảng", + "bình", + "huế", + "con", + "người", + "bà", + "khánh", + "mưa", + "tuổi", + "giao", + "nam", + "đơn", + "thư", + "phần", + "bay", + "thi", "hành", - "khởi" + "hướng", + "là", + "phép", + "chính", + "dễ", + "dàng", + "tên", + "phép", + "ngủ", + "hạt", + "bướm", + "quá", + "nào", + "tháng", + "hoàn", + "toàn", + "mẹ", + "phố", + "ngày", + "kĩ", + "thuật", + "phần", + "thang", + "trần", + "cảm", + "điện", + "tử", + "năm", + "giao", + "nam", + "nga", + "nhạc", + "bóng", + "lựu", + "hả", + "anh", + "cổ", + "tích" ] -} \ No newline at end of file +} From 623c54bc5bd569026d88c7204f29c9566cff3d33 Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 12 Nov 2020 16:49:14 +0000 Subject: [PATCH 21/40] making sure holding down command stops the input --- src/js/script.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/script.js b/src/js/script.js index 54f065a9c..e353dccbf 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -4542,6 +4542,7 @@ $(document).keydown(function (event) { if (/Numpad/.test(event.key)) return; if (/Volume/.test(event.key)) return; if (event.ctrlKey) return; + if (event.metaKey) return; event = emulateLayout(event); //start the test From b879a5967d90a056d81000a52dd3faf1e71fafca Mon Sep 17 00:00:00 2001 From: typer Date: Thu, 12 Nov 2020 23:12:53 -0800 Subject: [PATCH 22/40] added browserify and made db.js an ES6 module --- gulpfile.js | 85 +- package-lock.json | 2473 +++++++++++++++++++++++++++++++++ package.json | 12 +- src/js/account.js | 86 +- src/js/commandline.js | 6 +- src/js/db.js | 24 +- src/js/global-dependencies.js | 9 + src/js/script.js | 53 +- src/js/settings.js | 16 +- src/js/userconfig.js | 2 +- 10 files changed, 2665 insertions(+), 101 deletions(-) create mode 100644 src/js/global-dependencies.js diff --git a/gulpfile.js b/gulpfile.js index a5dfe092f..a508bae6d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,25 +1,15 @@ const { task, src, dest, series, watch } = require("gulp"); +const browserify = require("browserify"); +const babelify = require("babelify"); const concat = require("gulp-concat"); const del = require("del"); +const source = require("vinyl-source-stream"); +const buffer = require("vinyl-buffer"); const vinylPaths = require("vinyl-paths"); const eslint = require("gulp-eslint"); var sass = require("gulp-sass"); sass.compiler = require("dart-sass"); -//the order of files is important -const gulpSrc = [ - "./src/js/misc.js", - "./src/js/words.js", - "./src/js/layouts.js", - "./src/js/db.js", - "./src/js/userconfig.js", - "./src/js/commandline.js", - "./src/js/leaderboards.js", - "./src/js/settings.js", - "./src/js/account.js", - "./src/js/script.js", -]; - let eslintConfig = { parser: "babel-eslint", globals: [ @@ -94,13 +84,33 @@ let eslintConfig = { }, }; +//refactored files, which should be es6 modules +//once all files are moved here, then can we use a bundler to its full potential +const refactoredSrc = ["./src/js/db.js"]; + +//legacy files +//the order of files is important +const globalSrc = [ + "./src/js/global-dependencies.js", + "./src/js/misc.js", + "./src/js/words.js", + "./src/js/layouts.js", + "./src/js/userconfig.js", + "./src/js/commandline.js", + "./src/js/leaderboards.js", + "./src/js/settings.js", + "./src/js/account.js", + "./src/js/script.js", +]; + +//concatenates and lints legacy js files and writes the output to dist/gen/index.js task("cat", function () { - return src(gulpSrc) - .pipe(concat("monkeytype.js")) + return src(globalSrc) + .pipe(concat("index.js")) .pipe(eslint(eslintConfig)) .pipe(eslint.format()) .pipe(eslint.failAfterError()) - .pipe(dest("./dist/js")); + .pipe(dest("./dist/gen")); }); task("sass", function () { @@ -113,11 +123,50 @@ task("static", function () { return src("./static/**/*").pipe(dest("./dist/")); }); +//copies refactored js files to dist/gen so that they can be required by dist/gen/index.js +task("copy-modules", function () { + return src(refactoredSrc, { allowEmpty: true }).pipe(dest("./dist/gen")); +}); + +//bundles the refactored js files together with index.js (the concatenated legacy js files) +//it's odd that the entry point is generated, so we should seek a better way of doing this +task("browserify", function () { + const b = browserify({ + //index.js is generated by task "cat" + entries: "./dist/gen/index.js", + //a source map isn't very useful right now because + //the source files are concatenated together + debug: false, + }); + return b + .transform( + babelify.configure({ + presets: ["@babel/preset-env"], + plugins: ["@babel/transform-runtime"], + }) + ) + .bundle() + .pipe(source("monkeytype.js")) + .pipe(buffer()) + .pipe(dest("./dist/js")); +}); + +//lints only the refactored files +task("lint", function () { + return src(refactoredSrc) + .pipe(eslint(eslintConfig)) + .pipe(eslint.format()) + .pipe(eslint.failAfterError()); +}); + task("clean", function () { return src("./dist/", { allowEmpty: true }).pipe(vinylPaths(del)); }); -task("compile", series("static", "sass", "cat")); +task( + "compile", + series("lint", "cat", "copy-modules", "browserify", "static", "sass") +); task("watch", function () { watch(["./static/**/*", "./src/**/*"], series("compile")); diff --git a/package-lock.json b/package-lock.json index 4b740b233..c14fdabdf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,36 @@ "@babel/highlight": "^7.10.4" } }, + "@babel/compat-data": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.5.tgz", + "integrity": "sha512-DTsS7cxrsH3by8nqQSpFSyjSfSYl57D6Cf4q8dW3LK83tBKBDCkfcay1nYkXq1nIHXnpX8WMMb/O25HOy3h1zg==", + "dev": true + }, + "@babel/core": { + "version": "7.12.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.3.tgz", + "integrity": "sha512-0qXcZYKZp3/6N2jKYVxZv0aNCsxTSVCiK72DTiTYZAu7sjg73W0/aynWjMbiGd87EQL4WyA8reiJVh92AVla9g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.12.1", + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helpers": "^7.12.1", + "@babel/parser": "^7.12.3", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.12.1", + "@babel/types": "^7.12.1", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.19", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + } + }, "@babel/generator": { "version": "7.12.1", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz", @@ -24,6 +54,118 @@ "source-map": "^0.5.0" } }, + "@babel/helper-annotate-as-pure": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz", + "integrity": "sha512-XQlqKQP4vXFB7BN8fEEerrmYvHp3fK/rBkRFz9jaJbzK0B1DSfej9Kc7ZzE8Z/OnId1jpJdNAZ3BFQjWG68rcA==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.10.4.tgz", + "integrity": "sha512-L0zGlFrGWZK4PbT8AszSfLTM5sDU1+Az/En9VrdT8/LmEiJt4zXt+Jve9DCAnQcbqDhCI+29y/L93mrDzddCcg==", + "dev": true, + "requires": { + "@babel/helper-explode-assignable-expression": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-compilation-targets": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.5.tgz", + "integrity": "sha512-+qH6NrscMolUlzOYngSBMIOQpKUGPPsc61Bu5W10mg84LxZ7cmvnBHzARKbDoFxVvqqAbj6Tg6N7bSrWSPXMyw==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.12.5", + "@babel/helper-validator-option": "^7.12.1", + "browserslist": "^4.14.5", + "semver": "^5.5.0" + } + }, + "@babel/helper-create-class-features-plugin": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.1.tgz", + "integrity": "sha512-hkL++rWeta/OVOBTRJc9a5Azh5mt5WgZUGAKMD8JM141YsE08K//bp1unBBieO6rUKkIPyUE0USQ30jAy3Sk1w==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-member-expression-to-functions": "^7.12.1", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/helper-replace-supers": "^7.12.1", + "@babel/helper-split-export-declaration": "^7.10.4" + } + }, + "@babel/helper-create-regexp-features-plugin": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.1.tgz", + "integrity": "sha512-rsZ4LGvFTZnzdNZR5HZdmJVuXK8834R5QkF3WvcnBhrlVtF0HSIUC6zbreL9MgjTywhKokn8RIYRiq99+DLAxA==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-regex": "^7.10.4", + "regexpu-core": "^4.7.1" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + }, + "regexpu-core": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.1.tgz", + "integrity": "sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ==", + "dev": true, + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.2.0", + "regjsgen": "^0.5.1", + "regjsparser": "^0.6.4", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.2.0" + } + }, + "regjsgen": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", + "dev": true + }, + "regjsparser": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz", + "integrity": "sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + } + } + } + }, + "@babel/helper-define-map": { + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.10.5.tgz", + "integrity": "sha512-fMw4kgFB720aQFXSVaXr79pjjcW5puTCM16+rECJ/plGS+zByelE8l9nCpV1GibxTnFVmUuYG9U8wYfQHdzOEQ==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.4", + "@babel/types": "^7.10.5", + "lodash": "^4.17.19" + } + }, + "@babel/helper-explode-assignable-expression": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.12.1.tgz", + "integrity": "sha512-dmUwH8XmlrUpVqgtZ737tK88v07l840z9j3OEhCLwKTkjlvKpfqXVIZ0wpK3aeOxspwGrf/5AP5qLx4rO3w5rA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.1" + } + }, "@babel/helper-function-name": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", @@ -44,6 +186,175 @@ "@babel/types": "^7.10.4" } }, + "@babel/helper-hoist-variables": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz", + "integrity": "sha512-wljroF5PgCk2juF69kanHVs6vrLwIPNp6DLD+Lrl3hoQ3PpPPikaDRNFA+0t81NOoMt2DL6WW/mdU8k4k6ZzuA==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.1.tgz", + "integrity": "sha512-k0CIe3tXUKTRSoEx1LQEPFU9vRQfqHtl+kf8eNnDqb4AUJEy5pz6aIiog+YWtVm2jpggjS1laH68bPsR+KWWPQ==", + "dev": true, + "requires": { + "@babel/types": "^7.12.1" + } + }, + "@babel/helper-module-imports": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", + "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.5" + }, + "dependencies": { + "@babel/types": { + "version": "7.12.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.6.tgz", + "integrity": "sha512-hwyjw6GvjBLiyy3W0YQf0Z5Zf4NpYejUnKFcfcUhZCSffoBBp30w6wP2Wn6pk31jMYZvcOrB/1b7cGXvEoKogA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + } + } + }, + "@babel/helper-module-transforms": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz", + "integrity": "sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.12.1", + "@babel/helper-replace-supers": "^7.12.1", + "@babel/helper-simple-access": "^7.12.1", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/helper-validator-identifier": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.12.1", + "@babel/types": "^7.12.1", + "lodash": "^4.17.19" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", + "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", + "dev": true + }, + "@babel/helper-regex": { + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.10.5.tgz", + "integrity": "sha512-68kdUAzDrljqBrio7DYAEgCoJHxppJOERHOgOrDN7WjOzP0ZQ1LsSDRXcemzVZaLvjaJsJEESb6qt+znNuENDg==", + "dev": true, + "requires": { + "lodash": "^4.17.19" + } + }, + "@babel/helper-remap-async-to-generator": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.12.1.tgz", + "integrity": "sha512-9d0KQCRM8clMPcDwo8SevNs+/9a8yWVVmaE80FGJcEP8N1qToREmWEGnBn8BUlJhYRFz6fqxeRL1sl5Ogsed7A==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-wrap-function": "^7.10.4", + "@babel/types": "^7.12.1" + } + }, + "@babel/helper-replace-supers": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.5.tgz", + "integrity": "sha512-5YILoed0ZyIpF4gKcpZitEnXEJ9UoDRki1Ey6xz46rxOzfNMAhVIJMoune1hmPVxh40LRv1+oafz7UsWX+vyWA==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.12.1", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" + }, + "dependencies": { + "@babel/generator": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz", + "integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==", + "dev": true, + "requires": { + "@babel/types": "^7.12.5", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/parser": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.5.tgz", + "integrity": "sha512-FVM6RZQ0mn2KCf1VUED7KepYeUWoVShczewOCfm3nzoBybaih51h+sYVVGthW9M6lPByEPTQf+xm27PBdlpwmQ==", + "dev": true + }, + "@babel/traverse": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.5.tgz", + "integrity": "sha512-xa15FbQnias7z9a62LwYAA5SZZPkHIXpd42C6uW68o8uTuua96FHZy1y61Va5P/i83FAAcMpW8+A/QayntzuqA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.12.5", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/parser": "^7.12.5", + "@babel/types": "^7.12.5", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.19" + } + }, + "@babel/types": { + "version": "7.12.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.6.tgz", + "integrity": "sha512-hwyjw6GvjBLiyy3W0YQf0Z5Zf4NpYejUnKFcfcUhZCSffoBBp30w6wP2Wn6pk31jMYZvcOrB/1b7cGXvEoKogA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + } + } + }, + "@babel/helper-simple-access": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz", + "integrity": "sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.1" + } + }, + "@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.12.1.tgz", + "integrity": "sha512-Mf5AUuhG1/OCChOJ/HcADmvcHM42WJockombn8ATJG3OnyiSxBK/Mm5x78BQWvmtXZKHgbjdGL2kin/HOLlZGA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.1" + } + }, "@babel/helper-split-export-declaration": { "version": "7.11.0", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", @@ -59,6 +370,82 @@ "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", "dev": true }, + "@babel/helper-validator-option": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.1.tgz", + "integrity": "sha512-YpJabsXlJVWP0USHjnC/AQDTLlZERbON577YUVO/wLpqyj6HAtVYnWaQaN0iUN+1/tWn3c+uKKXjRut5115Y2A==", + "dev": true + }, + "@babel/helper-wrap-function": { + "version": "7.12.3", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.12.3.tgz", + "integrity": "sha512-Cvb8IuJDln3rs6tzjW3Y8UeelAOdnpB8xtQ4sme2MSZ9wOxrbThporC0y/EtE16VAtoyEfLM404Xr1e0OOp+ow==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helpers": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz", + "integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==", + "dev": true, + "requires": { + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" + }, + "dependencies": { + "@babel/generator": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz", + "integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==", + "dev": true, + "requires": { + "@babel/types": "^7.12.5", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/parser": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.5.tgz", + "integrity": "sha512-FVM6RZQ0mn2KCf1VUED7KepYeUWoVShczewOCfm3nzoBybaih51h+sYVVGthW9M6lPByEPTQf+xm27PBdlpwmQ==", + "dev": true + }, + "@babel/traverse": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.5.tgz", + "integrity": "sha512-xa15FbQnias7z9a62LwYAA5SZZPkHIXpd42C6uW68o8uTuua96FHZy1y61Va5P/i83FAAcMpW8+A/QayntzuqA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.12.5", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/parser": "^7.12.5", + "@babel/types": "^7.12.5", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.19" + } + }, + "@babel/types": { + "version": "7.12.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.6.tgz", + "integrity": "sha512-hwyjw6GvjBLiyy3W0YQf0Z5Zf4NpYejUnKFcfcUhZCSffoBBp30w6wP2Wn6pk31jMYZvcOrB/1b7cGXvEoKogA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + } + } + }, "@babel/highlight": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", @@ -76,6 +463,679 @@ "integrity": "sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw==", "dev": true }, + "@babel/plugin-proposal-async-generator-functions": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.12.1.tgz", + "integrity": "sha512-d+/o30tJxFxrA1lhzJqiUcEJdI6jKlNregCv5bASeGf2Q4MXmnwH7viDo7nhx1/ohf09oaH8j1GVYG/e3Yqk6A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-remap-async-to-generator": "^7.12.1", + "@babel/plugin-syntax-async-generators": "^7.8.0" + } + }, + "@babel/plugin-proposal-class-properties": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.12.1.tgz", + "integrity": "sha512-cKp3dlQsFsEs5CWKnN7BnSHOd0EOW8EKpEjkoz1pO2E5KzIDNV9Ros1b0CnmbVgAGXJubOYVBOGCT1OmJwOI7w==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-proposal-dynamic-import": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.12.1.tgz", + "integrity": "sha512-a4rhUSZFuq5W8/OO8H7BL5zspjnc1FLd9hlOxIK/f7qG4a0qsqk8uvF/ywgBA8/OmjsapjpvaEOYItfGG1qIvQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-dynamic-import": "^7.8.0" + } + }, + "@babel/plugin-proposal-export-namespace-from": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.12.1.tgz", + "integrity": "sha512-6CThGf0irEkzujYS5LQcjBx8j/4aQGiVv7J9+2f7pGfxqyKh3WnmVJYW3hdrQjyksErMGBPQrCnHfOtna+WLbw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" + } + }, + "@babel/plugin-proposal-json-strings": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.12.1.tgz", + "integrity": "sha512-GoLDUi6U9ZLzlSda2Df++VSqDJg3CG+dR0+iWsv6XRw1rEq+zwt4DirM9yrxW6XWaTpmai1cWJLMfM8qQJf+yw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.0" + } + }, + "@babel/plugin-proposal-logical-assignment-operators": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.12.1.tgz", + "integrity": "sha512-k8ZmVv0JU+4gcUGeCDZOGd0lCIamU/sMtIiX3UWnUc5yzgq6YUGyEolNYD+MLYKfSzgECPcqetVcJP9Afe/aCA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" + } + }, + "@babel/plugin-proposal-nullish-coalescing-operator": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.12.1.tgz", + "integrity": "sha512-nZY0ESiaQDI1y96+jk6VxMOaL4LPo/QDHBqL+SF3/vl6dHkTwHlOI8L4ZwuRBHgakRBw5zsVylel7QPbbGuYgg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0" + } + }, + "@babel/plugin-proposal-numeric-separator": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.5.tgz", + "integrity": "sha512-UiAnkKuOrCyjZ3sYNHlRlfuZJbBHknMQ9VMwVeX97Ofwx7RpD6gS2HfqTCh8KNUQgcOm8IKt103oR4KIjh7Q8g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + } + }, + "@babel/plugin-proposal-object-rest-spread": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.12.1.tgz", + "integrity": "sha512-s6SowJIjzlhx8o7lsFx5zmY4At6CTtDvgNQDdPzkBQucle58A6b/TTeEBYtyDgmcXjUTM+vE8YOGHZzzbc/ioA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-transform-parameters": "^7.12.1" + } + }, + "@babel/plugin-proposal-optional-catch-binding": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.12.1.tgz", + "integrity": "sha512-hFvIjgprh9mMw5v42sJWLI1lzU5L2sznP805zeT6rySVRA0Y18StRhDqhSxlap0oVgItRsB6WSROp4YnJTJz0g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0" + } + }, + "@babel/plugin-proposal-optional-chaining": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.12.1.tgz", + "integrity": "sha512-c2uRpY6WzaVDzynVY9liyykS+kVU+WRZPMPYpkelXH8KBt1oXoI89kPbZKKG/jDT5UK92FTW2fZkZaJhdiBabw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1", + "@babel/plugin-syntax-optional-chaining": "^7.8.0" + } + }, + "@babel/plugin-proposal-private-methods": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.12.1.tgz", + "integrity": "sha512-mwZ1phvH7/NHK6Kf8LP7MYDogGV+DKB1mryFOEwx5EBNQrosvIczzZFTUmWaeujd5xT6G1ELYWUz3CutMhjE1w==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-proposal-unicode-property-regex": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.1.tgz", + "integrity": "sha512-MYq+l+PvHuw/rKUz1at/vb6nCnQ2gmJBNaM62z0OgH7B2W1D9pvkpYtlti9bGtizNIU1K3zm4bZF9F91efVY0w==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-class-properties": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.1.tgz", + "integrity": "sha512-U40A76x5gTwmESz+qiqssqmeEsKvcSyvtgktrm0uzcARAmM9I1jR221f6Oq+GmHrcD+LvZDag1UTOTe2fL3TeA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-export-namespace-from": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", + "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.3" + } + }, + "@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-top-level-await": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.1.tgz", + "integrity": "sha512-i7ooMZFS+a/Om0crxZodrTzNEPJHZrlMVGMTEpFAj6rYY/bKCddB0Dk/YxfPuYXOopuhKk/e1jV6h+WUU9XN3A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-arrow-functions": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.12.1.tgz", + "integrity": "sha512-5QB50qyN44fzzz4/qxDPQMBCTHgxg3n0xRBLJUmBlLoU/sFvxVWGZF/ZUfMVDQuJUKXaBhbupxIzIfZ6Fwk/0A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-async-to-generator": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.12.1.tgz", + "integrity": "sha512-SDtqoEcarK1DFlRJ1hHRY5HvJUj5kX4qmtpMAm2QnhOlyuMC4TMdCRgW6WXpv93rZeYNeLP22y8Aq2dbcDRM1A==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-remap-async-to-generator": "^7.12.1" + } + }, + "@babel/plugin-transform-block-scoped-functions": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.12.1.tgz", + "integrity": "sha512-5OpxfuYnSgPalRpo8EWGPzIYf0lHBWORCkj5M0oLBwHdlux9Ri36QqGW3/LR13RSVOAoUUMzoPI/jpE4ABcHoA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-block-scoping": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.12.1.tgz", + "integrity": "sha512-zJyAC9sZdE60r1nVQHblcfCj29Dh2Y0DOvlMkcqSo0ckqjiCwNiUezUKw+RjOCwGfpLRwnAeQ2XlLpsnGkvv9w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-classes": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.12.1.tgz", + "integrity": "sha512-/74xkA7bVdzQTBeSUhLLJgYIcxw/dpEpCdRDiHgPJ3Mv6uC11UhjpOhl72CgqbBCmt1qtssCyB2xnJm1+PFjog==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-define-map": "^7.10.4", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-replace-supers": "^7.12.1", + "@babel/helper-split-export-declaration": "^7.10.4", + "globals": "^11.1.0" + } + }, + "@babel/plugin-transform-computed-properties": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.12.1.tgz", + "integrity": "sha512-vVUOYpPWB7BkgUWPo4C44mUQHpTZXakEqFjbv8rQMg7TC6S6ZhGZ3otQcRH6u7+adSlE5i0sp63eMC/XGffrzg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-destructuring": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.12.1.tgz", + "integrity": "sha512-fRMYFKuzi/rSiYb2uRLiUENJOKq4Gnl+6qOv5f8z0TZXg3llUwUhsNNwrwaT/6dUhJTzNpBr+CUvEWBtfNY1cw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-dotall-regex": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.1.tgz", + "integrity": "sha512-B2pXeRKoLszfEW7J4Hg9LoFaWEbr/kzo3teWHmtFCszjRNa/b40f9mfeqZsIDLLt/FjwQ6pz/Gdlwy85xNckBA==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-duplicate-keys": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.12.1.tgz", + "integrity": "sha512-iRght0T0HztAb/CazveUpUQrZY+aGKKaWXMJ4uf9YJtqxSUe09j3wteztCUDRHs+SRAL7yMuFqUsLoAKKzgXjw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-exponentiation-operator": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.12.1.tgz", + "integrity": "sha512-7tqwy2bv48q+c1EHbXK0Zx3KXd2RVQp6OC7PbwFNt/dPTAV3Lu5sWtWuAj8owr5wqtWnqHfl2/mJlUmqkChKug==", + "dev": true, + "requires": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-for-of": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.12.1.tgz", + "integrity": "sha512-Zaeq10naAsuHo7heQvyV0ptj4dlZJwZgNAtBYBnu5nNKJoW62m0zKcIEyVECrUKErkUkg6ajMy4ZfnVZciSBhg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-function-name": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.12.1.tgz", + "integrity": "sha512-JF3UgJUILoFrFMEnOJLJkRHSk6LUSXLmEFsA23aR2O5CSLUxbeUX1IZ1YQ7Sn0aXb601Ncwjx73a+FVqgcljVw==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-literals": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.12.1.tgz", + "integrity": "sha512-+PxVGA+2Ag6uGgL0A5f+9rklOnnMccwEBzwYFL3EUaKuiyVnUipyXncFcfjSkbimLrODoqki1U9XxZzTvfN7IQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-member-expression-literals": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.12.1.tgz", + "integrity": "sha512-1sxePl6z9ad0gFMB9KqmYofk34flq62aqMt9NqliS/7hPEpURUCMbyHXrMPlo282iY7nAvUB1aQd5mg79UD9Jg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-modules-amd": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.12.1.tgz", + "integrity": "sha512-tDW8hMkzad5oDtzsB70HIQQRBiTKrhfgwC/KkJeGsaNFTdWhKNt/BiE8c5yj19XiGyrxpbkOfH87qkNg1YGlOQ==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-commonjs": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.12.1.tgz", + "integrity": "sha512-dY789wq6l0uLY8py9c1B48V8mVL5gZh/+PQ5ZPrylPYsnAvnEMjqsUXkuoDVPeVK+0VyGar+D08107LzDQ6pag==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-simple-access": "^7.12.1", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-systemjs": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.12.1.tgz", + "integrity": "sha512-Hn7cVvOavVh8yvW6fLwveFqSnd7rbQN3zJvoPNyNaQSvgfKmDBO9U1YL9+PCXGRlZD9tNdWTy5ACKqMuzyn32Q==", + "dev": true, + "requires": { + "@babel/helper-hoist-variables": "^7.10.4", + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-validator-identifier": "^7.10.4", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-umd": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.12.1.tgz", + "integrity": "sha512-aEIubCS0KHKM0zUos5fIoQm+AZUMt1ZvMpqz0/H5qAQ7vWylr9+PLYurT+Ic7ID/bKLd4q8hDovaG3Zch2uz5Q==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.12.1.tgz", + "integrity": "sha512-tB43uQ62RHcoDp9v2Nsf+dSM8sbNodbEicbQNA53zHz8pWUhsgHSJCGpt7daXxRydjb0KnfmB+ChXOv3oADp1Q==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.12.1" + } + }, + "@babel/plugin-transform-new-target": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.12.1.tgz", + "integrity": "sha512-+eW/VLcUL5L9IvJH7rT1sT0CzkdUTvPrXC2PXTn/7z7tXLBuKvezYbGdxD5WMRoyvyaujOq2fWoKl869heKjhw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-object-super": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.12.1.tgz", + "integrity": "sha512-AvypiGJH9hsquNUn+RXVcBdeE3KHPZexWRdimhuV59cSoOt5kFBmqlByorAeUlGG2CJWd0U+4ZtNKga/TB0cAw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-replace-supers": "^7.12.1" + } + }, + "@babel/plugin-transform-parameters": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.12.1.tgz", + "integrity": "sha512-xq9C5EQhdPK23ZeCdMxl8bbRnAgHFrw5EOC3KJUsSylZqdkCaFEXxGSBuTSObOpiiHHNyb82es8M1QYgfQGfNg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-property-literals": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.12.1.tgz", + "integrity": "sha512-6MTCR/mZ1MQS+AwZLplX4cEySjCpnIF26ToWo942nqn8hXSm7McaHQNeGx/pt7suI1TWOWMfa/NgBhiqSnX0cQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-regenerator": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.12.1.tgz", + "integrity": "sha512-gYrHqs5itw6i4PflFX3OdBPMQdPbF4bj2REIUxlMRUFk0/ZOAIpDFuViuxPjUL7YC8UPnf+XG7/utJvqXdPKng==", + "dev": true, + "requires": { + "regenerator-transform": "^0.14.2" + }, + "dependencies": { + "regenerator-transform": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", + "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", + "dev": true, + "requires": { + "@babel/runtime": "^7.8.4" + } + } + } + }, + "@babel/plugin-transform-reserved-words": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.12.1.tgz", + "integrity": "sha512-pOnUfhyPKvZpVyBHhSBoX8vfA09b7r00Pmm1sH+29ae2hMTKVmSp4Ztsr8KBKjLjx17H0eJqaRC3bR2iThM54A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-runtime": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.12.1.tgz", + "integrity": "sha512-Ac/H6G9FEIkS2tXsZjL4RAdS3L3WHxci0usAnz7laPWUmFiGtj7tIASChqKZMHTSQTQY6xDbOq+V1/vIq3QrWg==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4", + "resolve": "^1.8.1", + "semver": "^5.5.1" + } + }, + "@babel/plugin-transform-shorthand-properties": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.12.1.tgz", + "integrity": "sha512-GFZS3c/MhX1OusqB1MZ1ct2xRzX5ppQh2JU1h2Pnfk88HtFTM+TWQqJNfwkmxtPQtb/s1tk87oENfXJlx7rSDw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-spread": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.12.1.tgz", + "integrity": "sha512-vuLp8CP0BE18zVYjsEBZ5xoCecMK6LBMMxYzJnh01rxQRvhNhH1csMMmBfNo5tGpGO+NhdSNW2mzIvBu3K1fng==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1" + } + }, + "@babel/plugin-transform-sticky-regex": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.1.tgz", + "integrity": "sha512-CiUgKQ3AGVk7kveIaPEET1jNDhZZEl1RPMWdTBE1799bdz++SwqDHStmxfCtDfBhQgCl38YRiSnrMuUMZIWSUQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-regex": "^7.10.4" + } + }, + "@babel/plugin-transform-template-literals": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.12.1.tgz", + "integrity": "sha512-b4Zx3KHi+taXB1dVRBhVJtEPi9h1THCeKmae2qP0YdUHIFhVjtpqqNfxeVAa1xeHVhAy4SbHxEwx5cltAu5apw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-typeof-symbol": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.12.1.tgz", + "integrity": "sha512-EPGgpGy+O5Kg5pJFNDKuxt9RdmTgj5sgrus2XVeMp/ZIbOESadgILUbm50SNpghOh3/6yrbsH+NB5+WJTmsA7Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-unicode-escapes": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.12.1.tgz", + "integrity": "sha512-I8gNHJLIc7GdApm7wkVnStWssPNbSRMPtgHdmH3sRM1zopz09UWPS4x5V4n1yz/MIWTVnJ9sp6IkuXdWM4w+2Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-unicode-regex": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.12.1.tgz", + "integrity": "sha512-SqH4ClNngh/zGwHZOOQMTD+e8FGWexILV+ePMyiDJttAWRh5dhDL8rcl5lSgU3Huiq6Zn6pWTMvdPAb21Dwdyg==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/preset-env": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.12.1.tgz", + "integrity": "sha512-H8kxXmtPaAGT7TyBvSSkoSTUK6RHh61So05SyEbpmr0MCZrsNYn7mGMzzeYoOUCdHzww61k8XBft2TaES+xPLg==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.12.1", + "@babel/helper-compilation-targets": "^7.12.1", + "@babel/helper-module-imports": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-validator-option": "^7.12.1", + "@babel/plugin-proposal-async-generator-functions": "^7.12.1", + "@babel/plugin-proposal-class-properties": "^7.12.1", + "@babel/plugin-proposal-dynamic-import": "^7.12.1", + "@babel/plugin-proposal-export-namespace-from": "^7.12.1", + "@babel/plugin-proposal-json-strings": "^7.12.1", + "@babel/plugin-proposal-logical-assignment-operators": "^7.12.1", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1", + "@babel/plugin-proposal-numeric-separator": "^7.12.1", + "@babel/plugin-proposal-object-rest-spread": "^7.12.1", + "@babel/plugin-proposal-optional-catch-binding": "^7.12.1", + "@babel/plugin-proposal-optional-chaining": "^7.12.1", + "@babel/plugin-proposal-private-methods": "^7.12.1", + "@babel/plugin-proposal-unicode-property-regex": "^7.12.1", + "@babel/plugin-syntax-async-generators": "^7.8.0", + "@babel/plugin-syntax-class-properties": "^7.12.1", + "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.0", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.0", + "@babel/plugin-syntax-top-level-await": "^7.12.1", + "@babel/plugin-transform-arrow-functions": "^7.12.1", + "@babel/plugin-transform-async-to-generator": "^7.12.1", + "@babel/plugin-transform-block-scoped-functions": "^7.12.1", + "@babel/plugin-transform-block-scoping": "^7.12.1", + "@babel/plugin-transform-classes": "^7.12.1", + "@babel/plugin-transform-computed-properties": "^7.12.1", + "@babel/plugin-transform-destructuring": "^7.12.1", + "@babel/plugin-transform-dotall-regex": "^7.12.1", + "@babel/plugin-transform-duplicate-keys": "^7.12.1", + "@babel/plugin-transform-exponentiation-operator": "^7.12.1", + "@babel/plugin-transform-for-of": "^7.12.1", + "@babel/plugin-transform-function-name": "^7.12.1", + "@babel/plugin-transform-literals": "^7.12.1", + "@babel/plugin-transform-member-expression-literals": "^7.12.1", + "@babel/plugin-transform-modules-amd": "^7.12.1", + "@babel/plugin-transform-modules-commonjs": "^7.12.1", + "@babel/plugin-transform-modules-systemjs": "^7.12.1", + "@babel/plugin-transform-modules-umd": "^7.12.1", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.12.1", + "@babel/plugin-transform-new-target": "^7.12.1", + "@babel/plugin-transform-object-super": "^7.12.1", + "@babel/plugin-transform-parameters": "^7.12.1", + "@babel/plugin-transform-property-literals": "^7.12.1", + "@babel/plugin-transform-regenerator": "^7.12.1", + "@babel/plugin-transform-reserved-words": "^7.12.1", + "@babel/plugin-transform-shorthand-properties": "^7.12.1", + "@babel/plugin-transform-spread": "^7.12.1", + "@babel/plugin-transform-sticky-regex": "^7.12.1", + "@babel/plugin-transform-template-literals": "^7.12.1", + "@babel/plugin-transform-typeof-symbol": "^7.12.1", + "@babel/plugin-transform-unicode-escapes": "^7.12.1", + "@babel/plugin-transform-unicode-regex": "^7.12.1", + "@babel/preset-modules": "^0.1.3", + "@babel/types": "^7.12.1", + "core-js-compat": "^3.6.2", + "semver": "^5.5.0" + } + }, + "@babel/preset-modules": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.4.tgz", + "integrity": "sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + } + }, + "@babel/runtime": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", + "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, "@babel/template": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", @@ -153,6 +1213,16 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, + "JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + } + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -171,6 +1241,23 @@ "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", "dev": true }, + "acorn-node": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz", + "integrity": "sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==", + "dev": true, + "requires": { + "acorn": "^7.0.0", + "acorn-walk": "^7.0.0", + "xtend": "^4.0.2" + } + }, + "acorn-walk": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", + "dev": true + }, "aggregate-error": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", @@ -353,6 +1440,12 @@ "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", "dev": true }, + "array-filter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", + "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=", + "dev": true + }, "array-find-index": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", @@ -446,6 +1539,53 @@ "safer-buffer": "~2.1.0" } }, + "asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "assert": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", + "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", + "dev": true, + "requires": { + "object-assign": "^4.1.1", + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + } + } + }, "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", @@ -509,6 +1649,15 @@ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true }, + "available-typed-arrays": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz", + "integrity": "sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ==", + "dev": true, + "requires": { + "array-filter": "^1.0.0" + } + }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -535,6 +1684,21 @@ "resolve": "^1.12.0" } }, + "babel-plugin-dynamic-import-node": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", + "dev": true, + "requires": { + "object.assign": "^4.1.0" + } + }, + "babelify": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/babelify/-/babelify-10.0.0.tgz", + "integrity": "sha512-X40FaxyH7t3X+JFAKvb1H9wooWKLRCi8pg3m8poqtdZaIng+bjzp9RvKQCvRjF9isHiPkXspbbXT/zwXLtwgwg==", + "dev": true + }, "bach": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz", @@ -613,6 +1777,12 @@ } } }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true + }, "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", @@ -628,6 +1798,16 @@ "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", "dev": true }, + "bl": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz", + "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==", + "dev": true, + "requires": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, "block-stream": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", @@ -637,6 +1817,12 @@ "inherits": "~2.0.0" } }, + "bn.js": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", + "dev": true + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -656,6 +1842,214 @@ "fill-range": "^7.0.1" } }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browser-pack": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz", + "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "combine-source-map": "~0.8.0", + "defined": "^1.0.0", + "safe-buffer": "^5.1.1", + "through2": "^2.0.0", + "umd": "^3.0.0" + } + }, + "browser-resolve": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz", + "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==", + "dev": true, + "requires": { + "resolve": "^1.17.0" + } + }, + "browserify": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-17.0.0.tgz", + "integrity": "sha512-SaHqzhku9v/j6XsQMRxPyBrSP3gnwmE27gLJYZgMT2GeK3J0+0toN+MnuNYDfHwVGQfLiMZ7KSNSIXHemy905w==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "assert": "^1.4.0", + "browser-pack": "^6.0.1", + "browser-resolve": "^2.0.0", + "browserify-zlib": "~0.2.0", + "buffer": "~5.2.1", + "cached-path-relative": "^1.0.0", + "concat-stream": "^1.6.0", + "console-browserify": "^1.1.0", + "constants-browserify": "~1.0.0", + "crypto-browserify": "^3.0.0", + "defined": "^1.0.0", + "deps-sort": "^2.0.1", + "domain-browser": "^1.2.0", + "duplexer2": "~0.1.2", + "events": "^3.0.0", + "glob": "^7.1.0", + "has": "^1.0.0", + "htmlescape": "^1.1.0", + "https-browserify": "^1.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "^7.2.1", + "labeled-stream-splicer": "^2.0.0", + "mkdirp-classic": "^0.5.2", + "module-deps": "^6.2.3", + "os-browserify": "~0.3.0", + "parents": "^1.0.1", + "path-browserify": "^1.0.0", + "process": "~0.11.0", + "punycode": "^1.3.2", + "querystring-es3": "~0.2.0", + "read-only-stream": "^2.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.1.4", + "shasum-object": "^1.0.0", + "shell-quote": "^1.6.1", + "stream-browserify": "^3.0.0", + "stream-http": "^3.0.0", + "string_decoder": "^1.1.1", + "subarg": "^1.0.0", + "syntax-error": "^1.1.1", + "through2": "^2.0.0", + "timers-browserify": "^1.0.1", + "tty-browserify": "0.0.1", + "url": "~0.11.0", + "util": "~0.12.0", + "vm-browserify": "^1.0.0", + "xtend": "^4.0.0" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + } + } + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "dev": true, + "requires": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "dev": true, + "requires": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.3", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "~1.0.5" + } + }, + "browserslist": { + "version": "4.14.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.7.tgz", + "integrity": "sha512-BSVRLCeG3Xt/j/1cCGj1019Wbty0H+Yvu2AOuZSuoaUWn3RatbL33Cxk+Q4jRMRAbOm0p7SLravLjpnT6s0vzQ==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001157", + "colorette": "^1.2.1", + "electron-to-chromium": "^1.3.591", + "escalade": "^3.1.1", + "node-releases": "^1.1.66" + } + }, + "buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", + "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, "buffer-equal": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", @@ -668,6 +2062,18 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", @@ -685,6 +2091,12 @@ "unset-value": "^1.0.0" } }, + "cached-path-relative": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.2.tgz", + "integrity": "sha512-5r2GqsoEb4qMTTN9J+WzXfjov+hjxT+j3u5K+kIVNIwAd99DLCJE9pBIMP1qVeybV6JiijL385Oz0DcYxfbOIg==", + "dev": true + }, "call-bind": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", @@ -725,6 +2137,12 @@ } } }, + "caniuse-lite": { + "version": "1.0.30001157", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001157.tgz", + "integrity": "sha512-gOerH9Wz2IRZ2ZPdMfBvyOi3cjaz4O4dgNwPGzx8EhqAs4+2IL/O+fJsbt+znSigujoZG8bVcIAUM/I/E5K3MA==", + "dev": true + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -770,6 +2188,16 @@ "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -902,6 +2330,32 @@ "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", "dev": true }, + "colorette": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz", + "integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==", + "dev": true + }, + "combine-source-map": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", + "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", + "dev": true, + "requires": { + "convert-source-map": "~1.1.0", + "inline-source-map": "~0.6.0", + "lodash.memoize": "~3.0.3", + "source-map": "~0.5.3" + }, + "dependencies": { + "convert-source-map": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", + "dev": true + } + } + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -986,12 +2440,24 @@ } } }, + "console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", + "dev": true + }, "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, "convert-source-map": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", @@ -1017,6 +2483,24 @@ "is-plain-object": "^2.0.1" } }, + "core-js-compat": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.7.0.tgz", + "integrity": "sha512-V8yBI3+ZLDVomoWICO6kq/CD28Y4r1M7CWeO4AGpMdMfseu8bkSubBmUPySMGKRTS+su4XQ07zUkAsiu9FCWTg==", + "dev": true, + "requires": { + "browserslist": "^4.14.6", + "semver": "7.0.0" + }, + "dependencies": { + "semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true + } + } + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -1050,6 +2534,51 @@ } } }, + "create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -1063,6 +2592,25 @@ "which": "^1.2.9" } }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -1091,6 +2639,12 @@ "chokidar": ">=2.0.0 <4.0.0" } }, + "dash-ast": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz", + "integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==", + "dev": true + }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -1206,6 +2760,12 @@ } } }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, "del": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/del/-/del-6.0.0.tgz", @@ -1234,12 +2794,64 @@ "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true }, + "deps-sort": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.1.tgz", + "integrity": "sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "shasum-object": "^1.0.0", + "subarg": "^1.0.0", + "through2": "^2.0.0" + } + }, + "des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, "detect-file": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", "dev": true }, + "detective": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.0.tgz", + "integrity": "sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg==", + "dev": true, + "requires": { + "acorn-node": "^1.6.1", + "defined": "^1.0.0", + "minimist": "^1.1.1" + } + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, "dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -1258,6 +2870,21 @@ "esutils": "^2.0.2" } }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true + }, + "duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, "duplexify": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", @@ -1290,6 +2917,35 @@ "safer-buffer": "^2.1.0" } }, + "electron-to-chromium": { + "version": "1.3.595", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.595.tgz", + "integrity": "sha512-JpaBIhdBkF9FLG7x06ONfe0f5bxPrxRcq0X+Sc8vsCt+OPWIzxOD+qM71NEHLGbDfN9Q6hbtHRv4/dnvcOxo6g==", + "dev": true + }, + "elliptic": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", @@ -1314,6 +2970,36 @@ "is-arrayish": "^0.2.1" } }, + "es-abstract": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "es5-ext": { "version": "0.10.53", "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", @@ -1358,6 +3044,12 @@ "es6-symbol": "^3.1.1" } }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1520,6 +3212,22 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, + "events": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.2.0.tgz", + "integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, "execa": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", @@ -1809,6 +3517,12 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "fast-safe-stringify": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", + "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==", + "dev": true + }, "fastq": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.9.0.tgz", @@ -2052,6 +3766,12 @@ "for-in": "^1.0.1" } }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -2198,6 +3918,18 @@ "globule": "^1.0.0" } }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true + }, + "get-assigned-identifiers": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", + "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==", + "dev": true + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -2940,6 +4672,57 @@ } } }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, "homedir-polyfill": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", @@ -2955,6 +4738,12 @@ "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "dev": true }, + "htmlescape": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", + "dev": true + }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -2966,6 +4755,12 @@ "sshpk": "^1.7.0" } }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, "human-signals": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", @@ -3050,6 +4845,12 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true + }, "ignore": { "version": "5.1.8", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", @@ -3106,6 +4907,15 @@ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true }, + "inline-source-map": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", + "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", + "dev": true, + "requires": { + "source-map": "~0.5.3" + } + }, "inquirer": { "version": "7.3.3", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", @@ -3216,6 +5026,24 @@ } } }, + "insert-module-globals": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.1.tgz", + "integrity": "sha512-ufS5Qq9RZN+Bu899eA9QCAYThY+gGW7oRkmb0vC93Vlyu/CFGcH0OYPEjVkDXA5FEbTt1+VWzdoOD3Ny9N+8tg==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "acorn-node": "^1.5.2", + "combine-source-map": "^0.8.0", + "concat-stream": "^1.6.1", + "is-buffer": "^1.1.0", + "path-is-absolute": "^1.0.1", + "process": "~0.11.0", + "through2": "^2.0.0", + "undeclared-identifiers": "^1.1.2", + "xtend": "^4.0.0" + } + }, "interpret": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", @@ -3258,6 +5086,12 @@ } } }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", + "dev": true + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -3279,6 +5113,12 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, + "is-callable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", + "dev": true + }, "is-core-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.0.0.tgz", @@ -3308,6 +5148,12 @@ } } }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", @@ -3351,6 +5197,12 @@ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, + "is-generator-function": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.7.tgz", + "integrity": "sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw==", + "dev": true + }, "is-glob": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", @@ -3366,6 +5218,12 @@ "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", "dev": true }, + "is-negative-zero": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", + "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=", + "dev": true + }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -3393,6 +5251,15 @@ "isobject": "^3.0.1" } }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, "is-relative": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", @@ -3408,6 +5275,27 @@ "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", "dev": true }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-typed-array": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.3.tgz", + "integrity": "sha512-BSYUBOK/HJibQ30wWkWold5txYwMUXQct9YHAQJr8fSwvZoiglcqB0pd7vEN23+Tsi9IUEjztdOSzl4qLVYGTQ==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.0", + "es-abstract": "^1.17.4", + "foreach": "^2.0.5", + "has-symbols": "^1.0.1" + } + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -3535,6 +5423,21 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -3559,6 +5462,16 @@ "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true }, + "labeled-stream-splicer": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz", + "integrity": "sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "stream-splicer": "^2.0.0" + } + }, "last-run": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz", @@ -3674,6 +5587,12 @@ "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, + "lodash.memoize": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", + "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", + "dev": true + }, "loud-rejection": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", @@ -3862,6 +5781,17 @@ } } }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, "meow": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", @@ -3902,6 +5832,24 @@ "picomatch": "^2.0.5" } }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, "mime-db": { "version": "1.44.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", @@ -3923,6 +5871,18 @@ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -3968,6 +5928,35 @@ "minimist": "^1.2.5" } }, + "mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "dev": true + }, + "module-deps": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.3.tgz", + "integrity": "sha512-fg7OZaQBcL4/L+AK5f4iVqf9OMbCclXfy/znXRxTVhJSeW5AIlS9AwheYwDaXM3lVW7OBeaeUEY3gbaC6cLlSA==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "browser-resolve": "^2.0.0", + "cached-path-relative": "^1.0.2", + "concat-stream": "~1.6.0", + "defined": "^1.0.0", + "detective": "^5.2.0", + "duplexer2": "^0.1.2", + "inherits": "^2.0.1", + "parents": "^1.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.4.0", + "stream-combiner2": "^1.1.1", + "subarg": "^1.0.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" + } + }, "mri": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz", @@ -4085,6 +6074,12 @@ } } }, + "node-releases": { + "version": "1.1.66", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.66.tgz", + "integrity": "sha512-JHEQ1iWPGK+38VLB2H9ef2otU4l8s3yAMt9Xf934r6+ojCYDMHPMqvCc9TnzfeFSP1QEOeU6YZEd3+De0LTCgg==", + "dev": true + }, "node-sass": { "version": "4.14.1", "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.1.tgz", @@ -4276,6 +6271,12 @@ } } }, + "object-inspect": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", + "dev": true + }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -4391,6 +6392,12 @@ "readable-stream": "^2.0.1" } }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", @@ -4455,6 +6462,12 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true + }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -4464,6 +6477,28 @@ "callsites": "^3.0.0" } }, + "parents": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", + "dev": true, + "requires": { + "path-platform": "~0.11.15" + } + }, + "parse-asn1": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "dev": true, + "requires": { + "asn1.js": "^5.2.0", + "browserify-aes": "^1.0.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, "parse-filepath": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", @@ -4503,6 +6538,12 @@ "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, + "path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true + }, "path-dirname": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", @@ -4533,6 +6574,12 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "path-platform": { + "version": "0.11.15", + "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", + "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", + "dev": true + }, "path-root": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", @@ -4554,6 +6601,19 @@ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, + "pbkdf2": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -4776,6 +6836,12 @@ } } }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -4800,6 +6866,28 @@ "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", "dev": true }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, "pump": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", @@ -4833,6 +6921,46 @@ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "read-only-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", + "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, "read-pkg": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-4.0.1.tgz", @@ -4957,6 +7085,26 @@ } } }, + "regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true + }, + "regenerate-unicode-properties": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", + "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", + "dev": true, + "requires": { + "regenerate": "^1.4.0" + } + }, + "regenerator-runtime": { + "version": "0.13.7", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", + "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==" + }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -5150,6 +7298,16 @@ "glob": "^7.1.3" } }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, "run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", @@ -5281,6 +7439,25 @@ } } }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shasum-object": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shasum-object/-/shasum-object-1.0.0.tgz", + "integrity": "sha512-Iqo5rp/3xVi6M4YheapzZhhGPVs0yZwHj7wvwQ1B9z8H6zk+FEnI7y3Teq7qwnekfEhu8WmG2z0z4iWZaxLWVg==", + "dev": true, + "requires": { + "fast-safe-stringify": "^2.0.7" + } + }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -5296,12 +7473,24 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, + "shell-quote": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz", + "integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==", + "dev": true + }, "signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, + "simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "dev": true + }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -5578,18 +7767,86 @@ "readable-stream": "^2.0.1" } }, + "stream-browserify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", + "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", + "dev": true, + "requires": { + "inherits": "~2.0.4", + "readable-stream": "^3.5.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, + "stream-combiner2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", + "dev": true, + "requires": { + "duplexer2": "~0.1.0", + "readable-stream": "^2.0.2" + } + }, "stream-exhaust": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==", "dev": true }, + "stream-http": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.1.1.tgz", + "integrity": "sha512-S7OqaYu0EkFpgeGFb/NPOoPLxFko7TPqtEeFg5DXPB4v/KETHG0Ln6fRFrNezoelpaDKmycEmmZ81cC9DAwgYg==", + "dev": true, + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "xtend": "^4.0.2" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "stream-shift": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", "dev": true }, + "stream-splicer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.1.tgz", + "integrity": "sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.2" + } + }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -5601,6 +7858,70 @@ "strip-ansi": "^5.1.0" } }, + "string.prototype.trimend": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.2.tgz", + "integrity": "sha512-8oAG/hi14Z4nOVP0z6mdiVZ/wqjDtWSLygMigTzAb+7aPEDTleeFf+WrF+alzecxIRkckkJVn+dTlwzJXORATw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", + "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } + } + }, + "string.prototype.trimstart": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.2.tgz", + "integrity": "sha512-7F6CdBTl5zyu30BJFdzSTlSlLPwODC23Od+iLoVH8X6+3fvDPPuBVVj9iaB1GOsSTSIgVfsfm27R2FGrAPznWg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", + "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } + } + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -5649,6 +7970,15 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, + "subarg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", + "dev": true, + "requires": { + "minimist": "^1.1.0" + } + }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -5668,6 +7998,15 @@ "es6-symbol": "^3.1.1" } }, + "syntax-error": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", + "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", + "dev": true, + "requires": { + "acorn-node": "^1.2.0" + } + }, "table": { "version": "5.4.6", "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", @@ -5729,6 +8068,15 @@ "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", "dev": true }, + "timers-browserify": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", + "dev": true, + "requires": { + "process": "~0.11.0" + } + }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -5841,6 +8189,12 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, + "tty-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", + "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", + "dev": true + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -5883,12 +8237,31 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, + "umd": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", + "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==", + "dev": true + }, "unc-path-regex": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", "dev": true }, + "undeclared-identifiers": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.3.tgz", + "integrity": "sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw==", + "dev": true, + "requires": { + "acorn-node": "^1.3.0", + "dash-ast": "^1.0.0", + "get-assigned-identifiers": "^1.2.0", + "simple-concat": "^1.0.0", + "xtend": "^4.0.1" + } + }, "undertaker": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.3.0.tgz", @@ -5921,6 +8294,34 @@ "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=", "dev": true }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", + "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", + "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", + "dev": true + }, "union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", @@ -6004,12 +8405,44 @@ "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", "dev": true }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, "use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", "dev": true }, + "util": { + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.3.tgz", + "integrity": "sha512-I8XkoQwE+fPQEhy9v012V+TSdH2kp9ts29i20TaaDUXsg7x/onePbhFJUExBfv/2ay1ZOp/Vsm3nDlmnFGSAog==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "safe-buffer": "^5.1.2", + "which-typed-array": "^1.1.2" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -6078,6 +8511,16 @@ "replace-ext": "^1.0.0" } }, + "vinyl-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vinyl-buffer/-/vinyl-buffer-1.0.1.tgz", + "integrity": "sha1-lsGjR5uMU5JULGEgKQE7Wyf4i78=", + "dev": true, + "requires": { + "bl": "^1.2.1", + "through2": "^2.0.3" + } + }, "vinyl-fs": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", @@ -6124,6 +8567,16 @@ } } }, + "vinyl-source-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/vinyl-source-stream/-/vinyl-source-stream-2.0.0.tgz", + "integrity": "sha1-84pa+53R6Ttl1VBGmsYYKsT1S44=", + "dev": true, + "requires": { + "through2": "^2.0.3", + "vinyl": "^2.1.0" + } + }, "vinyl-sourcemap": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", @@ -6159,6 +8612,12 @@ "source-map": "^0.5.1" } }, + "vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", + "dev": true + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -6180,6 +8639,20 @@ "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", "dev": true }, + "which-typed-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.2.tgz", + "integrity": "sha512-KT6okrd1tE6JdZAy3o2VhMoYPh3+J6EMZLyrxBQsZflI1QCZIxMrIYLkosd8Twf+YfknVIHmYQPgJt238p8dnQ==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.2", + "es-abstract": "^1.17.5", + "foreach": "^2.0.5", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.1", + "is-typed-array": "^1.1.3" + } + }, "wide-align": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", diff --git a/package.json b/package.json index c28cabf7c..0defe02c1 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,12 @@ "node": "10" }, "devDependencies": { + "@babel/core": "^7.12.3", + "@babel/plugin-transform-runtime": "^7.12.1", + "@babel/preset-env": "^7.12.1", "babel-eslint": "^10.1.0", + "babelify": "^10.0.0", + "browserify": "^17.0.0", "concurrently": "^5.3.0", "dart-sass": "^1.25.0", "del": "^6.0.0", @@ -27,11 +32,16 @@ "husky": "^4.3.0", "prettier": "2.1.2", "pretty-quick": "^3.1.0", - "vinyl-paths": "^3.0.1" + "vinyl-buffer": "^1.0.1", + "vinyl-paths": "^3.0.1", + "vinyl-source-stream": "^2.0.0" }, "husky": { "hooks": { "pre-commit": "pretty-quick --staged" } + }, + "dependencies": { + "@babel/runtime": "^7.12.5" } } diff --git a/src/js/account.js b/src/js/account.js index 89a70b00c..3abe46ebf 100644 --- a/src/js/account.js +++ b/src/js/account.js @@ -160,7 +160,7 @@ function signUp() { console.log("Analytics unavailable"); } $(".pageLogin .preloader").addClass("hidden"); - dbSnapshot = { + db_setSnapshot({ results: [], personalBests: {}, tags: [], @@ -169,14 +169,14 @@ function signUp() { started: undefined, completed: undefined, }, - }; + }); if (notSignedInLastResult !== null) { notSignedInLastResult.uid = usr.uid; testCompleted({ uid: usr.uid, obj: notSignedInLastResult, }); - dbSnapshot.results.push(notSignedInLastResult); + db_getSnapshot().results.push(notSignedInLastResult); config.resultFilters = defaultAccountFilters; } changePage("account"); @@ -225,7 +225,7 @@ function signOut() { hideAccountSettingsSection(); updateAccountLoginButton(); changePage("login"); - dbSnapshot = null; + db_setSnapshot(null); }) .catch(function (error) { showNotification(error.message, 5000); @@ -284,7 +284,7 @@ firebase.auth().onAuthStateChanged(function (user) { verifyUser(verifyUserWhenLoggedIn).then((data) => { showNotification(data.data.message, 3000); if (data.data.status === 1) { - dbSnapshot.discordId = data.data.did; + db_getSnapshot().discordId = data.data.did; updateDiscordSettingsSection(); } }); @@ -312,18 +312,18 @@ firebase.auth().onAuthStateChanged(function (user) { function getAccountDataAndInit() { db_getUserSnapshot() .then((e) => { - if (dbSnapshot === null) { + if (db_getSnapshot() === null) { throw "Missing db snapshot. Client likely could not connect to the backend."; } initPaceCaret(true); if (!configChangedBeforeDb) { if (cookieConfig === null) { accountIconLoading(false); - applyConfig(dbSnapshot.config); + applyConfig(db_getSnapshot().config); updateSettingsPage(); saveConfigToCookie(true); restartTest(false, true); - } else if (dbSnapshot.config !== undefined) { + } else if (db_getSnapshot().config !== undefined) { let configsDifferent = false; Object.keys(config).forEach((key) => { if (!configsDifferent) { @@ -331,18 +331,22 @@ function getAccountDataAndInit() { if (key !== "resultFilters") { if (Array.isArray(config[key])) { config[key].forEach((arrval, index) => { - if (arrval != dbSnapshot.config[key][index]) { + if (arrval != db_getSnapshot().config[key][index]) { configsDifferent = true; console.log( - `.config is different: ${arrval} != ${dbSnapshot.config[key][index]}` + `.config is different: ${arrval} != ${ + db_getSnapshot().config[key][index] + }` ); } }); } else { - if (config[key] != dbSnapshot.config[key]) { + if (config[key] != db_getSnapshot().config[key]) { configsDifferent = true; console.log( - `..config is different ${key}: ${config[key]} != ${dbSnapshot.config[key]}` + `..config is different ${key}: ${config[key]} != ${ + db_getSnapshot().config[key] + }` ); } } @@ -357,7 +361,7 @@ function getAccountDataAndInit() { if (configsDifferent) { console.log("applying config from db"); accountIconLoading(false); - config = dbSnapshot.config; + config = db_getSnapshot().config; applyConfig(config); updateSettingsPage(); saveConfigToCookie(true); @@ -375,12 +379,12 @@ function getAccountDataAndInit() { config.resultFilters.difficulty === undefined ) { if ( - dbSnapshot.config.resultFilters == null || - dbSnapshot.config.resultFilters.difficulty === undefined + db_getSnapshot().config.resultFilters == null || + db_getSnapshot().config.resultFilters.difficulty === undefined ) { config.resultFilters = defaultAccountFilters; } else { - config.resultFilters = dbSnapshot.config.resultFilters; + config.resultFilters = db_getSnapshot().config.resultFilters; } } } catch (e) { @@ -1045,14 +1049,14 @@ function updateFilterTags() { $( ".pageAccount .content .filterButtons .buttonsAndTitle.tags .buttons" ).empty(); - if (dbSnapshot.tags.length > 0) { + if (db_getSnapshot().tags.length > 0) { $(".pageAccount .content .filterButtons .buttonsAndTitle.tags").removeClass( "hidden" ); $( ".pageAccount .content .filterButtons .buttonsAndTitle.tags .buttons" ).append(`
no tag
`); - dbSnapshot.tags.forEach((tag) => { + db_getSnapshot().tags.forEach((tag) => { defaultAccountFilters.tags[tag.id] = true; $( ".pageAccount .content .filterButtons .buttonsAndTitle.tags .buttons" @@ -1150,9 +1154,9 @@ function showActiveFilters() { ret += aboveChartDisplay.tags.array .map((id) => { if (id == "none") return id; - let name = dbSnapshot.tags.filter((t) => t.id == id)[0]; + let name = db_getSnapshot().tags.filter((t) => t.id == id)[0]; if (name !== undefined) { - return dbSnapshot.tags.filter((t) => t.id == id)[0].name; + return db_getSnapshot().tags.filter((t) => t.id == id)[0].name; } }) .join(", "); @@ -1278,7 +1282,7 @@ $(".pageAccount .topFilters .button.currentConfigFilter").click((e) => { } config.resultFilters.funbox[activeFunBox] = true; config.resultFilters.tags.none = true; - dbSnapshot.tags.forEach((tag) => { + db_getSnapshot().tags.forEach((tag) => { if (tag.active === true) { config.resultFilters.tags.none = false; config.resultFilters.tags[tag.id] = true; @@ -1398,7 +1402,7 @@ function fillPbTables() { `); - const pb = dbSnapshot.personalBests; + const pb = db_getSnapshot().personalBests; let pbData; let text; @@ -1637,7 +1641,7 @@ function loadMoreLines() { if (result.tags !== undefined && result.tags.length > 0) { result.tags.forEach((tag) => { - dbSnapshot.tags.forEach((snaptag) => { + db_getSnapshot().tags.forEach((snaptag) => { if (tag === snaptag.id) { tagNames += snaptag.name + ", "; } @@ -1708,10 +1712,10 @@ function clearGlobalStats() { } function refreshGlobalStats() { - if (dbSnapshot.globalStats.time != undefined) { - let th = Math.floor(dbSnapshot.globalStats.time / 3600); - let tm = Math.floor((dbSnapshot.globalStats.time % 3600) / 60); - let ts = Math.floor((dbSnapshot.globalStats.time % 3600) % 60); + if (db_getSnapshot().globalStats.time != undefined) { + let th = Math.floor(db_getSnapshot().globalStats.time / 3600); + let tm = Math.floor((db_getSnapshot().globalStats.time % 3600) / 60); + let ts = Math.floor((db_getSnapshot().globalStats.time % 3600) % 60); $(".pageAccount .globalTimeTyping .val").text(` ${th < 10 ? "0" + th : th}:${tm < 10 ? "0" + tm : tm}:${ @@ -1719,14 +1723,14 @@ function refreshGlobalStats() { } `); } - if (dbSnapshot.globalStats.started != undefined) { + if (db_getSnapshot().globalStats.started != undefined) { $(".pageAccount .globalTestsStarted .val").text( - dbSnapshot.globalStats.started + db_getSnapshot().globalStats.started ); } - if (dbSnapshot.globalStats.completed != undefined) { + if (db_getSnapshot().globalStats.completed != undefined) { $(".pageAccount .globalTestsCompleted .val").text( - dbSnapshot.globalStats.completed + db_getSnapshot().globalStats.completed ); } } @@ -1775,7 +1779,7 @@ function refreshAccountPage() { filteredResults = []; $(".pageAccount .history table tbody").empty(); - dbSnapshot.results.forEach((result) => { + db_getSnapshot().results.forEach((result) => { let tt = 0; if (result.testDuration == undefined) { //test finished before testDuration field was introduced - estimate @@ -1849,14 +1853,14 @@ function refreshAccountPage() { if (result.tags === undefined || result.tags.length === 0) { //no tags, show when no tag is enabled - if (dbSnapshot.tags.length > 0) { + if (db_getSnapshot().tags.length > 0) { if (config.resultFilters.tags.none) tagHide = false; } else { tagHide = false; } } else { //tags exist - let validTags = dbSnapshot.tags.map((t) => t.id); + let validTags = db_getSnapshot().tags.map((t) => t.id); result.tags.forEach((tag) => { //check if i even need to check tags anymore if (!tagHide) return; @@ -2232,10 +2236,10 @@ function refreshAccountPage() { swapElements($(".pageAccount .preloader"), $(".pageAccount .content"), 250); } - if (dbSnapshot === null) { + if (db_getSnapshot() === null) { showNotification(`Missing account data. Please refresh.`, 5000); $(".pageAccount .preloader").html("Missing account data. Please refresh."); - } else if (dbSnapshot.results === undefined) { + } else if (db_getSnapshot().results === undefined) { db_getUserResults().then((d) => { if (d) { showActiveFilters(); @@ -2292,7 +2296,7 @@ $(".pageAccount .toggleChartStyle").click((params) => { }); $(document).on("click", ".pageAccount .group.history #resultEditTags", (f) => { - if (dbSnapshot.tags.length > 0) { + if (db_getSnapshot().tags.length > 0) { let resultid = $(f.target).parents("span").attr("resultid"); let tags = $(f.target).parents("span").attr("tags"); $("#resultEditTagsPanel").attr("resultid", resultid); @@ -2314,7 +2318,7 @@ $("#resultEditTagsPanelWrapper").click((e) => { function updateResultEditTagsPanelButtons() { $("#resultEditTagsPanel .buttons").empty(); - dbSnapshot.tags.forEach((tag) => { + db_getSnapshot().tags.forEach((tag) => { $("#resultEditTagsPanel .buttons").append( `
${tag.name}
` ); @@ -2354,7 +2358,7 @@ $("#resultEditTagsPanel .confirmButton").click((f) => { hideBackgroundLoader(); if (r.data.resultCode === 1) { showNotification("Tags updated.", 3000); - dbSnapshot.results.forEach((result) => { + db_getSnapshot().results.forEach((result) => { if (result.id === resultid) { result.tags = newtags; } @@ -2364,7 +2368,7 @@ $("#resultEditTagsPanel .confirmButton").click((f) => { if (newtags.length > 0) { newtags.forEach((tag) => { - dbSnapshot.tags.forEach((snaptag) => { + db_getSnapshot().tags.forEach((snaptag) => { if (tag === snaptag.id) { tagNames += snaptag.name + ", "; } @@ -2410,5 +2414,5 @@ $("#resultEditTagsPanel .confirmButton").click((f) => { }); function updateLbMemory(mode, mode2, type, value) { - dbSnapshot.lbMemory[mode + mode2][type] = value; + db_getSnapshot().lbMemory[mode + mode2][type] = value; } diff --git a/src/js/commandline.js b/src/js/commandline.js index e8207dd74..2aed504b9 100644 --- a/src/js/commandline.js +++ b/src/js/commandline.js @@ -1467,14 +1467,14 @@ let commandsTags = { }; function updateCommandsTagsList() { - if (dbSnapshot.tags.length > 0) { + if (db_getSnapshot().tags.length > 0) { commandsTags.list = []; commandsTags.list.push({ id: "clearTags", display: "Clear tags", exec: () => { - dbSnapshot.tags.forEach((tag) => { + db_getSnapshot().tags.forEach((tag) => { tag.active = false; }); updateTestModesNotice(); @@ -1482,7 +1482,7 @@ function updateCommandsTagsList() { }, }); - dbSnapshot.tags.forEach((tag) => { + db_getSnapshot().tags.forEach((tag) => { let dis = tag.name; if (tag.active === true) { diff --git a/src/js/db.js b/src/js/db.js index 4d5ed78f1..d1dedd96c 100644 --- a/src/js/db.js +++ b/src/js/db.js @@ -3,7 +3,15 @@ db.settings({ experimentalForceLongPolling: true }); let dbSnapshot = null; -async function db_getUserSnapshot() { +export function db_getSnapshot() { + return dbSnapshot; +} + +export function db_setSnapshot(newSnapshot) { + dbSnapshot = newSnapshot; +} + +export async function db_getUserSnapshot() { let user = firebase.auth().currentUser; if (user == null) return false; let snap = { @@ -71,7 +79,7 @@ async function db_getUserSnapshot() { return dbSnapshot; } -async function db_getUserResults() { +export async function db_getUserResults() { let user = firebase.auth().currentUser; if (user == null) return false; if (dbSnapshot === null) return false; @@ -103,7 +111,7 @@ async function db_getUserResults() { } } -async function db_getUserHighestWpm( +export async function db_getUserHighestWpm( mode, mode2, punctuation, @@ -137,7 +145,13 @@ async function db_getUserHighestWpm( return retval; } -async function db_getLocalPB(mode, mode2, punctuation, language, difficulty) { +export async function db_getLocalPB( + mode, + mode2, + punctuation, + language, + difficulty +) { function cont() { let ret = 0; try { @@ -164,7 +178,7 @@ async function db_getLocalPB(mode, mode2, punctuation, language, difficulty) { return retval; } -async function db_saveLocalPB( +export async function db_saveLocalPB( mode, mode2, punctuation, diff --git a/src/js/global-dependencies.js b/src/js/global-dependencies.js new file mode 100644 index 000000000..010ef6dda --- /dev/null +++ b/src/js/global-dependencies.js @@ -0,0 +1,9 @@ +import { + db_getSnapshot, + db_setSnapshot, + db_getUserSnapshot, + db_getUserResults, + db_getUserHighestWpm, + db_getLocalPB, + db_saveLocalPB, +} from "./db"; diff --git a/src/js/script.js b/src/js/script.js index 54f065a9c..9b2e94b32 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -1907,7 +1907,7 @@ function showResult(difficultyFailed = false) { } else { let activeTags = []; try { - dbSnapshot.tags.forEach((tag) => { + db_getSnapshot().tags.forEach((tag) => { if (tag.active === true) { activeTags.push(tag.id); } @@ -2073,24 +2073,27 @@ function showResult(difficultyFailed = false) { if (e.data.resultCode === 2) { completedEvent.isPb = true; } - if (dbSnapshot !== null && dbSnapshot.results !== undefined) { - dbSnapshot.results.unshift(completedEvent); - if (dbSnapshot.globalStats.time == undefined) { - dbSnapshot.globalStats.time = + if ( + db_getSnapshot() !== null && + db_getSnapshot().results !== undefined + ) { + db_getSnapshot().results.unshift(completedEvent); + if (db_getSnapshot().globalStats.time == undefined) { + db_getSnapshot().globalStats.time = testtime + completedEvent.incompleteTestSeconds; } else { - dbSnapshot.globalStats.time += + db_getSnapshot().globalStats.time += testtime + completedEvent.incompleteTestSeconds; } - if (dbSnapshot.globalStats.started == undefined) { - dbSnapshot.globalStats.started = restartCount + 1; + if (db_getSnapshot().globalStats.started == undefined) { + db_getSnapshot().globalStats.started = restartCount + 1; } else { - dbSnapshot.globalStats.started += restartCount + 1; + db_getSnapshot().globalStats.started += restartCount + 1; } - if (dbSnapshot.globalStats.completed == undefined) { - dbSnapshot.globalStats.completed = 1; + if (db_getSnapshot().globalStats.completed == undefined) { + db_getSnapshot().globalStats.completed = 1; } else { - dbSnapshot.globalStats.completed += 1; + db_getSnapshot().globalStats.completed += 1; } } try { @@ -2104,7 +2107,7 @@ function showResult(difficultyFailed = false) { if ( config.mode === "time" && (mode2 == "15" || mode2 == "60") && - dbSnapshot !== null + db_getSnapshot() !== null ) { const lbUpIcon = ``; const lbDownIcon = ``; @@ -2113,8 +2116,9 @@ function showResult(difficultyFailed = false) { //global let globalLbString = ""; const glb = e.data.globalLeaderboard; - const glbMemory = - dbSnapshot.lbMemory[config.mode + mode2].global; + const glbMemory = db_getSnapshot().lbMemory[ + config.mode + mode2 + ].global; let dontShowGlobalDiff = glbMemory == null || glbMemory === -1 ? true : false; let globalLbDiff = null; @@ -2169,8 +2173,9 @@ function showResult(difficultyFailed = false) { //daily let dailyLbString = ""; const dlb = e.data.dailyLeaderboard; - const dlbMemory = - dbSnapshot.lbMemory[config.mode + mode2].daily; + const dlbMemory = db_getSnapshot().lbMemory[ + config.mode + mode2 + ].daily; let dontShowDailyDiff = dlbMemory == null || dlbMemory === -1 ? true : false; let dailyLbDiff = null; @@ -2226,7 +2231,7 @@ function showResult(difficultyFailed = false) { saveLbMemory({ uid: firebase.auth().currentUser.uid, - obj: dbSnapshot.lbMemory, + obj: db_getSnapshot().lbMemory, }).then((d) => { if (d.data.returnCode === 1) { } else { @@ -2399,7 +2404,7 @@ function showResult(difficultyFailed = false) { let tagsText = ""; try { - dbSnapshot.tags.forEach((tag) => { + db_getSnapshot().tags.forEach((tag) => { if (tag.active === true) { tagsText += "
" + tag.name; } @@ -3351,7 +3356,7 @@ function updateTestModesNotice() { let tagsString = ""; try { - dbSnapshot.tags.forEach((tag) => { + db_getSnapshot().tags.forEach((tag) => { if (tag.active === true) { tagsString += tag.name + ", "; } @@ -3412,7 +3417,7 @@ function tagsEdit() { let status = e.data.resultCode; if (status === 1) { showNotification("Tag added", 2000); - dbSnapshot.tags.push({ + db_getSnapshot().tags.push({ name: inputVal, id: e.data.id, }); @@ -3437,7 +3442,7 @@ function tagsEdit() { let status = e.data.resultCode; if (status === 1) { showNotification("Tag updated", 2000); - dbSnapshot.tags.forEach((tag) => { + db_getSnapshot().tags.forEach((tag) => { if (tag.id === tagid) { tag.name = inputVal; } @@ -3459,9 +3464,9 @@ function tagsEdit() { let status = e.data.resultCode; if (status === 1) { showNotification("Tag removed", 2000); - dbSnapshot.tags.forEach((tag, index) => { + db_getSnapshot().tags.forEach((tag, index) => { if (tag.id === tagid) { - dbSnapshot.tags.splice(index, 1); + db_getSnapshot().tags.splice(index, 1); } }); updateResultEditTagsPanelButtons(); diff --git a/src/js/settings.js b/src/js/settings.js index 2a11f41a2..ba25156eb 100644 --- a/src/js/settings.js +++ b/src/js/settings.js @@ -548,9 +548,9 @@ function hideAccountSettingsSection() { } function refreshTagsSettingsSection() { - if (firebase.auth().currentUser !== null && dbSnapshot !== null) { + if (firebase.auth().currentUser !== null && db_getSnapshot() !== null) { let tagsEl = $(".pageSettings .section.tags .tagsList").empty(); - dbSnapshot.tags.forEach((tag) => { + db_getSnapshot().tags.forEach((tag) => { if (tag.active === true) { tagsEl.append(` @@ -618,7 +618,7 @@ function setCustomThemeInputs() { } function showActiveTags() { - dbSnapshot.tags.forEach((tag) => { + db_getSnapshot().tags.forEach((tag) => { if (tag.active === true) { $( `.pageSettings .section.tags .tagsList .tag[id='${tag.id}'] .active` @@ -632,7 +632,7 @@ function showActiveTags() { } function toggleTag(tagid, nosave = false) { - dbSnapshot.tags.forEach((tag) => { + db_getSnapshot().tags.forEach((tag) => { if (tag.id === tagid) { if (tag.active === undefined) { tag.active = true; @@ -650,10 +650,10 @@ function updateDiscordSettingsSection() { if (firebase.auth().currentUser == null) { $(".pageSettings .section.discordIntegration").addClass("hidden"); } else { - if (dbSnapshot == null) return; + if (db_getSnapshot() == null) return; $(".pageSettings .section.discordIntegration").removeClass("hidden"); - if (dbSnapshot.discordId == undefined) { + if (db_getSnapshot().discordId == undefined) { //show button $(".pageSettings .section.discordIntegration .buttons").removeClass( "hidden" @@ -719,7 +719,7 @@ $( .then((ret) => { hideBackgroundLoader(); if (ret.data.status === 1 || ret.data.status === 2) { - dbSnapshot.pairingCode = ret.data.pairingCode; + db_getSnapshot().pairingCode = ret.data.pairingCode; $(".pageSettings .section.discordIntegration .code .bottom").text( ret.data.pairingCode ); @@ -743,7 +743,7 @@ $(".pageSettings .section.discordIntegration #unlinkDiscordButton").click( hideBackgroundLoader(); console.log(ret); if (ret.data.status === 1) { - dbSnapshot.discordId = null; + db_getSnapshot().discordId = null; showNotification("Accounts unlinked", 2000); updateDiscordSettingsSection(); } else { diff --git a/src/js/userconfig.js b/src/js/userconfig.js index 0c5246a13..740aa6549 100644 --- a/src/js/userconfig.js +++ b/src/js/userconfig.js @@ -128,7 +128,7 @@ function saveActiveTagsToCookie() { let tags = []; try { - dbSnapshot.tags.forEach((tag) => { + db_getSnapshot().tags.forEach((tag) => { if (tag.active === true) { tags.push(tag.id); } From 1679e691234f8d247f6f0ace88592b068691aad7 Mon Sep 17 00:00:00 2001 From: typer Date: Thu, 12 Nov 2020 23:38:30 -0800 Subject: [PATCH 23/40] exported db snapshot globally for debugging in the browser --- gulpfile.js | 1 + src/js/exports.js | 4 ++++ src/js/global-dependencies.js | 2 ++ 3 files changed, 7 insertions(+) create mode 100644 src/js/exports.js diff --git a/gulpfile.js b/gulpfile.js index a508bae6d..dd8bea7a1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -101,6 +101,7 @@ const globalSrc = [ "./src/js/settings.js", "./src/js/account.js", "./src/js/script.js", + "./src/js/exports.js", ]; //concatenates and lints legacy js files and writes the output to dist/gen/index.js diff --git a/src/js/exports.js b/src/js/exports.js new file mode 100644 index 000000000..42848d576 --- /dev/null +++ b/src/js/exports.js @@ -0,0 +1,4 @@ +//this file should be concatenated with the legacy js files + +//these exports are just for debugging in the browser +global.snapshot = db_getSnapshot; diff --git a/src/js/global-dependencies.js b/src/js/global-dependencies.js index 010ef6dda..0d8fb3a1a 100644 --- a/src/js/global-dependencies.js +++ b/src/js/global-dependencies.js @@ -1,3 +1,5 @@ +//this file should be concatenated at the top of the legacy js files + import { db_getSnapshot, db_setSnapshot, From f28b5308f6eea995e208725d811f3c34d6af970a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Ark?= Date: Sat, 14 Nov 2020 11:13:11 +0100 Subject: [PATCH 24/40] =?UTF-8?q?Added=20B=C3=A9po,=20an=20optimised=20lay?= =?UTF-8?q?out=20for=20french?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/layouts.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/js/layouts.js b/src/js/layouts.js index 7df095cf8..33587df37 100644 --- a/src/js/layouts.js +++ b/src/js/layouts.js @@ -214,6 +214,17 @@ const layouts = { " " ] }, + bepo: { + keymapShowTopRow: false, + iso: true, + keys: [ + "$#", "\"1", "«2", "»3", "(4", ")5", "@6", "+7", "-8", "/9", "*0", "=°", "%`", + "bB", "éÉ", "pP", "oO", "èÈ", "^!", "vV", "dD", "lL", "jJ", "zZ", "wW", "mM", + "aA", "uU", "iI", "eE", ",;", "cC", "tT", "sS", "rR", "sS", "nN", + "êÊ", "àÀ", "yY", "xX", ".:", "kK", "’?", "qQ", "gG", "hH", "fF", + "  " + ] + }, alpha: { keymapShowTopRow: false, keys: [ From 01e98fcf7880152138093a039426003079ac1444 Mon Sep 17 00:00:00 2001 From: Jack Date: Sat, 14 Nov 2020 14:05:11 +0000 Subject: [PATCH 25/40] rounding spacing data --- functions/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/functions/index.js b/functions/index.js index 1afe52dea..c1e631834 100644 --- a/functions/index.js +++ b/functions/index.js @@ -1006,6 +1006,10 @@ exports.testCompleted = functions //yeet the key data obj.keySpacing = null; obj.keyDuration = null; + obj.keyDurationStats.average = roundTo2(obj.keyDurationStats.average); + obj.keyDurationStats.sd = roundTo2(obj.keyDurationStats.sd); + obj.keySpacingStats.average = roundTo2(obj.keySpacingStats.average); + obj.keySpacingStats.sd = roundTo2(obj.keySpacingStats.sd); return db .collection(`users/${request.uid}/results`) From 6ef90afcb9e15f65686cbc13554c53c7e75391ea Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 15 Nov 2020 18:15:54 +0000 Subject: [PATCH 26/40] catching any errors that might show up when removing the keydata --- functions/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/functions/index.js b/functions/index.js index c1e631834..8370b0270 100644 --- a/functions/index.js +++ b/functions/index.js @@ -1006,10 +1006,14 @@ exports.testCompleted = functions //yeet the key data obj.keySpacing = null; obj.keyDuration = null; - obj.keyDurationStats.average = roundTo2(obj.keyDurationStats.average); - obj.keyDurationStats.sd = roundTo2(obj.keyDurationStats.sd); - obj.keySpacingStats.average = roundTo2(obj.keySpacingStats.average); - obj.keySpacingStats.sd = roundTo2(obj.keySpacingStats.sd); + try { + obj.keyDurationStats.average = roundTo2( + obj.keyDurationStats.average + ); + obj.keyDurationStats.sd = roundTo2(obj.keyDurationStats.sd); + obj.keySpacingStats.average = roundTo2(obj.keySpacingStats.average); + obj.keySpacingStats.sd = roundTo2(obj.keySpacingStats.sd); + } catch (e) {} return db .collection(`users/${request.uid}/results`) From ffff753f73a28d417404b4729679e7328cb2069d Mon Sep 17 00:00:00 2001 From: Fraser Price Date: Mon, 16 Nov 2020 12:04:15 +0000 Subject: [PATCH 27/40] Adding python language support --- static/languages/list.json | 4 ++- static/languages/python.json | 58 ++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 static/languages/python.json diff --git a/static/languages/list.json b/static/languages/list.json index 34161cf55..339e1d73c 100644 --- a/static/languages/list.json +++ b/static/languages/list.json @@ -27,5 +27,7 @@ "finnish", "persian", "kazakh", - "vietnamese" + "vietnamese", + "python" + ] diff --git a/static/languages/python.json b/static/languages/python.json new file mode 100644 index 000000000..db973608f --- /dev/null +++ b/static/languages/python.json @@ -0,0 +1,58 @@ +{ + "name": "italian", + "leftToRight": true, + "words":[ + "and", + "as", + "assert", + "break", + "class", + "continue", + "def", + "del", + "elif", + "else", + "except", + "False", + "finally", + "for", + "from", + "global", + "if", + "import", + "in", + "is", + "lambda", + "None", + "not", + "or", + "pass", + "raise", + "return", + "True", + "try", + "while", + "with", + "yield", + "print", + "len", + "str", + "int", + "float", + "list", + "tuple", + "dict", + "set", + "range", + "sum", + "enumerate", + "zip", + "bool", + "reversed", + "sorted", + "min", + "max", + "any", + "all" + ] +} \ No newline at end of file From 488088a531c1f84176eb1118f97bba37e5fef94d Mon Sep 17 00:00:00 2001 From: Fraser Price Date: Mon, 16 Nov 2020 12:05:30 +0000 Subject: [PATCH 28/40] oops --- static/languages/python.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/languages/python.json b/static/languages/python.json index db973608f..06c75ff96 100644 --- a/static/languages/python.json +++ b/static/languages/python.json @@ -1,5 +1,5 @@ { - "name": "italian", + "name": "python", "leftToRight": true, "words":[ "and", From b1e69d2adf4db6bd8660b66c98dadb46e4811901 Mon Sep 17 00:00:00 2001 From: Isaac Howie <11821003+zaxophone@users.noreply.github.com> Date: Mon, 16 Nov 2020 14:23:51 -0800 Subject: [PATCH 29/40] capitalized some proper nouns as per the discord. --- static/languages/english_10k.json | 92 +++++++++++++++---------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/static/languages/english_10k.json b/static/languages/english_10k.json index 79bfb2028..455c7b0e1 100644 --- a/static/languages/english_10k.json +++ b/static/languages/english_10k.json @@ -399,14 +399,14 @@ "approximate", "approximately", "apps", - "april", + "April", "apt", "aqua", "aquarium", "aquatic", "Arab", "Arabia", - "arabic", + "Arabic", "arbitrary", "arbitration", "arc", @@ -520,7 +520,7 @@ "athletic", "athletics", "Atlanta", - "atlantic", + "Atlantic", "atlas", "atmosphere", "atmospheric", @@ -560,7 +560,7 @@ "audio", "audit", "auditor", - "august", + "August", "aurora", "Australia", "Australian", @@ -1069,7 +1069,7 @@ "calendar", "calendars", "calibration", - "california", + "California", "call", "called", "calling", @@ -1181,7 +1181,7 @@ "causing", "caution", "cave", - "cayman", + "Cayman", "cedar", "ceiling", "celebrate", @@ -1213,7 +1213,7 @@ "certificates", "certification", "certified", - "chad", + "Chad", "chain", "chains", "chair", @@ -1312,11 +1312,11 @@ "chorus", "chose", "chosen", - "christ", + "Christ", "christian", - "christianity", + "Christianity", "christians", - "christmas", + "Christmas", "chrome", "chronic", "chronicle", @@ -1874,7 +1874,7 @@ "critical", "criticism", "critics", - "croatia", + "Croatia", "crop", "crops", "cross", @@ -1980,7 +1980,7 @@ "debut", "decade", "decades", - "december", + "December", "decent", "decide", "decided", @@ -2454,8 +2454,8 @@ "efforts", "egg", "eggs", - "egypt", - "egyptian", + "Egypt", + "Egyptian", "eh", "eight", "either", @@ -2863,7 +2863,7 @@ "featured", "features", "featuring", - "february", + "February", "federal", "federation", "fee", @@ -3322,8 +3322,8 @@ "greater", "greatest", "greatly", - "greece", - "greek", + "Greece", + "Greek", "green", "greenhouse", "greeting", @@ -3971,7 +3971,7 @@ "jail", "jam", "Jamaica", - "january", + "January", "Japan", "Japanese", "jar", @@ -3981,7 +3981,7 @@ "jeep", "jersey", "Jerusalem", - "jesus", + "Jesus", "jet", "jets", "jewel", @@ -4011,11 +4011,11 @@ "judicial", "judy", "juice", - "july", + "July", "jump", "jumping", "junction", - "june", + "June", "jungle", "junior", "junk", @@ -4213,7 +4213,7 @@ "liability", "liable", "liberal", - "liberia", + "Liberia", "liberty", "librarian", "libraries", @@ -4316,7 +4316,7 @@ "logical", "login", "logistics", - "logitech", + "Logitech", "logo", "logos", "logs", @@ -4536,7 +4536,7 @@ "medicines", "medieval", "meditation", - "mediterranean", + "Mediterranean", "medium", "meet", "meeting", @@ -4699,7 +4699,7 @@ "moments", "momentum", "Monaco", - "monday", + "Monday", "monetary", "money", "Mongolia", @@ -4726,7 +4726,7 @@ "mortgage", "mortgages", "Moscow", - "moses", + "Moses", "moss", "most", "mostly", @@ -4779,8 +4779,8 @@ "musical", "musician", "musicians", - "muslim", - "muslims", + "Muslim", + "Muslims", "must", "mutual", "Myanmar", @@ -4922,7 +4922,7 @@ "novel", "novels", "novelty", - "november", + "November", "now", "nowhere", "nuclear", @@ -4977,7 +4977,7 @@ "occurring", "occurs", "ocean", - "october", + "October", "odd", "odds", "of", @@ -5086,7 +5086,7 @@ "organized", "organizer", "organizing", - "oriental", + "Oriental", "orientation", "oriented", "origin", @@ -5138,7 +5138,7 @@ "oxygen", "ozone", "pace", - "pacific", + "Pacific", "pack", "package", "packages", @@ -5434,7 +5434,7 @@ "playing", "playlist", "plays", - "playstation", + "PlayStation", "plaza", "pleasant", "please", @@ -5463,7 +5463,7 @@ "pointer", "pointing", "points", - "pokemon", + "Pokemon", "poker", "Poland", "polar", @@ -5488,7 +5488,7 @@ "pools", "poor", "pop", - "pope", + "Pope", "popular", "popularity", "population", @@ -5501,7 +5501,7 @@ "portfolio", "portion", "portions", - "portland", + "Portland", "portrait", "portraits", "ports", @@ -6093,7 +6093,7 @@ "remove", "removed", "removing", - "renaissance", + "Renaissance", "render", "rendered", "rendering", @@ -6138,8 +6138,8 @@ "reproduction", "reproductive", "republic", - "republican", - "republicans", + "Republican", + "Republicans", "reputation", "request", "requested", @@ -6545,7 +6545,7 @@ "separated", "separately", "separation", - "september", + "September", "sequence", "sequences", "Serbia", @@ -6585,7 +6585,7 @@ "shake", "shall", "shame", - "shanghai", + "Shanghai", "shannon", "shape", "shaped", @@ -7646,7 +7646,7 @@ "typical", "typically", "typing", - "uganda", + "Uganda", "ugly", "Ukraine", "ultimate", @@ -7809,8 +7809,8 @@ "victim", "victims", "victor", - "victoria", - "victorian", + "Victoria", + "Victorian", "victory", "video", "videos", @@ -7960,7 +7960,7 @@ "wed", "wedding", "weddings", - "wednesday", + "Wednesday", "week", "weekend", "weekends", @@ -7974,7 +7974,7 @@ "welding", "welfare", "well", - "wellington", + "Wellington", "wellness", "wells", "Welsh", From c4995e6622693a95516c78f7a1e968a8290ab492 Mon Sep 17 00:00:00 2001 From: Cyrus Yip Date: Mon, 16 Nov 2020 17:25:46 -0800 Subject: [PATCH 30/40] add semicolon in punctuation --- src/js/script.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/js/script.js b/src/js/script.js index e353dccbf..28154a556 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -733,6 +733,14 @@ function punctuateWord(previousWord, currentWord, index, maxindex) { ) { //1% chance to add a dash word = "-"; + } else if ( + Math.random() < 0.01 && + getLastChar(previousWord) != "," && + getLastChar(previousWord) != "." && + getLastChar(previousWord) != ";" + ) { + //1% chance to add semicolon + word = word + ";"; } else if (Math.random() < 0.2 && getLastChar(previousWord) != ",") { //2% chance to add a comma word += ","; From b369182d7a76d1bfd0b6229f7f5a888d3734d471 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 17 Nov 2020 12:22:52 +0000 Subject: [PATCH 31/40] slimmed down the chart data --- src/js/account.js | 4 ++-- src/js/script.js | 23 ++++++++++++++--------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/js/account.js b/src/js/account.js index 89a70b00c..27405c877 100644 --- a/src/js/account.js +++ b/src/js/account.js @@ -735,12 +735,12 @@ let hoverChart = new Chart($(".pageAccount #hoverChart"), { radius: function (context) { var index = context.dataIndex; var value = context.dataset.data[index]; - return value.y <= 0 ? 0 : 3; + return value <= 0 ? 0 : 3; }, pointHoverRadius: function (context) { var index = context.dataIndex; var value = context.dataset.data[index]; - return value.y <= 0 ? 0 : 5; + return value <= 0 ? 0 : 5; }, }, ], diff --git a/src/js/script.js b/src/js/script.js index e353dccbf..92dcdf0cd 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -1877,16 +1877,21 @@ function showResult(difficultyFailed = false) { wpmOverTimeChart.options.scales.yAxes[1].ticks.min = 0; } - let errorsNoZero = []; + // let errorsNoZero = []; + // for (let i = 0; i < errorsPerSecond.length; i++) { + // errorsNoZero.push({ + // x: i + 1, + // y: errorsPerSecond[i].count, + // }); + // } + + let errorsArray = []; for (let i = 0; i < errorsPerSecond.length; i++) { - errorsNoZero.push({ - x: i + 1, - y: errorsPerSecond[i].count, - }); + errorsArray.push(errorsPerSecond[i].count); } - wpmOverTimeChart.data.datasets[2].data = errorsNoZero; + wpmOverTimeChart.data.datasets[2].data = errorsArray; let kps = keypressPerSecond.slice(Math.max(keypressPerSecond.length - 5, 0)); @@ -1917,7 +1922,7 @@ function showResult(difficultyFailed = false) { let chartData = { wpm: wpmHistory, raw: rawWpmPerSecond, - err: errorsNoZero, + err: errorsArray, }; if (testtime > 122) { @@ -4868,12 +4873,12 @@ let wpmOverTimeChart = new Chart(ctx, { radius: function (context) { var index = context.dataIndex; var value = context.dataset.data[index]; - return value.y <= 0 ? 0 : 3; + return value <= 0 ? 0 : 3; }, pointHoverRadius: function (context) { var index = context.dataIndex; var value = context.dataset.data[index]; - return value.y <= 0 ? 0 : 5; + return value <= 0 ? 0 : 5; }, }, ], From f03c4f8390c212b47761fd122af62e3e07e6fda7 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 17 Nov 2020 12:23:06 +0000 Subject: [PATCH 32/40] firebase update --- static/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/static/index.html b/static/index.html index 9956a22e0..68c6af101 100644 --- a/static/index.html +++ b/static/index.html @@ -3411,14 +3411,14 @@
- + - - - - + + + + From 5fbc59270cd131391b6bb1fc5aa4507109ca562c Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 17 Nov 2020 12:55:48 +0000 Subject: [PATCH 33/40] hopefully fixed config not saving and loading --- src/js/misc.js | 23 +++++++++++++++++++++++ src/js/userconfig.js | 36 ++++++++++++++++++++---------------- 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/src/js/misc.js b/src/js/misc.js index b219b0d80..31481088d 100644 --- a/src/js/misc.js +++ b/src/js/misc.js @@ -105,6 +105,29 @@ async function getLanguage(lang) { } } +function setCookie(cname, cvalue, exdays) { + var d = new Date(); + d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000); + var expires = "expires=" + d.toUTCString(); + document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; +} + +function getCookie(cname) { + var name = cname + "="; + var decodedCookie = decodeURIComponent(document.cookie); + var ca = decodedCookie.split(";"); + for (var i = 0; i < ca.length; i++) { + var c = ca[i]; + while (c.charAt(0) == " ") { + c = c.substring(1); + } + if (c.indexOf(name) == 0) { + return c.substring(name.length, c.length); + } + } + return ""; +} + function smooth(arr, windowSize, getter = (value) => value, setter) { const get = getter; const result = []; diff --git a/src/js/userconfig.js b/src/js/userconfig.js index 0c5246a13..afaf777e6 100644 --- a/src/js/userconfig.js +++ b/src/js/userconfig.js @@ -87,12 +87,13 @@ async function saveConfigToCookie(noDbCheck = false) { if (!dbConfigLoaded && !noDbCheck) { configChangedBeforeDb = true; } - let d = new Date(); - d.setFullYear(d.getFullYear() + 1); - $.cookie("config", JSON.stringify(config), { - expires: d, - path: "/", - }); + // let d = new Date(); + // d.setFullYear(d.getFullYear() + 1); + // $.cookie("config", JSON.stringify(config), { + // expires: d, + // path: "/", + // }); + setCookie("config", JSON.stringify(config), 365); restartCount = 0; if (!noDbCheck) await saveConfigToDB(); } @@ -133,19 +134,21 @@ function saveActiveTagsToCookie() { tags.push(tag.id); } }); - let d = new Date(); - d.setFullYear(d.getFullYear() + 1); - $.cookie("activeTags", null); - $.cookie("activeTags", JSON.stringify(tags), { - expires: d, - path: "/", - }); + // let d = new Date(); + // d.setFullYear(d.getFullYear() + 1); + // $.cookie("activeTags", null); + // $.cookie("activeTags", JSON.stringify(tags), { + // expires: d, + // path: "/", + // }); + setCookie("activeTags", JSON.stringify(tags), 365); } catch (e) {} } function loadConfigFromCookie() { console.log("loading cookie config"); - let newConfig = $.cookie("config"); + // let newConfig = $.cookie("config"); + let newConfig = getCookie("config"); if (newConfig !== undefined) { newConfig = JSON.parse(newConfig); applyConfig(newConfig); @@ -286,8 +289,9 @@ function applyConfig(configObj) { } function loadActiveTagsFromCookie() { - let newTags = $.cookie("activeTags"); - if (newTags !== undefined) { + // let newTags = $.cookie("activeTags"); + let newTags = getCookie("activeTags"); + if (newTags !== undefined && newTags !== "") { newTags = JSON.parse(newTags); newTags.forEach((ntag) => { toggleTag(ntag, true); From 4286e698f307234271996e56b93b778fab632ae3 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 17 Nov 2020 16:47:00 +0000 Subject: [PATCH 34/40] fixed a bug that was added when changing the cookie functions --- src/js/userconfig.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/js/userconfig.js b/src/js/userconfig.js index afaf777e6..40e3655a6 100644 --- a/src/js/userconfig.js +++ b/src/js/userconfig.js @@ -149,8 +149,12 @@ function loadConfigFromCookie() { console.log("loading cookie config"); // let newConfig = $.cookie("config"); let newConfig = getCookie("config"); - if (newConfig !== undefined) { - newConfig = JSON.parse(newConfig); + if (newConfig !== undefined && newConfig !== "") { + try { + newConfig = JSON.parse(newConfig); + } catch (e) { + newConfig = {}; + } applyConfig(newConfig); console.log("applying cookie config"); cookieConfig = newConfig; @@ -292,6 +296,11 @@ function loadActiveTagsFromCookie() { // let newTags = $.cookie("activeTags"); let newTags = getCookie("activeTags"); if (newTags !== undefined && newTags !== "") { + try { + newTags = JSON.parse(newTags); + } catch (e) { + newTags = {}; + } newTags = JSON.parse(newTags); newTags.forEach((ntag) => { toggleTag(ntag, true); From 65c994392f0e967d8d23f2723bb57bc632988d38 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 17 Nov 2020 22:12:31 +0000 Subject: [PATCH 35/40] fixed dumb mistake --- src/js/userconfig.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/js/userconfig.js b/src/js/userconfig.js index 40e3655a6..12f60ac24 100644 --- a/src/js/userconfig.js +++ b/src/js/userconfig.js @@ -301,7 +301,6 @@ function loadActiveTagsFromCookie() { } catch (e) { newTags = {}; } - newTags = JSON.parse(newTags); newTags.forEach((ntag) => { toggleTag(ntag, true); }); From 9a27979d8508e8adfaae377e097dfa55f601686e Mon Sep 17 00:00:00 2001 From: Alek Curless Date: Tue, 17 Nov 2020 22:29:12 -0800 Subject: [PATCH 36/40] added check so that caret position defaults to last letter in word if currentInput is longer --- src/js/script.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/js/script.js b/src/js/script.js index e353dccbf..e84cc9a36 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -1424,9 +1424,13 @@ function updateCaretPosition() { currentLetterIndex = 0; } try { - let currentLetter = document + let currentWordNodeList = document .querySelector("#words .active") - .querySelectorAll("letter")[currentLetterIndex]; + .querySelectorAll("letter"); + let currentLetter = currentWordNodeList[currentLetterIndex]; + if (inputLen > currentWordNodeList.length) { + currentLetter = currentWordNodeList[currentWordNodeList.length - 1]; + } if ($(currentLetter).length == 0) return; const isLanguageLeftToRight = currentLanguage.leftToRight; From a17f929b8a141f56b83b4a11b74587243e40e89a Mon Sep 17 00:00:00 2001 From: Anh Duc Nguyen Date: Wed, 18 Nov 2020 14:04:48 +0700 Subject: [PATCH 37/40] Added Vietnamese 1k --- static/languages/list.json | 3 +- static/languages/vietnamese_1k.json | 1006 +++++++++++++++++++++++++++ 2 files changed, 1008 insertions(+), 1 deletion(-) create mode 100644 static/languages/vietnamese_1k.json diff --git a/static/languages/list.json b/static/languages/list.json index 34161cf55..db53bf540 100644 --- a/static/languages/list.json +++ b/static/languages/list.json @@ -27,5 +27,6 @@ "finnish", "persian", "kazakh", - "vietnamese" + "vietnamese", + "vietnamese_1k" ] diff --git a/static/languages/vietnamese_1k.json b/static/languages/vietnamese_1k.json new file mode 100644 index 000000000..6295d5bf6 --- /dev/null +++ b/static/languages/vietnamese_1k.json @@ -0,0 +1,1006 @@ +{ + "name": "vietnamese_1k", + "leftToRight": true, + "words": [ + "a", + "á", + "ác", + "ai", + "âm", + "an", + "án", + "ăn", + "ấn", + "anh", + "ảnh", + "áo", + "áp", + "âu", + "ấy", + "ba", + "bà", + "bác", + "bắc", + "bạc", + "bài", + "bại", + "ban", + "bán", + "bàn", + "bắn", + "bản", + "bạn", + "bang", + "bàng", + "băng", + "bằng", + "bánh", + "bao", + "báo", + "bào", + "bảo", + "bạo", + "bất", + "bắt", + "bầu", + "bay", + "bày", + "bây", + "bảy", + "bé", + "bên", + "bệnh", + "bí", + "bị", + "biên", + "biến", + "biển", + "biện", + "biết", + "biệt", + "biểu", + "binh", + "bình", + "bò", + "bố", + "bỏ", + "bờ", + "bộ", + "bởi", + "bom", + "bốn", + "bọn", + "bóng", + "bỗng", + "bức", + "bụng", + "buộc", + "bước", + "buổi", + "buồn", + "ca", + "cá", + "cả", + "các", + "cách", + "cái", + "cải", + "cấm", + "cầm", + "cảm", + "can", + "cán", + "căn", + "cần", + "càng", + "cảng", + "cánh", + "cảnh", + "cạnh", + "cao", + "cáo", + "cấp", + "cập", + "câu", + "cầu", + "cậu", + "cây", + "cha", + "chắc", + "chăm", + "chấm", + "chân", + "chắn", + "chàng", + "chẳng", + "chấp", + "chất", + "chặt", + "cháu", + "châu", + "chạy", + "chế", + "chết", + "chi", + "chí", + "chỉ", + "chị", + "chia", + "chiếc", + "chiếm", + "chiến", + "chiều", + "chim", + "chính", + "chịu", + "cho", + "chó", + "chỗ", + "chờ", + "chợ", + "chơi", + "chọn", + "chống", + "chồng", + "chú", + "chủ", + "chứ", + "chữ", + "chúa", + "chùa", + "chưa", + "chuẩn", + "chục", + "chức", + "chung", + "chúng", + "chứng", + "chương", + "chuột", + "chuyên", + "chuyến", + "chuyển", + "chuyện", + "có", + "cô", + "cố", + "cỏ", + "cơ", + "cổ", + "cờ", + "cóc", + "coi", + "con", + "còn", + "công", + "cộng", + "cũ", + "cư", + "cụ", + "cứ", + "cử", + "của", + "cửa", + "cục", + "cực", + "cung", + "cùng", + "cũng", + "cuộc", + "cuối", + "cười", + "cuốn", + "cường", + "cướp", + "cứu", + "cựu", + "đa", + "đá", + "đà", + "đã", + "đặc", + "dài", + "đài", + "đại", + "dám", + "đám", + "đảm", + "dân", + "dần", + "dẫn", + "đàn", + "đang", + "đáng", + "đăng", + "đảng", + "danh", + "dành", + "đánh", + "đào", + "đảo", + "đạo", + "đáp", + "đất", + "đạt", + "đặt", + "dấu", + "dầu", + "đau", + "đâu", + "đấu", + "đầu", + "dây", + "dạy", + "dậy", + "đây", + "đấy", + "đầy", + "đẩy", + "dễ", + "đề", + "để", + "đem", + "đêm", + "đen", + "đến", + "đẹp", + "đều", + "di", + "đi", + "địa", + "dịch", + "đích", + "địch", + "điểm", + "diễn", + "diện", + "điện", + "điều", + "đình", + "định", + "do", + "đó", + "đô", + "đồ", + "đỏ", + "đổ", + "đỡ", + "độ", + "đoán", + "đoàn", + "đoạn", + "doanh", + "đốc", + "đọc", + "độc", + "đói", + "đòi", + "đôi", + "đối", + "đổi", + "đời", + "đội", + "đợi", + "đơn", + "đóng", + "đông", + "đồng", + "động", + "đột", + "du", + "dù", + "dư", + "dự", + "đủ", + "đưa", + "đứa", + "dục", + "đức", + "dung", + "dùng", + "dũng", + "dụng", + "dựng", + "đúng", + "đứng", + "đừng", + "được", + "dưới", + "đuổi", + "dương", + "đường", + "dứt", + "duy", + "ếch", + "em", + "gà", + "gái", + "gần", + "gặp", + "gấu", + "gây", + "ghi", + "gì", + "gia", + "giá", + "già", + "giả", + "giác", + "giải", + "giam", + "giám", + "giảm", + "gian", + "giận", + "giang", + "giành", + "giao", + "giáo", + "giấy", + "gió", + "giờ", + "giới", + "giống", + "giữ", + "giữa", + "giúp", + "gốc", + "gọi", + "gồm", + "gòn", + "góp", + "gửi", + "hà", + "hạ", + "hai", + "hải", + "hại", + "hàn", + "hạn", + "hang", + "hàng", + "hãng", + "hành", + "hạnh", + "hạt", + "hầu", + "hậu", + "hay", + "hãy", + "hệ", + "hết", + "hiểm", + "hiện", + "hiệp", + "hiểu", + "hiệu", + "hình", + "hồ", + "hỗ", + "hổ", + "họ", + "hộ", + "hoa", + "hóa", + "hòa", + "hoặc", + "hoạch", + "hoàn", + "hoàng", + "hoạt", + "học", + "hồi", + "hỏi", + "hội", + "hôm", + "hơn", + "hồng", + "họp", + "hợp", + "hùng", + "hương", + "hướng", + "hưởng", + "hữu", + "huyện", + "hy", + "in", + "ít", + "kê", + "kế", + "kẻ", + "kể", + "kém", + "kéo", + "kết", + "kêu", + "khá", + "khả", + "khác", + "khắc", + "khách", + "khai", + "khăn", + "khắp", + "khẩu", + "khi", + "khí", + "khiến", + "khó", + "khổ", + "khoa", + "khoảng", + "khóc", + "khối", + "khỏi", + "không", + "khu", + "khủng", + "kia", + "kích", + "kiếm", + "kiểm", + "kiến", + "kiện", + "kiểu", + "kim", + "kinh", + "kính", + "ký", + "kỳ", + "kỹ", + "kỷ", + "la", + "lá", + "là", + "lạ", + "lạc", + "lai", + "lại", + "làm", + "lắm", + "lan", + "lần", + "lẫn", + "làng", + "lành", + "lãnh", + "lao", + "lão", + "lập", + "lâu", + "lấy", + "lê", + "lẽ", + "lễ", + "lệ", + "lên", + "lệnh", + "lịch", + "liên", + "liền", + "liệt", + "liệu", + "linh", + "lính", + "lo", + "lộ", + "loài", + "loại", + "loan", + "lỗi", + "lời", + "lợi", + "lớn", + "long", + "lòng", + "lớp", + "lũ", + "lúa", + "lửa", + "luận", + "luật", + "lúc", + "lực", + "lược", + "lưới", + "luôn", + "lương", + "lượng", + "lưu", + "luyện", + "ly", + "lý", + "mà", + "mắc", + "mặc", + "mai", + "mãi", + "mại", + "mang", + "mạng", + "mạnh", + "mất", + "mắt", + "mật", + "mặt", + "máu", + "màu", + "may", + "máy", + "mấy", + "mẹ", + "mèo", + "miền", + "minh", + "mình", + "mô", + "mơ", + "mở", + "môi", + "mối", + "mỗi", + "mọi", + "mới", + "mời", + "món", + "môn", + "mong", + "một", + "mua", + "mùa", + "mưa", + "mục", + "mức", + "mừng", + "muốn", + "mỹ", + "nam", + "năm", + "nắm", + "nằm", + "nạn", + "nàng", + "năng", + "nặng", + "nào", + "nay", + "này", + "nên", + "nền", + "nếu", + "nga", + "ngài", + "ngại", + "ngàn", + "ngân", + "ngăn", + "ngành", + "ngay", + "ngày", + "nghe", + "nghề", + "nghệ", + "nghèo", + "nghi", + "nghĩ", + "nghỉ", + "nghị", + "nghĩa", + "nghiệm", + "nghiên", + "nghiêng", + "nghiệp", + "ngờ", + "ngoài", + "ngoại", + "ngọc", + "ngôi", + "ngồi", + "ngôn", + "ngủ", + "ngược", + "người", + "nguồn", + "nguy", + "nguyên", + "nguyễn", + "nha", + "nhà", + "nhạc", + "nhằm", + "nhân", + "nhận", + "nhanh", + "nhập", + "nhất", + "nhật", + "nhau", + "nhảy", + "nhiệm", + "nhiên", + "nhiêu", + "nhiều", + "nhìn", + "nhỏ", + "nhớ", + "nhờ", + "nhóm", + "như", + "nhũng", + "nhưng", + "những", + "niên", + "ninh", + "nó", + "nổ", + "nói", + "nỗi", + "nơi", + "nổi", + "nội", + "nông", + "nữ", + "nữa", + "núi", + "nước", + "nuôi", + "ô", + "ở", + "ơi", + "ơn", + "ông", + "phá", + "phải", + "phẩm", + "phạm", + "phân", + "phần", + "phản", + "pháp", + "phát", + "phạt", + "phe", + "phép", + "phi", + "phí", + "phía", + "phiếu", + "phim", + "phó", + "phố", + "phối", + "phong", + "phóng", + "phòng", + "phú", + "phủ", + "phụ", + "phúc", + "phục", + "phương", + "phút", + "qua", + "quá", + "quả", + "quan", + "quán", + "quân", + "quần", + "quản", + "quận", + "quang", + "quảng", + "quanh", + "quay", + "quê", + "quen", + "quên", + "qui", + "quốc", + "quy", + "quý", + "quyền", + "quyết", + "quỳnh", + "ra", + "rắn", + "rằng", + "rất", + "riêng", + "rõ", + "rồi", + "rơi", + "rộng", + "rừng", + "rút", + "sắc", + "sách", + "sai", + "sài", + "sân", + "sẵn", + "sản", + "sang", + "sáng", + "sao", + "sắp", + "sát", + "sau", + "sáu", + "sâu", + "sẽ", + "sĩ", + "sinh", + "so", + "số", + "sơ", + "sở", + "sợ", + "sớm", + "sơn", + "song", + "sóng", + "sông", + "sống", + "sư", + "sứ", + "sử", + "sự", + "sức", + "suốt", + "suy", + "ta", + "tác", + "tai", + "tài", + "tại", + "tâm", + "tấm", + "tạm", + "tàn", + "tân", + "tấn", + "tận", + "tăng", + "tạo", + "tập", + "tất", + "tàu", + "tay", + "tây", + "tế", + "tệ", + "tên", + "thái", + "tham", + "thăm", + "thậm", + "thân", + "thần", + "tháng", + "thắng", + "thẳng", + "thanh", + "thành", + "thảo", + "thấp", + "thập", + "thất", + "thật", + "thay", + "thấy", + "thầy", + "thế", + "thể", + "thêm", + "theo", + "thi", + "thí", + "thì", + "thị", + "thích", + "thiên", + "thiện", + "thiết", + "thiệt", + "thiếu", + "thịt", + "thỏ", + "thoại", + "thoát", + "thôi", + "thời", + "thông", + "thống", + "thu", + "thú", + "thủ", + "thư", + "thụ", + "thứ", + "thử", + "thua", + "thuận", + "thuật", + "thúc", + "thức", + "thực", + "thuế", + "thuốc", + "thuộc", + "thương", + "thường", + "thưởng", + "thượng", + "thủy", + "thuyền", + "thuyết", + "tỉ", + "tích", + "tịch", + "tiên", + "tiến", + "tiền", + "tiện", + "tiếng", + "tiếp", + "tiết", + "tiêu", + "tiểu", + "tìm", + "tin", + "tín", + "tìn", + "tinh", + "tính", + "tình", + "tỉnh", + "to", + "tố", + "tỏ", + "tổ", + "tớ", + "tờ", + "tòa", + "toán", + "toàn", + "tộc", + "tôi", + "tối", + "tới", + "tội", + "tôn", + "tổng", + "tốt", + "tra", + "trả", + "trách", + "trai", + "trái", + "trại", + "trăm", + "trận", + "trang", + "trắng", + "trạng", + "tranh", + "tránh", + "trao", + "trào", + "trẻ", + "trên", + "trí", + "trị", + "triển", + "triều", + "triệu", + "trình", + "trò", + "trở", + "trợ", + "trời", + "trong", + "trông", + "trống", + "trọng", + "trực", + "trung", + "trước", + "trương", + "trường", + "trưởng", + "truyền", + "tù", + "tư", + "tụ", + "từ", + "tử", + "tự", + "tuần", + "tục", + "tức", + "tung", + "từng", + "tuổi", + "tương", + "tướng", + "tường", + "tưởng", + "tượng", + "tuy", + "tuyên", + "tuyển", + "tuyệt", + "ty", + "tỷ", + "ủng", + "ứng", + "ước", + "uống", + "ủy", + "và", + "vai", + "vài", + "văn", + "vấn", + "vẫn", + "vận", + "vàng", + "vào", + "vật", + "vậy", + "về", + "vẻ", + "vệ", + "vi", + "vì", + "vị", + "việc", + "viên", + "viện", + "viết", + "việt", + "vô", + "vợ", + "với", + "vội", + "vốn", + "vòng", + "vọng", + "vũ", + "vụ", + "vua", + "vừa", + "vực", + "vui", + "vùng", + "vườn", + "vương", + "vượt", + "xa", + "xã", + "xác", + "xách", + "xanh", + "xấu", + "xây", + "xảy", + "xe", + "xem", + "xét", + "xin", + "xong", + "xử", + "xưa", + "xuân", + "xuất", + "xúc", + "xuống", + "xuyên", + "ý", + "yên", + "yêu", + "yếu" + ] +} From f7824d8d628927c56f525bb96f4889135f63f52f Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 18 Nov 2020 14:44:01 +0000 Subject: [PATCH 38/40] updated firebase --- functions/package-lock.json | 180 ++++++++---------------------------- functions/package.json | 2 +- 2 files changed, 38 insertions(+), 144 deletions(-) diff --git a/functions/package-lock.json b/functions/package-lock.json index 31406133c..3e95a20b2 100644 --- a/functions/package-lock.json +++ b/functions/package-lock.json @@ -84,9 +84,9 @@ } }, "@google-cloud/common": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-3.4.1.tgz", - "integrity": "sha512-e5z0CwsM0RXky+PnyPtQ3QK46ksqm+kE7kX8pm8X+ddBwZJipHchKeazMM5fLlGCS+AALalzXb+uYmH72TRnpQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-3.5.0.tgz", + "integrity": "sha512-10d7ZAvKhq47L271AqvHEd8KzJqGU45TY+rwM2Z3JHuB070FeTi7oJJd7elfrnKaEvaktw3hH2wKnRWxk/3oWQ==", "optional": true, "requires": { "@google-cloud/projectify": "^2.0.0", @@ -101,14 +101,14 @@ } }, "@google-cloud/firestore": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-4.5.0.tgz", - "integrity": "sha512-sExt4E+TlBqyv4l/av6kBZ4YGS99Cc3P5UvLRNj9z41mT9ekPGhIzptbj4K6O7h0KCyDIDOiJdi4gUPH9lip4g==", + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-4.7.1.tgz", + "integrity": "sha512-Qici+WKB6uRdDS1S3CaxGrIaCl4Bck70DYSzA5dZFkTU03Jj5DKXC4PYeUkfCAiB4haj7tzx+2ye7rhLxPclhQ==", "optional": true, "requires": { "fast-deep-equal": "^3.1.1", "functional-red-black-tree": "^1.0.1", - "google-gax": "^2.2.0" + "google-gax": "^2.9.2" } }, "@google-cloud/paginator": { @@ -134,9 +134,9 @@ "optional": true }, "@google-cloud/storage": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-5.3.0.tgz", - "integrity": "sha512-3t5UF3SZ14Bw2kcBHubCai6EIugU2GnQOstYWVSFuoO8IJ94RAaIOPq/dtexvQbUTpBTAGpd5smVR9WPL1mJVw==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-5.5.0.tgz", + "integrity": "sha512-Pat83kHNnKJpEHUirtQtCoAJ2K3OlEo2ZcSlPjierJnEKnhbIQPyJ6mAbs/ovm3K3QDQhouKJ9QSONkFPEwQuA==", "optional": true, "requires": { "@google-cloud/common": "^3.3.0", @@ -144,12 +144,12 @@ "@google-cloud/promisify": "^2.0.0", "arrify": "^2.0.0", "compressible": "^2.0.12", - "concat-stream": "^2.0.0", "date-and-time": "^0.14.0", - "duplexify": "^3.5.0", + "duplexify": "^4.0.0", "extend": "^3.0.2", - "gaxios": "^3.0.0", + "gaxios": "^4.0.0", "gcs-resumable-upload": "^3.1.0", + "get-stream": "^6.0.0", "hash-stream-validation": "^0.2.2", "mime": "^2.2.0", "mime-types": "^2.0.8", @@ -161,31 +161,6 @@ "xdg-basedir": "^4.0.0" }, "dependencies": { - "duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "optional": true, - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, - "gaxios": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-3.2.0.tgz", - "integrity": "sha512-+6WPeVzPvOshftpxJwRi2Ozez80tn/hdtOUag7+gajDHRJvAblKxTFSSMPtr2hmnLy7p0mvYz0rMXLBl8pSO7Q==", - "optional": true, - "requires": { - "abort-controller": "^3.0.0", - "extend": "^3.0.2", - "https-proxy-agent": "^5.0.0", - "is-stream": "^2.0.0", - "node-fetch": "^2.3.0" - } - }, "p-limit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.0.2.tgz", @@ -194,36 +169,6 @@ "requires": { "p-try": "^2.0.0" } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "optional": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } } } }, @@ -253,9 +198,9 @@ } }, "@types/node": { - "version": "12.19.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.3.tgz", - "integrity": "sha512-8Jduo8wvvwDzEVJCOvS/G6sgilOLvvhn1eMmK3TW8/T217O7u1jdrK6ImKLv80tVryaPSVeKu6sjDEiFjd4/eg==", + "version": "12.19.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.4.tgz", + "integrity": "sha512-o3oj1bETk8kBwzz1WlO6JWL/AfAA3Vm6J1B3C9CsdxHYp7XgPiH7OEXPUbZTndHlRaIElrANkQfe6ZmfJb3H2w==", "optional": true } } @@ -523,9 +468,9 @@ "dev": true }, "base64-js": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "optional": true }, "bignumber.js": { @@ -581,12 +526,6 @@ "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "optional": true - }, "bytes": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", @@ -717,18 +656,6 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "concat-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", - "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", - "optional": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.0.2", - "typedarray": "^0.0.6" - } - }, "configstore": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", @@ -773,12 +700,6 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "optional": true - }, "cors": { "version": "2.8.5", "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", @@ -1251,13 +1172,13 @@ } }, "firebase-admin": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/firebase-admin/-/firebase-admin-9.3.0.tgz", - "integrity": "sha512-qMUITOp2QKLLc2o0/wSiDC2OO2knejjieZN/8Or9AzfFk8ftTcUKq5ALNlQXu+7aUzGe0IwSJq9TVnkIU0h1xw==", + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/firebase-admin/-/firebase-admin-9.4.1.tgz", + "integrity": "sha512-y9r2Mz2x1WTr60YrCDqz8Lw70DlwIvRIieVltP+UdRogkVpfnvyd+bi4D0KPlujW3teqcFPmxuzsXB+DP5vGfQ==", "requires": { "@firebase/database": "^0.6.10", "@firebase/database-types": "^0.5.2", - "@google-cloud/firestore": "^4.0.0", + "@google-cloud/firestore": "^4.5.0", "@google-cloud/storage": "^5.3.0", "@types/node": "^10.10.0", "dicer": "^0.3.0", @@ -1345,28 +1266,13 @@ } }, "gcp-metadata": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.2.0.tgz", - "integrity": "sha512-vQZD57cQkqIA6YPGXM/zc+PIZfNRFdukWGsGZ5+LcJzesi5xp6Gn7a02wRJi4eXPyArNMIYpPET4QMxGqtlk6Q==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.2.1.tgz", + "integrity": "sha512-tSk+REe5iq/N+K+SK1XjZJUrFPuDqGZVzCy2vocIHIGmPlTGsa8owXMJwGkrXr73NO0AzhPW4MF2DEHz7P2AVw==", "optional": true, "requires": { - "gaxios": "^3.0.0", + "gaxios": "^4.0.0", "json-bigint": "^1.0.0" - }, - "dependencies": { - "gaxios": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-3.2.0.tgz", - "integrity": "sha512-+6WPeVzPvOshftpxJwRi2Ozez80tn/hdtOUag7+gajDHRJvAblKxTFSSMPtr2hmnLy7p0mvYz0rMXLBl8pSO7Q==", - "optional": true, - "requires": { - "abort-controller": "^3.0.0", - "extend": "^3.0.2", - "https-proxy-agent": "^5.0.0", - "is-stream": "^2.0.0", - "node-fetch": "^2.3.0" - } - } } }, "gcs-resumable-upload": { @@ -1405,6 +1311,12 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "optional": true }, + "get-stream": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.0.tgz", + "integrity": "sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg==", + "optional": true + }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -1443,9 +1355,9 @@ } }, "google-gax": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-2.9.1.tgz", - "integrity": "sha512-KQ7HiMTB/PAzKv3OU00x6tC1H7MHvSxQfon5BSyW5o+lkMgRA8xoqvlxZCBC1dlW1azOPGF8vScy8QgFmhaQ9Q==", + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-2.9.2.tgz", + "integrity": "sha512-Pve4osEzNKpBZqFXMfGKBbKCtgnHpUe5IQMh5Ou+Xtg8nLcba94L3gF0xgM5phMdGRRqJn0SMjcuEVmOYu7EBg==", "optional": true, "requires": { "@grpc/grpc-js": "~1.1.1", @@ -1453,7 +1365,7 @@ "@types/long": "^4.0.0", "abort-controller": "^3.0.0", "duplexify": "^4.0.0", - "google-auth-library": "^6.0.0", + "google-auth-library": "^6.1.3", "is-stream-ended": "^0.1.4", "node-fetch": "^2.6.1", "protobufjs": "^6.9.0", @@ -1661,12 +1573,6 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "optional": true }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "optional": true - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -2097,12 +2003,6 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "optional": true - }, "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -2594,12 +2494,6 @@ "mime-types": "~2.1.24" } }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "optional": true - }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", diff --git a/functions/package.json b/functions/package.json index f8161b005..0028b749a 100644 --- a/functions/package.json +++ b/functions/package.json @@ -13,7 +13,7 @@ "node": "10" }, "dependencies": { - "firebase-admin": "^9.3.0", + "firebase-admin": "^9.4.1", "firebase-functions": "^3.11.0" }, "devDependencies": { From 37f4f0dce950026dd40b200f267af1756a64c83f Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 18 Nov 2020 14:44:50 +0000 Subject: [PATCH 39/40] removed timeout increase --- functions/index.js | 669 ++++++++++++++++++++++----------------------- 1 file changed, 329 insertions(+), 340 deletions(-) diff --git a/functions/index.js b/functions/index.js index 8370b0270..602dc9695 100644 --- a/functions/index.js +++ b/functions/index.js @@ -829,358 +829,347 @@ async function incrementTimeSpentTyping(uid, res, userData) { } } -exports.testCompleted = functions - .runWith({ timeoutSeconds: 540, memory: "2GB" }) - .https.onRequest(async (request, response) => { - response.set("Access-Control-Allow-Origin", "*"); - if (request.method === "OPTIONS") { - // Send response to OPTIONS requests - response.set("Access-Control-Allow-Methods", "POST, GET, OPTIONS"); - response.set( - "Access-Control-Allow-Headers", - "Authorization,Content-Type" - ); - response.set("Access-Control-Max-Age", "3600"); - response.status(204).send(""); - return; - } - request = request.body.data; - if (request === undefined) { +exports.testCompleted = functions.https.onRequest(async (request, response) => { + response.set("Access-Control-Allow-Origin", "*"); + if (request.method === "OPTIONS") { + // Send response to OPTIONS requests + response.set("Access-Control-Allow-Methods", "POST, GET, OPTIONS"); + response.set("Access-Control-Allow-Headers", "Authorization,Content-Type"); + response.set("Access-Control-Max-Age", "3600"); + response.status(204).send(""); + return; + } + request = request.body.data; + if (request === undefined) { + response.status(200).send({ data: { resultCode: -999 } }); + return; + } + try { + if (request.uid === undefined || request.obj === undefined) { + console.error(`error saving result for - missing input`); response.status(200).send({ data: { resultCode: -999 } }); return; } - try { - if (request.uid === undefined || request.obj === undefined) { - console.error(`error saving result for - missing input`); - response.status(200).send({ data: { resultCode: -999 } }); - return; - } - let obj = request.obj; + let obj = request.obj; - function verifyValue(val) { - let errCount = 0; - if (Array.isArray(val)) { - //array - val.forEach((val2) => { - errCount += verifyValue(val2); - }); - } else if (typeof val === "object" && !Array.isArray(val)) { - //object - Object.keys(val).forEach((valkey) => { - errCount += verifyValue(val[valkey]); - }); - } else { - if (!/^[0-9a-zA-Z._]+$/.test(val)) errCount++; - } - return errCount; - } - - let errCount = verifyValue(obj); - // console.log(errCount); - if (errCount > 0) { - console.error( - `error saving result for ${ - request.uid - } error count ${errCount} - bad input - ${JSON.stringify( - request.obj - )}` - ); - response.status(200).send({ data: { resultCode: -1 } }); - return; - } - - if (obj.wpm <= 0 || obj.wpm > 350 || obj.acc < 50 || obj.acc > 100) { - response.status(200).send({ data: { resultCode: -1 } }); - return; - } - - if (!validateResult(obj)) { - if ( - obj.bailedOut && - ((obj.mode === "time" && obj.mode2 >= 3600) || - (obj.mode === "words" && obj.mode2 >= 5000) || - obj.mode === "custom") - ) { - //dont give an error - } else { - response.status(200).send({ data: { resultCode: -4 } }); - return; - } - } - - let keySpacing = null; - let keyDuration = null; - - try { - keySpacing = { - average: - obj.keySpacing.reduce( - (previous, current) => (current += previous) - ) / obj.keySpacing.length, - sd: stdDev(obj.keySpacing), - }; - - keyDuration = { - average: - obj.keyDuration.reduce( - (previous, current) => (current += previous) - ) / obj.keyDuration.length, - sd: stdDev(obj.keyDuration), - }; - } catch (e) { - console.error( - `cant verify key spacing or duration for user ${request.uid}! - ${e} - ${obj.keySpacing} ${obj.keyDuration}` - ); - } - - obj.keySpacingStats = keySpacing; - obj.keyDurationStats = keyDuration; - - if (obj.mode == "time" && (obj.mode2 == 15 || obj.mode2 == 60)) { + function verifyValue(val) { + let errCount = 0; + if (Array.isArray(val)) { + //array + val.forEach((val2) => { + errCount += verifyValue(val2); + }); + } else if (typeof val === "object" && !Array.isArray(val)) { + //object + Object.keys(val).forEach((valkey) => { + errCount += verifyValue(val[valkey]); + }); } else { - obj.keySpacing = "removed"; - obj.keyDuration = "removed"; + if (!/^[0-9a-zA-Z._]+$/.test(val)) errCount++; } + return errCount; + } - emailVerified = await admin - .auth() - .getUser(request.uid) - .then((user) => { - return user.emailVerified; - }); - - return db - .collection("users") - .doc(request.uid) - .get() - .then((ret) => { - let userdata = ret.data(); - let name = userdata.name === undefined ? false : userdata.name; - let banned = userdata.banned === undefined ? false : userdata.banned; - let verified = userdata.verified; - request.obj.name = name; - - //check keyspacing and duration here - if (obj.mode === "time" && obj.wpm > 130 && obj.testDuration < 122) { - if (verified === false || verified === undefined) { - if (keySpacing !== null && keyDuration !== null) { - if ( - keySpacing.sd <= 15 || - keyDuration.sd <= 10 || - keyDuration.average < 15 || - (obj.wpm > 200 && obj.consistency < 70) - ) { - console.error( - `possible bot detected by user (${obj.wpm} ${obj.rawWpm} ${ - obj.acc - }) ${request.uid} ${name} - spacing ${JSON.stringify( - keySpacing - )} duration ${JSON.stringify(keyDuration)}` - ); - response.status(200).send({ data: { resultCode: -2 } }); - return; - } - if ( - (keySpacing.sd > 15 && keySpacing.sd <= 25) || - (keyDuration.sd > 10 && keyDuration.sd <= 15) || - (keyDuration.average > 15 && keyDuration.average <= 20) - ) { - console.error( - `very close to bot detected threshold by user (${obj.wpm} ${ - obj.rawWpm - } ${obj.acc}) ${ - request.uid - } ${name} - spacing ${JSON.stringify( - keySpacing - )} duration ${JSON.stringify(keyDuration)}` - ); - } - } else { - response.status(200).send({ data: { resultCode: -3 } }); - return; - } - } - } - - //yeet the key data - obj.keySpacing = null; - obj.keyDuration = null; - try { - obj.keyDurationStats.average = roundTo2( - obj.keyDurationStats.average - ); - obj.keyDurationStats.sd = roundTo2(obj.keyDurationStats.sd); - obj.keySpacingStats.average = roundTo2(obj.keySpacingStats.average); - obj.keySpacingStats.sd = roundTo2(obj.keySpacingStats.sd); - } catch (e) {} - - return db - .collection(`users/${request.uid}/results`) - .add(obj) - .then((e) => { - let createdDocId = e.id; - return Promise.all([ - checkLeaderboards( - request.obj, - "global", - banned, - name, - verified, - emailVerified - ), - checkLeaderboards( - request.obj, - "daily", - banned, - name, - verified, - emailVerified - ), - checkIfPB(request.uid, request.obj, userdata), - ]) - .then(async (values) => { - let globallb = values[0].insertedAt; - let dailylb = values[1].insertedAt; - let ispb = values[2]; - // console.log(values); - - if (obj.mode === "time" && String(obj.mode2) === "60") { - incrementT60Bananas(request.uid, obj, userdata); - } - - incrementTestCounter(request.uid, userdata); - incrementStartedTestCounter( - request.uid, - obj.restartCount + 1, - userdata - ); - incrementTimeSpentTyping(request.uid, obj, userdata); - - let usr = - userdata.discordId !== undefined - ? userdata.discordId - : userdata.name; - - if ( - globallb !== null && - globallb.insertedAt >= 0 && - globallb.insertedAt <= 9 && - globallb.newBest - ) { - let lbstring = `${obj.mode} ${obj.mode2} global`; - console.log( - `sending command to the bot to announce lb update ${ - userdata.discordId - } ${globallb + 1} ${lbstring} ${obj.wpm}` - ); - - announceLbUpdate( - usr, - globallb.insertedAt + 1, - lbstring, - obj.wpm, - obj.rawWpm, - obj.acc - ); - } - - let returnobj = { - resultCode: null, - globalLeaderboard: globallb, - dailyLeaderboard: dailylb, - lbBanned: banned, - name: name, - createdId: createdDocId, - needsToVerify: values[0].needsToVerify, - needsToVerifyEmail: values[0].needsToVerifyEmail, - }; - - if (ispb) { - let logobj = request.obj; - logobj.keySpacing = "removed"; - logobj.keyDuration = "removed"; - console.log( - `saved result for ${ - request.uid - } (new PB) - ${JSON.stringify(logobj)}` - ); - await db - .collection(`users/${request.uid}/results/`) - .doc(createdDocId) - .update({ isPb: true }); - if ( - obj.mode === "time" && - String(obj.mode2) === "60" && - userdata.discordId !== null && - userdata.discordId !== undefined - ) { - if (verified !== false) { - console.log( - `sending command to the bot to update the role for user ${request.uid} with wpm ${obj.wpm}` - ); - updateDiscordRole( - userdata.discordId, - Math.round(obj.wpm) - ); - } - } - returnobj.resultCode = 2; - } else { - let logobj = request.obj; - logobj.keySpacing = "removed"; - logobj.keyDuration = "removed"; - console.log( - `saved result for ${request.uid} - ${JSON.stringify( - logobj - )}` - ); - returnobj.resultCode = 1; - } - response.status(200).send({ data: returnobj }); - return; - }) - .catch((e) => { - console.error( - `error saving result when checking for PB / checking leaderboards for ${request.uid} - ${e.message}` - ); - response - .status(200) - .send({ data: { resultCode: -999, message: e.message } }); - return; - }); - }) - .catch((e) => { - console.error( - `error saving result when adding result to the db for ${request.uid} - ${e.message}` - ); - response - .status(200) - .send({ data: { resultCode: -999, message: e.message } }); - return; - }); - }) - .catch((e) => { - console.error( - `error saving result when getting user data for ${request.uid} - ${e.message}` - ); - response - .status(200) - .send({ data: { resultCode: -999, message: e.message } }); - return; - }); - } catch (e) { + let errCount = verifyValue(obj); + // console.log(errCount); + if (errCount > 0) { console.error( - `error saving result for ${request.uid} - ${JSON.stringify( - request.obj - )} - ${e}` + `error saving result for ${ + request.uid + } error count ${errCount} - bad input - ${JSON.stringify(request.obj)}` ); - response - .status(200) - .send({ data: { resultCode: -999, message: e.message } }); + response.status(200).send({ data: { resultCode: -1 } }); return; } - }); + + if (obj.wpm <= 0 || obj.wpm > 350 || obj.acc < 50 || obj.acc > 100) { + response.status(200).send({ data: { resultCode: -1 } }); + return; + } + + if (!validateResult(obj)) { + if ( + obj.bailedOut && + ((obj.mode === "time" && obj.mode2 >= 3600) || + (obj.mode === "words" && obj.mode2 >= 5000) || + obj.mode === "custom") + ) { + //dont give an error + } else { + response.status(200).send({ data: { resultCode: -4 } }); + return; + } + } + + let keySpacing = null; + let keyDuration = null; + + try { + keySpacing = { + average: + obj.keySpacing.reduce((previous, current) => (current += previous)) / + obj.keySpacing.length, + sd: stdDev(obj.keySpacing), + }; + + keyDuration = { + average: + obj.keyDuration.reduce((previous, current) => (current += previous)) / + obj.keyDuration.length, + sd: stdDev(obj.keyDuration), + }; + } catch (e) { + console.error( + `cant verify key spacing or duration for user ${request.uid}! - ${e} - ${obj.keySpacing} ${obj.keyDuration}` + ); + } + + obj.keySpacingStats = keySpacing; + obj.keyDurationStats = keyDuration; + + if (obj.mode == "time" && (obj.mode2 == 15 || obj.mode2 == 60)) { + } else { + obj.keySpacing = "removed"; + obj.keyDuration = "removed"; + } + + emailVerified = await admin + .auth() + .getUser(request.uid) + .then((user) => { + return user.emailVerified; + }); + + return db + .collection("users") + .doc(request.uid) + .get() + .then((ret) => { + let userdata = ret.data(); + let name = userdata.name === undefined ? false : userdata.name; + let banned = userdata.banned === undefined ? false : userdata.banned; + let verified = userdata.verified; + request.obj.name = name; + + //check keyspacing and duration here + if (obj.mode === "time" && obj.wpm > 130 && obj.testDuration < 122) { + if (verified === false || verified === undefined) { + if (keySpacing !== null && keyDuration !== null) { + if ( + keySpacing.sd <= 15 || + keyDuration.sd <= 10 || + keyDuration.average < 15 || + (obj.wpm > 200 && obj.consistency < 70) + ) { + console.error( + `possible bot detected by user (${obj.wpm} ${obj.rawWpm} ${ + obj.acc + }) ${request.uid} ${name} - spacing ${JSON.stringify( + keySpacing + )} duration ${JSON.stringify(keyDuration)}` + ); + response.status(200).send({ data: { resultCode: -2 } }); + return; + } + if ( + (keySpacing.sd > 15 && keySpacing.sd <= 25) || + (keyDuration.sd > 10 && keyDuration.sd <= 15) || + (keyDuration.average > 15 && keyDuration.average <= 20) + ) { + console.error( + `very close to bot detected threshold by user (${obj.wpm} ${ + obj.rawWpm + } ${obj.acc}) ${ + request.uid + } ${name} - spacing ${JSON.stringify( + keySpacing + )} duration ${JSON.stringify(keyDuration)}` + ); + } + } else { + response.status(200).send({ data: { resultCode: -3 } }); + return; + } + } + } + + //yeet the key data + obj.keySpacing = null; + obj.keyDuration = null; + try { + obj.keyDurationStats.average = roundTo2(obj.keyDurationStats.average); + obj.keyDurationStats.sd = roundTo2(obj.keyDurationStats.sd); + obj.keySpacingStats.average = roundTo2(obj.keySpacingStats.average); + obj.keySpacingStats.sd = roundTo2(obj.keySpacingStats.sd); + } catch (e) {} + + return db + .collection(`users/${request.uid}/results`) + .add(obj) + .then((e) => { + let createdDocId = e.id; + return Promise.all([ + checkLeaderboards( + request.obj, + "global", + banned, + name, + verified, + emailVerified + ), + checkLeaderboards( + request.obj, + "daily", + banned, + name, + verified, + emailVerified + ), + checkIfPB(request.uid, request.obj, userdata), + ]) + .then(async (values) => { + let globallb = values[0].insertedAt; + let dailylb = values[1].insertedAt; + let ispb = values[2]; + // console.log(values); + + if (obj.mode === "time" && String(obj.mode2) === "60") { + incrementT60Bananas(request.uid, obj, userdata); + } + + incrementTestCounter(request.uid, userdata); + incrementStartedTestCounter( + request.uid, + obj.restartCount + 1, + userdata + ); + incrementTimeSpentTyping(request.uid, obj, userdata); + + let usr = + userdata.discordId !== undefined + ? userdata.discordId + : userdata.name; + + if ( + globallb !== null && + globallb.insertedAt >= 0 && + globallb.insertedAt <= 9 && + globallb.newBest + ) { + let lbstring = `${obj.mode} ${obj.mode2} global`; + console.log( + `sending command to the bot to announce lb update ${ + userdata.discordId + } ${globallb + 1} ${lbstring} ${obj.wpm}` + ); + + announceLbUpdate( + usr, + globallb.insertedAt + 1, + lbstring, + obj.wpm, + obj.rawWpm, + obj.acc + ); + } + + let returnobj = { + resultCode: null, + globalLeaderboard: globallb, + dailyLeaderboard: dailylb, + lbBanned: banned, + name: name, + createdId: createdDocId, + needsToVerify: values[0].needsToVerify, + needsToVerifyEmail: values[0].needsToVerifyEmail, + }; + + if (ispb) { + let logobj = request.obj; + logobj.keySpacing = "removed"; + logobj.keyDuration = "removed"; + console.log( + `saved result for ${ + request.uid + } (new PB) - ${JSON.stringify(logobj)}` + ); + await db + .collection(`users/${request.uid}/results/`) + .doc(createdDocId) + .update({ isPb: true }); + if ( + obj.mode === "time" && + String(obj.mode2) === "60" && + userdata.discordId !== null && + userdata.discordId !== undefined + ) { + if (verified !== false) { + console.log( + `sending command to the bot to update the role for user ${request.uid} with wpm ${obj.wpm}` + ); + updateDiscordRole( + userdata.discordId, + Math.round(obj.wpm) + ); + } + } + returnobj.resultCode = 2; + } else { + let logobj = request.obj; + logobj.keySpacing = "removed"; + logobj.keyDuration = "removed"; + console.log( + `saved result for ${request.uid} - ${JSON.stringify( + logobj + )}` + ); + returnobj.resultCode = 1; + } + response.status(200).send({ data: returnobj }); + return; + }) + .catch((e) => { + console.error( + `error saving result when checking for PB / checking leaderboards for ${request.uid} - ${e.message}` + ); + response + .status(200) + .send({ data: { resultCode: -999, message: e.message } }); + return; + }); + }) + .catch((e) => { + console.error( + `error saving result when adding result to the db for ${request.uid} - ${e.message}` + ); + response + .status(200) + .send({ data: { resultCode: -999, message: e.message } }); + return; + }); + }) + .catch((e) => { + console.error( + `error saving result when getting user data for ${request.uid} - ${e.message}` + ); + response + .status(200) + .send({ data: { resultCode: -999, message: e.message } }); + return; + }); + } catch (e) { + console.error( + `error saving result for ${request.uid} - ${JSON.stringify( + request.obj + )} - ${e}` + ); + response + .status(200) + .send({ data: { resultCode: -999, message: e.message } }); + return; + } +}); exports.updateEmail = functions.https.onCall(async (request, response) => { try { From 24143cfe67e557036d8a4cc4bdab3011860a57b0 Mon Sep 17 00:00:00 2001 From: decaf Date: Thu, 19 Nov 2020 08:35:32 -0600 Subject: [PATCH 40/40] Fix "Bail Out" subcommands not hiding in single command mode --- src/js/commandline.js | 18 +++++++----------- src/js/misc.js | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/js/commandline.js b/src/js/commandline.js index 4059e6b2f..47d8ef888 100644 --- a/src/js/commandline.js +++ b/src/js/commandline.js @@ -575,6 +575,9 @@ let commands = { exec: () => { hideCommandLine(); }, + available: () => { + return canBailOut(); + }, }, { id: "bailOutForSure", @@ -583,23 +586,16 @@ let commands = { bailout = true; showResult(); }, + available: () => { + return canBailOut(); + }, }, ], }); showCommandLine(); }, available: () => { - return ( - (config.mode === "custom" && - customTextIsRandom && - customTextWordCount >= 5000) || - (config.mode === "custom" && - !customTextIsRandom && - customText.length >= 5000) || - (config.mode === "words" && config.words >= 5000) || - config.words === 0 || - (config.mode === "time" && (config.time >= 3600 || config.time === 0)) - ); + return canBailOut(); }, }, { diff --git a/src/js/misc.js b/src/js/misc.js index 31481088d..bfd61d010 100644 --- a/src/js/misc.js +++ b/src/js/misc.js @@ -511,6 +511,20 @@ function toggleFullscreen(elem) { } } +function canBailOut() { + return ( + (config.mode === "custom" && + customTextIsRandom && + customTextWordCount >= 5000) || + (config.mode === "custom" && + !customTextIsRandom && + customText.length >= 5000) || + (config.mode === "words" && config.words >= 5000) || + config.words === 0 || + (config.mode === "time" && (config.time >= 3600 || config.time === 0)) + ); +} + let simplePopups = {}; class SimplePopup {